Class Jingle
- java.lang.Object
-
- rocks.xmpp.extensions.jingle.model.Jingle
-
public final class Jingle extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Jingle.Action
The action.static class
Jingle.Content
The implementation of the<content/>
element.static class
Jingle.Reason
The implementation of the<reason/>
element.
-
Constructor Summary
Constructors Constructor Description Jingle(String sessionId, Jingle.Action action, Object payload)
Jingle(String sessionId, Jingle.Action action, Jingle.Reason reason)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Jingle.Action
getAction()
Gets the Jingle action.List<Jingle.Content>
getContents()
Gets the contents.Jid
getInitiator()
Gets the initiator.Object
getPayload()
Jingle.Reason
getReason()
Gets the reason.Jid
getResponder()
Gets the responder.String
getSessionId()
Gets the session id.static Jingle
initiator(Jid initiator, String sessionId, Jingle.Action action, List<Jingle.Content> contents)
static Jingle
responder(Jid responder, String sessionId, Jingle.Action action, List<Jingle.Content> contents)
void
setReason(Jingle.Reason reason)
Sets the reason.
-
-
-
Field Detail
-
NAMESPACE
public static final String NAMESPACE
urn:xmpp:jingle:1- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Jingle
public Jingle(String sessionId, Jingle.Action action, Jingle.Reason reason)
-
Jingle
public Jingle(String sessionId, Jingle.Action action, Object payload)
-
-
Method Detail
-
initiator
public static Jingle initiator(Jid initiator, String sessionId, Jingle.Action action, List<Jingle.Content> contents)
-
responder
public static Jingle responder(Jid responder, String sessionId, Jingle.Action action, List<Jingle.Content> contents)
-
getAction
public Jingle.Action getAction()
Gets the Jingle action.- Returns:
- The Jingle action.
- See Also:
Jingle.Action
-
getInitiator
public Jid getInitiator()
Gets the initiator.The full JID of the entity that has initiated the session flow. When the Jingle action is "session-initiate", the
<jingle/>
element SHOULD possess an 'initiator' attribute that explicitly specifies the full JID of the initiating entity; for all other actions, the<jingle/>
element SHOULD NOT possess an 'initiator' attribute and the recipient of the message SHOULD ignore the value if provided. The value of the 'initiator' attribute MAY be different from the 'from' address on the IQ-set of the session-initiate message (e.g., to handle certain interactions involving call managers, soft switches, and media relays). This usage shall be defined in other specifications, for example, in Jingle Session Transfer (XEP-0251). However, in all cases if the 'initiator' and 'from' values differ then the responder MUST NOT interact with the 'initiator' JID unless it trusts the 'initiator' JID or trusts that the 'from' JID is allowed to authorize the 'initiator' JID to act on the 'from' JID's behalf. In the absence of explicit rules for handling this case, the responder SHOULD simply ignore the 'initiator' attribute and treat the 'from' JID as the initiating entity. After sending acknowledgement of the session-initiate message, the responder MUST send all future commmunications about the Jingle session to the initiator (whether the initiator is considered the 'from' JID or the 'initiator' JID).- Returns:
- The initiator.
-
getResponder
public Jid getResponder()
Gets the responder.The full JID of the entity that has replied to the initiation, which can be different from the 'to' address on the IQ-set. When the Jingle action is "session-accept", the
<jingle/>
element SHOULD possess a 'responder' attribute that explicitly specifies the full JID of the responding entity; for all other actions, the<jingle/>
element SHOULD NOT possess a 'responder' attribute and the recipient of the message SHOULD ignore the value if provided. The value of the 'responder' attribute MAY be different from the 'from' address on the IQ-set of the session-accept message, where the logic for handling any difference between the 'responder' JID and the 'from' JID follows the same logic as for session-initiate messages (see above). After sending acknowledgement of the session-accept message, the initiator MUST send all future commmunications about this Jingle session to the responder (whether the responder is considered the 'from' JID or the 'responder' JID).- Returns:
- The responder.
-
getSessionId
public String getSessionId()
Gets the session id.A random session identifier generated by the initiator, which effectively maps to the local-part of a SIP "Call-ID" parameter; this SHOULD match the XML Nmtoken production so that XML character escaping is not needed for characters such as '&'. In some situations the Jingle session identifier might have security implications. See RFC 4086 regarding requirements for randomness.
- Returns:
- The session id.
-
getContents
public List<Jingle.Content> getContents()
Gets the contents.- Returns:
- The contents.
-
getReason
public Jingle.Reason getReason()
Gets the reason.- Returns:
- The reason.
-
setReason
public void setReason(Jingle.Reason reason)
Sets the reason.- Parameters:
reason
- The reason.
-
getPayload
public Object getPayload()
-
-