org.apache.uima.aae.message
Class UimaMessageValidator

java.lang.Object
  extended by org.apache.uima.aae.message.UimaMessageValidator

public class UimaMessageValidator
extends java.lang.Object


Constructor Summary
UimaMessageValidator()
           
 
Method Summary
static java.lang.String decodeIntToString(java.lang.String aTypeToDecode, int aValueToDecode)
           
static boolean isProcessRequest(UimaMessage aMessage)
           
static boolean isRequest(UimaMessage aMessage)
           
static boolean isStaleMessage(UimaMessage aMessage, boolean isStopped, java.lang.String endpointName, boolean entryExists)
           
static boolean isValidMessage(UimaMessage aMessage, AnalysisEngineController controller)
          Validates contents of the message.
static boolean validCommand(UimaMessage aMessage, java.lang.String endpointName)
          Validate command contained in the header of the JMS Message
static boolean validMessageType(UimaMessage aMessage, java.lang.String endpointName)
          Validate message type contained in the JMS header.
static boolean validPayload(UimaMessage aMessage, java.lang.String endpointName)
          Validates payload in the JMS Message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UimaMessageValidator

public UimaMessageValidator()
Method Detail

validMessageType

public static boolean validMessageType(UimaMessage aMessage,
                                       java.lang.String endpointName)
                                throws java.lang.Exception
Validate message type contained in the JMS header.

Parameters:
aMessage - - jms message retrieved from queue
properties - - map containing message properties
Returns:
Throws:
java.lang.Exception

isRequest

public static boolean isRequest(UimaMessage aMessage)
                         throws java.lang.Exception
Throws:
java.lang.Exception

isProcessRequest

public static boolean isProcessRequest(UimaMessage aMessage)
                                throws java.lang.Exception
Throws:
java.lang.Exception

validCommand

public static boolean validCommand(UimaMessage aMessage,
                                   java.lang.String endpointName)
                            throws java.lang.Exception
Validate command contained in the header of the JMS Message

Parameters:
aMessage - - JMS Message received
properties - - Map containing header properties
Returns:
- true if the command received is a valid one, false otherwise
Throws:
java.lang.Exception

validPayload

public static boolean validPayload(UimaMessage aMessage,
                                   java.lang.String endpointName)
                            throws java.lang.Exception
Validates payload in the JMS Message.

Parameters:
aMessage - - JMS Message received
properties - - Map containing header properties
Returns:
- true if the payload is valid, false otherwise
Throws:
java.lang.Exception

isStaleMessage

public static boolean isStaleMessage(UimaMessage aMessage,
                                     boolean isStopped,
                                     java.lang.String endpointName,
                                     boolean entryExists)

isValidMessage

public static boolean isValidMessage(UimaMessage aMessage,
                                     AnalysisEngineController controller)
                              throws java.lang.Exception
Validates contents of the message. It checks if command, payload and message types contain valid data.

Parameters:
aMessage - - JMS Message to validate
Returns:
- true if message is valid, false otherwise
Throws:
java.lang.Exception

decodeIntToString

public static java.lang.String decodeIntToString(java.lang.String aTypeToDecode,
                                                 int aValueToDecode)


Copyright © 2012. All Rights Reserved.