com.sage.orion.sdata.servlet.accpac
Class IsDirtyOperation

java.lang.Object
  extended by com.sage.orion.sdata.servlet.BaseServiceOperation
      extended by com.sage.orion.sdata.servlet.accpac.BaseService
          extended by com.sage.orion.sdata.servlet.accpac.IsDirtyOperation
All Implemented Interfaces:
ServiceOperation

public class IsDirtyOperation
extends BaseService

A service operation for finding out whether the view tied to a resource has uncommitted changes or not.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sage.orion.sdata.servlet.BaseServiceOperation
BaseServiceOperation.FieldData, BaseServiceOperation.FieldNames
 
Constructor Summary
IsDirtyOperation(ApplicationContext applicationContext, ResourceContextImpl resourceContext, Resource resource, Service service, SDataViewSet viewSet)
          Constructor
 
Method Summary
protected  java.util.List<ServiceField> createRequestFields(SDataRequest request)
          Create a list of input fields for Request.
protected  java.util.List<ServiceField> createResponseFields(SDataRequest request)
          Create a list of output fields for Response.
protected  java.util.List<ServiceField> createTemplateFields(SDataRequest request)
          Create a list of fields for Template.
protected  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.
protected  java.lang.String getOperationName()
          Get the short name of this service operation, i.e.
protected  boolean isDirty(SDataRequest request)
          Return the dirty status for the resource
 
Methods inherited from class com.sage.orion.sdata.servlet.accpac.BaseService
getApplicationContext, getName, getPath, getResource, getResourceContext, getService, getViewSet, isForMetaDataInquiry
 
Methods inherited from class com.sage.orion.sdata.servlet.BaseServiceOperation
getDescription, getResponseFields, getSchema, handleRequest, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IsDirtyOperation

public IsDirtyOperation(ApplicationContext applicationContext,
                        ResourceContextImpl resourceContext,
                        Resource resource,
                        Service service,
                        SDataViewSet viewSet)
Constructor

Parameters:
applicationContext - the ApplicationContext in which the service operation will be run
resourceContext - the ResourceContextImpl in which the service operation will be run
resource - the Resource on which the service operation will be performed
service - the Service to be performed. Could be null
viewSet - the SDataViewSet associated with the resource. Could be null
Method Detail

createRequestFields

protected final java.util.List<ServiceField> createRequestFields(SDataRequest request)
Create a list of input fields for Request.

Note that value for each field may not be initialized.

Specified by:
createRequestFields in class BaseServiceOperation
Parameters:
request - the SDataRequest, or null
Returns:
a list of service fields for Request, or return null or an empty list if no input fields are required.

createResponseFields

protected final java.util.List<ServiceField> createResponseFields(SDataRequest request)
Create a list of output fields for Response.

Note that value for each field may not be initialized.

Specified by:
createResponseFields in class BaseServiceOperation
Parameters:
request - the SDataRequest, or null
Returns:
a list of service fields for Response, or return null or an empty list if there are no output fields.

createTemplateFields

protected final java.util.List<ServiceField> createTemplateFields(SDataRequest request)
Create a list of fields for Template.

The list must be the same as (or a subset of) request fields and each field has been initialized with default value

Specified by:
createTemplateFields in class BaseServiceOperation
Parameters:
request - the SDataRequest
Returns:
a list of service fields for Template, or return null or an empty list if there are no such fields.

execute

protected final 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.

Specified by:
execute in class BaseServiceOperation
Parameters:
payload - the request (input) portion of the payload from the original SData request
request - the SDataRequest
listener - the AsyncStatusListener
Returns:
a list of service fields for response, or return null or an empty list if there are no output fields.

isDirty

protected boolean isDirty(SDataRequest request)
Return the dirty status for the resource

Parameters:
request - the SDataRequest
Returns:
true if the resource has uncommitted changes. otherwise false.

getOperationName

protected final java.lang.String getOperationName()
Get the short name of this service operation, i.e. the operation name which is not prefixed with resource name(s)

Overrides:
getOperationName in class BaseService
Returns:
service operation name


Copyright © 2011 Sage Software, Inc. All rights reserved.