Table of Contents |
---|
Introduction
This page identifies areas of the OODT codebase where XMLRPC is currently used. It is part of the Google Summer of Code 2015 effort to replace OODT's XMLRPC codebase with AvroRPC.
Components
catalog
The XMLRPC communication is already abstracted in the classes below. The Client and the Server interfaces share the same method signatures for the functionality. The Client side implementation serializes the operation requested by the caller and sends it the the Server side implementation. The Client class is in fact used as a proxy to the Server one. Specific to the XMLRPC implementation, the XMLRPC logic is used only for method call and parameter passing as String, the real parameter serialization is done with something independent of XMLRPC (Serializer).
Code Block |
---|
Searching 152 files for "apache.xmlrpc." /home/radu/oodt/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelClient.java: 43 44 //APACHE imports 45: import org.apache.xmlrpc.CommonsXmlRpcTransportFactory; 46: import org.apache.xmlrpc.XmlRpcClient; 47 48 /** /home/radu/oodt/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelServer.java: 38 39 //APACHE imports 40: import org.apache.xmlrpc.WebServer; 41 42 /** 3 matches across 2 files |
commons
XmlRpcClientLite is used in callLocalServerManager to execute a method of a remote local XMLRPC server. The server port, credentials and the remote method name and its parameter list are given as parameters to callLocalServerManager. This method doesn't look like it has anything in common with the ExecServer class and possibly could be completely separated. Also, I can't find anywhere is the OODT code that the callLocalServerManager method be called.
XmlRpcServer class is created in the constructor of ExecSerer:
Code Block |
---|
// Create the XML-RPC interface to this server. xmlrpcServer = new XmlRpcServer(); xmlrpcServer.addHandler("server", this); |
From the comment, probably XMLRPC is used to control ExecServer while it is running, that is call methods of ExecServer.
XmlRpcServer is also used in the control() method, that seems to execute and arbitrary command on the server.
Code Block |
---|
/** Control this server. * * @param command Command to send to the server. * @return Results of <var>command</var>. */ public byte[] control(byte[] command) { return xmlrpcServer.execute(new ByteArrayInputStream(command)); } |
What is different from other uses of XmlRpcServer in other parts of OODT is that here it doesn't don't use the WebServer class.
From docs of XmlRpcServer:
A multithreaded, reusable XML-RPC server object. The name may be misleading because this does not open any server sockets. Instead it is fed by passing instances of XmlRpcRequest
from a transport.
Code Block |
---|
Searching 126 files for "apache.xmlrpc." /home/radu/oodt/commons/src/main/java/org/apache/oodt/commons/ExecServer.java: 28 import org.apache.oodt.commons.io.Log; 29 import org.apache.oodt.commons.util.*; 30: import org.apache.xmlrpc.XmlRpcClientLite; 31: import org.apache.xmlrpc.XmlRpcServer; 32 import org.w3c.dom.*; 33 import org.xml.sax.*; 2 matches in 1 file |
crawler
There are two classes that uses xmlrpc, CrawlDeamon method startCrawling uses xmlrpc WebServer directly to get requests from a client to control the CrawlerDaemon. In the constructor of the CrawlDeamonController class xmlRpcClinent is used to send RPC requests to the CrawlerDaemon which are transformed into calls of the methods of CrawlDaemon. There is no abstraction of XMLRPC. CrawlDaemonController is used to call CrawlDaemon methods remotely.
Code Block |
---|
Searching 74 files for "apache.xmlrpc." /home/radu/oodt/crawler/src/main/java/org/apache/oodt/cas/crawl/daemon/CrawlDaemon.java: 27 28 //APACHE imports 29: import org.apache.xmlrpc.WebServer; 30 31 /** /home/radu/oodt/crawler/src/main/java/org/apache/oodt/cas/crawl/daemon/CrawlDaemonController.java: 29 30 //APACHE imports 31: import org.apache.xmlrpc.XmlRpcClient; 32: import org.apache.xmlrpc.XmlRpcException; 33 34 /** 3 matches across 2 files |
filemgr
The XmlRpcFileManager abd XmlRpcFileManagerClient, uses xmlrpc exactly the same as the crawler. XmlRpcFileManager uses the WebServer to process client request. In the same matter XmlRpcFileManagerClient send RPC requests to WebServer. SecureWebServer its a class that implements xmlrpc.WebServer and AuthenticatedXmlRpcHandler, for secure access to server throught username and password. No abstraction of XMLRPC for this classes nether.
Code Block |
---|
Searching 338 files for "apache.xmlrpc." /home/radu/oodt/filemgr/src/main/java/org/apache/oodt/cas/filemgr/system/XmlRpcFileManager.java: 19 20 //APACHE imports 21: import org.apache.xmlrpc.WebServer; 22 23 //OODT imports /home/radu/oodt/filemgr/src/main/java/org/apache/oodt/cas/filemgr/system/XmlRpcFileManagerClient.java: 19 20 //APACHE imports 21: import org.apache.xmlrpc.CommonsXmlRpcTransport; 22: import org.apache.xmlrpc.XmlRpcClient; 23: import org.apache.xmlrpc.XmlRpcClientException; 24: import org.apache.xmlrpc.XmlRpcException; 25: import org.apache.xmlrpc.XmlRpcTransport; 26: import org.apache.xmlrpc.XmlRpcTransportFactory; 27 //JDK imports 28 import java.net.URL; /home/radu/oodt/filemgr/src/main/java/org/apache/oodt/cas/filemgr/system/auth/SecureWebServer.java: 26 27 //XML-RPC imports 28: import org.apache.xmlrpc.AuthenticatedXmlRpcHandler; 29 30 /** .. 33 * @author kelly 34 */ 35: public final class SecureWebServer extends org.apache.xmlrpc.WebServer 36 implements AuthenticatedXmlRpcHandler { 37 /home/radu/oodt/filemgr/src/test/java/org/apache/oodt/cas/filemgr/structs/type/TestTypeHandler.java: 56 import java.util.logging.Logger; 57 import javax.sql.DataSource; 58: import org.apache.xmlrpc.XmlRpcException; 59 import junit.framework.TestCase; 60 10 matches across 4 files |
pcs
The Process Control System's core system framework. PCS is an agglomeration of CAS services and components needed to build a science data system. cas- catalog and archive service.
PCSHealthMonitor its a class showing information and stats of various daemons. This class uses xmlrpc client through classes like CrawlerManager class, and directly is order to contact the daemons.
Code Block |
---|
Searching 136 files for "apache.xmlrpc." /home/radu/oodt/pcs/core/src/main/java/org/apache/oodt/pcs/tools/PCSHealthMonitor.java: 28 29 //APACHE imports 30: import org.apache.xmlrpc.XmlRpcClient; 31 32 //OODT imports /home/radu/oodt/pcs/core/src/main/java/org/apache/oodt/pcs/util/WorkflowManagerUtils.java: 30 import org.apache.oodt.cas.workflow.structs.WorkflowInstance; 31 import org.apache.oodt.cas.workflow.system.XmlRpcWorkflowManagerClient; 32: import org.apache.xmlrpc.XmlRpcClient; 33 34 /** 2 matches across 2 files |
resource
XmlRpcResourceManager and XmlRpcResourceManagerClient act like a remote procedure call system. Both use xmlrpc api for request and response control of XmlRpcResourceManager procedure calls. XmlRpcBatchStub its using the webServer to handle the requestes sent from client.
XmlRpcBatchMgr is implementing a interface this time and is created by a factory which is implementing the BatchmgrFactory interface. Now the communication with the XmlRpc server (XmlRpcBatchStub) is done through the XmlRpcMgrProxy.
Code Block |
---|
Searching 155 files for "apache.xmlrpc." /home/radu/oodt/resource/src/main/java/org/apache/oodt/cas/resource/batchmgr/XmlRpcBatchMgrProxy.java: 32 33 //APACHE imports 34: import org.apache.xmlrpc.XmlRpcClient; 35: import org.apache.xmlrpc.XmlRpcException; 36 37 /** /home/radu/oodt/resource/src/main/java/org/apache/oodt/cas/resource/system/XmlRpcResourceManager.java: 35 36 //APACHE imports 37: import org.apache.xmlrpc.WebServer; 38 39 //JDK imports /home/radu/oodt/resource/src/main/java/org/apache/oodt/cas/resource/system/XmlRpcResourceManagerClient.java: 20 21 //APACHE imports 22: import org.apache.xmlrpc.CommonsXmlRpcTransportFactory; 23: import org.apache.xmlrpc.XmlRpcClient; 24: import org.apache.xmlrpc.XmlRpcException; 25 26 //OODTimports /home/radu/oodt/resource/src/main/java/org/apache/oodt/cas/resource/system/extern/XmlRpcBatchStub.java: 38 39 //APACHE imports 40: import org.apache.xmlrpc.WebServer; 41 42 /** 7 matches across 4 files |
workflow
XmlRpcWorkflowManagerClient sends commands to the XmlRpcWorkflowManager (Server). Setup is very similar to before.
It is using XmlRpcStructFactory to transform XmlRpc data types to actual objects.
Code Block |
---|
Hashtable pageHash = null; ... return XmlRpcStructFactory.getWorkflowInstancePageFromXmlRpc(pageHash); |
Code Block |
---|
Searching 205 files for "apache.xmlrpc." /home/radu/oodt/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManager.java: 22 23 //Apache imports 24: import org.apache.xmlrpc.WebServer; 25 26 //OODT imports /home/radu/oodt/workflow/src/main/java/org/apache/oodt/cas/workflow/system/XmlRpcWorkflowManagerClient.java: 20 21 //APACHE imports 22: import org.apache.xmlrpc.XmlRpcClient; 23: import org.apache.xmlrpc.XmlRpcException; 24 25 //JDK imports 3 matches across 2 files |