|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.axis2.client.Options
public class Options
Holder for operation client options. This is used by the other classes in this package to configure various aspects of how a client communicates with a service. It exposes a number of predefined properties as part of the API (with specific getXXX and setXXX methods), and also allows for arbitrary named properties to be passed using a properties map with the property name as the key value. Instances of this class can be chained together for property inheritance, so that if a property is not set in one instance it will check its parent for a setting.
Field Summary | |
---|---|
static java.lang.String |
CUSTOM_REPLYTO_ADDRESS
|
static java.lang.String |
CUSTOM_REPLYTO_ADDRESS_TRUE
|
static int |
DEFAULT_TIMEOUT_MILLISECONDS
Default blocking timeout value. |
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 fulfil the request from its values. |
Method Summary | |
---|---|
void |
activate(ConfigurationContext cc)
This method checks to see if additional work needs to be done in order to complete the object reconstitution. |
void |
addReferenceParameter(org.apache.axiom.om.OMElement referenceParameter)
Deprecated. |
void |
addRelatesTo(RelatesTo relatesTo)
Add WS-Addressing RelatesTo item. |
java.lang.String |
getAction()
Get WS-Addressing Action / SOAP Action string. |
EndpointReference |
getFaultTo()
Get WS-Addressing FaultTo endpoint reference. |
EndpointReference |
getFrom()
Set WS-Addressing From endpoint reference. |
TransportListener |
getListener()
Get listener used for incoming message. |
java.lang.String |
getLogCorrelationIDString()
Get the ID associated with this object instance. |
java.lang.String |
getMessageId()
Get WS-Addressing MessageId. |
Options |
getParent()
Get parent instance providing default property values. |
java.lang.String |
getPassword()
|
java.util.Map |
getProperties()
Get a copy of the general option properties. |
java.lang.Object |
getProperty(java.lang.String key)
Get named property value. |
RelatesTo |
getRelatesTo()
Return a single instance of WS-Addressing RelatesTo that has a relationship type of either "http://www.w3.org/2005/08/addressing/reply" or "wsa:Reply". |
RelatesTo |
getRelatesTo(java.lang.String type)
Get WS-Addressing RelatesTo item with a specified type. |
RelatesTo[] |
getRelationships()
Get all WS-Addressing RelatesTo items. |
EndpointReference |
getReplyTo()
Get WS-Addressing ReplyTo endpoint reference. |
java.lang.String |
getSoapVersionURI()
Get SOAP version being used. |
long |
getTimeOutInMilliSeconds()
Gets the wait time after which a client times out in a blocking scenario. |
EndpointReference |
getTo()
Get WS-Addressing To endpoint reference. |
TransportInDescription |
getTransportIn()
Get transport used for incoming message. |
java.lang.String |
getTransportInProtocol()
Get transport protocol used for incoming message. |
TransportOutDescription |
getTransportOut()
Get outbound transport description. |
java.lang.String |
getUserName()
|
boolean |
isCallTransportCleanup()
|
boolean |
isEquivalent(Options obj)
Compares key parts of the state from the current instance of this class with the specified instance to see if they are equivalent. |
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()
Check if session management is enabled. |
boolean |
isUseSeparateListener()
Check whether the two SOAP Messages are be sent over same channel or over separate channels. |
void |
readExternal(java.io.ObjectInput inObject)
Restore the contents of the MessageContext that was previously saved. |
void |
setAction(java.lang.String action)
Set WS-Addressing Action / SOAP Action string. |
void |
setCallTransportCleanup(boolean callTransportCleanup)
|
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)
Set WS-Addressing FaultTo endpoint reference. |
void |
setFrom(EndpointReference from)
Set WS-Addressing From endpoint reference. |
void |
setListener(TransportListener listener)
Set listener used for incoming message. |
void |
setManageSession(boolean manageSession)
Set session management enabled state. |
void |
setMessageId(java.lang.String messageId)
Set WS-Addressing MessageId. |
void |
setParent(Options parent)
Set parent instance providing default property values. |
void |
setPassword(java.lang.String password)
|
void |
setProperties(java.util.Map properties)
Set the general property definitions. |
void |
setProperty(java.lang.String propertyKey,
java.lang.Object property)
General properties you need to pass in to the message context must be set via this method. |
void |
setRelationships(RelatesTo[] list)
Set WS-Addressing RelatesTo items. |
void |
setReplyTo(EndpointReference replyTo)
Set WS-Addressing ReplyTo endpoint. |
void |
setSenderTransport(java.lang.String senderTransport,
AxisConfiguration axisConfiguration)
Set transport used for outgoing message. |
void |
setSoapVersionURI(java.lang.String soapVersionURI)
Set the SOAP version to be used. |
void |
setTimeOutInMilliSeconds(long timeOutInMilliSeconds)
This is used in blocking scenario. |
void |
setTo(EndpointReference to)
Set WS-Addressing To endpoint. |
void |
setTransportIn(TransportInDescription transportIn)
Set transport used for incoming message. |
void |
setTransportInfo(java.lang.String senderTransport,
java.lang.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(java.lang.String transportInProtocol)
Set transport protocol used for incoming message. |
void |
setTransportOut(TransportOutDescription transportOut)
Set transport used for outgoing message. |
void |
setUserName(java.lang.String userName)
|
void |
setUseSeparateListener(boolean useSeparateListener)
Used to specify whether the two SOAP Messages are be sent over same channel or over separate channels. |
void |
writeExternal(java.io.ObjectOutput o)
Save the contents of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CUSTOM_REPLYTO_ADDRESS
public static java.lang.String CUSTOM_REPLYTO_ADDRESS_TRUE
public static final int DEFAULT_TIMEOUT_MILLISECONDS
protected TransportOutDescription transportOut
Constructor Detail |
---|
public Options()
public Options(Options parent)
parent
- Method Detail |
---|
public java.lang.String getAction()
public EndpointReference getFaultTo()
public EndpointReference getFrom()
public TransportListener getListener()
public TransportInDescription getTransportIn()
public java.lang.String getTransportInProtocol()
public java.lang.String getMessageId()
public java.util.Map getProperties()
setProperties(Map)
,
public java.lang.Object getProperty(java.lang.String key)
key
-
null
, if not found.public RelatesTo getRelatesTo(java.lang.String type)
getRelationships()
to retrieve all the items
and check for multiple matches.
type
- relationship type (URI)
public RelatesTo getRelatesTo()
null
.
RelatesTo
public RelatesTo[] getRelationships()
public void setRelationships(RelatesTo[] list)
list
- public EndpointReference getReplyTo()
public TransportOutDescription getTransportOut()
public java.lang.String getSoapVersionURI()
public long getTimeOutInMilliSeconds()
public EndpointReference getTo()
public boolean isExceptionToBeThrownOnSOAPFault()
true
if exception to be thrownpublic boolean isUseSeparateListener()
false
value.
public Options getParent()
null
if none)public void setParent(Options parent)
parent
- (null
if none)public void setAction(java.lang.String action)
action
- public void setExceptionToBeThrownOnSOAPFault(boolean exceptionToBeThrownOnSOAPFault)
exceptionToBeThrownOnSOAPFault
- public void setFaultTo(EndpointReference faultTo)
faultTo
- endpointpublic void setFrom(EndpointReference from)
from
- endpointpublic void setListener(TransportListener listener)
listener
- public void setTransportIn(TransportInDescription transportIn)
transportIn
- public void setTransportInProtocol(java.lang.String transportInProtocol)
transportInProtocol
- ("http", "tcp", etc.)public void setMessageId(java.lang.String messageId)
messageId
- URI stringpublic void setProperties(java.util.Map properties)
properties
- public void setProperty(java.lang.String propertyKey, java.lang.Object property)
Sometimes you want to send your SOAP message through a node, before it reaches to its destination. This means you want to give transport URL different from the URL of the ultimate destination. A typical example would be wanting to send this SOAP (or REST)message through a transparent proxy or through a message monitoring applet. How can that be done using the ServiceClient API?
options.setTo("http://destination.org"); options.setProperty(MessageContextConstants.TRANSPORT_URL, "http://myProxy.org");
This will send your SOAP message to "http://myProxy.org", but if WS-Addressing is enabled, wsa:To will contain "http://destination.org" as To address.
This will enable user to set the character set encoding scheme to be used when sending the message. Default is set to "UTF-8"
This will enable/disable MTOM support for outgoing messages.
Possible values are:
"true"/"false" or Boolean.TRUE/Boolean.FALSE
This will enable to select one of the two WS-Addressing versions available, if WS-Addressing is engaged.
Possible values are:
org.apache.axis2.addressing.AddressingConstants.Final.WSA_NAMESPACE and org.apache.axis2.addressing.AddressingConstants.Submission.WSA_NAMESPACE
AddressingOutHandler picks up the addressing information from the message context and set them to the outgoing message. But someone may have already put some addressing headers, before the AddressingOutHandler. This flag will notify the handler whether to override them or not.
Possible values are:
"true"/"false" or Boolean.TRUE/Boolean.FALSE
If WS-Addressing is engaged globally or some how in effect for this particular invocation, this will disable Axis2 from putting WS-Addressing headers in to the out going SOAP message. (Note that Axis2 will not put addressing headers to the outgoing message, irrespective of the above flag, if the incoming message did not contain addressing headers).
Possible values are:
"true"/"false" or Boolean.TRUE/Boolean.FALSE
This will enable/disable chunking support.
Possible values are:
"true"/"false" or Boolean.TRUE/Boolean.FALSE
This enables the user to pass in NTLM authentication information, such as host, port, realm, username, password to be used with HTTP transport sender.
The value should always be an instance of:
org.apache.axis2.transport.http.HttpTransportProperties. NTLMAuthentication
This enables the user to pass in proxy information, such as proxy host name, port, domain, username, password to be used with HTTP transport sender.
The value should always be an instance of:
org.apache.axis2.transport.http.HttpTransportProperties.ProxyProperties
The value should always be an instance of:
org.apache.axis2.transport.http.HttpTransportProperties.BasicAuthentication
This enables the user to pass in socket timeout value as an Integer. If nothing is set, the default value is 60000 milliseconds.
This enables the user to pass in connection timeout value as an Integer. If nothing is set, the default value is 60000 milliseconds.
This enables the user to set the user agent header in the outgoing HTTP request. Default value is "Axis2"
If set this will GZip your request and send over to the destination. Before doing this, you must make sure that the receiving end supports GZip compressed streams.
Possible values are:
"true"/"false" or Boolean.TRUE/Boolean.FALSE
Whether or not you send a gzip-ped request, you can choose to receive GZIP back from the server using this flag.
Possible values are:
"true"/"false" or Boolean.TRUE/Boolean.FALSE
This enables the user to set the cookie string header in the outgoing HTTP request.
This will set the HTTP protocol version to be used in sending the SOAP requests.
Possible values are :
HTTP/1.1 - HTTPConstants.HEADER_PROTOCOL_11 HTTP/1.0 - HTTPConstants.HEADER_PROTOCOL_10
Default is to use HTTP/1.1.
You might sometimes want to send your own custom HTTP headers. You can set an ArrayList filled with
org.apache.commons.httpclient.Header
objects using the above property. You must not try to override the Headers the Axis2 engine is setting to the outgoing message.
You might want to use the same HTTPClient instance for multiple invocations. This flag will notify the engine to use the same HTTPClient between invocations.
If user had requested to re-use an HTTPClient using the above property, this property can be used to set a custom HTTPClient to be re-used.
Enabling REST using the above flag will send your request as a REST invocation.
Possible values are:
"true"/"false" or Boolean.TRUE/Boolean.FALSE
This will help the user to pick the HTTP method to be used during a REST invocation.
Possible values are :
org.apache.axis2.Constants.Configuration.HTTP_METHOD_GET and org.apache.axis2.Constants.Configuration.HTTP_METHOD_POST
Default is to use POST method.
This will help the user to pick the content type to be used during a REST
Possible values are :
HTTPConstants.MEDIA_TYPE_APPLICATION_XML
HTTPConstants.MEDIA_TYPE_X_WWW_FORM
MEDIA_TYPE_TEXT_XML
MEDIA_TYPE_MULTIPART_RELATED
propertyKey
- property
- public void addRelatesTo(RelatesTo relatesTo)
relatesTo
- public void setReplyTo(EndpointReference replyTo)
replyTo
- endpointpublic void setTransportOut(TransportOutDescription transportOut)
transportOut
- public void setSenderTransport(java.lang.String senderTransport, AxisConfiguration axisConfiguration) throws AxisFault
senderTransport
- transport name in Axis2 configuration
("http", "tcp", etc.)axisConfiguration
-
AxisFault
- if the transport is not foundpublic void setSoapVersionURI(java.lang.String soapVersionURI)
soapVersionURI
- Constants.URI_SOAP11_ENV
,
Constants.URI_SOAP12_ENV
public void setTimeOutInMilliSeconds(long timeOutInMilliSeconds)
timeOutInMilliSeconds
- public void setTo(EndpointReference to)
to
- endpointpublic void setTransportInfo(java.lang.String senderTransport, java.lang.String listenerTransport, boolean useSeparateListener) throws AxisFault
[senderTransport, listenerTransport, useSeparateListener] http, http, true http, http, false http, smtp, true smtp, http, true smtp, smtp, true tcp, tcp, true tcp, tcp, false etc.
senderTransport
- listenerTransport
- useSeparateListener
-
AxisFault
public void setUseSeparateListener(boolean useSeparateListener)
useSeparateListener
- public void addReferenceParameter(org.apache.axiom.om.OMElement referenceParameter)
referenceParameter
- public boolean isManageSession()
true
if enabledpublic void setManageSession(boolean manageSession)
manageSession
- true
if enabling sessionspublic void writeExternal(java.io.ObjectOutput o) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- The stream to write the object contents to
java.io.IOException
public void readExternal(java.io.ObjectInput inObject) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- The stream to read the object contents from
java.io.IOException
java.lang.ClassNotFoundException
public void activate(ConfigurationContext cc)
cc
- The configuration context object representing the active configurationpublic boolean isEquivalent(Options obj)
obj
- The object to compare with
public java.lang.String getLogCorrelationIDString()
public boolean isCallTransportCleanup()
public void setCallTransportCleanup(boolean callTransportCleanup)
public java.lang.String getUserName()
public void setUserName(java.lang.String userName)
public java.lang.String getPassword()
public void setPassword(java.lang.String password)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |