Clearspace API (2.5.18) Core Javadocs

com.jivesoftware.community
Class BanFilter

java.lang.Object
  extended by com.jivesoftware.community.ResultFilter
      extended by com.jivesoftware.community.BanFilter

public class BanFilter
extends ResultFilter

Filters and sorts lists of Ban objects. This allows for a very rich set of possible queries that can be run on ban data.


Field Summary
static int ASCENDING
          Ascending sort (ie 3, 4, 5...).
static int CREATION_DATE
          An integer value that represents the modification date filed.
static int DESCENDING
          Descending sort (ie 3, 2, 1...).
static int EXPIRATION_DATE
          An integer value that represents the creation date filed.
 
Fields inherited from class com.jivesoftware.community.ResultFilter
AND_MODE, CONTAINS_MATCH, EXACT_MATCH, NULL_INT, OR_MODE
 
Constructor Summary
BanFilter()
           
 
Method Summary
static BanFilter createDefaultBanFilter()
          Creates a default BanFilter: Filters out expired bans with results sorted by expiration date in descending order.
 boolean equals(Object o)
           
 long getAdminID()
          Gets the currently selected admin ID that bans will be filtered on.
 long getBanLevel()
          Gets the currently selected BanLevel that bans will be filtered on.
 long getBannedUserID()
          Returns the ID of the user that bans will be filtered on.
 int getBanType()
          Gets the currently selected ban type.
 Date getCreationDateRangeMax()
          Returns a date that represents the upper boundry for bans to be selected by the ban filter.
 Date getCreationDateRangeMin()
          Returns the creation date that represents the lower boundary for bans to be filtered on.
 Date getExpirationDateRangeMax()
          Returns a date that represents the upper boundry for bans to be selected by the ban filter.
 Date getExpirationDateRangeMin()
          Returns the expiration date that represents the lower boundary for bans to be filtered on.
 String getIpAddress()
          Gets the currently selected IP address that bans will be filtered on.
 int getSortField()
          Returns the currently selected sort field.
 int getSortOrder()
          Sets the currently selected sort order.
 int hashCode()
           
 void setAdminID(long adminID)
          Sets the currently selected admin ID that bans will be filtered on.
 void setBanLevel(long banLevel)
          Sets the currently selected BanLevel that bans will be filtered on.
 void setBannedUserID(long bannedUserID)
          Sets the ID of the user that bans will be filtered on.
 void setBanType(int banType)
          Sets the currently selected ban type.
 void setCreationDateRangeMax(Date creationDateRangeMax)
          Sets a date that represents the upper boundry for bans to be selected by the ban filter.
 void setCreationDateRangeMin(Date creationDateRangeMin)
          Sets the date that represents the lower boundary for bans to be selected by the ban filter.
 void setExpirationDateRangeMax(Date expirationDateRangeMax)
          Sets a date that represents the upper boundry for bans to be selected by the ban filter.
 void setExpirationDateRangeMin(Date expirationDateRangeMin)
          Sets the date that represents the lower boundary for bans to be selected by the ban filter.
 void setIpAddress(String ipAddress)
          Sets the currently selected IP address that bans will be filtered on.
 void setSortField(int sortField)
          Sets the currently selected sort field.
 void setSortOrder(int sortOrder)
          Sets the currently selected sort order.
 
Methods inherited from class com.jivesoftware.community.ResultFilter
addProperty, addProperty, addTag, createDefaultContentFilter, createDefaultRecursiveContentFilter, getModificationDateRangeMax, getModificationDateRangeMin, getNumResults, getPropertyCount, getPropertyMatchType, getPropertyMode, getPropertyName, getPropertyValue, getPropertyValueString, getSortPropertyName, getStartIndex, getTags, getUserID, isAllTagsRequired, isPerformDistinctCount, isRecursive, setAllTagsRequired, setModificationDateRangeMax, setModificationDateRangeMin, setNumResults, setPerformDistinctCount, setPropertyMode, setRecursive, setSortPropertyName, setStartIndex, setTags, setUserID, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DESCENDING

public static final int DESCENDING
Descending sort (ie 3, 2, 1...).

See Also:
Constant Field Values

ASCENDING

