Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.database
Class DbPresence

java.lang.Object
  extended by com.jivesoftware.base.database.DbPresence
All Implemented Interfaces:
Presence, Cacheable, java.io.Serializable

public class DbPresence
extends java.lang.Object
implements Presence, Cacheable

Database implementation of the Presence interface.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.jivesoftware.base.Presence
STATUS_AWAY, STATUS_IDLE, STATUS_INVISIBLE, STATUS_ONLINE
 
Constructor Summary
DbPresence(User user, java.lang.String uid, java.lang.String IP)
           
 
Method Summary
 int getCachedSize()
          Returns the approximate size of the Object in bytes.
 java.lang.String getID()
          Returns the unique ID for this status.
 java.lang.String getIPAddress()
          Returns the IP address of the user.
 java.util.Date getLastUpdateTime()
          Return the time when the presence was last updated (when the user last visited).
 java.util.Date getLoginTime()
          Return the time when the presence was created.
 int getStatus()
          Returns the status of the presence.
 User getUser()
          Return the user owning the presence.
 java.lang.String getUsername()
          Returns the unique username for this status.
 void setLastUpdateTime(java.util.Date time)
          Set the time when the presence was last updated (when the user last visited).
 void setLastUpdateTime(long time)
          Sets the time when the presence was last updated (when the user last visited).
 void setStatus(int status)
          Sets the status of the user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbPresence

public DbPresence(User user,
                  java.lang.String uid,
                  java.lang.String IP)
Method Detail

getID

public java.lang.String getID()
Description copied from interface: Presence
Returns the unique ID for this status. The ID in the default implmentation is the user's session ID, which is unique within a single JVM.

Specified by:
getID in interface Presence
Returns:
the unique ID for the presence.

getUsername

public java.lang.String getUsername()
Description copied from interface: Presence
Returns the unique username for this status.

Specified by:
getUsername in interface Presence
Returns:
the unique ID for the presence.

getUser

public User getUser()
Description copied from interface: Presence
Return the user owning the presence.

Specified by:
getUser in interface Presence
Returns:
the presence owner.

getIPAddress

public java.lang.String getIPAddress()
Description copied from interface: Presence
Returns the IP address of the user.

Specified by:
getIPAddress in interface Presence
Returns:
the IP address of the user.

getLoginTime

public java.util.Date getLoginTime()
Description copied from interface: Presence
Return the time when the presence was created.

Specified by:
getLoginTime in interface Presence
Returns:
the time when the presence was created.

getLastUpdateTime

public java.util.Date getLastUpdateTime()
Description copied from interface: Presence
Return the time when the presence was last updated (when the user last visited).

Specified by:
getLastUpdateTime in interface Presence
Returns:
the time when the presence was last updated (when the user last visited).

setLastUpdateTime

public void setLastUpdateTime(java.util.Date time)
                       throws UnauthorizedException
Description copied from interface: Presence
Set the time when the presence was last updated (when the user last visited).

Specified by:
setLastUpdateTime in interface Presence
Parameters:
time - the time of the last update.
Throws:
UnauthorizedException - if not the user or an admin.

setLastUpdateTime

public void setLastUpdateTime(long time)
                       throws UnauthorizedException
Description copied from interface: Presence
Sets the time when the presence was last updated (when the user last visited).

Specified by:
setLastUpdateTime in interface Presence
Parameters:
time - the time of the last update (in milliseconds).
Throws:
UnauthorizedException - if not the user or an admin.

getStatus

public int getStatus()
Description copied from interface: Presence
Returns the status of the presence.

Specified by:
getStatus in interface Presence
Returns:
the status of the presence.

setStatus

public void setStatus(int status)
               throws UnauthorizedException
Description copied from interface: Presence
Sets the status of the user.

Specified by:
setStatus in interface Presence
Parameters:
status - the status of the user.
Throws:
UnauthorizedException

getCachedSize

public int getCachedSize()
Description copied from interface: Cacheable
Returns the approximate size of the Object in bytes. The size should be considered to be a best estimate of how much memory the Object occupies and may be based on empirical trials or dynamic calculations.

Specified by:
getCachedSize in interface Cacheable
Returns:
the size of the Object in bytes.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.