[Capítulo 3] Open Access
7 El acceso abierto tiene una presencia residual en la
3.6 D ESARROLLO DEL O PEN A CCESS
In our example, the Auto-Trader application initiates a request to get the trade confidence level from the TCG application. The request is made to the getConfidence(…) operation exposed through a web service from the TCG application. Upon receipt of the request, the credentials are first authenticated and authorised. After successful completion of the authentication and authorization, the Process Orchestrator calls the TA Components (1 to 5) and the FA Component1 in a particular sequence. Each of the TA components and the FA component performs their respective in-memory data processing, file I/O activities and database interactions. The data is then aggregated by the orchestrator and response sent back to the client i.e. the Auto-Trader application. In a similar way, the facade orchestration web service of our experimental framework is invoked by the web service client (operation consumer) and it in turn calls the different back end application components one after the other. Each of the backend components then extracts the data to be processed from the input request and performs the following activities:
1.
Gets a Singleton instance of the LatencyActivities object:
For overall efficiency of memory usage, the LatencyActivities class has been designed as a Singleton i.e. only one object of the class will be instantiated per virtual machine. The component gets the singleton object and calls the authentication and authorization methods on the LatencyActivities object. For authentication and authorization of requests through XML data parsing, two objects namely AuthenticationHandler and AuthorizationHandler are used. These two objects extend the DefaultHandler class in org.xml.sax.helpers package.
2.
Performs authentication of the request for transaction:
The LatencyActivities object has a method which performs authentication on incoming requests for transactions. It reads an XML configuration file and authenticates the User Id and Password supplied with the request. Upon successful authentication, the transaction is allowed to proceed to the next step. Otherwise, the transaction processing is aborted.
3.
Performs authorization of the request:
81
transactions. It reads an XML configuration file and authorizes the request to perform certain activities. The XML file contains the User to Permissions mappings. Based on the requestor‟s credentials, specific permissions are granted to the request for transaction.
4.
Performs in-memory data processing:
Upon successful authentication and authorization, the component then calls the data processing method on the LatencyActivities object, which does some in-memory data processing. Volume of processing is determined by the value of the dataProcessLoop parameter, which is set by the client side when invoking the transaction request.
5.
Performs File I/O:
After completion of the data processing, the component calls a method on the LatencyActivities object, which does some file read/write on the file system. Magnitude of file I/O is determined by the value of the fileIOLoop parameter, which is set by the client side when invoking the transaction request.
6.
Performs database interactions:
After completion of the file input/output activities, the backend component interfaces with an Oracle 10g database. Based on the permission granted through authorization, it does read and write operations. Intensity of database interactions is determined by the value of the
dbAccessLoop parameter, which is set by the client side when invoking the transaction request.
7.
Applies component specific algorithm:
Every backend component performs some activities specific to the component. At the end of all the LatencyActivities defined processing activities, the component calls its specific method to perform the activity based on the type of component.
8.
Returns data back to the calling Orchestration Web Service:
82
processing done, the response is sent back to the orchestration web service. Upon receipt of this response, the orchestration web service calls the next backend component. This process carries on till the last backend component is called. Upon receipt of the response from the last backend component, the orchestration web service in turn sends the response back to the web service client.
The Sequence diagrams as shown in Figures 11 and 12 below illustrate the sequence of activities that take place behind the main orchestration web service of the application operation provider for Backend Component 1 and Backend Component 2.
83
Figure 11: Sequence model for Backend Component 1 activities
WebServiceClientread external config file
spawn operation requests as per config
MathOrchestrationWebService
call orchestrateMathService
call Backend Component1
Backend Component 1
process request
do Post
extract request data
LatencyActivities
get singleton instance perform latency activities
perform component specific activities
return response
call Backend Component 2
call Backend Component 3
call Backend Component 4
return aggregated response record response time
Standalone Java Web
Service client Web Service HttpServlet
Utility for all latency activities
call Backend Component 5
call Backend Component 6 contd to Fig 12
84
Figure 12: Sequence model for Backend Component 2 activities
WebServiceClient
read external config file
spawn operation requests as per config MathOrchestrationWebService
call orchestrateMathService
call Backend Component 1
LatencyActivities Backend Component 2
do Post
extract request data
perform call Backend Component 2
process request
get singleton instance perform latency activities
return response
call Backend Component 3
call Backend Component 4
call Backend Component 5
call Backend Component 6
return aggregated response
record response time
Standalone Java Web
Service client Web Service
Utility for all
latency activities HttpServlet
contd to Fig 11
component specific activities
85
Figure 13 below is a lower level Sequence diagram which shows the different methods invoked on the LatencyActivities object from Backend Component 1. The same happens for each of the other backend application components.
Figure 13: Lower level Sequence diagram for Backend Component 1
WebServiceClientread external config file
spawn operation requests as per config
MathOrchestrationWebService
call orchestrateMathServices
call Backend Component 1
Backend Component 1
process request
do Post
extract request data
LatencyActivities
get singleton instance perform authentication
perform return response
call other application components
Standalone Java Web
Service client Web Service HttpServlet
Utility for all latency activities
perform authorization perform data processing
perform file I/O
return aggregated response
record response time
Backend Component 2, Backend Component 3, Backend Component 4, Backend Component 5, Backend Component 6
perform DB interactions
component specific activities
86
The Sequence Diagrams of the activities that take place behind the main orchestration web service of the application operation provider for Backend Component 3, Backend Component 5 and Backend Component 6 are included in Annexes A.