com.pega.pegarules.pub.services
Interface ServiceInterface


public interface ServiceInterface

ServiceInterface simply provides wrapper methods for all public methods of ServiceAPI. The purpose is to expose a fixed set of API methods in the public interface.

Version:
$Revision: 30777 $ $Date: 2012-07-09 11:20:52 -0400 (Mon, 09 Jul 2012) $
Author:
Denise LaCombe

Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String EXECUTION_MODE_ASYNC
           
static java.lang.String EXECUTION_MODE_ASYNC_ONEWAY
           
static java.lang.String EXECUTION_MODE_SYNC
           
static java.lang.String VERSION
           
 
Method Summary
 void activateRequestor(java.lang.Object aPassivatedContext)
          Activate the requestor used to process the service request.
 void addRequestAttachment(java.lang.String aKey, java.lang.String aVal)
          Add request attachment values for the service to interpret.
 void addRequestParameter(java.lang.Object aVal)
          Add a request parameter value for the service to interpret.
 void addRequestParameters(java.util.List aList)
          Add request parameter values for the service to interpret.
 void closeRequestor()
          Finalize the requestor used to process the service request.
 java.lang.String getErrorMessage()
          Get the service error message following a service failure.
 java.lang.Throwable getExceptionObject()
          Retrieve service exception object following a service failure.
 java.lang.String getRequestorId()
          Get the service requestor ID value.
 int getResponseHeaderCount()
          Get the number of response header values.
 java.util.Iterator getResponseHeaderKeys()
          Get the list of response header keys.
 java.lang.String getResponseHeaderValue(java.lang.String aKey)
          Get the specified response header value.
 int getResponseParameterCount()
          Get the number of response parameter values.
 int getResponseParameterLength(int aIndex)
          Get the specified response parameter length.
 java.util.Iterator getResponseParameterLengths()
          Get the list of response parameter lengths.
 java.lang.String getResponseParameterName(int aIndex)
          Get the specified response parameter name.
 java.util.Iterator getResponseParameterNames()
          Get the list of response parameter names.
 int getResponseParameterOffset(int aIndex)
          Get the specified response parameter offset.
 java.util.Iterator getResponseParameterOffsets()
          Get the list of response parameter offsets.
 java.lang.String getResponseParameterType(int aIndex)
          Get the specified response parameter type.
 java.util.Iterator getResponseParameterTypes()
          Get the list of response parameter types.
 java.lang.Object getResponseParameterValue(int aIndex)
          Get the specified response parameter value.
 java.util.Iterator getResponseParameterValues()
          Get the list of response parameter values.
 int getResponsePropertyCount()
          Get the number of response property values.
 java.util.Iterator getResponsePropertyKeys()
          Get the list of response property keys.
 java.lang.Object getResponsePropertyValue(java.lang.String aKey)
          Get the specified response property value.
 java.lang.String getResponseType()
          Get the response type identifier specified by the service rule.
 java.lang.String getServiceClass()
          Get the service class name.
 java.lang.String getServiceMethod()
          Get the service method name.
 java.lang.String getServicePackage()
          Get the service package name.
 java.lang.String getServiceType()
          Get the service type value.
 java.lang.Object passivateRequestor()
          Passivate the requestor used to process the service request.
 void processRequest()
          Perform service request processing.
 boolean requestorIsValid()
          Deprecated. Check if the cached requestor ID value is still valid
 void setCredentials(java.lang.String aUserName, java.lang.String aPassword)
          Set the username and password credentials for the service.
 void setInitialParameters(java.util.HashMap aInitParams)
          Set initialization parameters.
 void setRequestHeader(java.lang.String aKey, java.lang.String aVal)
          Set a request header value for the service to interpret.
 void setRequestorId(java.lang.String aRequestorId)
          Set the service requestor ID value.
 void setRequestProperty(java.lang.String aKey, java.lang.Object aVal)
          Set a request property value for the service to interpret.
 void setServiceClass(java.lang.String aServiceClass)
          Set the service class name.
 void setServiceMethod(java.lang.String aServiceMethod)
          Set the service method name.
 void setServicePackage(java.lang.String aServicePackage)
          Set the service package name.
 void setServiceType(java.lang.String aServiceType)
          Set the service type value.
 void setTransacted(boolean isTransacted)
          Specify whether the requestor should perform database actions (commit or rollback) after processing a service request.
 boolean statusIsGood()
          Check the status of a completed service request.
 

Field Detail

COPYRIGHT

static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

static final java.lang.String VERSION
See Also:
Constant Field Values

EXECUTION_MODE_ASYNC

static final java.lang.String EXECUTION_MODE_ASYNC
See Also:
Constant Field Values

