|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.forum.interceptor.GovernorInterceptor
public class GovernorInterceptor
Provides a mechanism to limit the rate at which a user may post messages -- in effect, a governor on postings. If a user attempts to post a message more often than the specified post interval, the message will be rejected. Note that the check is only done on the local cluster member so it's assumed that sticky load balancing is being used.
Field Summary |
---|
Fields inherited from interface com.jivesoftware.forum.MessageInterceptor |
---|
TYPE_ALL, TYPE_BOTH, TYPE_EDIT, TYPE_POST, TYPE_PRE |
Constructor Summary | |
---|---|
GovernorInterceptor()
|
|
GovernorInterceptor(int objectType,
long objectID)
Creates a new instance of the class. |
Method Summary | |
---|---|
int |
getPostInterval()
Returns the number of seconds that must elapse before a user is allowed to post each new message. |
java.lang.String |
getRejectionMessage()
Returns the rejection message that will be returned if a user attempts to make multiple posts within the post interval. |
int |
getType()
Returns the type of the interceptor. |
void |
invokeInterceptor(ForumMessage message,
int type)
Invokes the interceptor on the specified message. |
void |
setPostInterval(int postInterval)
Sets the number of seconds that must elapse before a user is allowed to post each new message. |
void |
setRejectionMessage(java.lang.String rejectionMessage)
Sets the rejection message that will be returned if a user attempts to make multiple posts within the post interval. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GovernorInterceptor()
public GovernorInterceptor(int objectType, long objectID)
objectType
- the constant JiveConstants.SYSTEM if the interceptor is installed
globally JiveConstants.FORUM_CATEGORY if the interceptor is installed in a category,
or JiveConstants.FORUM if the interceptor is installed in a forum.objectID
- the id of the object that the interceptor is installed in, or -1 if it
is installed globally.Method Detail |
---|
public int getPostInterval()
public void setPostInterval(int postInterval)
postInterval
- the post interval (in seconds).public java.lang.String getRejectionMessage()
public void setRejectionMessage(java.lang.String rejectionMessage)
rejectionMessage
- the rejection message.public int getType()
MessageInterceptor
getType
in interface MessageInterceptor
public void invokeInterceptor(ForumMessage message, int type) throws MessageRejectedException
MessageInterceptor
invokeInterceptor
in interface MessageInterceptor
message
- the message to take action on.
MessageRejectedException
- if the message should be prevented from being posted.
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |