org.apache.axis2.client
Class Options

java.lang.Object
  extended byorg.apache.axis2.client.Options

public class Options
extends Object

The proposal related for this is here : http://marc.theaimsgroup.com/?l=axis2-dev&m=113320384108037&w=2 Client can fill this options and give to any class extending from MEPClient. All those classes will be getting parameters using this.


Field Summary
static String COPY_PROPERTIES
           
static int DEFAULT_TIMEOUT_MILLISECONDS
           
protected  TransportOutDescription transportOut
          This is used for sending and receiving messages.
 
Constructor Summary
Options()
          Default constructor
Options(Options parent)
          In normal mode operation, this options will try to fullfil the request from its values.
 
Method Summary
 void addReferenceParameter(org.apache.axiom.om.OMElement referenceParameter)
           
 void addRelatesTo(RelatesTo relatesTo)
           
 String getAction()
           
 EndpointReference getFaultTo()
           
 EndpointReference getFrom()
           
 TransportListener getListener()
           
 String getMessageId()
           
 Options getParent()
           
 Map getProperties()
           
 Object getProperty(String key)
           
 RelatesTo getRelatesTo()
           
 RelatesTo getRelatesTo(String type)
           
 RelatesTo[] getRelationships()
           
 EndpointReference getReplyTo()
           
 String getSenderTransportProtocol()
           
 String getSoapVersionURI()
           
 long getTimeOutInMilliSeconds()
          Gets the wait time after which a client times out in a blocking scenario.
 EndpointReference getTo()
           
 TransportInDescription getTransportIn()
           
 String getTransportInProtocol()
           
 TransportOutDescription getTransportOut()
           
 boolean isExceptionToBeThrownOnSOAPFault()
          If there is a SOAP Fault in the body of the incoming SOAP Message, system can be configured to throw an exception with the details extracted from the information from the fault message.
 boolean isManageSession()
           
 boolean isUseSeparateListener()
           
 void setAction(String action)
           
 void setExceptionToBeThrownOnSOAPFault(boolean exceptionToBeThrownOnSOAPFault)
          If there is a SOAP Fault in the body of the incoming SOAP Message, system can be configured to throw an exception with the details extracted from the information from the fault message.
 void setFaultTo(EndpointReference faultTo)
           
 void setFrom(EndpointReference from)
           
 void setListener(TransportListener listener)
           
 void setManageSession(boolean manageSession)
           
 void setMessageId(String messageId)
           
 void setParent(Options parent)
           
 void setProperties(Map properties)
          This will set the properties to the context.
 void setProperty(String propertyKey, Object property)
          Properties you need to pass in to the message context must be set via this.
 void setRelationships(RelatesTo[] list)
           
 void setReplyTo(EndpointReference replyTo)
           
 void setSenderTransport(String senderTransport, AxisConfiguration axisConfiguration)
          Sets the transport to be used for sending the SOAP Message
 void setSoapVersionURI(String soapVersionURI)
           
 void setTimeOutInMilliSeconds(long timeOutInMilliSeconds)
          This is used in blocking scenario.
 void setTo(EndpointReference to)
           
 void setTransportIn(TransportInDescription transportIn)
           
 void setTransportInfo(String senderTransport, String listenerTransport, boolean useSeparateListener)
          Deprecated. Use setTransportInProtocol(String) and useSeparateListener(boolean) instead. You do not need to setSenderTransportProtocol(String) as sender transport can be inferred from the to EPR. But still you can setTransportOut(TransportOutDescription).
 void setTransportInProtocol(String transportInProtocol)
           
 void setTransportOut(TransportOutDescription transportOut)
           
 void setUseSeparateListener(boolean useSeparateListener)
          Used to specify whether the two SOAP Messages are be sent over same channel or over separate channels.The value of this variable depends on the transport specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPY_PROPERTIES

public static final String COPY_PROPERTIES
See Also:
Constant Field Values

DEFAULT_TIMEOUT_MILLISECONDS

public static final int DEFAULT_TIMEOUT_MILLISECONDS
See Also:
Constant Field Values

transportOut

protected TransportOutDescription transportOut
This is used for sending and receiving messages.

Constructor Detail

Options

public Options()
Default constructor


Options

public Options(Options parent)
In normal mode operation, this options will try to fullfil the request from its values. If that is not possible, this options will request those information from its parent.

Parameters:
parent -
Method Detail

getAction

public String getAction()

getFaultTo

public EndpointReference getFaultTo()

getFrom

public EndpointReference getFrom()

getListener

public TransportListener getListener()

getTransportIn

public TransportInDescription getTransportIn()

getTransportInProtocol

public String getTransportInProtocol()

getMessageId

public String getMessageId()

getProperties

public Map getProperties()

getProperty

public Object getProperty(String key)
Parameters:
key -
Returns:
the value realeted to this key. Null, if not found.

getRelatesTo

public RelatesTo getRelatesTo(String type)

getRelatesTo

