src/net/java/sip/communicator/impl/protocol/jabber/OperationSetPersistentPresenceJabberImpl.java
/**
     * Gets the <tt>PresenceStatus</tt> of a contact with a specific
     * <tt>String</tt> identifier.
     *
     * @param contactIdentifier the identifier of the contact whose status we're
     * interested in.
     * @return the <tt>PresenceStatus</tt> of the contact with the specified
     * <tt>contactIdentifier</tt>
     * @throws IllegalArgumentException if the specified
     * <tt>contactIdentifier</tt> does not identify a contact known to the
     * underlying protocol provider
     * @throws IllegalStateException if the underlying protocol provider is not
     * registered/signed on a public service
     * @throws OperationFailedException with code NETWORK_FAILURE if retrieving
     * the status fails due to errors experienced during network communication
     */
Gets the PresenceStatus of a contact with a specific
String identifier.

@param contactIdentifier the identifier of the contact whose status we're
interested in.
@return the PresenceStatus of the contact with the specified
contactIdentifier
@throws IllegalArgumentException if the specified
contactIdentifier does not identify a contact known to the
underlying protocol provider
@throws IllegalStateException if the underlying protocol provider is not
registered/signed on a public service
@throws OperationFailedException with code NETWORK_FAILURE if retrieving
the status fails due to errors experienced during network communication
Gets the PresenceStatus of a contact with a specific String identifier . @param contactIdentifier the identifier of the contact whose status we ' re interested in . @return the PresenceStatus of the contact with the specified contactIdentifier @throws IllegalArgumentException if the specified contactIdentifier does not identify a contact known to the underlying protocol provider @throws IllegalStateException if the underlying protocol provider is not registered / signed on a public service @throws OperationFailedException with code NETWORK_FAILURE if retrieving the status fails due to errors experienced during network communication
public PresenceStatus queryContactStatus(String contactIdentifier)
        throws IllegalArgumentException,
               IllegalStateException,
               OperationFailedException
    {
        BareJid contactJid;
        try
        {
            contactJid = JidCreate.bareFrom(contactIdentifier);
        }
        catch (XmppStringprepException e)
        {
            throw new OperationFailedException(
                "Contact is not a valid JID",
                OperationFailedException.GENERAL_ERROR,
                e
            );
        }
        /*
         * As stated by the javadoc, IllegalStateException signals that the
         * ProtocolProviderService is not registered.
         */
        assertConnected();
        XMPPConnection xmppConnection = parentProvider.getConnection();
        if (xmppConnection == null)
        {
            throw
                new IllegalArgumentException(
                        "The provider/account must be signed on in order to"
                            + " query the status of a contact in its roster");
        }
        Roster r = Roster.getInstanceFor(xmppConnection);
        Presence presence = r.getPresence(contactJid);
        return jabberStatusToPresenceStatus(presence, parentProvider);
    }
public PresenceStatus queryContactStatus ( String contactIdentifier ) throws IllegalArgumentException , IllegalStateException , OperationFailedException { BareJid contactJid ; try { contactJid = JidCreate . bareFrom ( contactIdentifier ) ; } catch ( XmppStringprepException e ) { throw new OperationFailedException ( "Contact is not a valid JID" , OperationFailedException . GENERAL_ERROR , e ) ; } /*
         * As stated by the javadoc, IllegalStateException signals that the
         * ProtocolProviderService is not registered.
         */ assertConnected ( ) ; XMPPConnection xmppConnection = parentProvider . getConnection ( ) ; if ( xmppConnection == null ) { throw new IllegalArgumentException ( "The provider/account must be signed on in order to" + " query the status of a contact in its roster" ) ; } Roster r = Roster . getInstanceFor ( xmppConnection ) ; Presence presence = r . getPresence ( contactJid ) ; return jabberStatusToPresenceStatus ( presence , parentProvider ) ; }
Gets the <tt>PresenceStatus</tt> of a contact with a specific
 <tt>String</tt> identifier.
Gets the <tt > PresenceStatus< / tt > of a contact with a specific <tt > String< / tt > identifier .