Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.database
Class DbStatusLevel

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

public class DbStatusLevel
extends java.lang.Object
implements StatusLevel, Cacheable, com.tangosol.io.ExternalizableLite

Database implementation of status level.

See Also:
Serialized Form

Constructor Summary
  DbStatusLevel()
           
protected DbStatusLevel(long id)
           
protected DbStatusLevel(java.lang.String name)
           
protected DbStatusLevel(java.lang.String name, java.lang.String imagePath, Group group)
          Creates a new group based status level
protected DbStatusLevel(java.lang.String name, java.lang.String imagePath, int minPoints, int maxPoints)
          Creates a point based new status level.
 
Method Summary
protected  void addToCache()
           
protected  void checkGroup(Group group)
          Checks to see if any other group is taken by a status level.
 void deleteProperty(java.lang.String name)
          Deletes an extended property.
 boolean equals(java.lang.Object o)
           
 int getCachedSize()
          Returns the approximate size of the Object in bytes.
 java.lang.String getDescription()
          Returns the description of this status level
 Group getGroup()
          The group this status level is associated with.
 long getID()
          Returns the unique id of this status level
 java.lang.String getImagePath()
          Returns the relative path to the image.
 java.lang.String getLargeImagePath()
           
 int getMaxPoints()
          Returns the maximum value for a status level point range. -1 means unbounded (unless there is a group specified)
 int getMinPoints()
          Returns the minimum value for a status level point range. -1 means unbounded (unless there is a group specified)
 java.lang.String getName()
          Returns the name of this status level
 java.lang.String getProperty(java.lang.String name)
          Returns an extended property of the status level.
 java.util.Iterator getPropertyNames()
          Returns an Iterator for the names of the status level properties.
 int hashCode()
           
 boolean isInRange(int value)
          Used to check to see if a point value is in the range for this status level
