public class OperationSetPersistentPresenceGibberishImpl extends AbstractOperationSetPersistentPresence<ProtocolProviderServiceGibberishImpl>
parentProvider
Constructor and Description |
---|
OperationSetPersistentPresenceGibberishImpl(ProtocolProviderServiceGibberishImpl provider)
Creates an instance of this operation set keeping a reference to the
specified parent provider.
|
Modifier and Type | Method and Description |
---|---|
void |
addGibberishGroup(ContactGroupGibberishImpl contactGroup)
A Gibberish Provider method to use for fast filling of a contact list.
|
void |
addGibberishGroupAndFireEvent(ContactGroupGibberishImpl parent,
ContactGroupGibberishImpl contactGroup)
A Gibberish Provider method to use for fast filling of a contact list.
|
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 parent)
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.
|
ContactGibberishImpl |
createVolatileContact(java.lang.String contactAddress)
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/
|
ContactGroupGibberishImpl |
findContactParent(ContactGibberishImpl gibberishContact)
Returns the group that is parent of the specified gibberishContact or
null if no parent was found.
|
java.util.List<Contact> |
findContactsPointingToUs()
Looks for gibberish protocol providers that have added us to their
contact list and returns list of all contacts representing us in these
providers.
|
ContactGroupGibberishImpl |
findGroupParent(ContactGroupGibberishImpl gibberishGroup)
Returns the group that is parent of the specified gibberishGroup or null
if no parent was found.
|
ProtocolProviderServiceGibberishImpl |
findProviderForGibberishUserID(java.lang.String gibberishUserID)
Looks for a gibberish protocol provider registered for a user id matching
gibberishUserID.
|
java.lang.String |
getCurrentStatusMessage()
Returns the status message that was last set through
setCurrentStatusMessage.
|
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.
|
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 |
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 |
setStatusMessage(java.lang.String statusMessage)
Sets the specified status message.
|
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, addServerStoredGroupChangeListener, addSubscriptionListener, fireContactPresenceStatusChangeEvent, fireContactPresenceStatusChangeEvent, fireContactPresenceStatusChangeEvent, fireContactPropertyChangeEvent, fireProviderStatusChangeEvent, fireProviderStatusChangeEvent, fireProviderStatusMessageChangeEvent, fireServerStoredGroupEvent, fireSubscriptionEvent, fireSubscriptionEvent, fireSubscriptionMovedEvent, removeContactPresenceStatusListener, removeProviderPresenceStatusListener, removeServerStoredGroupChangeListener, removeSubscriptionListener, setDisplayName
public OperationSetPersistentPresenceGibberishImpl(ProtocolProviderServiceGibberishImpl provider)
provider
- the ProtocolProviderServiceGibberishImpl instance that
created us.public void createServerStoredContactGroup(ContactGroup parent, java.lang.String groupName)
parent
- the group where the new group should be createdgroupName
- the name of the new group to create.public void addGibberishGroup(ContactGroupGibberishImpl contactGroup)
contactGroup
- the group to addpublic void addGibberishGroupAndFireEvent(ContactGroupGibberishImpl parent, ContactGroupGibberishImpl contactGroup)
parent
- the group where contactGroup should be added.contactGroup
- the group to addpublic Contact findContactByID(java.lang.String contactID)
contactID
- a String identifier of the contact which we're
seeking a reference of.public void setStatusMessage(java.lang.String statusMessage)
statusMessage
- a String containing the new status message.public java.lang.String getCurrentStatusMessage()
public Contact getLocalContact()
getLocalContact
in class AbstractOperationSetPersistentPresence<ProtocolProviderServiceGibberishImpl>
public PresenceStatus getPresenceStatus()
public ContactGroup getServerStoredContactListRoot()
public java.util.Iterator<PresenceStatus> getSupportedStatusSet()
public void moveContactToGroup(Contact contactToMove, ContactGroup newParent)
contactToMove
- the Contact to movenewParent
- the ContactGroup where Contact
would be placed.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 PresenceStatus queryContactStatus(java.lang.String contactIdentifier) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, OperationFailedException
contactIdentifier
- the identifier of the contact whose status
we're interested in.java.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.OperationFailedException
- with code NETWORK_FAILURE if
retrieving the status fails due to errors experienced during
network communicationpublic ContactGroupGibberishImpl findGroupParent(ContactGroupGibberishImpl gibberishGroup)
gibberishGroup
- the group whose parent we're looking for.public ContactGroupGibberishImpl findContactParent(ContactGibberishImpl gibberishContact)
gibberishContact
- the contact whose parent we're looking for.public void removeServerStoredContactGroup(ContactGroup group) throws java.lang.IllegalArgumentException
group
- the group to remove.java.lang.IllegalArgumentException
- if group was not found in this
protocol's contact list.public void renameServerStoredContactGroup(ContactGroup group, java.lang.String newName)
group
- the group to rename.newName
- the new name of the group.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 void subscribe(ContactGroup parent, java.lang.String contactIdentifier) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, OperationFailedException
parent
- the parent group of the server stored contact list
where the contact should be added. contactIdentifier
- the contact whose status updates we are
subscribing for.java.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.OperationFailedException
- with code NETWORK_FAILURE if
subscribing fails due to errors experienced during network
communicationpublic void subscribe(java.lang.String contactIdentifier) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, OperationFailedException
contactIdentifier
- the identifier of the contact whose status
updates we are subscribing for. java.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.OperationFailedException
- with code NETWORK_FAILURE if
subscribing fails due to errors experienced during network
communicationpublic void unsubscribe(Contact contact) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, OperationFailedException
contact
- the contact whose status updates we are unsubscribing
from.java.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.OperationFailedException
- with code NETWORK_FAILURE if
unsubscribing fails due to errors experienced during network
communicationpublic 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 Contact createUnresolvedContact(java.lang.String address, java.lang.String persistentData, ContactGroup parent)
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.parent
- the group where the unresolved contact is
supposed to belong to.public ProtocolProviderServiceGibberishImpl findProviderForGibberishUserID(java.lang.String gibberishUserID)
gibberishUserID
- the ID of the Gibberish user whose corresponding
protocol provider we'd like to find.public java.util.List<Contact> findContactsPointingToUs()
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 ContactGibberishImpl createVolatileContact(java.lang.String contactAddress)
contactAddress
- the address of the volatile contact we'd like to
create.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.