| Oracle® Web Services Manager Extensibility Guide 10g (10.1.3.1.0) B31010-02 |
|
![]() Previous |
![]() Next |
This chapter contains reference information for the Oracle Web Services Manager (Oracle WSM) Step SDK. The Oracle WSM Step SDK contains the following interfaces and methods:
Interface IStep
Known Implementing Classes
AbstractStep
Declaration
public interface IStep
Description
A step is a basic execution block in the pipelines. A step is a Java Bean that is configured using the Java Beans framework. The AbstractStep class is an abstract class that provides partial implementation of this interface. A step may use resource pooling mechanisms to efficiently handle multiple requests, but it should not keep any per-invocation state.
Table 2-1 Methods of IStep
| Method | Description |
|---|---|
|
setEnabled() |
Enables or disables this step. |
|
getEnabled() |
Gets the boolean value from setEnabled. |
|
setStepName() |
Sets the name of this step. |
|
getStepName() |
Gets the step name. |
|
getAgentContext() |
Gets context information for the policy enforcement point. |
|
setAgentContext() |
Sets the agent context. |
|
execute() |
Executes this step. |
|
init() |
This method is called after the bean is created or after a bean property has changed. |
|
destroy() |
Ensures a clean ending of the step lifecycle. |
|
getFaultCodes() |
Gets the fault codes that are thrown by this step. |
|
setFaultCodes() |
Sets the fault codes that are thrown by this step. |
Declaration
public void setEnabled(boolean enabled)
Description
Enables or disables this step.
Parameters
Enabled: If true, the step is enabled.
Declaration
public boolean getEnabled()
Description
Gets the boolean value from setEnabled.
Returns
One of the boolean values: true or false. If the step is enabled, this method returns the value, true.
Declaration
public void setStepName(java.lang.String stepName)
Description
Sets the name of this step.
Parameters
stepName: Name of the step.
Declaration
public java.lang.String getStepName()
Description
Gets the step name.
Returns
The name of this step.
Declaration
public AgentContext getAgentContext()
Description
Gets context information for policy enforcement point.
Declaration
public void setAgentContext(AgentContext context)
Description
Sets the agent context.
Parameters
context (of type AgentContext): Represents the information of an agent during the pipeline execution.
Declaration
public IResult execute(IMessageContext context)
Throws Fault
Description
Executes this step.
Parameters
context: message context containing the request and response.
Returns
IResult: on successful execution of this method.
Fault: Fault type exception, if it gets thrown.
Declaration
public void init()
throws java.lang.IllegalStateException
Description
This method is called after the bean is created or after a bean property has changed.
Throws
java.lang.IllegalStateException
Declaration
public void destroy()
throws java.lang.IllegalStateException
Description
Use the destroy method to ensure a clean ending of the step lifecycle.
Interface IContext
Subinterfaces
IMessageContext
Declaration
public interface IContext
Description
Information about the pipeline execution context with regard to a component.
Table 2-2 Methods of IContext()
| Method | Description |
|---|---|
|
getProperty() |
Searches for a specific property and returns the value of the property. |
|
getPropertyNames() |
Searches for a specific property or set of properties and returns the name or names of those properties. |
|
containsProperty() |
Checks whether a specified property (propName) exists. |
|
setProperty() |
Sets the value of a specified property (propName). |
|
removeProperty() |
Removes a specified property (propName). |
Declaration
public java.lang.Object getProperty(java.lang.String propName)
Description
Searches for a specific property and returns the value of that property.
Returns
The value for propName.
Declaration
public java.util.Iterator getPropertyNames()
Description
Searches for a specific property or set of properties and returns the name or names.
Declaration
public boolean containsProperty(java.lang.String propName)
Description
Checks for the presence of a specific property.
Returns
One of the boolean values: true or false.
Interface IMessageContext
Declaration
public interface IMessageContext extends IContext
Description
Provides contextual information about messages that the step handles.
All Superinterfaces
IContext
Inheritance from interface com.cfluent.policysteps.sdk.IContext
containsProperty, getProperty, getPropertyNames, removeProperty, setProperty, setProperty.
Table 2-3 IMessageContext() Static Fields
| Field | Description |
|---|---|
|
STAGE_PREREQUEST |
Indicates the prerequest processing stage. |
|
STAGE_REQUEST |
Indicates the request processing stage. |
|
STAGE_RESPONSE |
Indicates the response processing stage. |
|
STAGE_POSTRESPONSE |
Indicates the postresponse processing stage. |
|
STAGE_SERVICE |
Indicates that the message is at service. |
|
STAGE_SERVICE_DEFINITION |
Provides a service definition. |
|
STAGE_SERVICE_WSDL |
Identifies the service WSDL. |
Table 2-4 Methods of IMessageContext()
| Method | Description |
|---|---|
|
getGUID() |
Gets the global unique ID. |
|
getServiceID() |
Identifies the service to where the message is forwarded. |
|
getService URL() |
Gets the remote user, posted with credentials. |
|
getRemoteUser() |
Gets the ID of the service requestor. |
|
getRequestMessage() |
Gets the SOAP request. |
|
getResponseMessage() |
Gets the SOAP response. |
|
setRequestMessage(*) |
Sets the request message. |
|
setResponseMessage() |
Sets the response message. |
|
getProcessingStage() |
Gets the processing stage information. |
|
setProcessingStage() |
Sets the processing stage. |
|
getInvocationStatus() |
Gets the invocation status. |
|
setUserLocale() |
Sets the user locale. The protocol handlers use this method to look for locale information in the message properties and message headers. If the locale information is found, the locale is set. If the locale information is not found, the user locale defaults to the product locale. |
|
getUserLocale() |
Gets the user locale. The policy step implementation code uses the user locale to provide the SOAP faults in the user's specified locale. |
Declaration
public static final java.lang.String STAGE_PREREQUEST
Description
Indicates the prerequest processing stage.
Declaration
public static final java.lang.String STAGE_REQUEST
Description
Indicates the request processing stage.
Declaration
public static final java.lang.String STAGE_RESPONSE
Description
Indicates the response processing stage.
Declaration
public static final java.lang.String STAGE_POSTRESPONSE
Description
Indicates the postresponse processing stage.
Declaration
public static final java.lang.String STAGE_SERVICE
Description
Indicates that the message is at the service.
Declaration
public java.lang.String getGUID()
Description
Gets the global unique ID.
Returns
The global unique ID.
Declaration
public java.lang.String getServiceID()
Description
Identifies the service to where the message is forwarded.
Returns
The ID of the service based on the service registration information in Oracle WSM.
Declaration
public java.lang.String getRemoteUser()
Description
Gets the service URL.
Returns
The service URL for this pipeline.
Declaration
public java.lang.String getRemoteUser()
Description
Gets the ID of the service requestor.
Returns
The ID of the service requestor.
Declaration
public com.cfluent.ccore.message.SOAPMessage getRequestMessage()
Description
Gets the SOAP request.
Returns
The SOAP request message.
Declaration
public com.cfluent.ccore.message.SOAPMessage getResponseMessage()
Description
Gets the SOAP response.
Returns
The SOAP response message.
Declaration
public void setRequestMessage(com.cfluent.ccore.message.SOAPMessage requestMessage)
Description
Sets the request message.
Declaration
public void setResponseMessage(com.cfluent.ccore.message.SOAPMessage responseMessage)
Description
Sets the response message.
Declaration
public java.lang.String getProcessingStage()
Description
Gets the processing stage information.
Returns
The information from the processing stage.
Declaration
public class AgentContext
extends
java.lang.Object
Properties
agentID, resolver, properties.
Description
Provides methods to retrieve and work with agent context information.
Constructor
public AgentContext(java.lang.String agentId,
com.cfluent.common.resource.IResourceResolver resolver,
java.util.Map properties)
throws java.io.IOException
Table 2-5 AgentContext Static Fields
| Field | Description |
|---|---|
|
SERVER_ID |
Component ID. |
|
LOG_LOGBUNDLES |
Bundles for the log. |
|
LOG_LOGENABLED |
Specifies whether logging is enabled. |
|
COREMAN_ENABLED |
Specifies whether the Oracle WSM Monitor is enabled. |
|
POLICYSERVER_ENDPOINT |
Specifies the Oracle WSM Policy Server endpoint. |
|
POLICYSERVER_ENABLED |
Specifies that policy server is enabled. |
|
POLICYPACKS_FILENAME |
Policy packs filename. [Internal code structure filename] |
Table 2-6 Methods of AgentContext
| Method | Description |
|---|---|
|
getAgentID() |
Gets the agent ID as a string. |
|
getProperty() |
Gets the property value for a specified propName. |
|
getStringProperty() |
Gets the value of the specified property. Returns null if the property does not exist. |
|
getIntProperty() |
Gets a property as an integer (primitive). |
|
getResourceResolver() |
Gets the resolver to a resource. The resolver is used to get the absolute path to the resource. |
|
getAllProperties() |
Gets all the properties as a key-value pair. |
Declaration
public static java.lang.String SERVER_ID
Description
Value for the component ID.
Declaration
public static java.lang.String LOG_LOGBUNDLES
Description
Bundles for the log.
Declaration
public static final java.lang.String LOG_LOGENABLED
Description
Property if logging is enabled.
Declaration
public static final java.lang.String COREMAN_ENABLED
Description
Property that specifies that the Oracle WSM Monitor is enabled.
Declaration
public static final java.lang.String POLICYSERVER_ENDPOINT
Description
Property for Oracle WSM Policy Server endpoint.
Declaration
public java.lang.String getAgentID()
Description
Gets the agent ID. The agent ID is configured in the config.xml file and is loaded by the constructor as a property during initialization.
Returns
The agent ID as a string.
Declaration
public java.lang.Object getProperty(java.lang.String propName)
Description
Gets the property value for a specified propName.
Parameters
propName: Name of the property for which the value needs to be retrieved.
Returns
The value of specified property. It returns a null if the property does not exist.
Declaration
public java.lang.String getStringProperty(java.lang.String propName, java.lang.String defaultValue)
Description
Gets the property value as a string.
Parameters
propName: Name of the property for which the value needs to be retrieved.
Returns
The string representation of the value of the property in argument. It returns a null if the property is not available.
Declaration
public int getIntProperty(java.lang.String propName)
Description
Gets a property as an integer (primitive).
Parameters
propName: Name of the property for which the value needs to be retrieved.
Returns
An integer (primitive) value of the property name in the argument.
Declaration
public int getIntProperty(java.lang.String propName, java.lang.string defaultValue)
Description
Fetches the value of a property in the argument.
Parameters
propName: Name of the property for which the value needs to be retrieved.
defaultValue: Default value that is returned if the property is not available.
Returns
The value of the property in the argument. It returns the value if the property exists; returns the default value in the argument, if the property is not available.
com.cfluent.policysteps.sdk.AbstractStep
Declaration
public abstract class AbstractStep
extends
java.lang.Object
implements
IStep
Description
A default implementation of IStep. The implementation should at least override the IStep execute method.
Table 2-7 Methods of AbstractStep
| Method | Description |
|---|---|
|
createResult() |
Called after the bean is created or after a bean property has changed. |
|
setEnabled() |
If set to true, the step is enabled. |
|
getEnabled() |
Returns the value of setEnabled; true if the step is enabled, otherwise false. |
|
setStepName() |
Sets the name of this step. |
|
getStepName() |
Gets the step name. |
|
getAgentContext() |
getAgentContext in interface IStep |
|
setAgentContext() |
Sets the agent context. |
|
execute() |
Throws FaultExecute for this step. Step implementations should override this method to perform desired tasks. |
|
init() |
Throws java.lang.IllegalStateException. This method is called after the bean is created or after a bean property has changed. |
|
getFaultCodes() |
Gets the fault codes thrown by this step. |
|
setFaultCodes() |
Sets the fault codes thrown by this step. |
|
destroy() |
Ensures a clean ending to the step lifecycle. |
|
generateFault() |
Generates faults for this step. |
|
createResult() |
Creates the result for this step. |
Declaration
protected IResult createResult(int status)
Parameters
int status
Description
This method is called after the bean is created or after a bean property has changed.
Declaration
public final void setEnabled(boolean enabled)
Description
Enables or disables this step.
Parameters
boolean enabled
Specified by
setEnabled in interface IStep.
Parameters
enabled: If true, the step is enabled.
Declaration
public final boolean getEnabled()
Description
Checks to see if the step is enabled.
Specified by
getEnabled in interface IStep.
Returns
One of the boolean values: true or false. If the step is enabled, this method returns the value, true
Declaration
public final void setStepName(java.lang.String stepName)
Description
Sets the name of this step.
Specified by
setStepName in interface IStep.
Parameters
stepName: Name of the step.
Declaration
public final java.lang.String getStepName()
Description
Gets the step name.
Specified by
getStepName in interface IStep.
Returns
The name of this step.
Declaration
public final AgentContext getAgentContext()
Description
Retrieves the agent context for the step.
Parameters
context
Specified by
getAgentContext in interface IStep.
Declaration
public final void setAgentContext(AgentContext context)
Description
Sets the agent context.
Specified by
setAgentContext in interface IStep.
Declaration
public abstract IResult execute(IMessageContext messageContext)
Description
Throws a FaultExecute for this step. Step implementations should override this method to perform desired tasks.
Specified by
execute in interface IStep.
Parameters
messageContext: Message context containing the request and response.
Returns
Depending on result of execution, can return IResult or Fault.
Declaration
public void init()
Description
Throws java.lang.IllegalStateException. This method is called after the bean is created or after a bean property has changed.
Specified by
init in interface IStep.
Throws
java.lang.IllegalStateException.
See Also
IManageable
Declaration
protected void generateFault(Fault fault)
Description
Generates faults for this step.
Throws
Fault
Declaration
public void destroy()
throws java.lang.IllegalStateException
Description
Use the destroy method to ensure a clean end of the step lifecycle.
Specified By
init in interface IStep
Declaration
void setFaultCoides(String[] faultCodes)
Description
Sets the fault codes thrown by this step.
Specified By
init in interface IStep
Parameters
faultCodes (of type String[]): Fault codes thrown by the step.
Declaration
public class Result()
extends
java.lang.Object
implements
IResult
Methods Inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll
Constructor
public Result()
Fields Inherited from interface com.cfluent.policysteps.sdk.IResult
FAILED, SUCCEEDED, SUSPENDED
Table 2-9 Methods of Result
| Method | Description |
|---|---|
|
getStatus() |
Gets the execution status. |
|
setStatus() |
Set the execution status. |
|
getFault() |
Returns the fault that caused the request execution failure. |
|
setFault() |
Sets the fault that caused this request execution to fail. The framework sets this fault if all the applicable fault handlers have failed. Step implementations should only call the generateFault method. |
|
toString() |
Result in string form |
Declaration
public int getStatus()
Description
Gets the execution status.
Specified by
getStatus in interface IResult.
Returns
The execution status.
Declaration
public void setStatus(int status)
Description
Sets the execution status.
Specified by
setStatus in interface IResult.
Parameters
status: Sets the execution status.
Declaration
public Fault getFault()
Description
The fault that caused the request execution failure. The framework sets the fault if all the applicable fault handlers have failed.
Specified by
getFault in interface IResult.
Returns
The fault that caused the request failure.
Declaration
public void setFault(Fault fault)
Description
Sets the fault that caused the request execution failure. The framework sets the fault if all the applicable fault handlers have failed. Step implementations should only call the generateFault method.
Specified by
setFault in interface IResult
Parameters
fault
Declaration
public class InvocationStatus
extends
java.lang.Object
Implements
java.io.Serializable
Inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll
Description
This class sends step execution status to the Oracle WSM Monitor. The Oracle WSM Monitor uses this information to interpret measurements.
Constructor
public InvocationStatus()
Table 2-10 Fields of InvocationStatus
| Field | Description |
|---|---|
|
SUCCEEDED |
Invocation Succeeded flag. |
|
FAILED |
Invocation failure flag. |
|
FAILEDOVER |
Failed Over flag. |
|
PENDING |
Measurement or execution pending. |
|
NA |
Object not available. |
Table 2-11 Methods of InvocationStatus
| Method | Description |
|---|---|
|
getServiceName() |
Gets the name of the service being invoked. |
|
setServiceName() |
Sets the service name. |
|
getTime() |
Gets the time. |
|
setTime() |
Sets the time. |
|
getAuthenticationStatus() |
Gets the authentication status. |
|
setAuthenticationStatus() |
Sets the authentication status. |
|
getAuthorizationStatus() |
Gets the authorization status. |
|
setAuthorizationStatus() |
Sets the authorization status. |
|
getServiceStatus() |
Gets the service status. |
|
setServiceStatus() |
Sets the service status. |
|
getInvocationStatus() |
Gets the invocation status. |
|
setInvocationStatus() |
Sets the invocation status. |
|
getSize() |
Gets the size. |
|
setSize() |
Sets the size. |
|
getLatency() |
Gets the default value for overall latency for policy pipelines. |
|
setLatency() |
Sets the value for overall latency. |
|
getServiceLatency() |
Gets the value for service latency in milliseconds. |
|
setServiceLatency() |
Sets the value for service latency in milliseconds. |
|
getFlowID() |
Gets the flow ID. |
|
setFlowID() |
Sets the flow ID. |
|
getMethod() |
Gets the method. |
|
setMethod() |
Sets the method. |
|
getCorrelationContext() |
Gets the correlation. |
|
setCorrelationContext() |
Sets the correlation. |
|
getMessageId() |
Gets the message ID. |
|
setMessageId() |
Sets the message ID. |
|
getErrorMessage() |
Gets the error message for the failure. |
|
setErrorMessage() |
Sets the error message on failure. |
|
toString() |
String representation of the object. |
Declaration
public java.lang.String getServiceName()
Description
Gets the name of the service being invoked.
Returns
The name of the service being invoked.
Declaration
public void setServiceName(java.lang.String name)
Description
Sets the service name.
Declaration
public int getAuthenticationStatus()
Description
Gets the authentication status.
Declaration
public void setAuthenticationStatus(int s)
Description
Sets the authentication status.
Parameters
s
Declaration
public int getAuthorizationStatus()
Description
Gets the authorization status.
Returns
Value for authorization status.
Declaration
public void setAuthorizationStatus(int s)
Description
Sets the authorization status.
Parameters
s
Declaration
public int getServiceStatus()
Description
Gets the service status.
Returns
The value of service status.
Declaration
public void setServiceStatus(int s)
Description
Sets the service status.
Parameters
s
Declaration
public int getInvocationStatus()
Description
Gets the invocation status.
Returns
The value for invocation status.
Declaration
public void setInvocationStatus(int s)
Description
Sets the invocation status.
Parameters
s
Declaration
public int getLatency()
Description
Gets the default value for overall latency used for policy pipelines.
Returns
The value for overall latency.
Declaration
public void setLatency(int l)
Description
Sets the value for overall latency.
Parameters
int l
Declaration
public int getServiceLatency()
Description
Gets the service only latency.
Returns
The value for service latency (in milliseconds).
See Also
getLatency()
Declaration
public void setServiceLatency(int l)
Description
Sets the value for service latency (in milliseconds).
Declaration
public java.lang.String getFlowID()
Description
Gets the flow ID.
Returns
The value for flow ID.
Declaration
public void setFlowID(java.lang.String flowid)
Description
Sets the flow ID.
Parameters
flowid (Flow ID passed)
Declaration
public java.lang.String getMethod()
Description
Finds and returns the method on the service.
Returns
The method on the service.
Declaration
public void setMethod(java.lang.String inMethod)
Description
Sets the method.
Parameters
inMethod
Declaration
public java.lang.String getCorrelationContext()
Description
Gets the correlation.
Declaration
public void setCorrelationContext(java.lang.String inCorrelationContext)
Description
Sets the correlation.
Parameters
inCorrelationContext
Declaration
public void setMessageId(java.lang.String inMessageId)
Description
Sets the message ID.
Parameters
inMessageId
Declaration
public java.lang.String getErrorMessage()
Description
Gets the associated error message for the failure.