cgl.narada.wsinfra.deployment
Class Filter

java.lang.Object
  extended by cgl.narada.wsinfra.deployment.Filter
All Implemented Interfaces:
WsMessageFlow

public abstract class Filter
extends Object
implements WsMessageFlow

This abstract class implements the functionality of a filter within our deployment environment. This class implements the WsMessageFlow interface. Note that the only method that needs to be implemented by filters extending this base class is the processMessage class. For examples of filters extending this baseclass, please see the filters in the cgl.narada.wsinfra. apps package; here, examples pertaining to WSE and WSRM filters have been included.


Field Summary
static int INPUT
           
static int INPUT_OUTPUT
           
static int OUTPUT
           
 
Fields inherited from interface cgl.narada.wsinfra.WsMessageFlow
FROM_APPLICATION, FROM_NETWORK
 
Constructor Summary
Filter()
           
 
Method Summary
 void dispose()
          Dipose this filter.
 void enrouteToApplication(SOAPMessage soapMessage)
          Routes a message enroute to the application.
 void enrouteToNetwork(SOAPMessage soapMessage)
          Routes a message enroute to the network.
 boolean equals(Filter obj)
          Compares two objects for equality.
 int getDirection()
          Retrieves the direction of messages that this filter operates upon.
 FilterPipeline getFilterPipeline()
          Retrieve the filter pipeline that this filter is a part of.
 String getIdentifier()
          Retrieve the identifier of the filter.
 int getPositionInFilterPipeline()
          Retrieves the position of this filter in the pipeline.
 int hashCode()
          Generates a hash code for the receiver.
 boolean isInputFilter()
          Is this an input filter.
 boolean isOutputFilter()
          Is this an output filter
abstract  boolean processMessage(SOAPContext soapContext, int direction)
          This method returns a boolean which indicates whether further processing should continue or if it should stop.
 void setDirection(int directionOfFlow)
          Sets the direction of messages that this filter should operate upon.
 void setFilterPipeline(FilterPipeline filterPipeline)
          Retrieve the filter pipeline that this filter is a part of.
 void setIdentifier(String identifier)
          Set the identifier of the filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INPUT

public static final int INPUT
See Also:
Constant Field Values

OUTPUT

public static final int OUTPUT
See Also:
Constant Field Values

INPUT_OUTPUT

public static final int INPUT_OUTPUT
See Also:
Constant Field Values
Constructor Detail

Filter

public Filter()
Method Detail

setFilterPipeline

public final void setFilterPipeline(FilterPipeline filterPipeline)
Retrieve the filter pipeline that this filter is a part of.


getFilterPipeline

public final FilterPipeline getFilterPipeline()
Retrieve the filter pipeline that this filter is a part of.


getPositionInFilterPipeline

public final int getPositionInFilterPipeline()
                                      throws DeploymentException
Retrieves the position of this filter in the pipeline.

Throws:
DeploymentException

setIdentifier

public final void setIdentifier(String identifier)
Set the identifier of the filter.


getIdentifier

public final String getIdentifier()
Retrieve the identifier of the filter.


setDirection

public final void setDirection(int directionOfFlow)
                        throws DeploymentException
Sets the direction of messages that this filter should operate upon.

Throws:
DeploymentException

isInputFilter

public final boolean isInputFilter()
Is this an input filter.


isOutputFilter

public final boolean isOutputFilter()
Is this an output filter


getDirection

public final int getDirection()
Retrieves the direction of messages that this filter operates upon.


enrouteToApplication

public final void enrouteToApplication(SOAPMessage soapMessage)
                                throws MessageFlowException
Routes a message enroute to the application. The message is basically routed to a neighboring filter which is nearer to the application.

Specified by:
enrouteToApplication in interface WsMessageFlow
Throws:
MessageFlowException

enrouteToNetwork

public final void enrouteToNetwork(SOAPMessage soapMessage)
                            throws MessageFlowException
Routes a message enroute to the network. The message is basically routed to a neighboring filter which is closer to the network side of the filter-pipeline.

Specified by:
enrouteToNetwork in interface WsMessageFlow
Throws:
MessageFlowException

processMessage

public abstract boolean processMessage(SOAPContext soapContext,
                                       int direction)
                                throws UnknownExchangeException,
                                       IncorrectExchangeException,
                                       MessageFlowException,
                                       ProcessingException
This method returns a boolean which indicates whether further processing should continue or if it should stop. A return value of true indicates that processing should continue; while false indicates that processing should stop. Note that it is the filter-pipeline which is responsible for stopping this processing.

Throws:
UnknownExchangeException
IncorrectExchangeException
MessageFlowException
ProcessingException

dispose

public final void dispose()
                   throws DeploymentException
Dipose this filter. This method will also remove this filter from a pipeline, if indeed it is part of one. It returns a boolean variable indicating whether the operation was successful or not.

Throws:
DeploymentException

equals

public final boolean equals(Filter obj)
Compares two objects for equality. Returns a boolean that indicates whether this object is equivalent to the specified object. This method is used when an object is stored in a hashtable.

Parameters:
obj - the Object to compare with
Returns:
true if these Objects are equal; false otherwise.
See Also:
Hashtable

hashCode

public final int hashCode()
Generates a hash code for the receiver. This method is supported primarily for hash tables, such as those provided in java.util. If two objects are equal (equals(Object) returns true) they must have the same hash code

Overrides:
hashCode in class Object
Returns:
an integer hash code for the receiver


For comments and suggestions please send e-mail to The NaradaBrokering Project