/protocols/jain-megaco/megaco-api/src/main/java/javax/megaco/message/descriptor/MediaStreamParam.java

http://mobicents.googlecode.com/ · Java · 132 lines · 37 code · 22 blank · 73 comment · 6 complexity · 349a460834c7c26a5bdf83601ccd829c MD5 · raw file

  1. package javax.megaco.message.descriptor;
  2. import java.io.Serializable;
  3. /**
  4. * The MediaStreamParam object is a class that shall be used to set the local
  5. * descriptor, local control descriptor and the remote descriptor. This is an
  6. * independent class derived from java.util.Object and shall not have any
  7. * derived classes.
  8. */
  9. public class MediaStreamParam implements Serializable {
  10. private LocalCtrlDescriptor localCtrlDescriptor;
  11. private SDPInfo localDescriptor;
  12. private SDPInfo remoteDescriptor;
  13. /**
  14. * Constructs a Stream Parameter Object consisting of local, remote and
  15. * local control descriptor.
  16. */
  17. public MediaStreamParam() {
  18. super();
  19. // TODO Auto-generated constructor stub
  20. }
  21. /**
  22. * The method can be used to get the local control descriptor.
  23. *
  24. * @return localControlDesc - The reference to the object corresponding to
  25. * the local control descriptor. This shall be returned only if the
  26. * local control descriptor is present in the media stream parameter
  27. * of the media descriptor else shall return a NULL value.
  28. */
  29. public LocalCtrlDescriptor getLclCtrlDescriptor() {
  30. return this.localCtrlDescriptor;
  31. }
  32. /**
  33. * The method can be used to get the SDP information for local descriptor.
  34. *
  35. * @return SDPinfo - The reference to the object corresponding to SDPInfo.
  36. * This shall be returned only if the SDP information is present in
  37. * the local descriptor of the media descriptor.
  38. */
  39. public SDPInfo getLocalDescriptor() {
  40. return this.localDescriptor;
  41. }
  42. /**
  43. * The method can be used to get the SDP information for remote descriptor.
  44. *
  45. * @return SDPInfo - The reference to the object corresponding to SDPInfo.
  46. * This shall be returned only if the SDP information is present in
  47. * the remote descriptor of the media descriptor.
  48. */
  49. public SDPInfo getRemoteDescriptor() {
  50. return this.remoteDescriptor;
  51. }
  52. /**
  53. * The method can be used to set the local control descriptor within the
  54. * media descriptor.
  55. *
  56. * @param localControlDesc
  57. * - The reference to the object corresponding to the local
  58. * control descriptor.
  59. * @throws IllegalArgumentException
  60. * - Thrown if local control descriptor has incompatible
  61. * parameters.
  62. */
  63. public void setLclCtrlDescriptor(LocalCtrlDescriptor localControlDesc) throws IllegalArgumentException {
  64. // FIXME this is not present
  65. if (localControlDesc == null) {
  66. throw new IllegalArgumentException("LocalCtrlDescriptor must not be null");
  67. }
  68. // FIXME: add error checks
  69. this.localCtrlDescriptor = localControlDesc;
  70. }
  71. /**
  72. * The method can be used to set the local descriptor within the media
  73. * descriptor.
  74. *
  75. * @param sdp
  76. * - The reference to the object corresponding to the SDPInfo for
  77. * setting the local descriptor.
  78. * @throws IllegalArgumentException
  79. * - Thrown if sdp information has incompatible parameters.
  80. */
  81. public void setLocalDescriptor(SDPInfo sdp) throws IllegalArgumentException {
  82. // FIXME this is not present
  83. if (sdp == null) {
  84. throw new IllegalArgumentException("SDPInfo must not be null");
  85. }
  86. // FIXME: add error checks
  87. this.localDescriptor = sdp;
  88. }
  89. /**
  90. * The method can be used to set the remote descriptor within the media
  91. * descriptor.
  92. *
  93. * @param sdp
  94. * - The reference to the object corresponding to the SDPInfo for
  95. * setting the remote descriptor.
  96. * @throws IllegalArgumentException
  97. * - Thrown if sdp information has incompatible parameters.
  98. */
  99. public void setRemoteDescriptor(SDPInfo sdp) throws IllegalArgumentException {
  100. // FIXME this is not present
  101. if (sdp == null) {
  102. throw new IllegalArgumentException("SDPInfo must not be null");
  103. }
  104. // FIXME: add error checks
  105. this.remoteDescriptor = sdp;
  106. }
  107. // public String toString()
  108. // return super.toString();
  109. // }
  110. }