|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sage.orion.sdata.servlet.BaseServiceOperation
public abstract class BaseServiceOperation
An abstract class that provides an adapter for the ServiceOperation
interface.
Each subclass must implement the following abstract methods:
createRequestFields(SDataRequest)
createResponseFields(SDataRequest)
createTemplateFields(SDataRequest)
execute(SDataResourceElement, SDataRequest, AsyncStatusListener)
ServiceOperation.getName()
the name combined with the resource names to make it
unique in the contract
getOperationName()
the name of the operation
Nested Class Summary | |
---|---|
protected static class |
BaseServiceOperation.FieldData
The set of field data complete with methods to retrieve it based upon FieldNames |
protected static class |
BaseServiceOperation.FieldNames
The pair of field name and description. |
Constructor Summary | |
---|---|
BaseServiceOperation()
|
Method Summary | |
---|---|
protected abstract java.util.List<ServiceField> |
createRequestFields(SDataRequest request)
Create a list of input fields for Request. |
protected abstract java.util.List<ServiceField> |
createResponseFields(SDataRequest request)
Create a list of output fields for Response. |
protected abstract java.util.List<ServiceField> |
createTemplateFields(SDataRequest request)
Create a list of fields for Template. |
protected abstract java.util.List<ServiceField> |
execute(SDataResourceElement payload,
SDataRequest request,
AsyncStatusListener listener)
Execute this service operation and then set the value for the response fields, if any. |
java.lang.String |
getDescription()
Get a description of the service operation, for use in service lists |
protected abstract java.lang.String |
getOperationName()
Get the short name of this service operation, i.e. |
protected abstract java.lang.String |
getPath()
Get the URL to this service operation. |
protected java.util.List<ServiceField> |
getResponseFields(SDataRequest request,
java.lang.String... values)
Creates the list of response fields populated with the data provided. |
SDataSchema |
getSchema(SDataRequest request)
Returns the schema of the operation, based upon its properties |
ResourceResponse |
handleRequest(SDataRequest request,
AsyncStatusListener listener)
Handle the request |
void |
shutdown()
Release any resources allocated for this service operation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sage.orion.sdata.servlet.ServiceOperation |
---|
getName |
Constructor Detail |
---|
public BaseServiceOperation()
Method Detail |
---|
public java.lang.String getDescription()
ServiceOperation
It defaults to the full name of this service operation, i.e. the operation name prefixed with resource name(s)
The description should be in the language required by the user
getDescription
in interface ServiceOperation
String
containing the description of the
service operationpublic ResourceResponse handleRequest(SDataRequest request, AsyncStatusListener listener)
ServiceOperation
handleRequest
in interface ServiceOperation
request
- the SDataRequestlistener
- the asynchronous status listener that will listen for events and
status from the service operation
public void shutdown()
ServiceOperation
shutdown
in interface ServiceOperation
protected abstract java.lang.String getOperationName()
protected abstract java.lang.String getPath()
protected abstract java.util.List<ServiceField> createRequestFields(SDataRequest request)
Note that value for each field may not be initialized.
request
- the SDataRequest, or null
protected abstract java.util.List<ServiceField> createResponseFields(SDataRequest request)
Note that value for each field may not be initialized.
request
- the SDataRequest, or null
protected abstract java.util.List<ServiceField> createTemplateFields(SDataRequest request)
The list must be the same as (or a subset of) request fields and each field has been initialized with default value
request
- the SDataRequest
protected abstract java.util.List<ServiceField> execute(SDataResourceElement payload, SDataRequest request, AsyncStatusListener listener)
payload
- the request (input) portion of the payload from the original
SData requestrequest
- the SDataRequestlistener
- the AsyncStatusListener
protected final java.util.List<ServiceField> getResponseFields(SDataRequest request, java.lang.String... values)
request
- the SDataRequestvalues
- the list of values to add to the list, in the order they are
specified in the createResponseFields(SDataRequest)
list.
public SDataSchema getSchema(SDataRequest request)
request
- the SDataRequest, or null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |