PublicationSession.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.9
  4. *
  5. * Do not make changes to this file unless you know what you are doing--modify
  6. * the SWIG interface file instead.
  7. * ----------------------------------------------------------------------------- */
  8. package org.doubango.tinyWRAP;
  9. public class PublicationSession extends SipSession {
  10. private long swigCPtr;
  11. protected PublicationSession(long cPtr, boolean cMemoryOwn) {
  12. super(tinyWRAPJNI.PublicationSession_SWIGUpcast(cPtr), cMemoryOwn);
  13. swigCPtr = cPtr;
  14. }
  15. protected static long getCPtr(PublicationSession obj) {
  16. return (obj == null) ? 0 : obj.swigCPtr;
  17. }
  18. protected void finalize() {
  19. delete();
  20. }
  21. public synchronized void delete() {
  22. if (swigCPtr != 0) {
  23. if (swigCMemOwn) {
  24. swigCMemOwn = false;
  25. tinyWRAPJNI.delete_PublicationSession(swigCPtr);
  26. }
  27. swigCPtr = 0;
  28. }
  29. super.delete();
  30. }
  31. public boolean Publish(byte[] bytes) {
  32. if(bytes != null){
  33. final java.nio.ByteBuffer byteBuffer = this.getByteBuffer(bytes);
  34. return this.publish(byteBuffer, bytes.length);
  35. }
  36. return false;
  37. }
  38. public PublicationSession(SipStack pStack) {
  39. this(tinyWRAPJNI.new_PublicationSession(SipStack.getCPtr(pStack), pStack), true);
  40. }
  41. public boolean publish(java.nio.ByteBuffer payload, long len, ActionConfig config) {
  42. return tinyWRAPJNI.PublicationSession_publish__SWIG_0(swigCPtr, this, payload, len, ActionConfig.getCPtr(config), config);
  43. }
  44. public boolean publish(java.nio.ByteBuffer payload, long len) {
  45. return tinyWRAPJNI.PublicationSession_publish__SWIG_1(swigCPtr, this, payload, len);
  46. }
  47. public boolean unPublish(ActionConfig config) {
  48. return tinyWRAPJNI.PublicationSession_unPublish__SWIG_0(swigCPtr, this, ActionConfig.getCPtr(config), config);
  49. }
  50. public boolean unPublish() {
  51. return tinyWRAPJNI.PublicationSession_unPublish__SWIG_1(swigCPtr, this);
  52. }
  53. }