EXECUTION_MODE_ASYNC_ONEWAY

static final java.lang.String EXECUTION_MODE_ASYNC_ONEWAY
See Also:
Constant Field Values

EXECUTION_MODE_SYNC

static final java.lang.String EXECUTION_MODE_SYNC
See Also:
Constant Field Values
Method Detail

setServiceType

void setServiceType(java.lang.String aServiceType)
Set the service type value. The value must be one of the service rule subclasses (e.g. 'SOAP', 'EJB'). This method must be called before calling processRequest.

Parameters:
aServiceType - the service type value

getServiceType

java.lang.String getServiceType()
Get the service type value.

Returns:
the service type value

setServicePackage

void setServicePackage(java.lang.String aServicePackage)
Set the service package name. The value must match the Service Package key of the service rule instance. This method must be called before calling processRequest.

Parameters:
aServicePackage - the service package name

getServicePackage

java.lang.String getServicePackage()
Get the service package name.

Returns:
the service package name

setServiceClass

void setServiceClass(java.lang.String aServiceClass)
Set the service class name. The value must match the Service Class key of the service rule instance. This method must be called before calling processRequest.

Parameters:
aServiceClass - the service class name

getServiceClass

java.lang.String getServiceClass()
Get the service class name.

Returns:
the service class name

setServiceMethod

void setServiceMethod(java.lang.String aServiceMethod)
Set the service method name. The value must match the Service Method key of the service rule instance. This method must be called before calling processRequest.

Parameters:
aServiceMethod - the service method name

getServiceMethod

java.lang.String getServiceMethod()
Get the service method name.

Returns:
the service method name

setInitialParameters

void setInitialParameters(java.util.HashMap aInitParams)
Set initialization parameters. The HashMap may contain configuration data such as the authentication protocol. This method must be called before calling processRequest.

Parameters:
aInitParams - HashMap of initialization parameter values

setCredentials

void setCredentials(java.lang.String aUserName,
                    java.lang.String aPassword)
Set the username and password credentials for the service. This method must be called before calling processRequest.

Parameters:
aUserName - the username value
aPassword - the password value, un-encrypted

setTransacted

void setTransacted(boolean isTransacted)
Specify whether the requestor should perform database actions (commit or rollback) after processing a service request. This method must be called before calling processRequest.

Parameters:
isTransacted - flag for performing database actions

setRequestHeader

void setRequestHeader(java.lang.String aKey,
                      java.lang.String aVal)
Set a request header value for the service to interpret. The key must match the header name specified in the service rule instance. This method must be called before calling processRequest.

Parameters:
aKey - the key of the request header value
aVal - the request header value

setRequestProperty

void setRequestProperty(java.lang.String aKey,
                        java.lang.Object aVal)
Set a request property value for the service to interpret. The key must match the property name specified in the service rule instance. This method must be called before calling processRequest.

Parameters:
aKey - the key of the request property value
aVal - the request property value

addRequestParameter

void addRequestParameter(java.lang.Object aVal)
Add a request parameter value for the service to interpret. The number and types of the request parameter values must match what is specified in the service rule instance. This method must be called before calling processRequest.

Parameters:
aVal - the request parameter value

addRequestParameters

void addRequestParameters(java.util.List aList)
Add request parameter values for the service to interpret. The number and types of the request parameter values must match what is specified in the service rule instance. This method must be called before calling processRequest.

Parameters:
aList - a list of request parameter values

addRequestAttachment

void addRequestAttachment(java.lang.String aKey,
                          java.lang.String aVal)
Add request attachment values for the service to interpret. The attachment values are placed on the clipboard on a page of type Data-ServiceMessage named 'pyAttachmentPage'. This method must be called before calling processRequest.

Parameters:
aKey - the key of the request attachment value
aVal - the request attachment value

processRequest

void processRequest()
Perform service request processing.


statusIsGood

boolean statusIsGood()
Check the status of a completed service request. Call this method after calling processRequest, to determine if any processing failures were encountered.

Returns:
true if the service completed successfully, false otherwise.

getErrorMessage

java.lang.String getErrorMessage()
Get the service error message following a service failure. Call this method if the statusIsGood method returns false, to retrieve an explanation of the service failure.

Returns:
the error message string.

getExceptionObject

java.lang.Throwable getExceptionObject()
Retrieve service exception object following a service failure. Call this method if the statusIsGood method returns false, to retrieve the exception that caused the service failure.

Returns:
the exception object.

getResponseType

java.lang.String getResponseType()
Get the response type identifier specified by the service rule. This method must be called after calling processRequest.

Returns:
the response type value

getResponseHeaderCount

int getResponseHeaderCount()
Get the number of response header values. This method must be called after calling processRequest.

