Oracle® Web Services Manager Extensibility Guide 10g (10.1.3.3.0) Part Number E10300-01 |
|
|
View PDF |
This chapter contains reference information for the Oracle Web Services Manager (Oracle WSM) Step Software Development Kit (SDK). The Oracle WSM Step SDK contains the following interfaces and classes:
Interface IStep
Known Implementing Classes
AbstractStep
Declaration
public interface IStep
Description
A step is a basic execution block in the pipeline. 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 3-1 Methods of IStep
Method | Description |
---|---|
|
Enables or disables this step. |
|
Gets the boolean value from setEnabled. |
|
Sets the name of this step. |
|
Gets the step name. |
|
Gets context information for the policy enforcement point. |
|
Sets the agent context. |
|
Executes this step. |
|
This method is called after the Java bean is created or after a Java bean property has changed. |
|
Ensures a clean ending to the step lifecycle. |
|
Gets the fault codes that are thrown by this step. |
|
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 Java bean is created or after a Java 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 to the step lifecycle.
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 3-2 Methods of AbstractStep
Method | Description |
---|---|
|
Called after the Java bean is created or after a Java bean property has changed. |
|
If set to true, the step is enabled. |
|
Returns the value of setEnabled; true if the step is enabled, otherwise false. |
|
Sets the name of this step. |
|
Gets the step name. |
|
|
|
Sets the agent context. |
|
Throws |
|
Throws |
|
Gets the fault codes thrown by this step. |
|
Sets the fault codes thrown by this step. |
|
Ensures a clean ending to the step lifecycle. |
|
Generates faults for this step. |
|
Creates the result for this step. |
Declaration
protected IResult createResult(int status)
Parameters
int
status
Description
This method is called after the Java bean is created or after a Java 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
Executes the 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 Java bean is created or after a Java bean property has changed.
Specified by
init
in interface IStep
.
Throws
java.lang.IllegalStateException
.
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 to the step lifecycle.
Specified By
destroy
in interface IStep
.
Declaration
void setFaultCodes(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.
Interface
IContext
Subinterfaces
IMessageContext
Declaration
public interface IContext
Description
Information about the pipeline execution context with regard to a component.
Table 3-4 Methods of IContext()
Method | Description |
---|---|
|
Searches for a specific property and returns the value of the property ( |
|
Returns an iterator on all the property names. |
|
Checks whether a specified property ( |
|
Sets the value of a specified property ( |
|
Removes a specified property ( |
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
Returns an iterator on all the property 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 3-5 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 the service stage. |
STAGE_SERVICE_DEFINITION |
Provides a Web service definition. |
STAGE_SERVICE_WSDL |
Identifies the Web service WSDL. |
Table 3-6 Methods of IMessageContext()
Method | Description |
---|---|
|
Gets the global unique ID. |
|
Gets the service ID. |
|
Gets the service URL. |
|
Gets the remote user. |
|
Gets the SOAP request. |
|
Gets the SOAP response. |
|
Sets the request message. |
|
Sets the response message. |
|
Gets the processing stage information. |
|
Sets the processing stage. |
|
Gets the invocation status. |
|
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. |
|
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
Gets the service ID.
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
Gets the remote user.
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 IResult()
extends
java.lang.Object
Methods Inherited from class java.lang.Object
clone
, equals
, finalize
, getClass
, hashCode
, notify
, notifyAll
Constructor
public Result()
Table 3-7 Methods of IResult
Method | Description |
---|---|
|
Gets the execution status. |
|
Set the execution status. |
|
Returns the fault that caused the request execution failure. |
|
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 |
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 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 3-8 Methods of Result
Method | Description |
---|---|
|
Gets the execution status. |
|
Set the execution status. |
|
Returns the fault that caused the request execution failure. |
|
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. |
|
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 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 3-9 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 Manager endpoint. |
POLICYSERVER_ENABLED |
Specifies that the Oracle WSM Policy Manager is enabled. |
POLICYPACKS_FILENAME |
Policy packs file name (internal property). |
Table 3-10 Methods of AgentContext
Method | Description |
---|---|
|
Gets the agent ID as a string. |
|
Gets the property value for a specified propName. |
|
Gets the value of the specified property. Returns null if the property does not exist. |
|
Gets a property as an integer (primitive). |
|
Gets the resolver to a resource. The resolver is used to get the absolute path to the resource. |
|
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 Manager 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.
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 3-11 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 3-12 Methods of InvocationStatus
Method | Description |
---|---|
|
Gets the name of the service being invoked. |
|
Sets the service name. |
|
Gets the time. |
|
Sets the time. |
|
Gets the authentication status. |
|
Sets the authentication status. |
|
Gets the authorization status. |
|
Sets the authorization status. |
|
Gets the service status. |
|
Sets the service status. |
|
Gets the invocation status. |
|
Sets the invocation status. |
|
Gets the size. |
|
Sets the size. |
|
Gets the default value for overall latency for policy pipelines. |
|
Sets the value for overall latency. |
|
Gets the value for service latency in milliseconds. |
|
Sets the value for service latency in milliseconds. |
|
Gets the flow ID. |
|
Sets the flow ID. |
|
Gets the method. |
|
Sets the method. |
|
Gets the correlation. |
|
Sets the correlation. |
getMessageId() |
Gets the message ID. |
|
Sets the message ID. |
|
Gets the error message for the failure. |
|
Sets the error message on failure. |
|
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
– Value for authorization status.
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
– Value for authorization status.
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
– Value for service status.
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
– Value for invocation status.
Declaration
public void setSize(int s)
Description
Sets the size.
Parameters
s
– The value of size.
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
l
– The value for overall latency.
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
– A string representing the flow ID.
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
– The WSDL operation.
Declaration
public java.lang.String getCorrelationContext()
Description
Gets the correlation.
Declaration
public void setCorrelationContext(java.lang.String inCorrelationContext)
Description
Sets the correlation.
Parameters
inCorrelationContext
– The correlation context string.
Declaration
public void setMessageId(java.lang.String inMessageId)
Description
Sets the message ID.
Parameters
inMessageId
– The message ID string.
Declaration
public java.lang.String getErrorMessage()
Description
Gets the associated error message for the failure.
Declaration
public class Fault extends BaseException
Description
The Fault
class contains all the information about a step execution failure.
Table 3-13 Methods of Fault
Method | Description |
---|---|
|
Gets the fault namespace. |
|
Gets the fault string. |
|
Gets the fault detail. |
|
Gets the fault actor. |
|
Gets the qualified fault code, for example, "Client.AuthenticationFailure." |
|
Gets the fault code qualifier. |
|
Gets the fault code. |
|
Gets the fault detail as a string. |
Declaration
public String getFaultNS()
Description
Gets the fault namespace.
Returns
The namespace as set or the default namespace.
Declaration
public String getFaultString()
Description
Gets the fault string.
Returns
The fault string as set for the fault.
Declaration
public Detail getFaultDetail()
Description
Gets the fault detail.
Returns
A detailed message for the cause of the fault.
Declaration
public String getFaultActor()
Description
Gets the fault actor.
Returns
The actor that experienced the fault.
Declaration
public String getQualifiedFaultCode()
Description
Gets the qualified fault code, for example, "Client.AuthenticationFailure."
Declaration
public String getFaultCodeQualifier()
Description
Gets the fault code qualifier.