com.oakgrovesystems.reactor.requests
Class CloneInstance

java.lang.Object
  |
  +--com.oakgrovesystems.reactor.requests.ReactorRequest
        |
        +--com.oakgrovesystems.reactor.requests.CloneInstance
All Implemented Interfaces:
java.io.Serializable

public class CloneInstance
extends ReactorRequest

A request to create an instance of a Process definition. The instance can then be immediately started or modified or configured and then started.

See Also:
Serialized Form

Field Summary
static java.lang.String CLONE_LABEL_PARM_NAME
          The name of the request parameter that is the new label to give to the clone.
static java.lang.String ID_PARM_NAME
          The name of the request parameter that is the id of the Process to clone.
static java.lang.String LABEL_PATH_PARM_NAME
          The name of the request parameter that is the label path of the Process to clone.
static java.lang.String REQUEST_TYPE
          The request type of CloneInstance requests.
 
Fields inherited from class com.oakgrovesystems.reactor.requests.ReactorRequest
operandOutputter, policyOutputter, processOutputter, statusOutputter
 
Constructor Summary
CloneInstance()
          Creates a CloneInstance request without specifying the authentication token to use to make the request.
CloneInstance(java.lang.String authToken)
          Creates a CloneInstance request that will use the specified authentication token
 
Method Summary
protected  org.jdom.Element createRtnValXML(com.oakgrovesystems.reactor.ReactorResponse res, com.oakgrovesystems.reactor.IdToLabelPathMapper mapper)
          This (superclass) implementation simply returns null, which is perfect for requests that don't have return values.
 java.lang.String getCloneLabel()
          returns the new label to give to the clone
 com.oakgrovesystems.reactor.ReactorObjectId getProcessId()
          returns the id of the object to clone
 com.oakgrovesystems.reactor.LabelPath getProcessLabelPath()
          returns the label path of the object to clone
protected  java.util.List paramsToXML()
          Returns a List of Elements representing the parameters of the request
protected  void parseParameters(org.jdom.Element params, com.oakgrovesystems.reactor.LabelPathToIdMapper mapper)
          Configures the parameters from the XML representation
protected  com.oakgrovesystems.reactor.ReactorResponse parseReturnValues(org.jdom.Element returnValues)
           
 void setCloneLabel(java.lang.String newLabel)
          Specifies the new label to give to the clone
 void setProcessId(com.oakgrovesystems.reactor.ReactorObjectId id)
          Specifies the id of the object to clone.
 void setProcessLabelPath(com.oakgrovesystems.reactor.LabelPath lp)
          Specifies the label path of the object to clone.
 
Methods inherited from class com.oakgrovesystems.reactor.requests.ReactorRequest
configureFromXML, configureFromXML, createResponseXML, createResponseXML, createReturnValuesElem, getAuthToken, getLabelPath, getObjectId, getParameter, getParameter, getParameterNames, getRequestType, makeAuthTokenXML, makeObjectElement, makeOperandElement, makePolicyElement, makeProcessElement, makeReferenceElement, makeStatusElement, parseResponse, send, sendAsXML, sendViaHttp, setAuthToken, setParameter, setRequestType, toString, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID_PARM_NAME

public static final java.lang.String ID_PARM_NAME
The name of the request parameter that is the id of the Process to clone.

See Also:
Constant Field Values

LABEL_PATH_PARM_NAME

public static final java.lang.String LABEL_PATH_PARM_NAME
The name of the request parameter that is the label path of the Process to clone.

See Also:
Constant Field Values

CLONE_LABEL_PARM_NAME

public static final java.lang.String CLONE_LABEL_PARM_NAME
The name of the request parameter that is the new label to give to the clone.

See Also:
Constant Field Values

REQUEST_TYPE

public static final java.lang.String REQUEST_TYPE
The request type of CloneInstance requests. Used as a parameter to setRequestType() in the instance initializer.

See Also:
Constant Field Values
Constructor Detail

CloneInstance

public CloneInstance()
Creates a CloneInstance request without specifying the authentication token to use to make the request. setAuthToken() must be called before the request can be sent successfully.


CloneInstance

public CloneInstance(java.lang.String authToken)
Creates a CloneInstance request that will use the specified authentication token

Parameters:
authToken - the authentication token to use to make the request
Method Detail

setProcessId

public void setProcessId(com.oakgrovesystems.reactor.ReactorObjectId id)
Specifies the id of the object to clone. Calling this method with a non-null parameter has the side effect of calling setLabelPath with a null parameter.

Parameters:
id - the id of the object to clone

getProcessId

public com.oakgrovesystems.reactor.ReactorObjectId getProcessId()
returns the id of the object to clone

Returns:
the id of the object to clone

setProcessLabelPath

public void setProcessLabelPath(com.oakgrovesystems.reactor.LabelPath lp)
Specifies the label path of the object to clone. Calling this method with a non-null parameter has the side effect of calling setId with a null parameter.

Parameters:
lp - the label path of the object to clone

getCloneLabel

public java.lang.String getCloneLabel()
returns the new label to give to the clone

Returns:
the new label to give to the clone

setCloneLabel

public void setCloneLabel(java.lang.String newLabel)
Specifies the new label to give to the clone

Parameters:
newLabel - the new label to give to the clone

getProcessLabelPath

public com.oakgrovesystems.reactor.LabelPath getProcessLabelPath()
returns the label path of the object to clone

Returns:
the label path of the object to clone

parseParameters

protected void parseParameters(org.jdom.Element params,
                               com.oakgrovesystems.reactor.LabelPathToIdMapper mapper)
                        throws FailedRequestException
Description copied from class: ReactorRequest
Configures the parameters from the XML representation

Specified by:
parseParameters in class ReactorRequest
Parameters:
params - the 'parameters' Element of the request
Throws:
FailedRequestException - if the parameters can't be configured from the XML.

createRtnValXML

protected org.jdom.Element createRtnValXML(com.oakgrovesystems.reactor.ReactorResponse res,
                                           com.oakgrovesystems.reactor.IdToLabelPathMapper mapper)
                                    throws FailedRequestException
Description copied from class: ReactorRequest
This (superclass) implementation simply returns null, which is perfect for requests that don't have return values. Subclass implementations should override this method if they have return values. This method should return a 'return_values' Element or null if there are no return values. A precondition of this method is that the ReactorResponse parameter is not a failure.

Overrides:
createRtnValXML in class ReactorRequest
Parameters:
res - the ReactorResponse to translate to XML.
mapper - object to convert IDs to label paths in return values
Returns:
the XML representation of the return values
Throws:
FailedRequestException - if the return values Element can't be created

paramsToXML

protected java.util.List paramsToXML()
                              throws FailedRequestException
Description copied from class: ReactorRequest
Returns a List of Elements representing the parameters of the request

Specified by:
paramsToXML in class ReactorRequest
Returns:
a List of Elements representing the parameters of the request
FailedRequestException

parseReturnValues

protected com.oakgrovesystems.reactor.ReactorResponse parseReturnValues(org.jdom.Element returnValues)
                                                                 throws FailedRequestException
Specified by:
parseReturnValues in class ReactorRequest
FailedRequestException


Copyright (c) 1999-2004 Oak Grove Systems. All Rights Reserved.