| Oracle® Enterprise Service Bus Developer's Guide 10g (10.1.3.4.0) Part Number E12638-02 |
|
|
View PDF |
This appendix describes the resubmission APIs that allow you to execute all the actions that can be performed in the ESB control, on the ESB DT server. This appendix covers the following sections:
Note:
If an error occurs while executing the resubmission APIs, then an exception is thrown back to the caller.
Refer to the following link for more information about resubmission APIs
http://www.oracle.com/technology/products/integration/esb/files/clientapi.zipp
This API returns a list of instances matching the given filter.
Action
GetInstances
XSD
Input XSD Element: Refer to the element instanceFilter in Instance Tracking section of the XML schema definition.
Output XSD Element: Refer to the element instances in Instance Tracking section of the XML schema definition.
Sample
The following code snippet returns all the instances created in the last 24 hours:
String filter="<instanceFilter timeZone=\"GMT+05:30\">"+ "<startTime>86400000</startTime>"+"</errorIinstanceFilter>";
HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("filter", URLEncoder.encode(filter,"UTF-8"));
ConsoleClient client = ConsoleClientFactory.getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
String data = client.perform("GetInstances", requestProps);
System.out.println("Instances ==> "+data);
This API returns a list of errors matching the given filter.
Action
GetFailedInstances
XSD
Input XSD Element: Refer to the element failedInstanceFilter in Instance Tracking section of the XML schema definition.
Output XSD Element: Refer to the element failedInstances in Instance Tracking section of the XML schema definition.
Sample
The following code snippet returns all the instances created in the last 24 hours that raised retryable and nonretryable errors:
String filter = "<failedInstanceFilter timeZone=\"GMT+05:30\">"+"<startTime>86400000</startTime>"+ "</failedIinstanceFilter>";
HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("filter", URLEncoder.encode(filter,"UTF-8"));
ConsoleClient client = ConsoleClientFactory.getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
String data = client.perform("GetFailedInstances", requestProps);
System.out.println("Failed Instances ==> "+data);
This API returns all the errors that occurred in a given flow ID. If the error is retryable, then the corresponding error element contains the list of routing rules that are executed upon resubmission, and the payload that the user can modify before resubmission.
Action
GetErrorInstance
XSD
Output XSD Element: Refer to the element errorInstances in Instance Tracking section of the XML schema definition.
Sample
The following code snippet returns all the instances that raised errors for the given instance ID.
HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("instanceID",URLEncoder.encode("102@1164094022","UTF-8"));
ConsoleClient client = ConsoleClientFactory.getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
String data = client.perform("GetErrorInstance", requestProps);
System.out.println("Error Instances ==> "+data);
This API returns the XML data containing the flow details. This XML data is used to draw the instance diagram on the console.
Action
GetTrackingDetails
XSD
Output XSD Element: Refer to the element relationship in Instance Tracking section of the XML schema definition.
Sample
The following code snippet returns the XML data required to draw the instance diagram for the given flow ID.
HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("flowId",URLEncoder.encode("102@1164094022","UTF-8"));
ConsoleClient client = ConsoleClientFactory.getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
String data = client.perform("GetTrackingDetails", requestProps);
System.out.println("Instance Diagram XML ==> "+data);
This API resubmits multiple instances that failed in multiple systems and flows. The input for this action is a list of IDs. In this case, FlowId and SystemId form a unique instanceId. During the process of resubmitting the instances, the console back end retrieves the actual payloads for these IDs from the instance store.
Action
ResubmitInstancesByIds
XSD
Input XSD Element: Refer to the element resubmitInstanceIds in Instance Tracking section of the XML schema definition.
Output XSD Element: Refer to the element resubmissionFailureReport in Instance Tracking section of the XML schema definition.
Sample
HashMap<String,String> requestProps = new HashMap<String,String>();
String ids = "<resubmitInstanceIds>" + "<resubmitInstanceId flowId=\"102@1164094022\" systemId=\"96DD76C0971311DABF1A87858E4395A7\"/>" +
"<resubmitInstanceId flowId=\"101@1164094022\" systemId=\"96DD76C0971311DABF1A87858E4395A7\"/>" + "</resubmitInstanceIds";
requestProps.put("resubmitIds", URLEncoder.encode(ids,"UTF-8"));
ConsoleClient client = ConsoleClientFactory.getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
String data = client.perform("ResubmitInstancesByIds",requestProps);
System.out.println("Resubmit Instances By Ids Status ==> "+data);
This API resubmits a single instance that failed in the given system that was a part of the given flow. The input for this action is an ID. In this case, FlowId and SystemId form a unique instanceId. During the process of resubmitting the instance, the console back end retrieves the actual payload for the given ID from the instance store.
Action
ResubmitInstanceById
Sample
HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("flowId", flowId);
requestProps.put("systemId", systemId);
ConsoleClient client = ConsoleClientFactory.getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
client.perform("ResubmitInstanceById",requestProps);
This API resubmits a single instance that failed in the given system as part of the given flow. The input for this action is an XML document containing the modified/unmodified payload.
The actions mentioned in the Get the List of Instances and Get the List of Instances That Raised an Error sections can also be used to obtain the list of instances with payload that raised errors. In a loop, the user needs to call this action to submit each error instance.
Action
ResubmitInstance
XSD
Input XSD Element: Refer to the element messageInstance in Instance Tracking section of the XML schema definition.
Sample
HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("resub", URLEncoder.encode(resubInstance,"UTF-8"));
ConsoleClient client = ConsoleClientFactory.getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
client.perform("ResubmitInstance",requestProps);
This API returns true if the instance tracking is enabled or false.
Action
GetTrackingConfig
XSD
Output XSD Element: Refer to the element instanceManage in Instance Tracking section of the XML schema definition.
Sample
The following code snippet returns current status of instance tracking:
ConsoleClient client = ConsoleClientFactory.getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);client.perform("GetTrackingConfig",null);
This API enables or disables instance tracking.
Action
UpdateTrackingConfig
XSD
Input XSD Element: Refer to the element instanceManage in Instance Tracking section of the XML schema definition.
Sample
The following code snippet disables instance tracking:
String config = "<instanceManage enable=\"false\" />"HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("root", config);
ConsoleClient client = ConsoleClientFactory.getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
client.perform("UpdateTrackingConfig", requestProps);
This API purges instances based on the following criteria:
All
Older than a specified time
Action
UpdateTrackingConfig
XSD
Input XSD Element: Refer to the element purgeInstance in Instance Tracking section of the XML schema definition.
Sample
The following code snippet deletes all the instances that are older than 10 minutes:
String purge = "<purgeInstance userPurgeTimePeriod=\"600000\"/>";
HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("root", purge);
ConsoleClient client = ConsoleClientFactory.getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
client.perform("UpdateTrackingConfig", requestProps);
This API lists all service data as shown in the ESB Control Service Metadata view.
Action
ExploreServices
XSD
Output XSD Element: Not available.
Sample
The following code lists all service metadata:
ConsoleClient client = ConsoleClientFactory.getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
String data = client.perform("UpdateTrackingConfig", null);
System.out.println("Service XML ==> "+data);
<metadata>
<system name="DefaultSystem" guid="96DD76C0971311DABF1A87858E4395A7" qname="DefaultSystem" status="ENABLED">
<versionInfo>
<ID>1139232135202</ID>
<lastModifiedTime>Thu Jun 29 08:30:55 PDT 2006</lastModifiedTime>
<lastModifiedUser>JDev</lastModifiedUser>
</versionInfo>
<service name="GetMovies_SOAP" guid="4ACA9F5083F911DBBFB6F366CB962EB8" qname="DefaultSystem.GetMovies_SOAP"
status="ENABLED" serviceType="ExternalService" typeDescription="External Service" isWSDLEditable="false">
<versionInfo>
<ID>1190913146234</ID>
<lastModifiedTime>Thu Sep 27 10:12:26 PDT 2007</lastModifiedTime>
<lastModifiedUser>oc4jadmin</lastModifiedUser>
</versionInfo>
<parent guid="96DD76C0971311DABF1A87858E4395A7" qname="DefaultSystem" type="system"/>
<operations>
<operationInfo guid="4ADFFC1083F911DBBFB6F366CB962EB8" qname="DefaultSystem.GetMovies_SOAP.GetTheatersAndMovies"
wsdlOperation="GetTheatersAndMovies" mepDisplayName="Request Response" mep="RequestResponse"/>
<operationInfo guid="4ADFFC1183F911DBBFB6F366CB962EB8" qname="DefaultSystem.GetMovies_SOAP.GetUpcomingMovies"
wsdlOperation="GetUpcomingMovies" mepDisplayName="Request Response" mep="RequestResponse"/>
</operations>
<endpointProperties>
<property name="RetryInterval" value="0"/>
<property name="RetryCount" value="0"/>
</endpointProperties>
</service>
This API sets the service status to ENABLED or DISABLED.
Action
UpdateServiceStatus
XSD
Output XSD Element: No response.
Sample
The following code updates the Service Status:
HashMap<String,String> requestProps = new HashMap<String,String>();
requestProps.put("service", guid);
requestProps.put("status", status);
ConsoleClient client = ConsoleClientFactory.getConsoleClient(HOST,PORT,USER_NAME,PASSWORD);
client.perform("UpdateServiceStatus",requestProps);