Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.ban
Class AbstractBanManager

java.lang.Object
  extended by com.jivesoftware.base.ban.AbstractBanManager
All Implemented Interfaces:
BanManager, UserListener
Direct Known Subclasses:
BanManagerImpl

public abstract class AbstractBanManager
extends java.lang.Object
implements BanManager

An abstract instance to manage the banning of User Accounts and IP Addresses. This class should be extended by projects that wish to provide project specific functionality to the ban model.


Field Summary
protected  BanDAO banDAO
           
 
Fields inherited from interface com.jivesoftware.base.ban.BanManager
PROPERTY_BANNED_USER_ENABLE, PROPERTY_EMAIL_ADDRESS, PROPERTY_EMAIL_BODY, PROPERTY_EMAIL_NAME, PROPERTY_EMAIL_NOTIFY_ENABLED, PROPERTY_EMAIL_SUBJECT, TYPE_BAN_IP, TYPE_BAN_USER
 
Constructor Summary
AbstractBanManager()
           
 
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.
protected static void populateContext(Ban ban, java.util.Map context)
           
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jivesoftware.base.event.UserListener
userCreated, userDeleted, userModified
 

Field Detail

banDAO

protected BanDAO banDAO
Constructor Detail

AbstractBanManager

public AbstractBanManager()
Method Detail

createBan

public void createBan(Ban ban)
Description copied from interface: BanManager
Creates a ban entry in the database

Specified by:
createBan in interface BanManager
Parameters:
ban - the ticket to create

updateBan

public void updateBan(Ban ban)
Description copied from interface: BanManager
Updates a ban entry in the database

Specified by:
updateBan in interface BanManager
Parameters:
ban - the ticket to update

removeBan

public void removeBan(long banID)
Description copied from interface: BanManager
Removes a ban entry from the database

Specified by:
removeBan in interface BanManager
Parameters:
banID - the id of the ban to remove

getBan

public Ban getBan(long userID,
                  BanLevel banLevel)
Description copied from interface: BanManager
Gets a Ban Object from the database.

Specified by:
getBan in interface BanManager
Parameters:
userID - userID the ID of the user
banLevel - the level of the ban
Returns:
the Ban object if one exists; null otherwise.

getBan

public Ban getBan(java.lang.String ipAddress,
                  BanLevel banLevel)
Description copied from interface: BanManager
Gets a Ban Object from the database.

Specified by:
getBan in interface BanManager
Parameters:
ipAddress - the IP Address of the ban
banLevel - the level of the ban
Returns:
the Ban object if one exists; null otherwise.

getBans

public java.util.List getBans()
Description copied from interface: BanManager
Gets an unfiltered list of Ban objects from database

Specified by:
getBans in interface BanManager
Returns:
a list of Ban objects

getBans

public java.util.List getBans(BanFilter filter)
Description copied from interface: BanManager
Gets a filtered list of Ban objects from the database

Specified by:
getBans in interface BanManager
Parameters:
filter - the BannedUserFilter object
Returns:
a filtered list of Ban objects
See Also:
Ban

isValidIpAddress

public boolean isValidIpAddress(java.lang.String ip)
Description copied from interface: BanManager
Check that an IP Address is valid. A valid ip address is between 0.0.0.0 and 255.255.255.255

Specified by:
isValidIpAddress in interface BanManager
Parameters:
ip - the ip address to check
Returns:
true if the ip address is valid, false otherwise.

isBanningEnabled

public boolean isBanningEnabled()
Description copied from interface: BanManager
Checks if the ban feature is enabled

Specified by:
isBanningEnabled in interface BanManager
Returns:
true if ban users is enabled; false otherwise.

setBanningEnabled

public void setBanningEnabled(boolean enabled)
Description copied from interface: BanManager
Enabled/Disabled Ban feature.

Specified by:
setBanningEnabled in interface BanManager
Parameters:
enabled - the boolean value to enable/disable ban users feature.

isEmailNotifyEnabled

public boolean isEmailNotifyEnabled()
Description copied from interface: BanManager
Gets the comma-delimited list of email addresses to notify when a user with with ban level notify posts a message.

Specified by:
isEmailNotifyEnabled in interface BanManager
Returns:
the comma-delimited list of email addresses

setEmailNotifyEnabled

public void setEmailNotifyEnabled(boolean emailNotifyEnabled)
Description copied from interface: BanManager
Sets the list of email addresses to notify when an attachment is blocked

Specified by:
setEmailNotifyEnabled in interface BanManager
Parameters:
emailNotifyEnabled - the comma-delimited list of email addresses

getEmailName

public java.lang.String getEmailName()
Description copied from interface: BanManager
Gets the name that notification emails will appear to be from

Specified by:
getEmailName in interface BanManager
Returns:
The name that notification emails will appear to be from

setEmailName

public void setEmailName(java.lang.String emailName)
Description copied from interface: BanManager
Sets The name that notification emails will appear to be from

Specified by:
setEmailName in interface BanManager
Parameters:
emailName - the name that notification emails will appear to be from

getEmailAddress

public java.lang.String getEmailAddress()
Description copied from interface: BanManager
Gets the email address that notification emails will appear to be from

Specified by:
getEmailAddress in interface BanManager
Returns:
the email address that notification emails will appear to be from

setEmailAddress

public void setEmailAddress(java.lang.String emailAddress)
Description copied from interface: BanManager
Sets the email address that notification emails will appear to be from

Specified by:
setEmailAddress in interface BanManager
Parameters:
emailAddress - the email address that notification emails will appear to be from

getEmailSubject

public java.lang.String getEmailSubject(java.util.Locale locale)
Description copied from interface: BanManager
Gets the text for the subject of notification emails

Specified by:
getEmailSubject in interface BanManager
Parameters:
locale - the locale for the subject of notification emails
Returns:
the text for the subject of notification emails

setEmailSubject

public void setEmailSubject(java.lang.String emailSubject,
                            java.util.Locale locale)
Description copied from interface: BanManager
Sets the text for the subject of notification emails

Specified by:
setEmailSubject in interface BanManager
Parameters:
emailSubject - the text for the subject of notification emails
locale - the locale for the subject of notification emails

getEmailBody

public java.lang.String getEmailBody(java.util.Locale locale)
Description copied from interface: BanManager
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}.

Specified by:
getEmailBody in interface BanManager
Parameters:
locale - the locale for the body of the notification emails
Returns:
the text for the body of the notification emails

setEmailBody

public void setEmailBody(java.lang.String emailBody,
                         java.util.Locale locale)
Description copied from interface: BanManager
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}.

Specified by:
setEmailBody in interface BanManager
Parameters:
emailBody - the text for the body of the notification emails
locale - the locale for the body of the notification emails

populateContext

protected static void populateContext(Ban ban,
                                      java.util.Map context)

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.