com.ail.core.command
Class WebServiceAccessor

java.lang.Object
  extended by com.ail.core.Type
      extended by com.ail.core.command.AbstractCommand
          extended by com.ail.core.command.Accessor
              extended by com.ail.core.command.WebServiceAccessor
All Implemented Interfaces:
CoreUser, java.io.Serializable, java.lang.Cloneable

public class WebServiceAccessor
extends Accessor
implements CoreUser

Accessor providing access to web service based commands. The assumption here is that the web-service we're invoking is one of our own - i.e. it takes a single command object as an argument and returns a command object of the same type. It also assumes that the web service is based on our EJB wrapper pattern, and as such it has a "invokeServiceXML" method.

In effect we're using soap as a transport mechanism here rather than providing a general accessor that might provide access to any web service.

Version:
$Revision: 1.7 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ail.core.Type
jXPathContext, NOT_PERSISTED
 
Constructor Summary
WebServiceAccessor()
           
 
Method Summary
 java.lang.Object clone()
          Clone this object.
 CommandArg getArgs()
          Get the argument set associated with this command.
 Configuration getConfiguration()
          Fetch the configuration of the entry point associated with this command.
 java.lang.String getConfigurationNamespace()
          Return the caller's configuration namespace.
 java.lang.String getEndpointClass()
           
 java.lang.String getLocalPart()
           
 java.lang.String getNamespace()
           
 java.lang.String getOperationName()
           
 java.security.Principal getSecurityPrincipal()
          Get the security principal associated with this instance.
 java.lang.String getUrl()
           
 Version getVersion()
          Fetch the version of the command (entry point) associated with this command.
 VersionEffectiveDate getVersionEffectiveDate()
          The Core uses this callback to determin which versions of artefacts it should use on the CoreUser's behalf.
 void invoke()
          Invoke the command associated with this command object.
 void setArgs(CommandArg that)
          Update this Command object's arguments with those taken from the command arg passed in.
 void setConfiguration(Configuration properties)
          Update the configuration of the entry point associated with this command.
 void setEndpointClass(java.lang.String endpointClass)
           
 void setLocalPart(java.lang.String localPart)
           
 void setNamespace(java.lang.String namespace)
           
 void setOperationName(java.lang.String operationName)
           
 void setUrl(java.lang.String url)
           
 
Methods inherited from class com.ail.core.command.Accessor
getLoggingIndicator, getLoggingIndicatorAsString, setLoggingIndicator, setLoggingIndicatorAsString
 
Methods inherited from class com.ail.core.Type
addAttribute, deleteLock, deleteSerialVersion, fetchJXPathContext, getAttribute, getAttribute, getAttributeCount, getForeignSystemId, getLock, getSerialVersion, getSystemId, hasLock, hasSerialVersion, hasSystemId, isPersisted, markAsNotPersisted, mergeWithDataFrom, removeAttribute, removeAttribute, setAttribute, setForeignSystemId, setLock, setSerialVersion, setSystemId, xpathGet, xpathGet, xpathIterate, xpathSet
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebServiceAccessor

public WebServiceAccessor()
Method Detail

setArgs

public void setArgs(CommandArg that)
Update this Command object's arguments with those taken from the command arg passed in. This is in effect a bulk setter. This interface will be implemented by beans that have many more getters/setters to support their properties. The implementations of this method take 'that', and pull all the relevant properties into this.

Specified by:
setArgs in class AbstractCommand
Parameters:
that - Source for arguments

getArgs

public CommandArg getArgs()
Get the argument set associated with this command.

Specified by:
getArgs in class AbstractCommand
Returns:
This objects arguments.

invoke

public void invoke()
            throws BaseException
Invoke the command associated with this command object. Before invoke is called, the command object must be populated with all the information (parameters) needed to invoke the service via the command object's setters. Once invoke has been called, the object's getters are used to retrieve the results.

Specified by:
invoke in class AbstractCommand
Throws:
BaseException

getVersion

public Version getVersion()
Description copied from class: AbstractCommand
Fetch the version of the command (entry point) associated with this command. This is similar to the 'invoke' entry point in that control is passed to the entry point object. In this case to the getVersion() method.

Note: This method does not return the version of the command.

Specified by:
getVersion in class AbstractCommand
Returns:
The version of the entry point.

getConfiguration

public Configuration getConfiguration()
Description copied from class: AbstractCommand
Fetch the configuration of the entry point associated with this command. This is similar to invoke in that control is passed to the entry point object, in this case to the getConfiguration method. Note: This method does not return the configuration of the command object.

Specified by:
getConfiguration in class AbstractCommand
Returns:
The entry point's configuration.

setConfiguration

public void setConfiguration(Configuration properties)
Description copied from class: AbstractCommand
Update the configuration of the entry point associated with this command. This is similar to the invoke method in that control is pass to the entry point object, in this case to its setConfiguration method. Note: This method does not set the configuration of the command object.

Specified by:
setConfiguration in class AbstractCommand
Parameters:
properties - Properties to replace the current configuration.

getUrl

public java.lang.String getUrl()

setUrl

public void setUrl(java.lang.String url)

getLocalPart

public java.lang.String getLocalPart()

setLocalPart

public void setLocalPart(java.lang.String localPart)

getNamespace

public java.lang.String getNamespace()

setNamespace

public void setNamespace(java.lang.String namespace)

getEndpointClass

public java.lang.String getEndpointClass()

setEndpointClass

public void setEndpointClass(java.lang.String endpointClass)

getOperationName

public java.lang.String getOperationName()

setOperationName

public void setOperationName(java.lang.String operationName)

getVersionEffectiveDate

public VersionEffectiveDate getVersionEffectiveDate()
The Core uses this callback to determin which versions of artefacts it should use on the CoreUser's behalf.

Specified by:
getVersionEffectiveDate in interface CoreUser
Returns:
The version date that the CoreUser is working at.

getConfigurationNamespace

public java.lang.String getConfigurationNamespace()
Return the caller's configuration namespace.

Specified by:
getConfigurationNamespace in interface CoreUser
Returns:
Caller's namespace

getSecurityPrincipal

public java.security.Principal getSecurityPrincipal()
Get the security principal associated with this instance.

Specified by:
getSecurityPrincipal in interface CoreUser
Returns:
The associated security principal - if defined, null otherwise.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from class: Type
Clone this object. This clone method is used by all Type subclasses to handle deep cloning. For the factory to operate correctly it is essential that Types can be deep cloned, as it hangs onto prototyped instances by name and simply clones them when a request is made for an instance of a named type.

Overrides:
clone in class Type
Throws:
java.lang.CloneNotSupportedException - If the type cannot be deep cloned.