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

java.lang.Object
  extended by com.sage.orion.sdata.servlet.BaseServiceOperation
      extended by com.sage.orion.sdata.servlet.accpac.OpenSessionOperation
All Implemented Interfaces:
ServiceOperation
Direct Known Subclasses:
OpenCRMSessionOperation

public class OpenSessionOperation
extends BaseServiceOperation

The OpenSessionOperation class provides the ability to open a session, by extending the BaseServiceOperation class. Construct the class by providing a SystemResourceContext to the constructor.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sage.orion.sdata.servlet.BaseServiceOperation
BaseServiceOperation.FieldData, BaseServiceOperation.FieldNames
 
Field Summary
protected static org.slf4j.Logger LOGGER
           
 
Constructor Summary
OpenSessionOperation(SystemResourceContext context)
          Constructs an instance of the OpenSessionOperation class that will use the provided context for execution.
 
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 requestElement, 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
 java.lang.String getName()
          Get the full name of this service operation, i.e.
protected  java.lang.String getOperationName()
          Get the short name of this service operation, i.e.
protected  java.lang.String getPath()
          Get the URL to this service operation.
protected  void updateSessionMap(SDataRequest request, com.sage.accpac.sm.Session session, com.sage.accpac.sm.Program program, java.lang.String sessionID, java.lang.String programGuid)
          Updates the session map with the given session.
 
Methods inherited from class com.sage.orion.sdata.servlet.BaseServiceOperation
getResponseFields, getSchema, handleRequest, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final org.slf4j.Logger LOGGER
Constructor Detail

OpenSessionOperation

public OpenSessionOperation(SystemResourceContext context)
Constructs an instance of the OpenSessionOperation class that will use the provided context for execution.

Parameters:
context - the context to use when executing
Method Detail

createRequestFields

protected java.util.List<ServiceField> createRequestFields(SDataRequest request)
Description copied from class: BaseServiceOperation
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 java.util.List<ServiceField> createResponseFields(SDataRequest request)
Description copied from class: BaseServiceOperation
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 java.util.List<ServiceField> createTemplateFields(SDataRequest request)
Description copied from class: BaseServiceOperation
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 java.util.List<ServiceField> execute(SDataResourceElement requestElement,
                                               SDataRequest request,
                                               AsyncStatusListener listener)
Description copied from class: BaseServiceOperation
Execute this service operation and then set the value for the response fields, if any.

Specified by:
execute in class BaseServiceOperation
Parameters:
requestElement - 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.

getOperationName

protected java.lang.String getOperationName()
Description copied from class: BaseServiceOperation
Get the short name of this service operation, i.e. the operation name which is not prefixed with resource name(s)

Specified by:
getOperationName in class BaseServiceOperation
Returns:
service operation name

getPath

protected java.lang.String getPath()
Description copied from class: BaseServiceOperation
Get the URL to this service operation.

Specified by:
getPath in class BaseServiceOperation
Returns:
the URL to this service operation

getName

public java.lang.String getName()
Description copied from interface: ServiceOperation
Get the full name of this service operation, i.e. the operation name prefixed with resource name(s) to make it unique in the schema

Returns:
a non-null String containing the full name of the service operation

getDescription

public java.lang.String getDescription()
Description copied from interface: ServiceOperation
Get a description of the service operation, for use in service lists

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

Specified by:
getDescription in interface ServiceOperation
Overrides:
getDescription in class BaseServiceOperation
Returns:
a non-null String containing the description of the service operation

updateSessionMap

protected void updateSessionMap(SDataRequest request,
                                com.sage.accpac.sm.Session session,
                                com.sage.accpac.sm.Program program,
                                java.lang.String sessionID,
                                java.lang.String programGuid)
Updates the session map with the given session.

Parameters:
request - the SDataRequest
session - the Session
program - the Program
sessionID - the session ID
programGuid - the program GUID


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