Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.ban
Interface BanManager

All Superinterfaces:
UserListener
All Known Implementing Classes:
AbstractBanManager, BanManagerImpl, BanManagerProxy

public interface BanManager
extends UserListener

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 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 getBans()
          Gets an unfiltered list of Ban objects from database
 java.util.List getBans(BanFilter filter)
          Gets a filtered list of Ban objects from the database
 java.lang.String getEmailAddress()
          Gets the email address that notification emails will appear to be from
 java.lang.String getEmailBody(java.util.Locale locale)
          Gets the text for the body of the notification emails.
 java.lang.String getEmailName()
          Gets the name that notification emails will appear to be from
 java.lang.String getEmailSubject(java.util.Locale locale)
          Gets the text for the subject of notification emails
 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 setEmailAddress(java.lang.String emailAddress)
          Sets the email address that notification emails will appear to be from
 void setEmailBody(java.lang.String emailBody, java.util.Locale locale)
          Text for the body of of notification emails.
 void setEmailName(java.lang.String emailName)
          Sets The name that notification emails will appear to be from
 void setEmailNotifyEnabled(boolean emailNotifyEnabled)
          Sets the list of email addresses to notify when an attachment is blocked
 void setEmailSubject(java.lang.String emailSubject, java.util.Locale locale)
          Sets the text for the subject of notification emails
 void updateBan(Ban ban)
          Updates a ban entry in the database
 
Methods inherited from interface com.jivesoftware.base.event.UserListener
userCreated, userDeleted, userModified
 

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)
               throws UnauthorizedException
Creates a ban entry in the database

Parameters:
ban - the ticket to create
Throws:
UnauthorizedException

updateBan

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

Parameters:
ban - the ticket to update
Throws:
UnauthorizedException

removeBan

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

Parameters:
banID - the id of the ban to remove
Throws:
UnauthorizedException

getBan

Ban getBan(long userID,
           BanLevel banLevel)
           throws UnauthorizedException
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.
Throws:
UnauthorizedException

getBan

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

getBans

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

Returns:
a list of Ban objects
Throws:
UnauthorizedException

getBans

java.util.List getBans(BanFilter filter)
                       throws UnauthorizedException
Gets a filtered list of Ban objects from the database

Parameters:
filter - the BannedUserFilter object
Returns:
a filtered list of Ban objects
Throws:
UnauthorizedException
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()
                         throws UnauthorizedException
Checks if the ban feature is enabled

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

setBanningEnabled

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

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

isEmailNotifyEnabled

boolean isEmailNotifyEnabled()
                             throws UnauthorizedException
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
Throws:
UnauthorizedException

setEmailNotifyEnabled

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

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

getEmailName

java.lang.String getEmailName()
                              throws UnauthorizedException
Gets the name that notification emails will appear to be from

Returns:
The name that notification emails will appear to be from
Throws:
UnauthorizedException

setEmailName

void setEmailName(java.lang.String emailName)
                  throws UnauthorizedException
Sets The name that notification emails will appear to be from

Parameters:
emailName - the name that notification emails will appear to be from
Throws:
UnauthorizedException

getEmailAddress

java.lang.String getEmailAddress()
                                 throws UnauthorizedException
Gets the email address that notification emails will appear to be from

Returns:
the email address that notification emails will appear to be from
Throws:
UnauthorizedException

setEmailAddress

void setEmailAddress(java.lang.String emailAddress)
                     throws UnauthorizedException
Sets the email address that notification emails will appear to be from

Parameters:
emailAddress - the email address that notification emails will appear to be from
Throws:
UnauthorizedException

getEmailSubject

java.lang.String getEmailSubject(java.util.Locale locale)
                                 throws UnauthorizedException
Gets the text for the subject of notification emails

Parameters:
locale - the locale for the subject of notification emails
Returns:
the text for the subject of notification emails
Throws:
UnauthorizedException

setEmailSubject

void setEmailSubject(java.lang.String emailSubject,
                     java.util.Locale locale)
                     throws UnauthorizedException
Sets the text for the subject of notification emails

Parameters:
emailSubject - the text for the subject of notification emails
locale - the locale for the subject of notification emails
Throws:
UnauthorizedException

getEmailBody

java.lang.String getEmailBody(java.util.Locale locale)
                              throws UnauthorizedException
Gets the text for the body of the notification emails. A number of of special tokens can be used. Each token will be dynamically replaced with a real value when emails are sent. Valid tokens are: ${fileName}, ${virusList}, ${jiveURL}, ${messageUser}, ${messageID}, ${messageSubject}, ${messageBody}, ${messageModificatonDate}, ${messageCreationDate}, ${threadID}, ${threadName}, ${threadModificatonDate}, ${threadCreationDate}, ${forumID}, ${forumName}, ${categoryID}, ${categoryName}, ${user-ID}, ${user-username}, ${user-name}, ${user-email}.

Parameters:
locale - the locale for the body of the notification emails
Returns:
the text for the body of the notification emails
Throws:
UnauthorizedException

setEmailBody

void setEmailBody(java.lang.String emailBody,
                  java.util.Locale locale)
                  throws UnauthorizedException
Text for the body of of notification emails. A number of of special tokens can be used. Each token will be dynamically replaced with a real value when emails are sent. Valid tokens are: ${fileName}, ${virusList}, ${jiveURL}, ${messageUser}, ${messageID}, ${messageSubject}, ${messageBody}, ${messageModificatonDate}, ${messageCreationDate}, ${threadID}, ${threadName}, ${threadModificatonDate}, ${threadCreationDate}, ${forumID}, ${forumName}, ${categoryID}, ${categoryName}, ${user-ID}, ${user-username}, ${user-name}, ${user-email}.

Parameters:
emailBody - the text for the body of the notification emails
locale - the locale for the body of the notification emails
Throws:
UnauthorizedException

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.