diff options
author | Boris Grozev <boris@jitsi.org> | 2014-07-23 11:21:39 +0300 |
---|---|---|
committer | Boris Grozev <boris@jitsi.org> | 2014-07-23 11:25:57 +0300 |
commit | 09045fa7a873b01b74b4a037bd38b1d06ec68277 (patch) | |
tree | 4b074b32d419f4276b0af6b377256f1745593644 /src | |
parent | 28dd54b4d5f31ff26613d29e08b86ba8b70e6911 (diff) | |
download | jitsi-09045fa7a873b01b74b4a037bd38b1d06ec68277.zip jitsi-09045fa7a873b01b74b4a037bd38b1d06ec68277.tar.gz jitsi-09045fa7a873b01b74b4a037bd38b1d06ec68277.tar.bz2 |
Adds an 'endpoint' sub-element to ColibriConferenceIQ.
Diffstat (limited to 'src')
2 files changed, 129 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriConferenceIQ.java b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriConferenceIQ.java index a478e7a..fcd467a 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriConferenceIQ.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriConferenceIQ.java @@ -66,6 +66,11 @@ public class ColibriConferenceIQ private RTCPTerminationStrategy rtcpTerminationStrategy = null; + /** + * The list of <tt>Endpoint</tt>s included into this <tt>conference</tt> IQ. + */ + private final List<Endpoint> endpoints = new LinkedList<Endpoint>(); + /** Initializes a new <tt>ColibriConferenceIQ</tt> instance. */ public ColibriConferenceIQ() { @@ -270,6 +275,25 @@ public class ColibriConferenceIQ } /** + * Returns the list of <tt>Endpoint</tt>s included in this + * <tt>ColibriConferenceIQ</tt>. + * @return the list of <tt>Endpoint</tt>s included in this + * <tt>ColibriConferenceIQ</tt>. + */ + public List<Endpoint> getEndpoints() + { + return Collections.unmodifiableList(endpoints); + } + + /** + * Add an <tt>Endpoint</tt> to this <tt>ColibriConferenceIQ</tt>. + * @param endpoint the <tt>Endpoint</tt> to add. + */ + public void addEndpoint(Endpoint endpoint) + { + endpoints.add(endpoint); + } + /** * Class contains common code for both <tt>Channel</tt> and * <tt>SctpConnection</tt> IQ classes. * @@ -1640,4 +1664,83 @@ public class ColibriConferenceIQ xml.append("/>"); } } + + /** + * Represents an 'endpoint' element. + */ + public static class Endpoint + { + /** + * The name of the 'endpoint' element. + */ + public static final String ELEMENT_NAME = "endpoint"; + + /** + * The name of the 'id' attribute. + */ + public static final String ID_ATTR_NAME = "id"; + + /** + * The name of the 'displayname' attribute. + */ + public static final String DISPLAYNAME_ATTR_NAME = "displayname"; + + /** + * The 'id' of this <tt>Endpoint</tt>. + */ + private String id; + + /** + * The 'display name' of this <tt>Endpoint</tt>. + */ + private String displayName; + + /** + * Initializes a new <tt>Endpoint</tt> with the given ID and display + * name. + * @param id the ID. + * @param displayName the display name. + */ + public Endpoint(String id, String displayName) + { + this.id = id; + this.displayName = displayName; + } + + /** + * Sets the ID of this <tt>Endpoint</tt>. + * @param id the ID to set. + */ + public void setId(String id) + { + this.id = id; + } + + /** + * Returns the ID of this <tt>Endpoint</tt>. + * @return the ID of this <tt>Endpoint</tt>. + */ + public String getId() + { + return id; + } + + /** + * Sets the display name of this <tt>Endpoint</tt>. + * @param displayName the display name to set. + */ + public void setDisplayName(String displayName) + { + this.displayName = displayName; + } + + /** + * Returns the display name of this <tt>Endpoint</tt>. + * @return the display name of this <tt>Endpoint</tt>. + */ + public String getDisplayName() + { + return displayName; + } + } } diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriIQProvider.java b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriIQProvider.java index 2e12c19..d5b2d37 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriIQProvider.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/ColibriIQProvider.java @@ -163,6 +163,7 @@ public class ColibriIQProvider ColibriConferenceIQ.SctpConnection sctpConnection = null; ColibriConferenceIQ.Content content = null; ColibriConferenceIQ.Recording recording = null; + ColibriConferenceIQ.Endpoint conferenceEndpoint = null; StringBuilder ssrc = null; while (!done) @@ -189,6 +190,12 @@ public class ColibriIQProvider content.addSctpConnection(sctpConnection); sctpConnection = null; } + else if (ColibriConferenceIQ.Endpoint.ELEMENT_NAME + .equals(name)) + { + conference.addEndpoint(conferenceEndpoint); + conferenceEndpoint = null; + } else if (ColibriConferenceIQ.Channel.SSRC_ELEMENT_NAME .equals(name)) { @@ -455,6 +462,25 @@ public class ColibriIQProvider if (!StringUtils.isNullOrEmpty(expire)) sctpConnection.setExpire(Integer.parseInt(expire)); } + else if (ColibriConferenceIQ.Endpoint.ELEMENT_NAME + .equals(name)) + { + String id + = parser.getAttributeValue( + "", + ColibriConferenceIQ.Endpoint.ID_ATTR_NAME); + + String endpointName + = parser.getAttributeValue( + "", + ColibriConferenceIQ.Endpoint + .DISPLAYNAME_ATTR_NAME); + + conferenceEndpoint + = new ColibriConferenceIQ.Endpoint(id, + endpointName); + + } else if (channel != null || sctpConnection != null) { String peName = null; |