Clearspace API (2.5.18) Core Javadocs

com.jivesoftware.community
Interface BanManager

All Superinterfaces:
JiveManager

public interface BanManager
extends JiveManager

Manages the banning of User Accounts and IP Addresses. There are various ban levels, such as Ban Login, Ban Post, and Moderate Post. Bans can also be set to expire, allowing for temporary bans in addition to permanent bans.


Field Summary
static String PROPERTY_BANNED_USER_ENABLE
          ****** Ban Setting Properties ******
static String PROPERTY_EMAIL_ADDRESS
           
static String PROPERTY_EMAIL_BODY
           
static String PROPERTY_EMAIL_NAME
           
static String PROPERTY_EMAIL_NOTIFY_ENABLED
           
static String PROPERTY_EMAIL_SUBJECT
           
static int TYPE_BAN_IP
          Ban By IP Address
static int TYPE_BAN_USER
          Ban by user account
 
Method Summary
 void createBan(Ban ban)
          Creates a ban entry in the database
 void deleteUserBans(User user)
          Removes all of a user's ban entries from the database.
 Ban getBan(long banID)
          Gets a Ban Object from the database.
 Ban getBan(long userID, BanLevel banLevel)
          Deprecated. Will return null if multiple entries are found. Use getBans(BanFilter) instead.
 Ban getBan(String ipAddress, BanLevel banLevel)
          Deprecated. Will return null if multiple entries are found. Use getBans(BanFilter) instead.
 List<Ban> getBans()
          Gets an unfiltered list of Ban objects from database
 List<Ban> getBans(BanFilter filter)
          Gets a filtered list of Ban objects from the database
 int getBansCount(BanFilter filter)
          Gets a count of the filtered list of Ban objects from the database
 boolean isBanningEnabled()
          Checks if the ban feature is enabled
 boolean isEmailNotifyEnabled()
          Gets the comma-delimited list of email addresses to notify when a user with with ban level notify posts a message.
 boolean isValidIpAddress(String ip)
          Check that an IP Address is valid.
 void removeBan(long banID)
          Removes a ban entry from the database
 void setBanningEnabled(boolean enabled)
          Enabled/Disabled Ban feature.
 void setEmailNotifyEnabled(boolean emailNotifyEnabled)
          Sets the list of email addresses to notify when an attachment is blocked
 void updateBan(Ban ban)
          Updates a ban entry in the database
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy
 

Field Detail

TYPE_BAN_USER

static final int TYPE_BAN_USER
Ban by user account

See Also:
Constant Field Values

TYPE_BAN_IP

static final int TYPE_BAN_IP
Ban By IP Address

See Also:
Constant Field Values

PROPERTY_BANNED_USER_ENABLE

static final String PROPERTY_BANNED_USER_ENABLE
****** Ban Setting Properties ******

See Also:
Constant Field Values

PROPERTY_EMAIL_NOTIFY_ENABLED

static final String PROPERTY_EMAIL_NOTIFY_ENABLED
See Also:
Constant Field Values

PROPERTY_EMAIL_NAME

static final String PROPERTY_EMAIL_NAME
See Also:
Constant Field Values

PROPERTY_EMAIL_ADDRESS

static final String PROPERTY_EMAIL_ADDRESS
See Also:
Constant Field Values

PROPERTY_EMAIL_SUBJECT

static final String PROPERTY_EMAIL_SUBJECT
See Also:
Constant Field Values

PROPERTY_EMAIL_BODY

static final String PROPERTY_EMAIL_BODY
See Also:
Constant Field Values
Method Detail

createBan

void createBan(Ban ban)
Creates a ban entry in the database

Parameters:
ban - the ticket to create

updateBan

void updateBan(Ban ban)
Updates a ban entry in the database

Parameters:
ban - the ticket to update

removeBan

void removeBan(long banID)
Removes a ban entry from the database

Parameters:
banID - the id of the ban to remove

deleteUserBans

void deleteUserBans(User user)
Removes all of a user's ban entries from the database.

Parameters:
user - the user associated with the bans being deleted.

getBan

Ban getBan(long banID)
Gets a Ban Object from the database.

Parameters:
banID - the ID of the ban object
Returns:
the Ban object if one exists; null otherwise.

getBan

@Deprecated
Ban getBan(long userID,
                      BanLevel banLevel)
Deprecated. Will return null if multiple entries are found. Use getBans(BanFilter) instead.

Gets a Ban Object from the database.

Parameters:
userID - userID the ID of the user
banLevel - the level of the ban
Returns:
the Ban object if one exists; null otherwise.

getBan

@Deprecated
Ban getBan(String ipAddress,
                      BanLevel banLevel)
Deprecated. Will return null if multiple entries are found. Use getBans(BanFilter) instead.

Gets a Ban Object from the database.

Parameters:
ipAddress - the IP Address of the ban
banLevel - the level of the ban
Returns:
the Ban object if one exists; null otherwise.

getBans

List<Ban> getBans()
Gets an unfiltered list of Ban objects from database

Returns:
a list of Ban objects

getBans

List<Ban> getBans(BanFilter filter)
Gets a filtered list of Ban objects from the database

Parameters:
filter - the BannedUserFilter object
Returns:
a filtered list of Ban objects
See Also:
Ban

getBansCount

int getBansCount(BanFilter filter)
Gets a count of the filtered list of Ban objects from the database

Parameters:
filter - the BannedUserFilter object
Returns:
the numbero of Ban objects
See Also:
Ban

isValidIpAddress

boolean isValidIpAddress(String ip)
Check that an IP Address is valid. A valid ip address is between 0.0.0.0 and 255.255.255.255

Parameters:
ip - the ip address to check
Returns:
true if the ip address is valid, false otherwise.

isBanningEnabled

boolean isBanningEnabled()
Checks if the ban feature is enabled

Returns:
true if ban users is enabled; false otherwise.

setBanningEnabled

void setBanningEnabled(boolean enabled)
Enabled/Disabled Ban feature.

Parameters:
enabled - the boolean value to enable/disable ban users feature.

isEmailNotifyEnabled

boolean isEmailNotifyEnabled()
Gets the comma-delimited list of email addresses to notify when a user with with ban level notify posts a message.

Returns:
the comma-delimited list of email addresses

setEmailNotifyEnabled

void setEmailNotifyEnabled(boolean emailNotifyEnabled)
Sets the list of email addresses to notify when an attachment is blocked

Parameters:
emailNotifyEnabled - the comma-delimited list of email addresses

Clearspace Project Page

Copyright © 1999-2007 Jive Software.