Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.database
Class DbWatch

java.lang.Object
  extended by com.jivesoftware.forum.database.DbWatch
All Implemented Interfaces:
Watch, Cacheable, com.tangosol.io.ExternalizableLite, java.io.Serializable

public class DbWatch
extends java.lang.Object
implements Watch, Cacheable, com.tangosol.io.ExternalizableLite

Database implementation of the Watch interface.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.jivesoftware.forum.Watch
BATCH_EMAIL_WATCH, EMAIL_WATCH, NORMAL_WATCH
 
Constructor Summary
DbWatch()
          Constructor for internal use only.
DbWatch(long userID, int objectType, long objectID, int watchType, boolean expirable)
           
 
Method Summary
protected  void deleteFromDb()
           
 void deleteFromDb(java.sql.Connection con)
           
 int getCachedSize()
          Returns the approximate size of the Object in bytes.
 long getObjectID()
          Returns the object ID of the object being watched.
 int getObjectType()
          Returns the object type of the object being watched.
 User getUser()
          Returns the user who is associated with this watch.
 int getWatchType()
          Returns the type of the watch.
protected  void insertIntoDb()
           
 boolean isExpirable()
          Returns whether this watch is expirable or not.
 void readExternal(java.io.DataInput in)
           
 void setExpirable(boolean expirable)
          Sets whether this watch is expirable or not.
 void setWatchType(int watchType)
          Sets the watch type.
 void writeExternal(java.io.DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbWatch

public DbWatch(long userID,
               int objectType,
               long objectID,
               int watchType,
               boolean expirable)

DbWatch

public DbWatch()
Constructor for internal use only.

Method Detail

getUser

public User getUser()
Description copied from interface: Watch
Returns the user who is associated with this watch.

Specified by:
getUser in interface Watch
Returns:
the user who is associated with this watch.

getObjectID

public long getObjectID()
Description copied from interface: Watch
Returns the object ID of the object being watched.

Specified by:
getObjectID in interface Watch
Returns:
the object ID of the object being watched.

getObjectType

public int getObjectType()
Description copied from interface: Watch
Returns the object type of the object being watched.

Specified by:
getObjectType in interface Watch
Returns:
the object type of the object being watched.

getWatchType

public int getWatchType()
Description copied from interface: Watch
Returns the type of the watch.

Specified by:
getWatchType in interface Watch
Returns:
the handler of the watch.

setWatchType

public void setWatchType(int watchType)
Description copied from interface: Watch
Sets the watch type.

Specified by:
setWatchType in interface Watch
Parameters:
watchType - the type of watch this should be.

isExpirable

public boolean isExpirable()
Description copied from interface: Watch
Returns whether this watch is expirable or not.

Specified by:
isExpirable in interface Watch
Returns:
true if the watch is expirable, false otherwise.

setExpirable

public void setExpirable(boolean expirable)
Description copied from interface: Watch
Sets whether this watch is expirable or not.

Specified by:
setExpirable in interface Watch
Parameters:
expirable - true if the watch is expirable, false if not.

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.

readExternal

public void readExternal(java.io.DataInput in)
                  throws java.io.IOException
Specified by:
readExternal in interface com.tangosol.io.ExternalizableLite
Throws:
java.io.IOException

writeExternal

public void writeExternal(java.io.DataOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface com.tangosol.io.ExternalizableLite
Throws:
java.io.IOException

insertIntoDb

protected void insertIntoDb()

deleteFromDb

protected void deleteFromDb()

deleteFromDb

public void deleteFromDb(java.sql.Connection con)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.