public static final int ASCENDING
Ascending sort (ie 3, 4, 5...).

See Also:
Constant Field Values

EXPIRATION_DATE

public static final int EXPIRATION_DATE
An integer value that represents the creation date filed.

See Also:
Constant Field Values

CREATION_DATE

public static final int CREATION_DATE
An integer value that represents the modification date filed.

See Also:
Constant Field Values
Constructor Detail

BanFilter

public BanFilter()
Method Detail

createDefaultBanFilter

public static BanFilter createDefaultBanFilter()
Creates a default BanFilter: Filters out expired bans with results sorted by expiration date in descending order.

Returns:
a default instance of BanFilter sorting by expiration date in descending order. Expired bans will not be shown with this default filter

getSortField

public int getSortField()
Returns the currently selected sort field. The default value is EXPIRATION_DATE.

Overrides:
getSortField in class ResultFilter
Returns:
the currently selected sort field.

setSortField

public void setSortField(int sortField)
Sets the currently selected sort field. The default value is EXPIRATION_DATE.

Overrides:
setSortField in class ResultFilter
Parameters:
sortField - the field that will be used for sorting.

getSortOrder

public int getSortOrder()
Sets the currently selected sort order. The default value is DESCENTDING.

Overrides:
getSortOrder in class ResultFilter
Returns:
the currently selected sort order.

setSortOrder

public void setSortOrder(int sortOrder)
Sets the currently selected sort order. The default value is DESCENDING.

Overrides:
setSortOrder in class ResultFilter
Parameters:
sortOrder - the order that will be used for sorting.

getBanType

public int getBanType()
Gets the currently selected ban type. This method will return -1 if no filtering on ban type is taking place.

Returns:
the currently selected ban type or -1 if no filtering on ban type is taking place.

setBanType

public void setBanType(int banType)
Sets the currently selected ban type. If a ban type is not specified, bans will not be filtered by a ban type. To change so that bans will not be filtered by a ban type, set the ban type to -1.

Parameters:
banType - the ban type to filter or -1 for all ban types

getBannedUserID

public long getBannedUserID()
Returns the ID of the user that bans will be filtered on. This method will return -1 if no user to filter on has been specified.

Returns:
the ID of the user that bans will be filtered on.

setBannedUserID

public void setBannedUserID(long bannedUserID)
Sets the ID of the user that bans will be filtered on. If a user ID is not specified, bans will not be filtered by a user ID. To change so that bans will not be filtered by a user ID, set the user ID to -1.

Parameters:
bannedUserID - the ID of the user that bans will be filtered on or -1 if there is no user filtering.

getIpAddress

public String getIpAddress()
Gets the currently selected IP address that bans will be filtered on. This method will return null if no IP address has been specified.

Returns:
the currently selected IP address or null if an IP address has not been specified.

setIpAddress

public void setIpAddress(String ipAddress)
Sets the currently selected IP address that bans will be filtered on. If an IP address is not specified, bans will not be filtered by an IP address. To change so that bans will not be filtered by an IP address, set the IP address to null.

Parameters:
ipAddress - the currently selected IP adress that bans will be filtered on, or null if there is no IP address filtering.

getAdminID

public long getAdminID()
Gets the currently selected admin ID that bans will be filtered on. This method will return -1 if an admin user ID has not been specified.

Returns:
the currently selected admin ID that bans will be filtered on or -1 if an admin ID has not been specified.

setAdminID

public void setAdminID(long adminID)
Sets the currently selected admin ID that bans will be filtered on. If an admin ID is not specified, bans will not be filtered by a specific admin ID. To change so that bans will not be filtered by an admin ID, set the admin ID to -1.

Parameters:
adminID - the ID of the admin that bans will be filtered on or -1 if bans should not be filtered by an admin ID.

getBanLevel

public long getBanLevel()
Gets the currently selected BanLevel that bans will be filtered on. This method will return -1 if a BanLevel has not been specified.

Returns:
the currently selected BanLevel that bans will be filtered on or -1 if a BanLevel has not been specified.

setBanLevel

public void setBanLevel(long banLevel)
Sets the currently selected BanLevel that bans will be filtered on. If a BanLevel is not specified, bans will not be filtered by a specific BanLevel. To change so that bans will not be filtered by a BanLevel set the ban level to -1.

