public class ColibriBuilder
extends java.lang.Object
addAllocateChannelsReq(boolean, String, boolean, java.util.List)
}
or addExpireChannelsReq(ColibriConferenceIQ)
or addRtpDescription(Map, ColibriConferenceIQ)
and addSourceGroupsInfo(Map, ColibriConferenceIQ)
and addSourceInfo(Map, ColibriConferenceIQ)
.
getRequest(String)
. Then send it to
the bridge.
ColibriAnalyser
to extract particular channels info or create
response to the client.
reset()
and start next query.
ColibriConferenceIQ
instance
between the ColibriAnalyser
and ColibriBuilder
. The builder
needs to have conference ID set once the first response from JVB is received.
Otherwise it will be allocating new conferences for each allocate request and
it will fail on other request types because it will not supply valid
conference ID.Modifier and Type | Class and Description |
---|---|
static class |
ColibriBuilder.RequestType
The types of request that can be built with
ColibriBuilder . |
Constructor and Description |
---|
ColibriBuilder(ColibriConferenceIQ conferenceState)
Creates new instance of
ColibriBuilder for given
conferenceState. |
Modifier and Type | Method and Description |
---|---|
boolean |
addAllocateChannelsReq(boolean useBundle,
java.lang.String endpointName,
boolean peerIsInitiator,
java.util.List<ContentPacketExtension> contents)
Adds next channel allocation request to
ColibriBuilder.RequestType.ALLOCATE_CHANNELS query currently being built. |
boolean |
addAllocateOctoChannelsReq(java.util.List<ContentPacketExtension> contents,
java.util.List<java.lang.String> relayIds)
Adds a request for allocation of "octo" channel to the query currently
being built.
|
boolean |
addBundleTransportUpdateReq(IceUdpTransportPacketExtension transport,
ColibriConferenceIQ localChannelsInfo)
Adds next request to
ColibriBuilder.RequestType.CHANNEL_INFO_UPDATE query. |
boolean |
addDirectionUpdateReq(java.util.Map<java.lang.String,org.jitsi.service.neomedia.MediaDirection> map,
ColibriConferenceIQ localChannelsInfo)
Adds next request to
ColibriBuilder.RequestType.CHANNEL_INFO_UPDATE query. |
boolean |
addExpireChannelsReq(ColibriConferenceIQ channelInfo)
Adds next expire channel request to
ColibriBuilder.RequestType.EXPIRE_CHANNELS
query currently being built. |
boolean |
addRtpDescription(java.util.Map<java.lang.String,RtpDescriptionPacketExtension> map,
ColibriConferenceIQ localChannelsInfo)
Adds next payload type information update request to
ColibriBuilder.RequestType.CHANNEL_INFO_UPDATE query currently being built. |
boolean |
addSourceGroupsInfo(java.util.Map<java.lang.String,java.util.List<SourceGroupPacketExtension>> sourceGroupMap,
ColibriConferenceIQ localChannelsInfo)
Adds next source group information update request to
ColibriBuilder.RequestType.CHANNEL_INFO_UPDATE query currently being built. |
boolean |
addSourceInfo(java.util.Map<java.lang.String,java.util.List<SourcePacketExtension>> sourceMap,
ColibriConferenceIQ localChannelsInfo)
Adds next source information update request to
ColibriBuilder.RequestType.CHANNEL_INFO_UPDATE query currently being built. |
boolean |
addTransportUpdateReq(java.util.Map<java.lang.String,IceUdpTransportPacketExtension> map,
ColibriConferenceIQ localChannelsInfo)
Adds next ICE transport update request to
ColibriBuilder.RequestType.CHANNEL_INFO_UPDATE query currently being built. |
java.lang.Integer |
getAudioPacketDelay()
Returns an Integer which stands for the audio packet delay
that will be set on all created audio channels or null if
the builder should leave not include the XML attribute at all.
|
java.lang.Integer |
getChannelLastN()
Channel 'last-n' option that will be added when channels are created.
|
ColibriConferenceIQ |
getRequest(java.lang.String videobridge)
Finishes query construction and returns it.
|
ColibriBuilder.RequestType |
getRequestType()
Returns
ColibriBuilder.RequestType of the query currently being
constructed or ColibriBuilder.RequestType.UNDEFINED if no query construction has
been started yet. |
boolean |
hasAnyChannelsToExpire()
Returns true if
ColibriBuilder.RequestType.EXPIRE_CHANNELS request is
being constructed and there are valid channels to be expired. |
void |
reset()
Resets this builder state to the "zero" state when no request info is
stored.
|
void |
setAudioPacketDelay(java.lang.Integer audioPacketDelay)
Configures audio channels packet delay.
|
void |
setChannelLastN(java.lang.Integer channelLastN)
Sets channel 'last-n' option that will be added to the request when
channels are created.
|
void |
setRTPLevelRelayType(RTPLevelRelayType rtpLevelRelayType)
Configures RTP-level relay (RFC 3550, section 2.3).
|
void |
setRTPLevelRelayType(java.lang.String rtpLevelRelayType)
Configures RTP-level relay (RFC 3550, section 2.3).
|
void |
setSimulcastMode(SimulcastMode simulcastMode)
Sets channel 'simulcast-mode' option that will be added to the
request when channels are created.
|
public ColibriBuilder(ColibriConferenceIQ conferenceState)
ColibriBuilder
for given
conferenceState.conferenceState
- the conference state which will be taken into
account when constructing specific requests (the need to allocate new
conference or re-use the one currently in progress).public void reset()
public boolean addAllocateOctoChannelsReq(java.util.List<ContentPacketExtension> contents, java.util.List<java.lang.String> relayIds)
contents
- the contents to which to add a request for allocation
of "octo" channels.relayIds
- the list of relay IDs to use in the request for
allocation of "octo" channels.public boolean addAllocateChannelsReq(boolean useBundle, java.lang.String endpointName, boolean peerIsInitiator, java.util.List<ContentPacketExtension> contents)
ColibriBuilder.RequestType.ALLOCATE_CHANNELS
query currently being built.useBundle
- true if allocated channels should all use
the same bundle.endpointName
- name of the endpoint for which Colibri channels will
be allocated.peerIsInitiator
- the value that will be set in 'initiator'
attribute (ColibriConferenceIQ.ChannelCommon.initiator
).contents
- the list of ContentPacketExtension
describing
channels media.public boolean addBundleTransportUpdateReq(IceUdpTransportPacketExtension transport, ColibriConferenceIQ localChannelsInfo) throws java.lang.IllegalArgumentException
ColibriBuilder.RequestType.CHANNEL_INFO_UPDATE
query.localChannelsInfo
- the ColibriConferenceIQ
instance that
describes the channel for which bundle transport will be updated. It
should contain the description of only one "channel bundle". If it
contains more than one then the first one will be used.java.lang.IllegalArgumentException
- if localChannelsInfo does not
describe any channel bundles.public boolean addExpireChannelsReq(ColibriConferenceIQ channelInfo)
ColibriBuilder.RequestType.EXPIRE_CHANNELS
query currently being built.channelInfo
- the ColibriConferenceIQ
instance that contains
info about the channels to be expired.public boolean addRtpDescription(java.util.Map<java.lang.String,RtpDescriptionPacketExtension> map, ColibriConferenceIQ localChannelsInfo)
ColibriBuilder.RequestType.CHANNEL_INFO_UPDATE
query currently being built.map
- the map of content name to RTP description packet extension.localChannelsInfo
- ColibriConferenceIQ
holding info about
Colibri channels to be updated.public boolean addSourceInfo(java.util.Map<java.lang.String,java.util.List<SourcePacketExtension>> sourceMap, ColibriConferenceIQ localChannelsInfo)
ColibriBuilder.RequestType.CHANNEL_INFO_UPDATE
query currently being built.sourceMap
- the map of content name to the list of
SourcePacketExtension.localChannelsInfo
- ColibriConferenceIQ
holding info about
Colibri channels to be updated.public boolean addSourceGroupsInfo(java.util.Map<java.lang.String,java.util.List<SourceGroupPacketExtension>> sourceGroupMap, ColibriConferenceIQ localChannelsInfo)
ColibriBuilder.RequestType.CHANNEL_INFO_UPDATE
query currently being built.sourceGroupMap
- the map of content name to the list of
SourceGroupPacketExtension.localChannelsInfo
- ColibriConferenceIQ
holding info about
Colibri channels to be updated.public boolean addTransportUpdateReq(java.util.Map<java.lang.String,IceUdpTransportPacketExtension> map, ColibriConferenceIQ localChannelsInfo)
ColibriBuilder.RequestType.CHANNEL_INFO_UPDATE
query currently being built.
Note that this should only be used for channels which do NOT use bundle.
For the bundle case use addBundleTransportUpdateReq(net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.IceUdpTransportPacketExtension, net.java.sip.communicator.impl.protocol.jabber.extensions.colibri.ColibriConferenceIQ)
instead.map
- the map of content name to transport extensions. Maps
transport to media types.localChannelsInfo
- ColibriConferenceIQ
holding info about
Colibri channels to be updated.public boolean addDirectionUpdateReq(java.util.Map<java.lang.String,org.jitsi.service.neomedia.MediaDirection> map, ColibriConferenceIQ localChannelsInfo)
ColibriBuilder.RequestType.CHANNEL_INFO_UPDATE
query.map
- the map of content name to media direction. Maps
media direction to media types.localChannelsInfo
- ColibriConferenceIQ
holding info about
Colibri channels to be updated.public ColibriConferenceIQ getRequest(java.lang.String videobridge)
reset()
must be called to start new query.
Otherwise we can continue adding next requests into current query.videobridge
- the JID of videobridge to which this query is
directed.ColibriBuilder.RequestType.EXPIRE_CHANNELS
and there are no channels to
be expired then null is returned which signals that
there's nothing to be done.public ColibriBuilder.RequestType getRequestType()
ColibriBuilder.RequestType
of the query currently being
constructed or ColibriBuilder.RequestType.UNDEFINED
if no query construction has
been started yet.public boolean hasAnyChannelsToExpire()
ColibriBuilder.RequestType.EXPIRE_CHANNELS
request is
being constructed and there are valid channels to be expired.public java.lang.Integer getChannelLastN()
reset()
is called.public void setChannelLastN(java.lang.Integer channelLastN)
channelLastN
- an integer value to specify 'last-n' option or
null in order to omit in requests.public java.lang.Integer getAudioPacketDelay()
public void setAudioPacketDelay(java.lang.Integer audioPacketDelay)
audioPacketDelay
- an Integer value which stands for
the audio packet delay that will be set on all created audio channels or
null if the builder should not set that channel property to any
value.public void setSimulcastMode(SimulcastMode simulcastMode)
simulcastMode
- a SimulcastMode value to specify
'simulcast-mode' option or null in order to omit in
requests.public void setRTPLevelRelayType(RTPLevelRelayType rtpLevelRelayType)
rtpLevelRelayType
- an RTPLevelRelayType value which
stands for the rtp level relay type that will be set on all created
audio channels.public void setRTPLevelRelayType(java.lang.String rtpLevelRelayType)
rtpLevelRelayType
- a String value which
stands for the rtp level relay type that will be set on all created
audio channels.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.