com.echomine.jabber
Class JabberClientService

java.lang.Object
  extended by com.echomine.jabber.JabberClientService

public class JabberClientService
extends java.lang.Object

the clients service contains the methods that you will use 90% of the time. For the rest, you will need to manually create the individual methods (should be easy) and work with the message object directly. The service relates to working with client-related information, such as obtaining a client's last signed on time. The functionality is similar to the User Service, except that it deals with the other clients rather than with your own information.


Constructor Summary
JabberClientService(JabberSession session)
           
 
Method Summary
 long getClientLastOnline(JID jid)
          this method works two ways.
 Element getPrivateData(java.lang.String elemName, java.lang.String ns)
          Provides a convenient way to send a request to retrieve private data.
 void sendIdleTimeReply(JID jid, java.lang.String msgID, long seconds)
          sends an idle time reply back to the client who sent us the request.
 java.lang.String sendOutOfBandRequest(JID jid, java.lang.String url, java.lang.String desc)
          Provides a convenient way to send an OOB request to the specified user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JabberClientService

public JabberClientService(JabberSession session)
Method Detail

getClientLastOnline

public long getClientLastOnline(JID jid)
                         throws SendMessageFailedException
this method works two ways. First, if the user is online, then you will get the idle time of the user. If the user is offline, then you will obtain the time since the last time the user has signed on. If you want to retrieve the last signed on message for the user, you will need to create your own message and retrieve the information directly yourself. This method submits the message synchronously.

BUG: Currently, Jabber Instant Messenger does not send the Last Idle Time message correctly; it is not sending back the result with the ID of the request message. Thus, synchronized messaging will fail. However, if you're using unsynchronized messaging, then it should be ok since you're not dependent on the ID.

Returns:
the time (seconds) since the last time the user signed on.
Throws:
SendMessageFailedException

sendIdleTimeReply

public void sendIdleTimeReply(JID jid,
                              java.lang.String msgID,
                              long seconds)
                       throws SendMessageFailedException
sends an idle time reply back to the client who sent us the request. This message is Asynchronous and will return immediately after sending the message.

Parameters:
jid - the jid of the user who submitted the request
msgID - the message id of the request message
seconds - the idle time in seconds
Throws:
SendMessageFailedException

sendOutOfBandRequest

public java.lang.String sendOutOfBandRequest(JID jid,
                                             java.lang.String url,
                                             java.lang.String desc)
                                      throws SendMessageFailedException
Provides a convenient way to send an OOB request to the specified user. The message will be sent asynchronously and will not listen for a reply either. The reply might come back later in reply to the request (success, failure, etc). Thus, the message id is returned so that you can match it later with the reply when it comes back.

Parameters:
jid - the user JID to send this request to
url - the URL to retrieve the file
desc - the description of the URL
Returns:
the message ID associated with the message that is sent out
Throws:
SendMessageFailedException

getPrivateData

public Element getPrivateData(java.lang.String elemName,
                              java.lang.String ns)
                       throws SendMessageFailedException
Provides a convenient way to send a request to retrieve private data. The message will be sent synchronously and will return either the private data or null.

Parameters:
elemName - the element name that the private data is stored as
ns - the namespace that the private data is stored in
Returns:
the private data as an Element, null if the private data requested does not exist
Throws:
SendMessageFailedException


Copyright © 2001-2005 Echomine. All Rights Reserved.