|
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 |
public interface MessageInterceptor
A message interceptor encapsulates an action that is invoked on a message immediately before or after it is added to the system and also when the message subject or body is being edited. These types of actions fall into two broad categories:
TYPE_PRE
.
Any number of interceptors can be installed and removed at run-time. They can be installed globally or per-forum. Global interceptors are run first, followed by any that are installed for the forum.
Create a MesssageInterceptor implementation:
Each interceptor can have properties that are configurable by end-users. These should be exposed through a BeanInfo class.
All interceptor implementations must have two public constructors. One should be a default constructor (no parameters), and the other should have following signature: (int objectType, long objectID). These paramaters tell the interceptor instance if it is installed globally, in a category, or in a forum. In the case of a global interceptor, the objectType is JiveConstants.SYSTEM and the objectID is -1.
InterceptorManager
Field Summary | |
---|---|
static int |
TYPE_ALL
Interceptor that is run before and after a message has been accepted into the system and also during message edits. |
static int |
TYPE_BOTH
Interceptor that is run before and after the message has been accepted into the system. |
static int |
TYPE_EDIT
Interceptor that is run when messages are edited by calling setSubject(String) or
setBody(String) . |
static int |
TYPE_POST
Interceptor that is run after the message has been accepted into the system. |
static int |
TYPE_PRE
Interceptor that is run before the message has been accepted into the system. |
Method Summary | |
---|---|
int |
getType()
Returns the type of the interceptor. |
void |
invokeInterceptor(ForumMessage message,
int type)
Invokes the interceptor on the specified message. |
Field Detail |
---|
static final int TYPE_PRE
static final int TYPE_POST
static final int TYPE_BOTH
static final int TYPE_EDIT
setSubject(String)
or
setBody(String)
.
static final int TYPE_ALL
Method Detail |
---|
int getType()
void invokeInterceptor(ForumMessage message, int type) throws MessageRejectedException
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 |