Clearspace API (1.7.0) Core Javadocs

com.jivesoftware.community
Interface BanManager

All Superinterfaces:
JiveManager, UserListener

public interface BanManager
extends UserListener, 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 java.lang.String PROPERTY_BANNED_USER_ENABLE
          ****** Ban Setting Properties ******
static java.lang.String PROPERTY_EMAIL_ADDRESS
           
static java.lang.String PROPERTY_EMAIL_BODY
           
static java.lang.String PROPERTY_EMAIL_NAME
           
static java.lang.String PROPERTY_EMAIL_NOTIFY_ENABLED
           
static java.lang.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
 Ban getBan(long banID)
          Gets a Ban Object from the database.
 Ban getBan(long userID, BanLevel banLevel)
          Gets a Ban Object from the database.
 Ban getBan(java.lang.String ipAddress, BanLevel banLevel)
          Gets a Ban Object from the database.
 java.util.List<Ban> getBans()
          Gets an unfiltered list of Ban objects from database
 java.util.List<Ban> getBans(BanFilter filter)
          Gets a 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(java.lang.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.base.event.UserListener
userCreated, userDeleted, userLoggedIn, userModified
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy, initialize
 

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 java.lang.String PROPERTY_BANNED_USER_ENABLE
****** Ban Setting Properties ******

See Also:
Constant Field Values

PROPERTY_EMAIL_NOTIFY_ENABLED

static final java.lang.String PROPERTY_EMAIL_NOTIFY_ENABLED
See Also:
Constant Field Values

PROPERTY_EMAIL_NAME

static final java.lang.String PROPERTY_EMAIL_NAME
See Also:
Constant Field Values

PROPERTY_EMAIL_ADDRESS

static final java.lang.String PROPERTY_EMAIL_ADDRESS
See Also:
Constant Field Values

PROPERTY_EMAIL_SUBJECT

static final java.lang.String PROPERTY_EMAIL_SUBJECT
See Also:
Constant Field Values

PROPERTY_EMAIL_BODY

static final java.lang.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

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

Ban getBan(long userID,
           BanLevel banLevel)
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

Ban getBan(java.lang.String ipAddress,
           BanLevel banLevel)
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

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

Returns:
a list of Ban objects

getBans

java.util.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

isValidIpAddress

boolean isValidIpAddress(java.lang.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.