Clearspace API (1.10.16) Core Javadocs

com.jivesoftware.community
Interface StatusLevelManager

All Superinterfaces:
JiveManager

public interface StatusLevelManager
extends JiveManager

Manages status level feature. StatusLevel levels allow the system to rank users by points or associate users with a specific group.

See Also:
StatusLevel

Method Summary
 void addPoints(User user, Community community, JiveObject object, long points, java.lang.String code)
          Rewards points to a user.
 StatusLevel createStatusLevel(java.lang.String name, java.lang.String imagePath, Group group)
          Creates a new group based StatusLevel Level
 StatusLevel createStatusLevel(java.lang.String name, java.lang.String imagePath, int minPoints, int maxPoints)
          Creates a new points based StatusLevel.
 void deleteStatusLevel(StatusLevel statusLevel)
          Deletes a statusLevel level from the system
 java.util.Map<Community,java.lang.Long> getAllPointLevels(User user)
          Returns a map of community -> status level points for all the communities the user has points in.
 java.util.List<com.jivesoftware.community.StatusLevelScenario> getAllStatusLevelScenarios()
          Returns all of the StatusLevelScenario objects.
 java.lang.Iterable<StatusLevel> getGroupStatusLevels()
          Returns an iterable of all group based status levels in the system.
 java.lang.Iterable<User> getLeaders()
          Returns an Iterable of system wide leaders.
 java.lang.Iterable<User> getLeaders(Community community)
          Returns an Iterable of leaders for a specific community
 java.lang.Iterable<User> getLeaders(Community community, int startIndex, int numResults)
          Returns an Iterable of leaders for a specific community
 java.lang.Iterable<User> getLeaders(int startIndex, int numResults)
          Returns an Iterable of system wide leaders.
 long getPointLevel(User user)
          Returns the point level for a user system wide.
 long getPointLevel(User user, Community community)
          Returns the status level points for a user in regards to a specific community
 java.lang.Iterable<StatusLevel> getPointStatusLevels()
          Returns an iterable of point based status levels in the system sorted by point range.
 StatusLevel getStatusLevel(Group group)
          If there is a status level associated with the group passed in then the status level will be returned, Otherwise null will be returned.
 StatusLevel getStatusLevel(long statusLevelID)
          Used to acquire a specific status level object from the system
 StatusLevel getStatusLevel(java.lang.String name)
          Used to acquire a specific status level by its name
 StatusLevel getStatusLevel(User user)
          Returns the system wide status level for specific user, will return null if there is no status level for this user.
 StatusLevel getStatusLevel(User user, Community community)
          Returns the status level for a user in a specific community. if a status level cannot be determined for this user in this community null will be returned.
 StatusLevel getStatusLevelByPoints(long points)
          Used to get a status level by a point value.
 com.jivesoftware.community.StatusLevelScenario getStatusLevelScenarioByCode(java.lang.String code)
          Returns a StatusLevelScenario by its code.
 boolean isStatusLevelsEnabled()
          Returns true if status levels are enabled in the system
 void setStatusLevelsEnabled(boolean statusLevelEnabled)
          Sets whether status levels should be enabled in the system.
 void updateStatusLevelScenario(com.jivesoftware.community.StatusLevelScenario scenario)
          Update the points and whether or not this scenario is included in status level results.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy, initialize
 

Method Detail

createStatusLevel

StatusLevel createStatusLevel(java.lang.String name,
                              java.lang.String imagePath,
                              int minPoints,
                              int maxPoints)
                              throws UnauthorizedException,
                                     StatusLevelException,
                                     StatusLevelAlreadyExistsException
Creates a new points based StatusLevel. The minPoints and maxPoints range must not intersect, and maxPoints cannot be zero. Specify -1 in either to denote a boundless range (ie minPoints=50, maxPoints=-1 would mean everything over 50 has this status level)

The minPoints and maxPoints values must not go into the range over another StatusLevel levels point range.

Parameters:
name - name of the status level
imagePath - The path the image used when displaying this status level.
minPoints - minimum amount in the point range
maxPoints - maximum amount in the point range
Returns:
The newly created status level object
Throws:
UnauthorizedException - if not system admin
StatusLevelException - if an illegal range is specified.
StatusLevelAlreadyExistsException - Thrown if there is a status level already matching these criteria.

createStatusLevel

StatusLevel createStatusLevel(java.lang.String name,
                              java.lang.String imagePath,
                              Group group)
                              throws UnauthorizedException,
                                     StatusLevelException,
                                     StatusLevelAlreadyExistsException
Creates a new group based StatusLevel Level

Parameters:
name - name of the status level
imagePath - The path the image used when displaying this status level.
group - group to associate this status level with
Returns:
newly created status level object
Throws:
UnauthorizedException - if not system admin
StatusLevelException - If this status level cannot be created.
StatusLevelAlreadyExistsException - Thrown if there is a status level already matching these criteria.

deleteStatusLevel

void deleteStatusLevel(StatusLevel statusLevel)
                       throws UnauthorizedException
Deletes a statusLevel level from the system

Parameters:
statusLevel - statusLevel level to delete
Throws:
UnauthorizedException - if not system admin

getGroupStatusLevels

java.lang.Iterable<StatusLevel> getGroupStatusLevels()
Returns an iterable of all group based status levels in the system.

Returns:
an iterable of all group based status levels in the system.