Parameters:
banLevel - the BanLevel of the ban

getCreationDateRangeMin

public Date getCreationDateRangeMin()
Returns the creation date that represents the lower boundary for bans to be filtered on. If this value has not been set, the method will return null.

Overrides:
getCreationDateRangeMin in class ResultFilter
Returns:
a Date representing the lower bound for creation dates to filter on.

setCreationDateRangeMin

public void setCreationDateRangeMin(Date creationDateRangeMin)
Sets the date that represents the lower boundary for bans to be selected by the ban filter. If this value is not set the results filter will be unbounded for the earliest creation date selected.

Setting a date range for a BanFilter is a potential performance bottleneck. For example, if the argument for the date range is "new Date()" then the corresponding database query will map to an accuracy of a particular millesecond in time. This means that the results can't be cached. A better solution is to round dates to the nearest minute, hour, etc (whatever accuracy you need).

Overrides:
setCreationDateRangeMin in class ResultFilter
Parameters:
creationDateRangeMin - Date representing the filter lowest value of the creation date to be selected.

getCreationDateRangeMax

public Date getCreationDateRangeMax()
Returns a date that represents the upper boundry for bans to be selected by the ban filter. If this value is not set it will return null and the results filter will be unbounded for the latest creation date selected.

Overrides:
getCreationDateRangeMax in class ResultFilter
Returns:
a Date representing the filter highest value of the creation date to be selected.

setCreationDateRangeMax

public void setCreationDateRangeMax(Date creationDateRangeMax)
Sets a date that represents the upper boundry for bans to be selected by the ban filter. If this value is not set the results filter will be unbounded for the latest creation date selected. Setting a date range for a BanFilter is a potential performance bottleneck. For example, if the argument for the date range is "new Date()" then the corresponding database query will map to an accuracy of a particular millesecond in time. This means that the results can't be cached. A better solution is to round dates to the nearest minute, hour, etc (whatever accuracy you need).

Overrides:
setCreationDateRangeMax in class ResultFilter
Parameters:
creationDateRangeMax - Date representing the filter lowest value of the creation date range.

getExpirationDateRangeMin

public Date getExpirationDateRangeMin()
Returns the expiration date that represents the lower boundary for bans to be filtered on. If this value has not been set, the method will return null.

Returns:
a Date representing the lower bound for expiration dates to filter on.

setExpirationDateRangeMin

public void setExpirationDateRangeMin(Date expirationDateRangeMin)
Sets the date that represents the lower boundary for bans to be selected by the ban filter. If this value is not set the results filter will be unbounded for the earliest expiration date selected.

Setting a date range for a BanFilter is a potential performance bottleneck. For example, if the argument for the date range is "new Date()" then the corresponding database query will map to an accuracy of a particular millesecond in time. This means that the results can't be cached. A better solution is to round dates to the nearest minute, hour, etc (whatever accuracy you need).

Parameters:
expirationDateRangeMin - Date representing the filter lowest value of the expiration date to be selected.

getExpirationDateRangeMax

public Date getExpirationDateRangeMax()
Returns a date that represents the upper boundry for bans to be selected by the ban filter. If this value is not set it will return null and the results filter will be unbounded for the latest expiration date selected.

Returns:
a Date representing the filter highest value of the expiration date to be selected.

setExpirationDateRangeMax

public void setExpirationDateRangeMax(Date expirationDateRangeMax)
Sets a date that represents the upper boundry for bans to be selected by the ban filter. If this value is not set the results filter will be unbounded for the latest expiration date selected. Setting a date range for a BanFilter is a potential performance bottleneck. For example, if the argument for the date range is "new Date()" then the corresponding database query will map to an accuracy of a particular millesecond in time. This means that the results can't be cached. A better solution is to round dates to the nearest minute, hour, etc (whatever accuracy you need).

Parameters:
expirationDateRangeMax - Date representing the filter lowest value of the expiration date range.

equals

public boolean equals(Object o)
Overrides:
equals in class ResultFilter

hashCode

public int hashCode()
Overrides:
hashCode in class ResultFilter

Clearspace Project Page

Copyright © 1999-2007 Jive Software.