Oracle Application Server Wireless Java API Reference
B10400-01

oracle.panama.presence.model
Class PresenceServer

java.lang.Object
  |
  +--oracle.panama.presence.model.PresenceServer

public abstract class PresenceServer
extends java.lang.Object

The PresenceServer class. This class provides the API to lookup, modify, add, remove presence information and set current presence for users. This class is used by calling the getInstance() method, which will return the PresenceServer instance that the caller can use.


Constructor Summary
PresenceServer()
           

 

Method Summary
abstract  Presence createNewPresence(long userID)
          Return a new Presence object.
abstract  Presence getCurrentPresence(long userID)
          Return the current presence of the specified user.
abstract  Presence getCurrentPresence(java.lang.String guid)
          Return the current presence of the specified user.
abstract  DeviceAddress[] getDeviceAddresses(long userID)
          Return a list of device addresses in the current presence profile of the specified user.
abstract  DeviceAddress[] getDeviceAddresses(java.lang.String guid)
          Return a list of device addresses in the current presence profile of the specified user.
static PresenceServer getInstance()
          Return the single instance of the PresenceServer.
abstract  Presence getPresence(long presenceID)
          Deprecated. Replaced by getPresence(long, long).
abstract  Presence getPresence(long presenceID, long userID)
          Return the presence having the specified ID
abstract  Presence getPresence(java.lang.String presenceName, long userID)
          Return the presence having the specified name (for the given user).
abstract  Presence[] listPresences(long userID)
          Return a list of available presences for the specified user.
abstract  Presence[] listPresences(java.lang.String guid)
          Return a list of available presences for the specified user.
abstract  void removePresence(long presenceID)
          Remove the specified presence.
abstract  void removePresence(Presence presence)
          Remove the specified presence.
abstract  void savePresence(Presence presence)
          Deprecated. Use Model Factory to save. For example, MetaLocator.getInstance().getModelFactory().save();
abstract  void setCurrentPresence(long presenceID, long userID)
          Set the current presence of the specified user.
abstract  void setCurrentPresence(Presence presence, long userID)
          Set the current presence of the specified user.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

PresenceServer

public PresenceServer()
Method Detail

getCurrentPresence

public abstract Presence getCurrentPresence(long userID)
Return the current presence of the specified user.
Parameters:
userID - the user's ID.
Returns:
the Presence object.

getCurrentPresence

public abstract Presence getCurrentPresence(java.lang.String guid)
                                     throws PresenceException
Return the current presence of the specified user.
Parameters:
guid - the user's global ID.
Returns:
the Presence object.
PresenceException

setCurrentPresence

public abstract void setCurrentPresence(Presence presence,
                                        long userID)
                                 throws PresenceException
Set the current presence of the specified user.
Parameters:
presence - the Presence object to be set as current.
userID - the ID of the user whose current presence is to be set. Note that the presence must already belong to the user before it is set as current.
PresenceException

setCurrentPresence

public abstract void setCurrentPresence(long presenceID,
                                        long userID)
                                 throws PresenceException
Set the current presence of the specified user.
Parameters:
presenceID - the ID of the presence to be set as current.
userID - the ID of the user whose current presence is to be set. Note that the presence must already belong to the user before it is set as current.
PresenceException

getPresence

public abstract Presence getPresence(long presenceID)
Deprecated. Replaced by getPresence(long, long).
Return the presence having the specified ID
Parameters:
presenceID - the precense's ID.
Returns:
the Presence object.
See Also:
getPresence(long, long)

getPresence

public abstract Presence getPresence(long presenceID,
                                     long userID)
Return the presence having the specified ID
Parameters:
presenceID - the precense's ID.
userID - the ID of the user having this presence.
Returns:
the Presence object.

getPresence

public abstract Presence getPresence(java.lang.String presenceName,
                                     long userID)
Return the presence having the specified name (for the given user).
Parameters:
presenceName - the precense's name.
userID - the user's ID.
Returns:
the Presence object.

listPresences

public abstract Presence[] listPresences(long userID)
Return a list of available presences for the specified user.
Parameters:
userID - the user's ID.
Returns:
array of Presence objects.

listPresences

public abstract Presence[] listPresences(java.lang.String guid)
                                  throws PresenceException
Return a list of available presences for the specified user.
Parameters:
guid - the user's global ID.
Returns:
array of Presence objects.
PresenceException

createNewPresence

public abstract Presence createNewPresence(long userID)
Return a new Presence object.
Parameters:
userID - the user's ID.
Returns:
the new Presence object.

savePresence

public abstract void savePresence(Presence presence)
                           throws PresenceException
Deprecated. Use Model Factory to save. For example, MetaLocator.getInstance().getModelFactory().save();
Save the presence information into the repository. If the presence is a newly created one, this presence will be inserted into the repository. Otherwise, this operation updates the existing information in the repository.
Parameters:
presence - the Presence object to be persisted.
PresenceException
See Also:
ModelFactory.save(), MetaLocator

removePresence

public abstract void removePresence(Presence presence)
                             throws PresenceException
Remove the specified presence.
Parameters:
presence - the presence to be removed.
PresenceException

removePresence

public abstract void removePresence(long presenceID)
                             throws PresenceException
Remove the specified presence.
Parameters:
presenceID - the ID of the presence to be removed.
PresenceException

getDeviceAddresses

public abstract DeviceAddress[] getDeviceAddresses(long userID)
Return a list of device addresses in the current presence profile of the specified user.
Parameters:
userID - the user's ID.
Returns:
array of DeviceAddress objects.
See Also:
oracle.panama.model.DeviceAddress.

getDeviceAddresses

public abstract DeviceAddress[] getDeviceAddresses(java.lang.String guid)
                                            throws PresenceException
Return a list of device addresses in the current presence profile of the specified user.
Parameters:
guid - the user's global ID.
Returns:
array of DeviceAddress objects.
PresenceException
See Also:
oracle.panama.model.DeviceAddress.

getInstance

public static PresenceServer getInstance()
Return the single instance of the PresenceServer.
Returns:
the single instance.

Oracle Application Server Wireless Java API Reference
B10400-01

Copyright © 2003 Oracle Corporation. All Rights Reserved.