public class OperationSetPersistentPresenceIcqImpl extends AbstractOperationSetPersistentPresence<ProtocolProviderServiceIcqImpl>
parentProvider
Modifier | Constructor and Description |
---|---|
protected |
OperationSetPersistentPresenceIcqImpl(ProtocolProviderServiceIcqImpl icqProvider,
java.lang.String uin)
Creates a new Presence OperationSet over the specified icq provider.
|
Modifier and Type | Method and Description |
---|---|
void |
addServerStoredGroupChangeListener(ServerStoredGroupListener listener)
Registers a listener that would receive events upong changes in server
stored groups.
|
void |
createServerStoredContactGroup(ContactGroup parent,
java.lang.String groupName)
Creates a group with the specified name and parent in the server stored
contact list.
|
Contact |
createUnresolvedContact(java.lang.String address,
java.lang.String persistentData)
Creates and returns a unresolved contact from the specified
address and persistentData.
|
Contact |
createUnresolvedContact(java.lang.String address,
java.lang.String persistentData,
ContactGroup parentGroup)
Creates and returns a unresolved contact from the specified
address and persistentData.
|
ContactGroup |
createUnresolvedContactGroup(java.lang.String groupUID,
java.lang.String persistentData,
ContactGroup parentGroup)
Creates and returns a unresolved contact group from the specified
address and persistentData.
|
ContactIcqImpl |
createVolatileContact(java.lang.String uin)
Creates a non persistent contact for the specified address.
|
Contact |
findContactByID(java.lang.String contactID)
Returns a reference to the contact with the specified ID in case we have
a subscription for it and null otherwise/
|
(package private) void |
fireProviderPresenceStatusChangeEvent(long oldStatusL,
long newStatusL)
Notify all provider presence listeners of the corresponding event change
|
java.lang.String |
getCurrentStatusMessage()
Returns the status message that was confirmed by the serfver
|
Contact |
getLocalContact()
Returns the protocol specific contact instance representing the local
user.
|
PresenceStatus |
getPresenceStatus()
Returns a PresenceStatus instance representing the state this provider
is currently in.
|
(package private) ServerStoredContactListIcqImpl |
getServerStoredContactList()
Returns a snapshot ieves a server stored list of subscriptions/contacts that have been
made previously.
|
ContactGroup |
getServerStoredContactListRoot()
Returns the root group of the server stored contact list.
|
java.util.Iterator<PresenceStatus> |
getSupportedStatusSet()
Returns the set of PresenceStatus objects that a user of this service
may request the provider to enter.
|
void |
moveContactToGroup(Contact contactToMove,
ContactGroup newParent)
Removes the specified contact from its current parent and places it
under newParent.
|
void |
publishPresenceStatus(PresenceStatus status,
java.lang.String statusMessage)
Requests the provider to enter into a status corresponding to the
specified paramters.
|
PresenceStatus |
queryContactStatus(java.lang.String contactIdentifier)
Get the PresenceStatus for a particular contact.
|
void |
removeServerStoredContactGroup(ContactGroup group)
Removes the specified group from the server stored contact list.
|
void |
removeServerStoredGroupChangeListener(ServerStoredGroupListener listener)
Removes the specified group change listener so that it won't receive
any further events.
|
void |
renameServerStoredContactGroup(ContactGroup group,
java.lang.String newName)
Renames the specified group from the server stored contact list.
|
void |
setAuthorizationHandler(AuthorizationHandler handler)
Handler for incoming authorization requests.
|
void |
subscribe(ContactGroup parent,
java.lang.String contactIdentifier)
Persistently adds a subscription for the presence status of the contact
corresponding to the specified contactIdentifier and indicates that it
should be added to the specified group of the server stored contact list.
|
void |
subscribe(java.lang.String contactIdentifier)
Adds a subscription for the presence status of the contact corresponding
to the specified contactIdentifier.
|
void |
unsubscribe(Contact contact)
Removes a subscription for the presence status of the specified contact.
|
addContactPresenceStatusListener, addProviderPresenceStatusListener, addSubscriptionListener, fireContactPresenceStatusChangeEvent, fireContactPresenceStatusChangeEvent, fireContactPresenceStatusChangeEvent, fireContactPropertyChangeEvent, fireProviderStatusChangeEvent, fireProviderStatusChangeEvent, fireProviderStatusMessageChangeEvent, fireServerStoredGroupEvent, fireSubscriptionEvent, fireSubscriptionEvent, fireSubscriptionMovedEvent, removeContactPresenceStatusListener, removeProviderPresenceStatusListener, removeSubscriptionListener, setDisplayName
protected OperationSetPersistentPresenceIcqImpl(ProtocolProviderServiceIcqImpl icqProvider, java.lang.String uin)
icqProvider
- IcqProtocolProviderServiceImpluin
- the UIN of our account.public PresenceStatus queryContactStatus(java.lang.String contactIdentifier) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
contactIdentifier
- the dientifier of the contact whose status we're
interested in.java.lang.IllegalStateException
- if the provider is not signed
on ICQjava.lang.IllegalArgumentException
- if contact is not
a valid IcqContactpublic void subscribe(java.lang.String contactIdentifier) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, OperationFailedException
This subscription is not going to be persistent (as opposed to subscriptions added from the OperationSetPersistentPresence.subscribe() method)
contactIdentifier
- the identifier of the contact whose status
updates we are subscribing for.
OperationFailedException
- with code NETWORK_FAILURE if subscribing
fails due to errors experienced during network communicationjava.lang.IllegalArgumentException
- if contact is not a contact
known to the underlying protocol providerjava.lang.IllegalStateException
- if the underlying protocol provider is not
registered/signed on a public service.public ContactIcqImpl createVolatileContact(java.lang.String uin)
uin
- the UIN/Screenname of the contact to create.public Contact createUnresolvedContact(java.lang.String address, java.lang.String persistentData, ContactGroup parentGroup) throws java.lang.IllegalArgumentException
address
- an identifier of the contact that we'll be creating.persistentData
- a String returned Contact's getPersistentData()
method during a previous run and that has been persistently stored
locally.parentGroup
- the group that the unresolved contact should belong to.java.lang.IllegalArgumentException
- if parentGroup is not
an instance of ContactGroupIcqImplpublic Contact createUnresolvedContact(java.lang.String address, java.lang.String persistentData)
address
- an identifier of the contact that we'll be creating.persistentData
- a String returned Contact's getPersistentData()
method during a previous run and that has been persistently stored
locally.public ContactGroup createUnresolvedContactGroup(java.lang.String groupUID, java.lang.String persistentData, ContactGroup parentGroup)
groupUID
- an identifier, returned by ContactGroup's getGroupUID,
that the protocol provider may use in order to create the group.persistentData
- a String returned ContactGroups's getPersistentData()
method during a previous run and that has been persistently stored
locally.parentGroup
- the group under which the new group is to be created
or null if this is group directly underneath the root.public void subscribe(ContactGroup parent, java.lang.String contactIdentifier) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, OperationFailedException
contactIdentifier
- the contact whose status updates we are subscribing
for.parent
- the parent group of the server stored contact list where
the contact should be added.
OperationFailedException
- with code NETWORK_FAILURE if subscribing
fails due to errors experienced during network communicationjava.lang.IllegalArgumentException
- if contact or
parent are not a contact known to the underlying protocol
provider.java.lang.IllegalStateException
- if the underlying protocol provider is not
registered/signed on a public service.public void unsubscribe(Contact contact) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, OperationFailedException
contact
- the contact whose status updates we are unsubscribing from.OperationFailedException
- with code NETWORK_FAILURE if unsubscribing
fails due to errors experienced during network communicationjava.lang.IllegalArgumentException
- if contact is not a contact
known to this protocol provider or is not an ICQ contactjava.lang.IllegalStateException
- if the underlying protocol provider is not
registered/signed on a public service.public Contact findContactByID(java.lang.String contactID)
contactID
- a String identifier of the contact which we're seeking a
reference of.public void publishPresenceStatus(PresenceStatus status, java.lang.String statusMessage) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, OperationFailedException
status
- the PresenceStatus as returned by getRequestableStatusSetstatusMessage
- the message that should be set as the reason to
enter that statusjava.lang.IllegalArgumentException
- if the status requested is not a valid
PresenceStatus supported by this provider.java.lang.IllegalStateException
- if the provider is not currently
registered.OperationFailedException
- with code NETWORK_FAILURE if publishing
the status fails due to a network error.public java.lang.String getCurrentStatusMessage()
public Contact getLocalContact()
getLocalContact
in class AbstractOperationSetPersistentPresence<ProtocolProviderServiceIcqImpl>
public void createServerStoredContactGroup(ContactGroup parent, java.lang.String groupName)
groupName
- the name of the new group to create.parent
- the group where the new group should be createdOperationFailedException
- with code NETWORK_FAILURE if unsubscribing
fails due to errors experienced during network communicationjava.lang.IllegalArgumentException
- if contact is not a contact
known to the underlying protocol providerjava.lang.IllegalStateException
- if the underlying protocol provider is not
registered/signed on a public service.public void removeServerStoredContactGroup(ContactGroup group)
group
- the group to remove.OperationFailedException
- with code NETWORK_FAILURE if deleting
the group fails because of a network error.java.lang.IllegalArgumentException
- if parent is not a contact
known to the underlying protocol provider.java.lang.IllegalStateException
- if the underlying protocol provider is not
registered/signed on a public service.public void renameServerStoredContactGroup(ContactGroup group, java.lang.String newName)
group
- the group to rename.newName
- the new name of the group.OperationFailedException
- with code NETWORK_FAILURE if deleting
the group fails because of a network error.java.lang.IllegalArgumentException
- if parent is not a contact
known to the underlying protocol provider.java.lang.IllegalStateException
- if the underlying protocol provider is not
registered/signed on a public service.public void moveContactToGroup(Contact contactToMove, ContactGroup newParent)
contactToMove
- the Contact to movenewParent
- the ContactGroup where Contact
would be placed.ServerStoredContactListIcqImpl getServerStoredContactList()
public PresenceStatus getPresenceStatus()
public java.util.Iterator<PresenceStatus> getSupportedStatusSet()
public void setAuthorizationHandler(AuthorizationHandler handler)
handler
- an instance of an AuthorizationHandler for authorization
requests coming from other users requesting permission add us to their
contact list.public ContactGroup getServerStoredContactListRoot()
public void addServerStoredGroupChangeListener(ServerStoredGroupListener listener)
addServerStoredGroupChangeListener
in interface OperationSetPersistentPresence
addServerStoredGroupChangeListener
in class AbstractOperationSetPersistentPresence<ProtocolProviderServiceIcqImpl>
listener
- a ServerStoredGroupChangeListener impl that would receive
events upong group changes.public void removeServerStoredGroupChangeListener(ServerStoredGroupListener listener)
removeServerStoredGroupChangeListener
in interface OperationSetPersistentPresence
removeServerStoredGroupChangeListener
in class AbstractOperationSetPersistentPresence<ProtocolProviderServiceIcqImpl>
listener
- the ServerStoredGroupChangeListener to removevoid fireProviderPresenceStatusChangeEvent(long oldStatusL, long newStatusL)
oldStatusL
- the status our icq stack had so farnewStatusL
- the status we have from now on
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.