getPointStatusLevels

java.lang.Iterable<StatusLevel> getPointStatusLevels()
Returns an iterable of point based status levels in the system sorted by point range.

Returns:
point range sorted iterable of StatusLevel objects

getLeaders

java.lang.Iterable<User> getLeaders()
Returns an Iterable of system wide leaders.

Returns:
Iterable of User objects for system wide leaders

getLeaders

java.lang.Iterable<User> getLeaders(int startIndex,
                                    int numResults)
Returns an Iterable of system wide leaders.

Parameters:
startIndex - The starting point of the results.
numResults - The number of results to return in the iterable.
Returns:
Iterable of User objects for system wide leaders

getLeaders

java.lang.Iterable<User> getLeaders(Community community)
Returns an Iterable of leaders for a specific community

Parameters:
community - community to find leaders for.
Returns:
Iterable of User objects for a specific forum

getLeaders

java.lang.Iterable<User> getLeaders(Community community,
                                    int startIndex,
                                    int numResults)
Returns an Iterable of leaders for a specific community

Parameters:
community - community to find leaders for
startIndex - The starting point of the leader results.
numResults - The number of results in the iterable.
Returns:
Iterable of User objects for a specific forum

getStatusLevel

StatusLevel getStatusLevel(long statusLevelID)
                           throws StatusLevelNotFoundException
Used to acquire a specific status level object from the system

Parameters:
statusLevelID - the id of the object to acquire
Returns:
the object found in the system
Throws:
StatusLevelNotFoundException - thrown if the object does not exist in the system

getStatusLevel

StatusLevel getStatusLevel(java.lang.String name)
                           throws StatusLevelNotFoundException
Used to acquire a specific status level by its name

Parameters:
name - name of the status level
Returns:
the object found in the system
Throws:
StatusLevelNotFoundException - thrown if the object does not exist in the system

getStatusLevel

StatusLevel getStatusLevel(User user)
Returns the system wide status level for specific user, will return null if there is no status level for this user.

If the user belongs to a group status level the group status level will always be returned.

Parameters:
user - user to find the status level for
Returns:
system wide status level for the user or null if no status level

getStatusLevel

StatusLevel getStatusLevel(User user,
                           Community community)
Returns the status level for a user in a specific community. if a status level cannot be determined for this user in this community null will be returned.

If the user belongs to a group status level the group status level will always be returned.

Parameters:
user - user to find the status level for
community - community to check the status level for
Returns:
community specific status level or null if no status level can be determined

setStatusLevelsEnabled

void setStatusLevelsEnabled(boolean statusLevelEnabled)
                            throws UnauthorizedException
Sets whether status levels should be enabled in the system.

Parameters:
statusLevelEnabled - true if status levels are enabled, else false
Throws:
UnauthorizedException - if not system admin

isStatusLevelsEnabled

boolean isStatusLevelsEnabled()
Returns true if status levels are enabled in the system

Returns:
true if status levels are enabled

getStatusLevelByPoints

StatusLevel getStatusLevelByPoints(long points)
Used to get a status level by a point value. If the points exceeds that of the maximum status level, the maximum status level will be returned.

Parameters:
points - point value find a status level for
Returns:
the StatusLevel matching a point level, or null if non is found

getPointLevel

long getPointLevel(User user)
Returns the point level for a user system wide.

Parameters:
user - user to get status level points for
Returns:
how many status points the user has

getPointLevel

long getPointLevel(User user,
                   Community community)
Returns the status level points for a user in regards to a specific community

Parameters:
user - user user to get status level points for
community - community to filter by
Returns:
how many status level points a user has for the particular community

getAllPointLevels

java.util.Map<Community,java.lang.Long> getAllPointLevels(User user)
Returns a map of community -> status level points for all the communities the user has points in.

Parameters:
user - user user to get status level points for
Returns:
how many status level points a user has for the particular community

getStatusLevel

StatusLevel getStatusLevel(Group group)
If there is a status level associated with the group passed in then the status level will be returned, Otherwise null will be returned.

Parameters:
group - group to find a status level for
Returns:
status level that is associated with group, else null

addPoints

void addPoints(User user,
               Community community,
               JiveObject object,
               long points,
               java.lang.String code)
Rewards points to a user. By providing the object and a reason we can tell which object the user is be rewarded on and a code explaining why.

Note that it is valid to submit negative point values to remove points from a user.

Parameters:
user - The user who is receiving points.
community - The community the points are added to.
object - The object the user should receive points on.
points - Amount of points to award the user.
code - A code explaining why the user is receiving points.

getAllStatusLevelScenarios

java.util.List<com.jivesoftware.community.StatusLevelScenario> getAllStatusLevelScenarios()
Returns all of the StatusLevelScenario objects.

Returns:
all of the StatusLevelScenario objects.

updateStatusLevelScenario

void updateStatusLevelScenario(com.jivesoftware.community.StatusLevelScenario scenario)
Update the points and whether or not this scenario is included in status level results.

Parameters:
scenario - the points and whether or not this scenario is included in status level results.

getStatusLevelScenarioByCode

com.jivesoftware.community.StatusLevelScenario getStatusLevelScenarioByCode(java.lang.String code)
Returns a StatusLevelScenario by its code.

Parameters:
code - The code of the StatusLevelScenario.
Returns:
The matching StatusLevelScenario.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.