adams.flow.webservice
Class AbstractWebServiceClientSource<O>

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.flow.webservice.AbstractWebServiceClientSource<O>
Type Parameters:
O - the type of output data to handle
All Implemented Interfaces:
CleanUpHandler, Debuggable, Destroyable, OptionHandler, SizeOfHandler, WebServiceClient, WebServiceClientProducer<O>, Serializable
Direct Known Subclasses:
AbstractWebServiceClientSourceWithGlobalTransformer

public abstract class AbstractWebServiceClientSource<O>
extends AbstractOptionHandler
implements WebServiceClientProducer<O>

Ancestor for webservice clients.

Version:
$Revision: 6420 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  int m_ConnectionTimeout
          the connection timeout.
protected  AbstractActor m_Owner
          the owner.
protected  int m_ReceiveTimeout
          the receive timeout.
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
AbstractWebServiceClientSource()
           
 
Method Summary
 void cleanUp()
          Cleans up the client.
 String connectionTimeoutTipText()
          Returns the tip text for this property.
 void defineOptions()
          Adds options to the internal list of options.
protected abstract  void doQuery()
          Performs the actual webservice query.
 int getConnectionTimeout()
          Returns the timeout for the connection.
 AbstractActor getOwner()
          Returns the owning actor.
 int getReceiveTimeout()
          Returns the timeout for receiving.
protected abstract  URL getWsdlLocation()
          Returns the WSDL location.
protected  void postQuery()
          Hook method after querying the webservice.
protected  void preQuery()
          Hook method before querying the webservice.
 void query()
          Queries the webservice.
 String receiveTimeoutTipText()
          Returns the tip text for this property.
 void setConnectionTimeout(int value)
          Sets the timeout for connection.
 void setOwner(AbstractActor value)
          Sets the actor that executes this webservice.
 void setReceiveTimeout(int value)
          Sets the timeout for receiving.
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, destroy, finishInit, getDebugLevel, getOptionManager, globalInfo, initialize, isDebugOn, newOptionManager, reset, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface adams.flow.webservice.WebServiceClientProducer
generates, getResponseData, hasResponseData
 
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager
 
Methods inherited from interface adams.core.Destroyable
destroy
 

Field Detail

m_Owner

protected AbstractActor m_Owner
the owner.


m_ConnectionTimeout

protected int m_ConnectionTimeout
the connection timeout.


m_ReceiveTimeout

protected int m_ReceiveTimeout
the receive timeout.

Constructor Detail

AbstractWebServiceClientSource

public AbstractWebServiceClientSource()
Method Detail

defineOptions

public void defineOptions()
Adds options to the internal list of options.

Specified by:
defineOptions in interface OptionHandler
Overrides:
defineOptions in class AbstractOptionHandler

setConnectionTimeout

public void setConnectionTimeout(int value)
Sets the timeout for connection.

Specified by:
setConnectionTimeout in interface WebServiceClient
Parameters:
value - the timeout in msec, 0 is infinite

getConnectionTimeout

public int getConnectionTimeout()
Returns the timeout for the connection.

Specified by:
getConnectionTimeout in interface WebServiceClient
Returns:
the timeout in msec, 0 is infinite

connectionTimeoutTipText

public String connectionTimeoutTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

setReceiveTimeout

public void setReceiveTimeout(int value)
Sets the timeout for receiving.

Specified by:
setReceiveTimeout in interface WebServiceClient
Parameters:
value - the timeout in msec, 0 is infinite

getReceiveTimeout

public int getReceiveTimeout()
Returns the timeout for receiving.

Specified by:
getReceiveTimeout in interface WebServiceClient
Returns:
the timeout in msec, 0 is infinite

receiveTimeoutTipText

public String receiveTimeoutTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

setOwner

public void setOwner(AbstractActor value)
Sets the actor that executes this webservice.

Specified by:
setOwner in interface WebServiceClient
Parameters:
value - the owner

getOwner

public AbstractActor getOwner()
Returns the owning actor.

Specified by:
getOwner in interface WebServiceClient
Returns:
the owner

getWsdlLocation

protected abstract URL getWsdlLocation()
Returns the WSDL location.

Returns:
the location

preQuery

protected void preQuery()
                 throws Exception
Hook method before querying the webservice.

Default implementation ensures that an owner is set.

Throws:
Exception - if it fails for some reason

doQuery

protected abstract void doQuery()
                         throws Exception
Performs the actual webservice query.

Throws:
Exception - if accessing webservice fails for some reason

postQuery

protected void postQuery()
                  throws Exception
Hook method after querying the webservice.

Default implementation does nothing.

Throws:
Exception - if it fails for some reason

query

public void query()
           throws Exception
Queries the webservice.

Specified by:
query in interface WebServiceClient
Throws:
Exception - if accessing webservice fails for some reason

cleanUp

public void cleanUp()
Cleans up the client.

Specified by:
cleanUp in interface CleanUpHandler


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.