public RelatesTo getRelatesTo()
Returns:
the relates to which has the type http://www.w3.org/2005/08/addressing/reply

getRelationships

public RelatesTo[] getRelationships()

setRelationships

public void setRelationships(RelatesTo[] list)

getReplyTo

public EndpointReference getReplyTo()

getTransportOut

public TransportOutDescription getTransportOut()

getSenderTransportProtocol

public String getSenderTransportProtocol()

getSoapVersionURI

public String getSoapVersionURI()

getTimeOutInMilliSeconds

public long getTimeOutInMilliSeconds()
Gets the wait time after which a client times out in a blocking scenario. The default is Options#DEFAULT_TIMEOUT_MILLISECONDS

Returns:
timeOutInMilliSeconds

getTo

public EndpointReference getTo()

isExceptionToBeThrownOnSOAPFault

public boolean isExceptionToBeThrownOnSOAPFault()
If there is a SOAP Fault in the body of the incoming SOAP Message, system can be configured to throw an exception with the details extracted from the information from the fault message. This boolean variable will enable that facility. If this is false, the response message will just be returned to the application, irrespective of whether it has a Fault or not.


isUseSeparateListener

public boolean isUseSeparateListener()

getParent

public Options getParent()

setParent

public void setParent(Options parent)

setAction

public void setAction(String action)

setExceptionToBeThrownOnSOAPFault

public void setExceptionToBeThrownOnSOAPFault(boolean exceptionToBeThrownOnSOAPFault)
If there is a SOAP Fault in the body of the incoming SOAP Message, system can be configured to throw an exception with the details extracted from the information from the fault message. This boolean variable will enable that facility. If this is false, the response message will just be returned to the application, irrespective of whether it has a Fault or not.

Parameters:
exceptionToBeThrownOnSOAPFault -

setFaultTo

public void setFaultTo(EndpointReference faultTo)

setFrom

public void setFrom(EndpointReference from)

setListener

public void setListener(TransportListener listener)

setTransportIn

public void setTransportIn(TransportInDescription transportIn)

setTransportInProtocol

public void setTransportInProtocol(String transportInProtocol)

setMessageId

public void setMessageId(String messageId)

setProperties

public void setProperties(Map properties)
This will set the properties to the context. But in setting that one may need to "copy" all the properties from the source properties to the target properties. To enable this we introduced a property (org.apache.axis2.client.Options#COPY_PROPERTIES) so that if set to Boolean(true), this code will copy the whole thing, without just referencing to the source.

Parameters:
properties -

setProperty

public void setProperty(String propertyKey,
                        Object property)
Properties you need to pass in to the message context must be set via this. If there is a method to the set this property, within this class, its encouraged to use that method, without duplicating stuff or making room for bugs.

Parameters:
propertyKey -
property -

addRelatesTo

public void addRelatesTo(RelatesTo relatesTo)

setReplyTo

public void setReplyTo(EndpointReference replyTo)

setTransportOut

public void setTransportOut(TransportOutDescription transportOut)

setSenderTransport

public void setSenderTransport(String senderTransport,
                               AxisConfiguration axisConfiguration)
                        throws AxisFault
Sets the transport to be used for sending the SOAP Message

Parameters:
senderTransport -
Throws:
AxisFault - if the transport is not found

setSoapVersionURI

public void setSoapVersionURI(String soapVersionURI)

setTimeOutInMilliSeconds

public void setTimeOutInMilliSeconds(long timeOutInMilliSeconds)
This is used in blocking scenario. Client will time out after waiting this amount of time. The default is 2000 and must be provided in multiples of 100.

Parameters:
timeOutInMilliSeconds -

setTo

public void setTo(EndpointReference to)

setTransportInfo

public void setTransportInfo(String senderTransport,
                             String listenerTransport,
                             boolean useSeparateListener)
                      throws AxisFault
Deprecated. Use setTransportInProtocol(String) and useSeparateListener(boolean) instead. You do not need to setSenderTransportProtocol(String) as sender transport can be inferred from the to EPR. But still you can setTransportOut(TransportOutDescription).

Sets transport information to the call. The senarios supported are as follows:

  [transportOut, transportIn, useSeparateListener]
  http, http, true
  http, http, false
  http,smtp,true
  smtp,http,true
  smtp,smtp,true
 

Parameters:
senderTransport -
listenerTransport -
useSeparateListener -
Throws:
AxisFault

setUseSeparateListener

public void setUseSeparateListener(boolean useSeparateListener)
Used to specify whether the two SOAP Messages are be sent over same channel or over separate channels.The value of this variable depends on the transport specified. For e.g., if the transports are different this is true by default. HTTP transport supports both cases while SMTP transport supports only two channel case.

Parameters:
useSeparateListener -

addReferenceParameter

public void addReferenceParameter(org.apache.axiom.om.OMElement referenceParameter)

isManageSession

public boolean isManageSession()

setManageSession

public void setManageSession(boolean manageSession)