idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
19,600
public LeafNode getLeafNode ( String id ) throws NotALeafNodeException , NoResponseException , NotConnectedException , InterruptedException , XMPPErrorException , NotAPubSubNodeException { Node node ; try { node = getNode ( id ) ; } catch ( XMPPErrorException e ) { if ( e . getStanzaError ( ) . getCondition ( ) == Cond...
Try to get a leaf node with the given node ID .
19,601
public DiscoverItems discoverNodes ( String nodeId ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { DiscoverItems items = new DiscoverItems ( ) ; if ( nodeId != null ) items . setNode ( nodeId ) ; items . setTo ( pubSubService ) ; DiscoverItems nodeItems = connection ( ...
Get all the nodes that currently exist as a child of the specified collection node . If the service does not support collection nodes then all nodes will be returned .
19,602
public List < Subscription > getSubscriptions ( ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { Stanza reply = sendPubsubPacket ( Type . get , new NodeExtension ( PubSubElementType . SUBSCRIPTIONS ) , null ) ; SubscriptionsExtension subElem = reply . getExtension ( Pub...
Gets the subscriptions on the root node .
19,603
public List < Affiliation > getAffiliations ( ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { PubSub reply = sendPubsubPacket ( Type . get , new NodeExtension ( PubSubElementType . AFFILIATIONS ) , null ) ; AffiliationsExtension listElem = reply . getExtension ( PubSub...
Gets the affiliations on the root node .
19,604
public boolean deleteNode ( String nodeId ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { boolean res = true ; try { sendPubsubPacket ( Type . set , new NodeExtension ( PubSubElementType . DELETE , nodeId ) , PubSubElementType . DELETE . getNamespace ( ) ) ; } catch ( ...
Delete the specified node .
19,605
public ConfigureForm getDefaultConfiguration ( ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { PubSub reply = sendPubsubPacket ( Type . get , new NodeExtension ( PubSubElementType . DEFAULT ) , PubSubElementType . DEFAULT . getNamespace ( ) ) ; return NodeUtils . getFo...
Returns the default settings for Node configuration .
19,606
public boolean supportsAutomaticNodeCreation ( ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { ServiceDiscoveryManager sdm = ServiceDiscoveryManager . getInstanceFor ( connection ( ) ) ; return sdm . supportsFeature ( pubSubService , AUTO_CREATE_FEATURE ) ; }
Check if the PubSub service supports automatic node creation .
19,607
public static DomainBareJid getPubSubService ( XMPPConnection connection ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { return ServiceDiscoveryManager . getInstanceFor ( connection ) . findService ( PubSub . NAMESPACE , true , "pubsub" , "service" ) ; }
Get the default PubSub service for a given XMPP connection . The default PubSub service is simply an arbitrary XMPP service with the PubSub feature and an identity of category pubsub and type service .
19,608
protected void triggerCandidateAdded ( TransportCandidate cand ) throws NotConnectedException , InterruptedException { Iterator < TransportResolverListener > iter = getListenersList ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { TransportResolverListener trl = iter . next ( ) ; if ( trl instanceof TransportResolve...
Trigger a new candidate added event .
19,609
private void triggerResolveInit ( ) { Iterator < TransportResolverListener > iter = getListenersList ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { TransportResolverListener trl = iter . next ( ) ; if ( trl instanceof TransportResolverListener . Resolver ) { TransportResolverListener . Resolver li = ( TransportRes...
Trigger a event notifying the initialization of the resolution process .
19,610
private void triggerResolveEnd ( ) { Iterator < TransportResolverListener > iter = getListenersList ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { TransportResolverListener trl = iter . next ( ) ; if ( trl instanceof TransportResolverListener . Resolver ) { TransportResolverListener . Resolver li = ( TransportReso...
Trigger a event notifying the obtainment of all the candidates .
19,611
protected void addCandidate ( TransportCandidate cand ) throws NotConnectedException , InterruptedException { synchronized ( candidates ) { if ( ! candidates . contains ( cand ) ) candidates . add ( cand ) ; } triggerCandidateAdded ( cand ) ; }
Add a new transport candidate
19,612
public TransportCandidate getPreferredCandidate ( ) { TransportCandidate result = null ; ArrayList < ICECandidate > cands = new ArrayList < > ( ) ; for ( TransportCandidate tpcan : getCandidatesList ( ) ) { if ( tpcan instanceof ICECandidate ) cands . add ( ( ICECandidate ) tpcan ) ; } if ( cands . size ( ) > 0 ) { Col...
Get the candidate with the highest preference .
19,613
public TransportCandidate getCandidate ( int i ) { TransportCandidate cand ; synchronized ( candidates ) { cand = candidates . get ( i ) ; } return cand ; }
Get the n - th candidate .
19,614
public void initializeAndWait ( ) throws XMPPException , SmackException , InterruptedException { this . initialize ( ) ; try { LOGGER . fine ( "Initializing transport resolver..." ) ; while ( ! this . isInitialized ( ) ) { LOGGER . fine ( "Resolver init still pending" ) ; Thread . sleep ( 1000 ) ; } LOGGER . fine ( "Tr...
Initialize Transport Resolver and wait until it is completely uninitialized .
19,615
public final List < SRVRecord > lookupSRVRecords ( DnsName name , List < HostAddress > failedAddresses , DnssecMode dnssecMode ) { checkIfDnssecRequestedAndSupported ( dnssecMode ) ; return lookupSRVRecords0 ( name , failedAddresses , dnssecMode ) ; }
Gets a list of service records for the specified service .
19,616
MUCInitialPresence . History getMUCHistory ( ) { if ( ! isConfigured ( ) ) { return null ; } return new MUCInitialPresence . History ( maxChars , maxStanzas , seconds , since ) ; }
Returns the History that manages the amount of discussion history provided on entering a room .
19,617
public static ToMatchesFilter create ( Jid address ) { return new ToMatchesFilter ( address , address != null ? address . hasNoResource ( ) : false ) ; }
Creates a filter matching on the to field . If the filter address is bare compares the filter address with the bare from address . Otherwise compares the filter address with the full from address .
19,618
public static MediaSession createSession ( String localhost , int localPort , String remoteHost , int remotePort , MediaSessionListener eventHandler , int quality , boolean secure , boolean micOn ) throws NoProcessorException , UnsupportedFormatException , IOException , GeneralSecurityException { SpeexFormat . setFrame...
Create a Session using Speex Codec .
19,619
public void startTransmit ( ) { try { LOGGER . fine ( "start" ) ; mediaSession . start ( true ) ; this . mediaReceived ( "" ) ; } catch ( IOException e ) { LOGGER . log ( Level . WARNING , "exception" , e ) ; } }
Starts transmission and for NAT Traversal reasons start receiving also .
19,620
protected HeadersExtension parseHeaders ( XmlPullParser parser ) throws IOException , XmlPullParserException , SmackParsingException { HeadersExtension headersExtension = null ; if ( parser . next ( ) == XmlPullParser . START_TAG && parser . getName ( ) . equals ( HeadersExtension . ELEMENT ) ) { headersExtension = Hea...
Parses HeadersExtension element if any .
19,621
protected AbstractHttpOverXmpp . Data parseData ( XmlPullParser parser ) throws XmlPullParserException , IOException { NamedElement child = null ; boolean done = false ; AbstractHttpOverXmpp . Data data = null ; if ( parser . getEventType ( ) == XmlPullParser . START_TAG ) { while ( ! done ) { int eventType = parser . ...
Parses Data element if any .
19,622
public List < PayloadType > getPayloads ( ) { List < PayloadType > list = new ArrayList < > ( ) ; if ( preferredPayloadType != null ) list . add ( preferredPayloadType ) ; for ( JingleMediaManager manager : managers ) { for ( PayloadType payloadType : manager . getPayloads ( ) ) { if ( ! list . contains ( payloadType )...
Return all supported Payloads for this Manager .
19,623
public static boolean isServiceEnabled ( XMPPConnection connection , Jid userID ) throws XMPPException , SmackException , InterruptedException { return ServiceDiscoveryManager . getInstanceFor ( connection ) . supportsFeature ( userID , Jingle . NAMESPACE ) ; }
Returns true if the specified user handles Jingle messages .
19,624
public synchronized void addJingleSessionRequestListener ( final JingleSessionRequestListener jingleSessionRequestListener ) { if ( jingleSessionRequestListener != null ) { if ( jingleSessionRequestListeners == null ) { initJingleSessionRequestListeners ( ) ; } synchronized ( jingleSessionRequestListeners ) { jingleSes...
Add a Jingle session request listenerJingle to listen to incoming session requests .
19,625
public void triggerSessionCreated ( JingleSession jingleSession ) { jingleSessions . add ( jingleSession ) ; jingleSession . addListener ( this ) ; for ( CreatedJingleSessionListener createdJingleSessionListener : creationListeners ) { try { createdJingleSessionListener . sessionCreated ( jingleSession ) ; } catch ( Ex...
Trigger CreatedJingleSessionListeners that a session was created .
19,626
private void initJingleSessionRequestListeners ( ) { StanzaFilter initRequestFilter = new StanzaFilter ( ) { public boolean accept ( Stanza pin ) { if ( pin instanceof IQ ) { IQ iq = ( IQ ) pin ; if ( iq . getType ( ) . equals ( IQ . Type . set ) ) { if ( iq instanceof Jingle ) { Jingle jin = ( Jingle ) pin ; if ( jin ...
Register the listenerJingles waiting for a Jingle stanza that tries to establish a new session .
19,627
public void disconnectAllSessions ( ) { List < JingleSession > sessions = jingleSessions . subList ( 0 , jingleSessions . size ( ) ) ; for ( JingleSession jingleSession : sessions ) try { jingleSession . terminate ( ) ; } catch ( Exception e ) { LOGGER . log ( Level . WARNING , "exception" , e ) ; } sessions . clear ( ...
Disconnect all Jingle Sessions .
19,628
void triggerSessionRequested ( Jingle initJin ) { JingleSessionRequestListener [ ] jingleSessionRequestListeners ; synchronized ( this . jingleSessionRequestListeners ) { jingleSessionRequestListeners = new JingleSessionRequestListener [ this . jingleSessionRequestListeners . size ( ) ] ; this . jingleSessionRequestLis...
Activates the listenerJingles on a Jingle session request .
19,629
public JingleSession createOutgoingJingleSession ( EntityFullJid responder ) throws XMPPException { JingleSession session = new JingleSession ( connection , null , connection . getUser ( ) , responder , jingleMediaManagers ) ; triggerSessionCreated ( session ) ; return session ; }
Creates an Jingle session to start a communication with another user .
19,630
public JingleSession createIncomingJingleSession ( JingleSessionRequest request ) throws XMPPException { if ( request == null ) { throw new NullPointerException ( "Received request cannot be null" ) ; } JingleSession session = new JingleSession ( connection , request , request . getFrom ( ) , connection . getUser ( ) ,...
When the session request is acceptable this method should be invoked . It will create an JingleSession which allows the negotiation to procede .
19,631
public JingleSession getSession ( String jid ) { for ( JingleSession jingleSession : jingleSessions ) { if ( jingleSession . getResponder ( ) . equals ( jid ) ) { return jingleSession ; } } return null ; }
Get a session with the informed JID . If no session is found return null .
19,632
public String blocksOf8Chars ( ) { StringBuilder pretty = new StringBuilder ( ) ; for ( int i = 0 ; i < 8 ; i ++ ) { if ( i != 0 ) pretty . append ( ' ' ) ; pretty . append ( this . fingerprintString . substring ( 8 * i , 8 * ( i + 1 ) ) ) ; } return pretty . toString ( ) ; }
Split the fingerprint in blocks of 8 characters with spaces between .
19,633
public static synchronized IoTDataManager getInstanceFor ( XMPPConnection connection ) { IoTDataManager manager = INSTANCES . get ( connection ) ; if ( manager == null ) { manager = new IoTDataManager ( connection ) ; INSTANCES . put ( connection , manager ) ; } return manager ; }
Get the manger instance responsible for the given connection .
19,634
public List < IoTFieldsExtension > requestMomentaryValuesReadOut ( EntityFullJid jid ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { final XMPPConnection connection = connection ( ) ; final int seqNr = nextSeqNr . incrementAndGet ( ) ; IoTDataRequest iotDataRequest = n...
Try to read out a things momentary values .
19,635
public static synchronized BlockingCommandManager getInstanceFor ( XMPPConnection connection ) { BlockingCommandManager blockingCommandManager = INSTANCES . get ( connection ) ; if ( blockingCommandManager == null ) { blockingCommandManager = new BlockingCommandManager ( connection ) ; INSTANCES . put ( connection , bl...
Get the singleton instance of BlockingCommandManager .
19,636
public List < Jid > getBlockList ( ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { if ( blockListCached == null ) { BlockListIQ blockListIQ = new BlockListIQ ( ) ; BlockListIQ blockListIQResult = connection ( ) . createStanzaCollectorAndSend ( blockListIQ ) . nextResul...
Returns the block list .
19,637
public void blockContacts ( List < Jid > jids ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { BlockContactsIQ blockContactIQ = new BlockContactsIQ ( jids ) ; connection ( ) . createStanzaCollectorAndSend ( blockContactIQ ) . nextResultOrThrow ( ) ; }
Block contacts .
19,638
public void unblockContacts ( List < Jid > jids ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { UnblockContactsIQ unblockContactIQ = new UnblockContactsIQ ( jids ) ; connection ( ) . createStanzaCollectorAndSend ( unblockContactIQ ) . nextResultOrThrow ( ) ; }
Unblock contacts .
19,639
public void unblockAll ( ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { UnblockContactsIQ unblockContactIQ = new UnblockContactsIQ ( ) ; connection ( ) . createStanzaCollectorAndSend ( unblockContactIQ ) . nextResultOrThrow ( ) ; }
Unblock all .
19,640
public void execute ( Form form ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { executeAction ( Action . execute , form ) ; }
Executes the default action of the command with the information provided in the Form . This form must be the answer form of the previous stage . If there is a problem executing the command it throws an XMPPException .
19,641
public synchronized void controllerUpdate ( ControllerEvent ce ) { Player p = ( Player ) ce . getSourceController ( ) ; if ( p == null ) return ; if ( ce instanceof RealizeCompleteEvent ) { p . start ( ) ; } if ( ce instanceof ControllerErrorEvent ) { p . removeControllerListener ( this ) ; LOGGER . severe ( "Receiver ...
ControllerListener for the Players .
19,642
public void addAlgorithmsToFeatures ( List < ALGORITHM > algorithms ) { ServiceDiscoveryManager sdm = ServiceDiscoveryManager . getInstanceFor ( connection ( ) ) ; for ( ALGORITHM algo : algorithms ) { sdm . addFeature ( asFeature ( algo ) ) ; } }
Announce support for the given list of algorithms .
19,643
public static synchronized HashManager getInstanceFor ( XMPPConnection connection ) { HashManager hashManager = INSTANCES . get ( connection ) ; if ( hashManager == null ) { hashManager = new HashManager ( connection ) ; INSTANCES . put ( connection , hashManager ) ; } return hashManager ; }
Get an instance of the HashManager for the given connection .
19,644
public OutgoingFileTransfer createOutgoingFileTransfer ( EntityFullJid userID ) { if ( userID == null ) { throw new IllegalArgumentException ( "userID was null" ) ; } return new OutgoingFileTransfer ( connection ( ) . getUser ( ) , userID , FileTransferNegotiator . getNextStreamID ( ) , fileTransferNegotiator ) ; }
Creates an OutgoingFileTransfer to send a file to another user .
19,645
protected IncomingFileTransfer createIncomingFileTransfer ( FileTransferRequest request ) { if ( request == null ) { throw new NullPointerException ( "ReceiveRequest cannot be null" ) ; } IncomingFileTransfer transfer = new IncomingFileTransfer ( request , fileTransferNegotiator ) ; transfer . setFileInfo ( request . g...
When the file transfer request is acceptable this method should be invoked . It will create an IncomingFileTransfer which allows the transmission of the file to proceed .
19,646
public void accept ( ) throws NotConnectedException , InterruptedException { Stanza acceptPacket = new AcceptPacket ( this . session . getWorkgroupJID ( ) ) ; connection . sendStanza ( acceptPacket ) ; accepted = true ; }
Accepts the offer .
19,647
public void reject ( ) throws NotConnectedException , InterruptedException { RejectPacket rejectPacket = new RejectPacket ( this . session . getWorkgroupJID ( ) ) ; connection . sendStanza ( rejectPacket ) ; rejected = true ; }
Rejects the offer .
19,648
public String toXML ( org . jivesoftware . smack . packet . XmlEnvironment enclosingNamespace ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( '<' ) . append ( getElementName ( ) ) . append ( " xmlns=\"" ) . append ( getNamespace ( ) ) . append ( "\">" ) ; if ( isOffline ( ) ) buf . append ( '<' ) . appen...
Returns the XML representation of a Message Event according the specification .
19,649
public static DirectoryRosterStore init ( final File baseDir ) { DirectoryRosterStore store = new DirectoryRosterStore ( baseDir ) ; if ( store . setRosterVersion ( "" ) ) { return store ; } else { return null ; } }
Creates a new roster store on disk .
19,650
public static DirectoryRosterStore open ( final File baseDir ) { DirectoryRosterStore store = new DirectoryRosterStore ( baseDir ) ; String s = FileUtils . readFile ( store . getVersionFile ( ) ) ; if ( s != null && s . startsWith ( STORE_ID + "\n" ) ) { return store ; } else { return null ; } }
Opens a roster store .
19,651
public static BoBHash fromSrc ( String src ) { String hashType = src . substring ( src . lastIndexOf ( "cid:" ) + 4 , src . indexOf ( "+" ) ) ; String hash = src . substring ( src . indexOf ( "+" ) + 1 , src . indexOf ( "@bob.xmpp.org" ) ) ; return new BoBHash ( hash , hashType ) ; }
Get BoB hash from src attribute string .
19,652
public static BoBHash fromCid ( String cid ) { String hashType = cid . substring ( 0 , cid . indexOf ( "+" ) ) ; String hash = cid . substring ( cid . indexOf ( "+" ) + 1 , cid . indexOf ( "@bob.xmpp.org" ) ) ; return new BoBHash ( hash , hashType ) ; }
Get BoB hash from cid attribute string .
19,653
public static void preApproveSubscriptionIfRequiredAndPossible ( Roster roster , BareJid jid ) throws NotLoggedInException , NotConnectedException , InterruptedException { if ( ! roster . isSubscriptionPreApprovalSupported ( ) ) { return ; } RosterEntry entry = roster . getEntry ( jid ) ; if ( entry == null || ( ! entr...
Pre - approve the subscription if it is required and possible .
19,654
protected TransportResolver createResolver ( JingleSession session ) { BridgedResolver bridgedResolver = new BridgedResolver ( this . xmppConnection ) ; return bridgedResolver ; }
Return the correspondent resolver
19,655
private static List < HostAddress > sortSRVRecords ( List < SRVRecord > records ) { if ( records . size ( ) == 1 && records . get ( 0 ) . getFQDN ( ) . isRootLabel ( ) ) return Collections . emptyList ( ) ; Collections . sort ( records ) ; SortedMap < Integer , List < SRVRecord > > buckets = new TreeMap < Integer , Lis...
Sort a given list of SRVRecords as described in RFC 2782 Note that we follow the RFC with one exception . In a group of the same priority only the first entry is calculated by random . The others are ore simply ordered by their priority .
19,656
public static List < ClassLoader > getClassLoaders ( ) { ClassLoader [ ] classLoaders = new ClassLoader [ 2 ] ; classLoaders [ 0 ] = FileUtils . class . getClassLoader ( ) ; classLoaders [ 1 ] = Thread . currentThread ( ) . getContextClassLoader ( ) ; List < ClassLoader > loaders = new ArrayList < ClassLoader > ( class...
Returns default classloaders .
19,657
@ SuppressWarnings ( "DefaultCharset" ) public static String readFileOrThrow ( File file ) throws IOException { try ( Reader reader = new FileReader ( file ) ) { char [ ] buf = new char [ 8192 ] ; int len ; StringBuilder s = new StringBuilder ( ) ; while ( ( len = reader . read ( buf ) ) >= 0 ) { s . append ( buf , 0 ,...
Reads the contents of a File .
19,658
public OfferRequestPacket parse ( XmlPullParser parser , int initialDepth , XmlEnvironment xmlEnvironment ) throws XmlPullParserException , IOException , SmackParsingException { int eventType = parser . getEventType ( ) ; String sessionID = null ; int timeout = - 1 ; OfferContent content = null ; boolean done = false ;...
happen anytime soon .
19,659
public static synchronized ReconnectionManager getInstanceFor ( AbstractXMPPConnection connection ) { ReconnectionManager reconnectionManager = INSTANCES . get ( connection ) ; if ( reconnectionManager == null ) { reconnectionManager = new ReconnectionManager ( connection ) ; INSTANCES . put ( connection , reconnection...
Get a instance of ReconnectionManager for the given connection .
19,660
public synchronized void enableAutomaticReconnection ( ) { if ( automaticReconnectEnabled ) { return ; } XMPPConnection connection = weakRefConnection . get ( ) ; if ( connection == null ) { throw new IllegalStateException ( "Connection instance no longer available" ) ; } connection . addConnectionListener ( connection...
Enable the automatic reconnection mechanism . Does nothing if already enabled .
19,661
public synchronized void disableAutomaticReconnection ( ) { if ( ! automaticReconnectEnabled ) { return ; } XMPPConnection connection = weakRefConnection . get ( ) ; if ( connection == null ) { throw new IllegalStateException ( "Connection instance no longer available" ) ; } connection . removeConnectionListener ( conn...
Disable the automatic reconnection mechanism . Does nothing if already disabled .
19,662
private synchronized void reconnect ( ) { XMPPConnection connection = this . weakRefConnection . get ( ) ; if ( connection == null ) { LOGGER . fine ( "Connection is null, will not reconnect" ) ; return ; } if ( reconnectionThread != null && reconnectionThread . isAlive ( ) ) return ; reconnectionThread = Async . go ( ...
Starts a reconnection mechanism if it was configured to do that . The algorithm is been executed when the first connection error is detected .
19,663
public List < V > remove ( K key , int num ) { List < V > values = map . get ( key ) ; if ( values == null ) { return Collections . emptyList ( ) ; } final int resultSize = values . size ( ) > num ? num : values . size ( ) ; final List < V > result = new ArrayList < > ( resultSize ) ; for ( int i = 0 ; i < resultSize ;...
Remove the given number of values for a given key . May return less values then requested .
19,664
public List < V > values ( ) { List < V > values = new ArrayList < > ( size ( ) ) ; for ( List < V > list : map . values ( ) ) { values . addAll ( list ) ; } return values ; }
Returns a new list containing all values of this multi map .
19,665
public void initialize ( ) { JingleSession session = getJingleSession ( ) ; if ( session != null && session . getInitiator ( ) . equals ( session . getConnection ( ) . getUser ( ) ) ) { try { InetAddress remote = InetAddress . getByName ( getRemote ( ) . getIp ( ) ) ; transmitter = new ImageTransmitter ( new DatagramSo...
Initialize the screen share channels .
19,666
public static void addSpoiler ( Message message , String hint ) { message . addExtension ( new SpoilerElement ( null , hint ) ) ; }
Add a SpoilerElement with a hint to a message .
19,667
public static void addSpoiler ( Message message , String lang , String hint ) { message . addExtension ( new SpoilerElement ( lang , hint ) ) ; }
Add a SpoilerElement with a hint in a certain language to a message .
19,668
public static Map < String , String > getSpoilers ( Message message ) { if ( ! containsSpoiler ( message ) ) { return Collections . emptyMap ( ) ; } List < ExtensionElement > spoilers = message . getExtensions ( SpoilerElement . ELEMENT , NAMESPACE ) ; Map < String , String > map = new HashMap < > ( ) ; for ( Extension...
Return a map of all spoilers contained in a message . The map uses the language of a spoiler as key . If a spoiler has no language attribute its key will be an empty String .
19,669
public AgentRoster getAgentRoster ( ) throws NotConnectedException , InterruptedException { if ( agentRoster == null ) { agentRoster = new AgentRoster ( connection , workgroupJID ) ; } int elapsed = 0 ; while ( ! agentRoster . rosterInitialized && elapsed <= 2000 ) { try { Thread . sleep ( 500 ) ; } catch ( Exception e...
Returns the agent roster for the workgroup which contains .
19,670
public void setMetaData ( String key , String val ) throws XMPPException , SmackException , InterruptedException { synchronized ( this . metaData ) { List < String > oldVals = metaData . get ( key ) ; if ( oldVals == null || ! oldVals . get ( 0 ) . equals ( val ) ) { oldVals . set ( 0 , val ) ; setStatus ( presenceMode...
Allows the addition of a new key - value pair to the agent s meta data if the value is new data the revised meta data will be rebroadcast in an agent s presence broadcast .
19,671
public void removeMetaData ( String key ) throws XMPPException , SmackException , InterruptedException { synchronized ( this . metaData ) { List < String > oldVal = metaData . remove ( key ) ; if ( oldVal != null ) { setStatus ( presenceMode , maxChats ) ; } } }
Allows the removal of data from the agent s meta data if the key represents existing data the revised meta data will be rebroadcast in an agent s presence broadcast .
19,672
public void setOnline ( boolean online ) throws XMPPException , SmackException , InterruptedException { if ( this . online == online ) { return ; } Presence presence ; if ( online ) { presence = new Presence ( Presence . Type . available ) ; presence . setTo ( workgroupJID ) ; presence . addExtension ( new StandardExte...
Sets whether the agent is online with the workgroup . If the user tries to go online with the workgroup but is not allowed to be an agent an XMPPError with error code 401 will be thrown .
19,673
public void dequeueUser ( EntityJid userID ) throws XMPPException , NotConnectedException , InterruptedException { DepartQueuePacket departPacket = new DepartQueuePacket ( workgroupJID , userID ) ; this . connection . sendStanza ( departPacket ) ; }
Removes a user from the workgroup queue . This is an administrative action that the
19,674
public OccupantsInfo getOccupantsInfo ( String roomID ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { OccupantsInfo request = new OccupantsInfo ( roomID ) ; request . setType ( IQ . Type . get ) ; request . setTo ( workgroupJID ) ; OccupantsInfo response = ( OccupantsI...
Asks the workgroup for information about the occupants of the specified room . The returned information will include the real JID of the occupants the nickname of the user in the room as well as the date when the user joined the room .
19,675
public WorkgroupQueue getQueue ( String queueName ) { Resourcepart queueNameResourcepart ; try { queueNameResourcepart = Resourcepart . from ( queueName ) ; } catch ( XmppStringprepException e ) { throw new IllegalArgumentException ( e ) ; } return getQueue ( queueNameResourcepart ) ; }
Get queue .
19,676
public void addOfferListener ( OfferListener offerListener ) { synchronized ( offerListeners ) { if ( ! offerListeners . contains ( offerListener ) ) { offerListeners . add ( offerListener ) ; } } }
Adds an offer listener .
19,677
public void addInvitationListener ( WorkgroupInvitationListener invitationListener ) { synchronized ( invitationListeners ) { if ( ! invitationListeners . contains ( invitationListener ) ) { invitationListeners . add ( invitationListener ) ; } } }
Adds an invitation listener .
19,678
public void setNote ( String sessionID , String note ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { ChatNotes notes = new ChatNotes ( ) ; notes . setType ( IQ . Type . set ) ; notes . setTo ( workgroupJID ) ; notes . setSessionID ( sessionID ) ; notes . setNotes ( not...
Creates a ChatNote that will be mapped to the given chat session .
19,679
public ChatNotes getNote ( String sessionID ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { ChatNotes request = new ChatNotes ( ) ; request . setType ( IQ . Type . get ) ; request . setTo ( workgroupJID ) ; request . setSessionID ( sessionID ) ; ChatNotes response = co...
Retrieves the ChatNote associated with a given chat session .
19,680
public AgentChatHistory getAgentHistory ( EntityBareJid jid , int maxSessions , Date startDate ) throws XMPPException , NotConnectedException , InterruptedException { AgentChatHistory request ; if ( startDate != null ) { request = new AgentChatHistory ( jid , maxSessions , startDate ) ; } else { request = new AgentChat...
Retrieves the AgentChatHistory associated with a particular agent jid .
19,681
public SearchSettings getSearchSettings ( ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { SearchSettings request = new SearchSettings ( ) ; request . setType ( IQ . Type . get ) ; request . setTo ( workgroupJID ) ; SearchSettings response = connection . createStanzaCol...
Asks the workgroup for it s Search Settings .
19,682
public MacroGroup getMacros ( boolean global ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { Macros request = new Macros ( ) ; request . setType ( IQ . Type . get ) ; request . setTo ( workgroupJID ) ; request . setPersonal ( ! global ) ; Macros response = connection ....
Asks the workgroup for it s Global Macros .
19,683
public void saveMacros ( MacroGroup group ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { Macros request = new Macros ( ) ; request . setType ( IQ . Type . set ) ; request . setTo ( workgroupJID ) ; request . setPersonal ( true ) ; request . setPersonalMacroGroup ( gro...
Persists the Personal Macro for an agent .
19,684
public Map < String , List < String > > getChatMetadata ( String sessionID ) throws XMPPException , NotConnectedException , InterruptedException { ChatMetadata request = new ChatMetadata ( ) ; request . setType ( IQ . Type . get ) ; request . setTo ( workgroupJID ) ; request . setSessionID ( sessionID ) ; ChatMetadata ...
Query for metadata associated with a session id .
19,685
public GenericSettings getGenericSettings ( XMPPConnection con , String query ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { GenericSettings setting = new GenericSettings ( ) ; setting . setType ( IQ . Type . get ) ; setting . setTo ( workgroupJID ) ; GenericSettings ...
Returns the generic metadata of the workgroup the agent belongs to .
19,686
public boolean isNull ( ) { if ( ip == null ) { return true ; } else if ( ip . length ( ) == 0 ) { return true ; } else if ( port < 0 ) { return true ; } else { return false ; } }
Return true if the candidate is not valid .
19,687
public int compareTo ( ICECandidate arg ) { if ( getPreference ( ) < arg . getPreference ( ) ) { return - 1 ; } else if ( getPreference ( ) > arg . getPreference ( ) ) { return 1 ; } return 0 ; }
Compare the to other Transport candidate .
19,688
public static Stanza parseStanza ( XmlPullParser parser , XmlEnvironment outerXmlEnvironment ) throws Exception { ParserUtils . assertAtStartTag ( parser ) ; final String name = parser . getName ( ) ; switch ( name ) { case Message . ELEMENT : return parseMessage ( parser , outerXmlEnvironment ) ; case IQ . IQ_ELEMENT ...
Tries to parse and return either a Message IQ or Presence stanza .
19,689
public static Message parseMessage ( XmlPullParser parser , XmlEnvironment outerXmlEnvironment ) throws XmlPullParserException , IOException , SmackParsingException { ParserUtils . assertAtStartTag ( parser ) ; assert ( parser . getName ( ) . equals ( Message . ELEMENT ) ) ; XmlEnvironment messageXmlEnvironment = XmlEn...
Parses a message packet .
19,690
public static Presence parsePresence ( XmlPullParser parser , XmlEnvironment outerXmlEnvironment ) throws XmlPullParserException , IOException , SmackParsingException { ParserUtils . assertAtStartTag ( parser ) ; final int initialDepth = parser . getDepth ( ) ; XmlEnvironment presenceXmlEnvironment = XmlEnvironment . f...
Parses a presence packet .
19,691
public static IQ parseIQ ( XmlPullParser parser , XmlEnvironment outerXmlEnvironment ) throws Exception { ParserUtils . assertAtStartTag ( parser ) ; final int initialDepth = parser . getDepth ( ) ; XmlEnvironment iqXmlEnvironment = XmlEnvironment . from ( parser , outerXmlEnvironment ) ; IQ iqPacket = null ; StanzaErr...
Parses an IQ packet .
19,692
public static Collection < String > parseMechanisms ( XmlPullParser parser ) throws XmlPullParserException , IOException { List < String > mechanisms = new ArrayList < String > ( ) ; boolean done = false ; while ( ! done ) { int eventType = parser . next ( ) ; if ( eventType == XmlPullParser . START_TAG ) { String elem...
Parse the available SASL mechanisms reported from the server .
19,693
public static Compress . Feature parseCompressionFeature ( XmlPullParser parser ) throws IOException , XmlPullParserException { assert ( parser . getEventType ( ) == XmlPullParser . START_TAG ) ; String name ; final int initialDepth = parser . getDepth ( ) ; List < String > methods = new LinkedList < > ( ) ; outerloop ...
Parse the Compression Feature reported from the server .
19,694
public static SASLFailure parseSASLFailure ( XmlPullParser parser ) throws XmlPullParserException , IOException { final int initialDepth = parser . getDepth ( ) ; String condition = null ; Map < String , String > descriptiveTexts = null ; outerloop : while ( true ) { int eventType = parser . next ( ) ; switch ( eventTy...
Parses SASL authentication error packets .
19,695
public static StreamError parseStreamError ( XmlPullParser parser , XmlEnvironment outerXmlEnvironment ) throws XmlPullParserException , IOException , SmackParsingException { final int initialDepth = parser . getDepth ( ) ; List < ExtensionElement > extensions = new ArrayList < > ( ) ; Map < String , String > descripti...
Parses stream error packets .
19,696
public static StanzaError . Builder parseError ( XmlPullParser parser , XmlEnvironment outerXmlEnvironment ) throws XmlPullParserException , IOException , SmackParsingException { final int initialDepth = parser . getDepth ( ) ; Map < String , String > descriptiveTexts = null ; XmlEnvironment stanzaErrorXmlEnvironment =...
Parses error sub - packets .
19,697
public static ExtensionElement parseExtensionElement ( String elementName , String namespace , XmlPullParser parser , XmlEnvironment outerXmlEnvironment ) throws XmlPullParserException , IOException , SmackParsingException { ParserUtils . assertAtStartTag ( parser ) ; ExtensionElementProvider < ExtensionElement > provi...
Parses an extension element .
19,698
private void fireMessageEventRequestListeners ( Jid from , String packetID , String methodName ) { try { Method method = MessageEventRequestListener . class . getDeclaredMethod ( methodName , new Class < ? > [ ] { Jid . class , String . class , MessageEventManager . class } ) ; for ( MessageEventRequestListener listene...
Fires message event request listeners .
19,699
private void fireMessageEventNotificationListeners ( Jid from , String packetID , String methodName ) { try { Method method = MessageEventNotificationListener . class . getDeclaredMethod ( methodName , new Class < ? > [ ] { Jid . class , String . class } ) ; for ( MessageEventNotificationListener listener : messageEven...
Fires message event notification listeners .