protected  boolean isInRange(int value, StatusLevel statusLevel)
           
 void readExternal(java.io.DataInput in)
           
 void setDescription(java.lang.String description)
          Sets the description of this status level
 void setGroup(Group group)
          The group this status level is associated with.
 void setImagePath(java.lang.String imagePath)
          Sets the path of the image used for this status level.
 void setLargeImagePath(java.lang.String largeImagePath)
           
 void setName(java.lang.String name)
          Sets the name of this status level
 void setPointRange(int minPoints, int maxPoints)
          Sets a point range for this status level, if this status level was group based before it will now be point based.
 void setProperty(java.lang.String name, java.lang.String value)
          Sets an extended property of the status level.
 void writeExternal(java.io.DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbStatusLevel

public DbStatusLevel()

DbStatusLevel

protected DbStatusLevel(java.lang.String name,
                        java.lang.String imagePath,
                        int minPoints,
                        int maxPoints)
                 throws StatusLevelException
Creates a point based new status level.

Parameters:
name - the name of this status level.
imagePath -
minPoints - minimum point range.
maxPoints - maximum point range.
Throws:
StatusLevelException - if an invalid point range is passed, or an null name is passed.

DbStatusLevel

protected DbStatusLevel(java.lang.String name,
                        java.lang.String imagePath,
                        Group group)
                 throws StatusLevelException
Creates a new group based status level

Parameters:
name - name of the status level.
imagePath -
group - group to associate this status level with.
Throws:
StatusLevelException - if the group is already used by another status level, group is null, or a null name is passed in.

DbStatusLevel

protected DbStatusLevel(long id)
                 throws StatusLevelNotFoundException
Throws:
StatusLevelNotFoundException

DbStatusLevel

protected DbStatusLevel(java.lang.String name)
                 throws StatusLevelNotFoundException
Throws:
StatusLevelNotFoundException
Method Detail

getID

public long getID()
Description copied from interface: StatusLevel
Returns the unique id of this status level

Specified by:
getID in interface StatusLevel
Returns:
the unique id of this status level

setName

public void setName(java.lang.String name)
             throws UnauthorizedException,
                    StatusLevelException
Description copied from interface: StatusLevel
Sets the name of this status level

Specified by:
setName in interface StatusLevel
Parameters:
name - the name of this status level
Throws:
UnauthorizedException - if not system admin
StatusLevelException - if you try to set a null name

getName

public java.lang.String getName()
Description copied from interface: StatusLevel
Returns the name of this status level

Specified by:
getName in interface StatusLevel
Returns:
the name of this status level

setDescription

public void setDescription(java.lang.String description)
                    throws UnauthorizedException
Description copied from interface: StatusLevel
Sets the description of this status level

Specified by:
setDescription in interface StatusLevel
Parameters:
description - description of this status level
Throws:
UnauthorizedException - if not system admin

getDescription

public java.lang.String getDescription()
Description copied from interface: StatusLevel
Returns the description of this status level

Specified by:
getDescription in interface StatusLevel
Returns:
the description of this status level

setImagePath

public void setImagePath(java.lang.String imagePath)
                  throws UnauthorizedException,
                         StatusLevelException
Description copied from interface: StatusLevel
Sets the path of the image used for this status level. This should be a relative path.

Specified by:
setImagePath in interface StatusLevel
Parameters:
imagePath - the path of the image used for this status level
Throws:
UnauthorizedException - if not system admin
StatusLevelException - if you try to set a null image path

getImagePath

public java.lang.String getImagePath()
Description copied from interface: StatusLevel
Returns the relative path to the image.

Specified by:
getImagePath in interface StatusLevel
Returns:
the relative path to the image.

getLargeImagePath

public java.lang.String getLargeImagePath()
Specified by:
getLargeImagePath in interface StatusLevel

setLargeImagePath

public void setLargeImagePath(java.lang.String largeImagePath)
                       throws UnauthorizedException
Specified by:
setLargeImagePath in interface StatusLevel
Throws:
UnauthorizedException

getMinPoints

public int getMinPoints()
Description copied from interface: StatusLevel
Returns the minimum value for a status level point range. -1 means unbounded (unless there is a group specified)

Specified by:
getMinPoints in interface StatusLevel
Returns:
the minimum value for a status level point range.

getMaxPoints

public int getMaxPoints()
Description copied from interface: StatusLevel
Returns the maximum value for a status level point range. -1 means unbounded (unless there is a group specified)

Specified by:
getMaxPoints in interface StatusLevel
Returns:
the maximum value for a status level point range.

setPointRange

public void setPointRange(int minPoints,
                          int maxPoints)
                   throws UnauthorizedException,
                          StatusLevelException
Description copied from interface: StatusLevel
Sets a point range for this status level, if this status level was group based before it will now be point based.

Setting maxPoints to a negative number means unbounded, minPoints must be 0 or greater.

minPoints value cannot be greater than the maxPoints value, though they can be the same.

Specified by:
setPointRange in interface StatusLevel
Parameters:
minPoints - minimum value for the point range
maxPoints - maximmum value for the point range
Throws:
UnauthorizedException - UnauthorizedException if not system admin
StatusLevelException - if an illegal point range is specified

setGroup

public void setGroup(Group group)
              throws UnauthorizedException,
                     StatusLevelException
Description copied from interface: StatusLevel
The group this status level is associated with. If a group is set this means that this status level is group based.

Calling this method will set minPoints and maxPoints = -1 (disabling the point based system)

If you decide to set this status level to be point based, first set this method to null then set the min and max values.

Specified by:
setGroup in interface StatusLevel
Throws:
UnauthorizedException
StatusLevelException - if there are minPoints or maxPoints values greater than -1.

getGroup

public Group getGroup()
Description copied from interface: StatusLevel
The group this status level is associated with. This will return null if the status level is point based.

Specified by:
getGroup in interface StatusLevel
Returns:
group this status level is associated with, null if point based

getProperty

public java.lang.String getProperty(java.lang.String name)
Description copied from interface: StatusLevel
Returns an extended property of the status level. Each status level can have an arbitrary number of extended properties. This allows for enhanced functionality that is not part of the base interface.

Specified by:
getProperty in interface StatusLevel
Parameters:
name - the name of the property to get.
Returns:
the value of the property specified by name.

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
                 throws UnauthorizedException
Description copied from interface: StatusLevel
Sets an extended property of the status level. Each status level can have an arbitrary number of extended properties. This allows for enhanced functionality that is not part of the base interface.

If the property referenced by name already exists, its value will be updated.

Specified by:
setProperty in interface StatusLevel
Parameters:
name - the name of the property to set.
value - the new value for the property.
Throws:
UnauthorizedException - if not system admin

deleteProperty

public void deleteProperty(java.lang.String name)
                    throws UnauthorizedException
Description copied from interface: StatusLevel
Deletes an extended property. If the property specified by name does not exist, this method will do nothing.

Specified by:
deleteProperty in interface StatusLevel
Parameters:
name - the name of the property to delete.
Throws:
UnauthorizedException - if not system admin

getPropertyNames

public java.util.Iterator getPropertyNames()
Description copied from interface: StatusLevel
Returns an Iterator for the names of the status level properties.

Specified by:
getPropertyNames in interface StatusLevel
Returns:
an Iterator for the names of the status level properties.

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

isInRange

public boolean isInRange(int value)
Description copied from interface: StatusLevel
Used to check to see if a point value is in the range for this status level

Specified by:
isInRange in interface StatusLevel
Parameters:
value - point value to check
Returns:
true if pointValue is in the status level's range

isInRange

protected boolean isInRange(int value,
                            StatusLevel statusLevel)

checkGroup

protected void checkGroup(Group group)
                   throws StatusLevelException
Checks to see if any other group is taken by a status level.

Throws:
StatusLevelException

addToCache

protected void addToCache()

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.