Returns:
the number of response header values

getResponseHeaderKeys

java.util.Iterator getResponseHeaderKeys()
Get the list of response header keys. This method must be called after calling processRequest.

Returns:
an Iterator of response header keys

getResponseHeaderValue

java.lang.String getResponseHeaderValue(java.lang.String aKey)
Get the specified response header value. The key must match the header name specified in the service rule instance. This method must be called after calling processRequest.

Parameters:
aKey - the key of the response header value
Returns:
the specified response header value

getResponsePropertyCount

int getResponsePropertyCount()
Get the number of response property values. This method must be called after calling processRequest.

Returns:
the number of response property values

getResponsePropertyKeys

java.util.Iterator getResponsePropertyKeys()
Get the list of response property keys. This method must be called after calling processRequest.

Returns:
an Iterator of response property keys

getResponsePropertyValue

java.lang.Object getResponsePropertyValue(java.lang.String aKey)
Get the specified response property value. The key must match the property name specified in the service rule instance. This method must be called after calling processRequest.

Parameters:
aKey - the key of the response property value
Returns:
the specified response property value

getResponseParameterCount

int getResponseParameterCount()
Get the number of response parameter values. This method must be called after calling processRequest.

Returns:
the number of response parameter values

getResponseParameterValue

java.lang.Object getResponseParameterValue(int aIndex)
Get the specified response parameter value. The index must match the row number of the parameter specified in the service rule instance. This method must be called after calling processRequest.

Parameters:
aIndex - the index of the response parameter value
Returns:
the specified response parameter value

getResponseParameterValues

java.util.Iterator getResponseParameterValues()
Get the list of response parameter values. This method must be called after calling processRequest.

Returns:
an Iterator of response parameter values

getResponseParameterName

java.lang.String getResponseParameterName(int aIndex)
Get the specified response parameter name. The index must match the row number of the parameter specified in the service rule instance. This method must be called after calling processRequest.

Parameters:
aIndex - the index of the response parameter name
Returns:
the specified response parameter name

getResponseParameterNames

java.util.Iterator getResponseParameterNames()
Get the list of response parameter names. This method must be called after calling processRequest.

Returns:
an Iterator of response parameter names

getResponseParameterType

java.lang.String getResponseParameterType(int aIndex)
Get the specified response parameter type. The index must match the row number of the parameter specified in the service rule instance. This method must be called after calling processRequest.

Parameters:
aIndex - the index of the response parameter type
Returns:
the specified response parameter type

getResponseParameterTypes

java.util.Iterator getResponseParameterTypes()
Get the list of response parameter types. This method must be called after calling processRequest.

Returns:
an Iterator of response parameter types

getResponseParameterOffset

int getResponseParameterOffset(int aIndex)
Get the specified response parameter offset. The index must match the row number of the parameter specified in the service rule instance. This method must be called after calling processRequest.

Parameters:
aIndex - the index of the response parameter offset
Returns:
the specified response parameter offset

getResponseParameterOffsets

java.util.Iterator getResponseParameterOffsets()
Get the list of response parameter offsets. The list contains java.lang.Integer instances. This method must be called after calling processRequest.

Returns:
an Iterator of response parameter offsets

getResponseParameterLength

int getResponseParameterLength(int aIndex)
Get the specified response parameter length. The index must match the row number of the parameter specified in the service rule instance. This method must be called after calling processRequest.

Parameters:
aIndex - the index of the response parameter length
Returns:
the specified response parameter length

getResponseParameterLengths

java.util.Iterator getResponseParameterLengths()
Get the list of response parameter lengths. The list contains java.lang.Integer instances. This method must be called after calling processRequest.

Returns:
an Iterator of response parameter lengths

setRequestorId

void setRequestorId(java.lang.String aRequestorId)
Set the service requestor ID value. This method must be called before calling processRequest.

Parameters:
aRequestorId - the service requestor ID value

getRequestorId

java.lang.String getRequestorId()
Get the service requestor ID value. This method should be called after calling processRequest.

Returns:
the service requestor ID value

requestorIsValid

boolean requestorIsValid()
Deprecated. Check if the cached requestor ID value is still valid

Returns:
true if the requestor ID is valid, false otherwise

passivateRequestor

java.lang.Object passivateRequestor()
Passivate the requestor used to process the service request.

Returns:
context data for activating the requestor

activateRequestor

void activateRequestor(java.lang.Object aPassivatedContext)
Activate the requestor used to process the service request.

Parameters:
aPassivatedContext - context data for activating the requestor

closeRequestor

void closeRequestor()
Finalize the requestor used to process the service request.



Copyright © 2012 Pegasystems Inc. All Rights Reserved.