Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.interceptor
Class VirusScanInterceptor

java.lang.Object
  extended by com.jivesoftware.forum.interceptor.VirusScanInterceptor
All Implemented Interfaces:
MessageInterceptor

public class VirusScanInterceptor
extends java.lang.Object
implements MessageInterceptor

Redirects messages with attachments to the VirusScanManager queue. The general logic flow is as follows:

  1. If a message contains one or more attachments, the moderation value of the message is set to VIRUS_CHECK_MODERATION_VALUE, which is below the visible threshold and will prevent the message from being viewed by other users.
  2. The message is added to the VirusScanManager queue where it will be scanned for viruses.

See Also:
VirusScanManager

Field Summary
static int VIRUS_CHECK_MODERATION_VALUE
          The moderation value that messages will be set to (-156) while waiting to be scanned for viruses.
 
Fields inherited from interface com.jivesoftware.forum.MessageInterceptor
TYPE_ALL, TYPE_BOTH, TYPE_EDIT, TYPE_POST, TYPE_PRE
 
Constructor Summary
VirusScanInterceptor()
           
VirusScanInterceptor(int objectType, long objectID)
           
 
Method Summary
 int getType()
          Returns the type of the interceptor.
 void invokeInterceptor(ForumMessage message, int type)
          Invokes the interceptor on the specified message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIRUS_CHECK_MODERATION_VALUE

public static int VIRUS_CHECK_MODERATION_VALUE
The moderation value that messages will be set to (-156) while waiting to be scanned for viruses. The value is below the visible threshold, which means that other users will not see the message until it's finished being scanned.

Constructor Detail

VirusScanInterceptor

public VirusScanInterceptor()

VirusScanInterceptor

public VirusScanInterceptor(int objectType,
                            long objectID)
Method Detail

getType

public int getType()
Description copied from interface: MessageInterceptor
Returns the type of the interceptor.

Specified by:
getType in interface MessageInterceptor
Returns:
the interceptor type.

invokeInterceptor

public void invokeInterceptor(ForumMessage message,
                              int type)
                       throws MessageRejectedException
Description copied from interface: MessageInterceptor
Invokes the interceptor on the specified message. The interceptor can either modify the message, or throw a MessageRejectedException to block it from being posted. Only a TYPE_PRE interceptor can throw an exception.

Specified by:
invokeInterceptor in interface MessageInterceptor
Parameters:
message - the message to take action on.
Throws:
MessageRejectedException - if the message should be prevented from being posted.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.