You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by ma...@apache.org on 2010/07/12 22:08:07 UTC
svn commit: r963458 - in
/incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel:
./ xmlrpc/
Author: mattmann
Date: Mon Jul 12 20:08:06 2010
New Revision: 963458
URL: http://svn.apache.org/viewvc?rev=963458&view=rev
Log:
- progress towards OODT-15 One trunk for all OODT components with top level build
Removed:
incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/AbstractCommunicationChannelClient.java
incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/AbstractCommunicationChannelServer.java
incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/CommunicationChannelClient.java
incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/CommunicationChannelClientFactory.java
incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/CommunicationChannelServer.java
incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/CommunicationChannelServerFactory.java
Modified:
incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCatalogClient.java
incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCatalogServer.java
Modified: incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCatalogClient.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCatalogClient.java?rev=963458&r1=963457&r2=963458&view=diff
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCatalogClient.java (original)
+++ incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCatalogClient.java Mon Jul 12 20:08:06 2010
@@ -51,13 +51,12 @@ import org.apache.oodt.cas.metadata.Meta
* XML-RPC implementation of the Catalog Server.
*
*/
-public class XmlRpcCommunicationChannelClient extends
- AbstractCommunicationChannelClient {
+public class XmlRpcCatalogClient {
protected XmlRpcClient client;
protected int chunkSize;
- public XmlRpcCommunicationChannelClient(URL serverUrl, int connectionTimeout,
+ public XmlRpcCatalogClient(URL serverUrl, int connectionTimeout,
int requestTimeout, int chunkSize) {
super();
CommonsXmlRpcTransportFactory transportFactory = new CommonsXmlRpcTransportFactory(
@@ -70,30 +69,29 @@ public class XmlRpcCommunicationChannelC
public void shutdown() throws Exception {
Vector<Object> args = new Vector<Object>();
- this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_shutdown", args);
+ this.client.execute(XmlRpcClient.class.getSimpleName() + ".shutdown", args);
}
public void addCatalog(Catalog catalog) throws Exception {
Vector<Object> args = new Vector<Object>();
args.add(this.serializer.serializeObject(catalog));
- this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_addCatalog", args);
+ this.client.execute(XmlRpcClient.class.getSimpleName() + ".addCatalog",
+ args);
}
public void replaceCatalog(Catalog catalog) throws Exception {
Vector<Object> args = new Vector<Object>();
args.add(this.serializer.serializeObject(catalog));
- this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_replaceCatalog", args);
+ this.client.execute(XmlRpcClient.class.getSimpleName() + ".replaceCatalog",
+ args);
}
public void addCatalog(String catalogId, Index index) throws Exception {
Vector<Object> args = new Vector<Object>();
args.add(catalogId);
args.add(this.serializer.serializeObject(index));
- this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_addCatalog", args);
+ this.client.execute(XmlRpcClient.class.getSimpleName() + ".addCatalog",
+ args);
}
public void addCatalog(String catalogId, Index index,
@@ -102,8 +100,8 @@ public class XmlRpcCommunicationChannelC
args.add(catalogId);
args.add(this.serializer.serializeObject(index));
args.add(this.serializer.serializeObject(dictionaries));
- this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_addCatalog", args);
+ this.client.execute(XmlRpcClient.class.getSimpleName() + ".addCatalog",
+ args);
}
public void addCatalog(String catalogId, Index index,
@@ -115,8 +113,8 @@ public class XmlRpcCommunicationChannelC
args.add(this.serializer.serializeObject(dictionaries));
args.add(restrictQueryPermission);
args.add(restrictIngestPermission);
- this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_addCatalog", args);
+ this.client.execute(XmlRpcClient.class.getSimpleName() + ".addCatalog",
+ args);
}
public void addDictionary(String catalogId, Dictionary dictionary)
@@ -124,8 +122,8 @@ public class XmlRpcCommunicationChannelC
Vector<Object> args = new Vector<Object>();
args.add(catalogId);
args.add(this.serializer.serializeObject(dictionary));
- this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_addDictionary", args);
+ this.client.execute(XmlRpcClient.class.getSimpleName() + ".addDictionary",
+ args);
}
public void replaceDictionaries(String catalogId,
@@ -133,16 +131,16 @@ public class XmlRpcCommunicationChannelC
Vector<Object> args = new Vector<Object>();
args.add(catalogId);
args.add(this.serializer.serializeObject(dictionaries));
- this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_addDictionary", args);
+ this.client.execute(XmlRpcClient.class.getSimpleName() + ".addDictionary",
+ args);
}
public void replaceIndex(String catalogId, Index index) throws Exception {
Vector<Object> args = new Vector<Object>();
args.add(catalogId);
args.add(this.serializer.serializeObject(index));
- this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_replaceIndex", args);
+ this.client.execute(XmlRpcClient.class.getSimpleName() + ".replaceIndex",
+ args);
}
public void modifyIngestPermission(String catalogId,
@@ -150,8 +148,8 @@ public class XmlRpcCommunicationChannelC
Vector<Object> args = new Vector<Object>();
args.add(catalogId);
args.add(this.serializer.serializeObject(restrictIngestPermission));
- this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_modifyIngestPermission", args);
+ this.client.execute(XmlRpcClient.class.getSimpleName()
+ + ".modifyIngestPermission", args);
}
public void modifyQueryPermission(String catalogId,
@@ -159,29 +157,28 @@ public class XmlRpcCommunicationChannelC
Vector<Object> args = new Vector<Object>();
args.add(catalogId);
args.add(this.serializer.serializeObject(restrictQueryPermission));
- this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_modifyQueryPermission", args);
+ this.client.execute(XmlRpcClient.class.getSimpleName()
+ + ".modifyQueryPermission", args);
}
public List<PluginURL> getPluginUrls() throws Exception {
Vector<Object> args = new Vector<Object>();
return this.serializer.deserializeObject(List.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getPluginUrls", args));
+ .execute(XmlRpcClient.class.getSimpleName() + ".getPluginUrls", args));
}
public void addPluginUrls(List<PluginURL> pluginURLs) throws Exception {
Vector<Object> args = new Vector<Object>();
args.add(this.serializer.serializeObject(pluginURLs));
- this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_addPluginUrls", args);
+ this.client.execute(XmlRpcClient.class.getSimpleName() + ".addPluginUrls",
+ args);
}
public URL getPluginStorageDir() throws Exception {
Vector<Object> args = new Vector<Object>();
return this.serializer.deserializeObject(URL.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getPluginStorageDir", args));
+ .execute(XmlRpcClient.class.getSimpleName() + ".getPluginStorageDir",
+ args));
}
public void transferUrl(URL fromUrl, URL toURL) throws Exception {
@@ -212,15 +209,14 @@ public class XmlRpcCommunicationChannelC
argList.add(fileData);
argList.add(new Integer(offset));
argList.add(new Integer(numBytes));
- client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_transferFile", argList);
+ client.execute(XmlRpcClient.class.getSimpleName() + ".transferFile",
+ argList);
}
public void delete(Metadata metadata) throws Exception {
Vector<Object> args = new Vector<Object>();
args.add(this.serializer.serializeObject(metadata));
- this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_delete", args);
+ this.client.execute(XmlRpcClient.class.getSimpleName() + ".delete", args);
}
public List<TransactionalMetadata> getAllPages(QueryPager queryPager)
@@ -228,24 +224,21 @@ public class XmlRpcCommunicationChannelC
Vector<Object> args = new Vector<Object>();
args.add(this.serializer.serializeObject(queryPager));
return this.serializer.deserializeObject(List.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getAllPages", args));
+ .execute(XmlRpcClient.class.getSimpleName() + ".getAllPages", args));
}
public Properties getCalalogProperties() throws Exception {
return this.serializer.deserializeObject(Properties.class,
- (String) this.client.execute(XmlRpcCommunicationChannelServer.class
- .getSimpleName()
- + ".xmlrpc_getCalalogProperties", new Vector<Object>()));
+ (String) this.client.execute(XmlRpcClient.class.getSimpleName()
+ + ".getCalalogProperties", new Vector<Object>()));
}
public Properties getCalalogProperties(String catalogUrn) throws Exception {
Vector<Object> args = new Vector<Object>();
args.add(catalogUrn);
return this.serializer.deserializeObject(Properties.class,
- (String) this.client.execute(XmlRpcCommunicationChannelServer.class
- .getSimpleName()
- + ".xmlrpc_getCalalogProperties", args));
+ (String) this.client.execute(XmlRpcClient.class.getSimpleName()
+ + ".getCalalogProperties", args));
}
public TransactionId<?> getCatalogServiceTransactionId(
@@ -255,9 +248,8 @@ public class XmlRpcCommunicationChannelC
args.add(this.serializer.serializeObject(catalogTransactionId));
args.add(catalogUrn);
return this.serializer.deserializeObject(TransactionId.class,
- (String) this.client.execute(XmlRpcCommunicationChannelServer.class
- .getSimpleName()
- + ".xmlrpc_getCatalogServiceTransactionId", args));
+ (String) this.client.execute(XmlRpcClient.class.getSimpleName()
+ + ".getCatalogServiceTransactionId", args));
}
public TransactionId<?> getCatalogServiceTransactionId(
@@ -266,9 +258,8 @@ public class XmlRpcCommunicationChannelC
args.add(this.serializer.serializeObject(catalogReceipt));
args.add(this.serializer.serializeObject(new Boolean(generateNew)));
return this.serializer.deserializeObject(TransactionId.class,
- (String) this.client.execute(XmlRpcCommunicationChannelServer.class
- .getSimpleName()
- + ".xmlrpc_getCatalogServiceTransactionId2", args));
+ (String) this.client.execute(XmlRpcClient.class.getSimpleName()
+ + ".getCatalogServiceTransactionId2", args));
}
public List<TransactionId<?>> getCatalogServiceTransactionIds(
@@ -278,14 +269,14 @@ public class XmlRpcCommunicationChannelC
args.add(this.serializer.serializeObject(catalogTransactionIds));
args.add(catalogUrn);
return this.serializer.deserializeObject(List.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getCatalogServiceTransactionId", args));
+ .execute(XmlRpcClient.class.getSimpleName()
+ + ".getCatalogServiceTransactionId", args));
}
public Set<String> getCurrentCatalogIds() throws Exception {
return this.serializer.deserializeObject(Set.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getCurrentCatalogIds", new Vector<Object>()));
+ .execute(XmlRpcClient.class.getSimpleName() + ".getCurrentCatalogIds",
+ new Vector<Object>()));
}
public List<TransactionalMetadata> getMetadataFromTransactionIdStrings(
@@ -294,8 +285,8 @@ public class XmlRpcCommunicationChannelC
args.add(this.serializer
.serializeObject(catalogServiceTransactionIdStrings));
return this.serializer.deserializeObject(List.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getMetadataFromTransactionIdStrings", args));
+ .execute(XmlRpcClient.class.getSimpleName()
+ + ".getMetadataFromTransactionIdStrings", args));
}
public List<TransactionalMetadata> getMetadataFromTransactionIds(
@@ -303,8 +294,8 @@ public class XmlRpcCommunicationChannelC
Vector<Object> args = new Vector<Object>();
args.add(this.serializer.serializeObject(catalogServiceTransactionIds));
return this.serializer.deserializeObject(List.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getMetadataFromTransactionIds", args));
+ .execute(XmlRpcClient.class.getSimpleName()
+ + ".getMetadataFromTransactionIds", args));
}
public List<TransactionalMetadata> getNextPage(QueryPager queryPager)
@@ -312,23 +303,21 @@ public class XmlRpcCommunicationChannelC
Vector<Object> args = new Vector<Object>();
args.add(this.serializer.serializeObject(queryPager));
return this.serializer.deserializeObject(List.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getNextPage", args));
+ .execute(XmlRpcClient.class.getSimpleName() + ".getNextPage", args));
}
public List<String> getProperty(String key) throws Exception {
Vector<Object> args = new Vector<Object>();
args.add(key);
return this.serializer.deserializeObject(List.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getProperty", args));
+ .execute(XmlRpcClient.class.getSimpleName() + ".getProperty", args));
}
public Class<? extends TransactionId<?>> getTransactionIdClass()
throws Exception {
return this.serializer.deserializeObject(Class.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getTransactionIdClass", new Vector<Object>()));
+ .execute(XmlRpcClient.class.getSimpleName() + ".getTransactionIdClass",
+ new Vector<Object>()));
}
public List<TransactionId<?>> getTransactionIdsForAllPages(
@@ -336,39 +325,35 @@ public class XmlRpcCommunicationChannelC
Vector<Object> args = new Vector<Object>();
args.add(this.serializer.serializeObject(queryPager));
return this.serializer.deserializeObject(List.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getTransactionIdsForAllPages", args));
+ .execute(XmlRpcClient.class.getSimpleName()
+ + ".getTransactionIdsForAllPages", args));
}
public TransactionReceipt ingest(Metadata metadata) throws Exception {
Vector<Object> args = new Vector<Object>();
args.add(this.serializer.serializeObject(metadata));
return this.serializer.deserializeObject(TransactionReceipt.class,
- (String) this.client.execute(XmlRpcCommunicationChannelServer.class
- .getSimpleName()
- + ".xmlrpc_ingest", args));
+ (String) this.client.execute(XmlRpcClient.class.getSimpleName()
+ + ".ingest", args));
}
public boolean isRestrictIngestPermissions() throws Exception {
return this.serializer.deserializeObject(Boolean.class,
- (String) this.client.execute(XmlRpcCommunicationChannelServer.class
- .getSimpleName()
- + ".xmlrpc_isRestrictIngestPermissions", new Vector<Object>()));
+ (String) this.client.execute(XmlRpcClient.class.getSimpleName()
+ + ".isRestrictIngestPermissions", new Vector<Object>()));
}
public boolean isRestrictQueryPermissions() throws Exception {
return this.serializer.deserializeObject(Boolean.class,
- (String) this.client.execute(XmlRpcCommunicationChannelServer.class
- .getSimpleName()
- + ".xmlrpc_isRestrictQueryPermissions", new Vector<Object>()));
+ (String) this.client.execute(XmlRpcClient.class.getSimpleName()
+ + ".isRestrictQueryPermissions", new Vector<Object>()));
}
public Page getFirstPage(QueryExpression queryExpression) throws Exception {
Vector<Object> args = new Vector<Object>();
args.add(this.serializer.serializeObject(queryExpression));
return this.serializer.deserializeObject(Page.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getFirstPage", args));
+ .execute(XmlRpcClient.class.getSimpleName() + ".getFirstPage", args));
}
public Page getFirstPage(QueryExpression queryExpression,
@@ -377,16 +362,14 @@ public class XmlRpcCommunicationChannelC
args.add(this.serializer.serializeObject(queryExpression));
args.add(this.serializer.serializeObject(catalogIds));
return this.serializer.deserializeObject(Page.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getFirstPage", args));
+ .execute(XmlRpcClient.class.getSimpleName() + ".getFirstPage", args));
}
public Page getNextPage(Page page) throws Exception {
Vector<Object> args = new Vector<Object>();
args.add(this.serializer.serializeObject(page));
return this.serializer.deserializeObject(Page.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getNextPage2", args));
+ .execute(XmlRpcClient.class.getSimpleName() + ".getNextPage2", args));
}
public Page getPage(PageInfo pageInfo, QueryExpression queryExpression)
@@ -395,8 +378,7 @@ public class XmlRpcCommunicationChannelC
args.add(this.serializer.serializeObject(pageInfo));
args.add(this.serializer.serializeObject(queryExpression));
return this.serializer.deserializeObject(Page.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getPage", args));
+ .execute(XmlRpcClient.class.getSimpleName() + ".getPage", args));
}
public Page getPage(PageInfo pageInfo, QueryExpression queryExpression,
@@ -406,16 +388,14 @@ public class XmlRpcCommunicationChannelC
args.add(this.serializer.serializeObject(queryExpression));
args.add(this.serializer.serializeObject(catalogIds));
return this.serializer.deserializeObject(Page.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getPage", args));
+ .execute(XmlRpcClient.class.getSimpleName() + ".getPage", args));
}
public Page getLastPage(QueryExpression queryExpression) throws Exception {
Vector<Object> args = new Vector<Object>();
args.add(this.serializer.serializeObject(queryExpression));
return this.serializer.deserializeObject(Page.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getLastPage", args));
+ .execute(XmlRpcClient.class.getSimpleName() + ".getLastPage", args));
}
public Page getLastPage(QueryExpression queryExpression,
@@ -424,25 +404,22 @@ public class XmlRpcCommunicationChannelC
args.add(this.serializer.serializeObject(queryExpression));
args.add(this.serializer.serializeObject(catalogIds));
return this.serializer.deserializeObject(Page.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getLastPage", args));
+ .execute(XmlRpcClient.class.getSimpleName() + ".getLastPage", args));
}
public List<TransactionalMetadata> getMetadata(Page page) throws Exception {
Vector<Object> args = new Vector<Object>();
args.add(this.serializer.serializeObject(page));
return this.serializer.deserializeObject(List.class, (String) this.client
- .execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_getMetadata", args));
+ .execute(XmlRpcClient.class.getSimpleName() + ".getMetadata", args));
}
public QueryPager query(QueryExpression queryExpression) throws Exception {
Vector<Object> args = new Vector<Object>();
args.add(this.serializer.serializeObject(queryExpression));
return this.serializer.deserializeObject(QueryPager.class,
- (String) this.client.execute(XmlRpcCommunicationChannelServer.class
- .getSimpleName()
- + ".xmlrpc_query", args));
+ (String) this.client.execute(XmlRpcClient.class.getSimpleName()
+ + ".query", args));
}
public QueryPager query(QueryExpression queryExpression,
@@ -451,16 +428,15 @@ public class XmlRpcCommunicationChannelC
args.add(this.serializer.serializeObject(queryExpression));
args.add(this.serializer.serializeObject(catalogIds));
return this.serializer.deserializeObject(QueryPager.class,
- (String) this.client.execute(XmlRpcCommunicationChannelServer.class
- .getSimpleName()
- + ".xmlrpc_query", args));
+ (String) this.client.execute(XmlRpcClient.class.getSimpleName()
+ + ".query", args));
}
public void removeCatalog(String catalogUrn) throws Exception {
Vector<Object> args = new Vector<Object>();
args.add(catalogUrn);
- this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName()
- + ".xmlrpc_removeCatalog", args);
+ this.client.execute(XmlRpcClient.class.getSimpleName() + ".removeCatalog",
+ args);
}
}
Modified: incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCatalogServer.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCatalogServer.java?rev=963458&r1=963457&r2=963458&view=diff
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCatalogServer.java (original)
+++ incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCatalogServer.java Mon Jul 12 20:08:06 2010
@@ -1,4 +1,4 @@
-/*
+/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -28,10 +28,10 @@ import org.apache.xmlrpc.WebServer;
//OODT imports
import org.apache.oodt.cas.catalog.metadata.TransactionalMetadata;
-import org.apache.oodt.cas.catalog.page.CatalogReceipt;
-import org.apache.oodt.cas.catalog.page.Page;
-import org.apache.oodt.cas.catalog.page.PageInfo;
-import org.apache.oodt.cas.catalog.page.QueryPager;
+import org.apache.oodt.cas.catalog.pagination.CatalogReceipt;
+import org.apache.oodt.cas.catalog.pagination.Page;
+import org.apache.oodt.cas.catalog.pagination.PageInfo;
+import org.apache.oodt.cas.catalog.pagination.QueryPager;
import org.apache.oodt.cas.catalog.query.QueryExpression;
import org.apache.oodt.cas.catalog.server.channel.AbstractCommunicationChannelServer;
import org.apache.oodt.cas.catalog.struct.Dictionary;
@@ -41,277 +41,264 @@ import org.apache.oodt.cas.catalog.syste
import org.apache.oodt.cas.metadata.Metadata;
/**
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * A Communication Channel Server over XML-RPC
- * <p>
+ *
+ * The XML-RPC Catalog Server.
+ *
*/
-public class XmlRpcCommunicationChannelServer extends
- AbstractCommunicationChannelServer {
+public class XmlRpcCatalogServer {
+
+ private WebServer webServer;
- private WebServer webServer;
-
- public XmlRpcCommunicationChannelServer() {
- super();
- }
-
- public void startup() throws Exception {
- this.webServer = new WebServer(this.port);
- this.webServer.addHandler(this.getClass().getSimpleName(), this);
- this.webServer.start();
- }
-
- public boolean xmlrpc_shutdown() throws Exception {
- this.shutdown();
- this.webServer.shutdown();
- this.webServer = null;
- return true;
- }
-
- public boolean xmlrpc_addCatalog(String catalogObject) throws Exception {
- this.addCatalog(this.serializer.deserializeObject(Catalog.class, catalogObject));
- return true;
- }
-
- public boolean xmlrpc_replaceCatalog(String catalogObject) throws Exception {
- this.replaceCatalog(this.serializer.deserializeObject(Catalog.class, catalogObject));
- return true;
- }
-
- public boolean xmlrpc_addCatalog(String catalogId, String indexObject) throws Exception {
- this.addCatalog(catalogId, this.serializer.deserializeObject(Index.class, indexObject));
- return true;
- }
-
- public boolean xmlrpc_addCatalog(String catalogId, String indexObject, String dictionariesObject) throws Exception {
- this.addCatalog(catalogId, this.serializer.deserializeObject(Index.class, indexObject), this.serializer.deserializeObject(List.class, dictionariesObject));
- return true;
- }
-
- public boolean xmlrpc_addCatalog(String catalogId, String indexObject, String dictionariesObject, String restrictQueryPermissionObject, String restrictIngestPermissionObject) throws Exception {
- this.addCatalog(catalogId, this.serializer.deserializeObject(Index.class, indexObject), this.serializer.deserializeObject(List.class, dictionariesObject), this.serializer.deserializeObject(Boolean.class, restrictQueryPermissionObject), this.serializer.deserializeObject(Boolean.class, restrictIngestPermissionObject));
- return true;
- }
-
- public boolean xmlrpc_addDictionary(String catalogId, String dictionaryObject) throws Exception {
- this.addDictionary(catalogId, this.serializer.deserializeObject(Dictionary.class, dictionaryObject));
- return true;
- }
-
- public boolean xmlrpc_replaceDictionaries(String catalogId, String dictionariesObject) throws Exception {
- this.replaceDictionaries(catalogId, this.serializer.deserializeObject(List.class, dictionariesObject));
- return true;
- }
-
- public boolean xmlrpc_replaceIndex(String catalogId, String indexObject) throws Exception {
- this.replaceIndex(catalogId, this.serializer.deserializeObject(Index.class, indexObject));
- return true;
- }
-
- public boolean xmlrpc_modifyIngestPermission(String catalogId, String restrictIngestPermissionObject) throws Exception {
- this.modifyIngestPermission(catalogId, this.serializer.deserializeObject(Boolean.class, restrictIngestPermissionObject));
- return true;
- }
-
- public boolean xmlrpc_modifyQueryPermission(String catalogId, String restrictQueryPermissionObject) throws Exception {
- this.modifyIngestPermission(catalogId, this.serializer.deserializeObject(Boolean.class, restrictQueryPermissionObject));
- return true;
- }
-
- public boolean xmlrpc_delete(String metadataObject) throws Exception {
- this.delete(this.serializer.deserializeObject(Metadata.class, metadataObject));
- return true;
- }
-
- public String xmlrpc_getPluginUrls() throws Exception {
- return this.serializer.serializeObject(this.getPluginUrls());
- }
-
- public boolean xmlrpc_addPluginUrls(String pluginUrlsObject) throws Exception {
- this.addPluginUrls(this.serializer.deserializeObject(List.class, pluginUrlsObject));
- return true;
- }
-
- public String xmlrpc_getPluginStorageDir() throws Exception {
- return this.serializer.serializeObject(this.getPluginStorageDir());
- }
-
- public boolean xmlrpc_transferFile(String filePath, byte[] fileData, int offset, int numBytes) throws Exception {
- FileOutputStream fOut = null;
- try {
- File outFile = new File(filePath);
- if (outFile.exists())
- fOut = new FileOutputStream(outFile, true);
- else
- fOut = new FileOutputStream(outFile, false);
-
- fOut.write(fileData, (int) offset, (int) numBytes);
- }catch (Exception e) {
- throw e;
- }finally {
- try {
- fOut.close();
- }catch(Exception e) {}
- }
- return true;
+ public XmlRpcCatalogServer() {
+ super();
+ }
+
+ public void startup() throws Exception {
+ this.webServer = new WebServer(this.port);
+ this.webServer.addHandler(this.getClass().getSimpleName(), this);
+ this.webServer.start();
+ }
+
+ public boolean shutdown() throws Exception {
+ this.shutdown();
+ this.webServer.shutdown();
+ this.webServer = null;
+ return true;
+ }
+
+ public boolean addCatalog(String catalogObject) throws Exception {
+ this.addCatalog(this.serializer.deserializeObject(Catalog.class,
+ catalogObject));
+ return true;
+ }
+
+ public boolean replaceCatalog(String catalogObject) throws Exception {
+ this.replaceCatalog(this.serializer.deserializeObject(Catalog.class,
+ catalogObject));
+ return true;
+ }
+
+ public boolean addCatalog(String catalogId, String indexObject)
+ throws Exception {
+ this.addCatalog(catalogId, this.serializer.deserializeObject(Index.class,
+ indexObject));
+ return true;
+ }
+
+ public boolean addCatalog(String catalogId, String indexObject,
+ String dictionariesObject) throws Exception {
+ this.addCatalog(catalogId, this.serializer.deserializeObject(Index.class,
+ indexObject), this.serializer.deserializeObject(List.class,
+ dictionariesObject));
+ return true;
+ }
+
+ public boolean addCatalog(String catalogId, String indexObject,
+ String dictionariesObject, String restrictQueryPermissionObject,
+ String restrictIngestPermissionObject) throws Exception {
+ this.addCatalog(catalogId, this.serializer.deserializeObject(Index.class,
+ indexObject), this.serializer.deserializeObject(List.class,
+ dictionariesObject), this.serializer.deserializeObject(Boolean.class,
+ restrictQueryPermissionObject), this.serializer.deserializeObject(
+ Boolean.class, restrictIngestPermissionObject));
+ return true;
+ }
+
+ public boolean addDictionary(String catalogId, String dictionaryObject)
+ throws Exception {
+ this.addDictionary(catalogId, this.serializer.deserializeObject(
+ Dictionary.class, dictionaryObject));
+ return true;
+ }
+
+ public boolean replaceDictionaries(String catalogId, String dictionariesObject)
+ throws Exception {
+ this.replaceDictionaries(catalogId, this.serializer.deserializeObject(
+ List.class, dictionariesObject));
+ return true;
+ }
+
+ public boolean replaceIndex(String catalogId, String indexObject)
+ throws Exception {
+ this.replaceIndex(catalogId, this.serializer.deserializeObject(Index.class,
+ indexObject));
+ return true;
+ }
+
+ public boolean modifyIngestPermission(String catalogId,
+ String restrictIngestPermissionObject) throws Exception {
+ this.modifyIngestPermission(catalogId, this.serializer.deserializeObject(
+ Boolean.class, restrictIngestPermissionObject));
+ return true;
+ }
+
+ public boolean modifyQueryPermission(String catalogId,
+ String restrictQueryPermissionObject) throws Exception {
+ this.modifyIngestPermission(catalogId, this.serializer.deserializeObject(
+ Boolean.class, restrictQueryPermissionObject));
+ return true;
+ }
+
+ public boolean delete(String metadataObject) throws Exception {
+ this.delete(this.serializer.deserializeObject(Metadata.class,
+ metadataObject));
+ return true;
+ }
+
+ public String getPluginUrls() throws Exception {
+ return this.serializer.serializeObject(this.getPluginUrls());
+ }
+
+ public boolean addPluginUrls(String pluginUrlsObject) throws Exception {
+ this.addPluginUrls(this.serializer.deserializeObject(List.class,
+ pluginUrlsObject));
+ return true;
+ }
+
+ public String getPluginStorageDir() throws Exception {
+ return this.serializer.serializeObject(this.getPluginStorageDir());
+ }
+
+ public boolean transferFile(String filePath, byte[] fileData, int offset,
+ int numBytes) throws Exception {
+ FileOutputStream fOut = null;
+ try {
+ File outFile = new File(filePath);
+ if (outFile.exists())
+ fOut = new FileOutputStream(outFile, true);
+ else
+ fOut = new FileOutputStream(outFile, false);
+
+ fOut.write(fileData, (int) offset, (int) numBytes);
+ } catch (Exception e) {
+ throw e;
+ } finally {
+ try {
+ fOut.close();
+ } catch (Exception e) {
+ }
}
+ return true;
+ }
- public String xmlrpc_getAllPages(String queryPagerObject) throws Exception {
- return this.serializer.serializeObject(this.getAllPages(this.serializer.deserializeObject(QueryPager.class, queryPagerObject)));
- }
-
- public String xmlrpc_getCalalogProperties() throws Exception {
- return this.serializer.serializeObject(this.getCalalogProperties());
- }
-
- public String xmlrpc_getCalalogProperties(String catalogUrn)
- throws Exception {
- return this.serializer.serializeObject(this.getCalalogProperties(catalogUrn));
- }
-
-// public String xmlrpc_getCatalog(String catalogUrn) throws Exception {
-// return this.serializer.serializeObject(this.getCatalog(catalogUrn));
-// }
-
- public String xmlrpc_getCatalogServiceTransactionId(
- String catalogTransactionIdObject, String catalogUrn)
- throws Exception {
- return this.serializer.serializeObject(this.getCatalogServiceTransactionId(this.serializer.deserializeObject(TransactionId.class, catalogTransactionIdObject), catalogUrn));
- }
-
- public String xmlrpc_getCatalogServiceTransactionId2(
- String catalogReceiptObject,
- String generateNewObject) throws Exception {
- return this.serializer.serializeObject(this.getCatalogServiceTransactionId(this.serializer.deserializeObject(CatalogReceipt.class, catalogReceiptObject), this.serializer.deserializeObject(Boolean.class, generateNewObject)));
- }
-
- public String xmlrpc_getCatalogServiceTransactionIds(
- String catalogTransactionIdsObject, String catalogUrn)
- throws Exception {
- return this.serializer.serializeObject(this.getCatalogServiceTransactionIds(this.serializer.deserializeObject(List.class, catalogTransactionIdsObject), catalogUrn));
- }
-
- public String xmlrpc_getCurrentCatalogIds() throws Exception {
- return this.serializer.serializeObject(this.getCurrentCatalogIds());
- }
-
-// public String xmlrpc_getCurrentCatalogList() throws Exception {
-// return this.serializer.serializeObject(this.getCurrentCatalogList());
-// }
-
- public String xmlrpc_getMetadataFromTransactionIdStrings(
- String catalogServiceTransactionIdStringsObject)
- throws Exception {
- return this.serializer.serializeObject(this.getMetadataFromTransactionIdStrings(this.serializer.deserializeObject(List.class, catalogServiceTransactionIdStringsObject)));
- }
-
- public String xmlrpc_getMetadataFromTransactionIds(
- String catalogServiceTransactionIdsObject)
- throws Exception {
- return this.serializer.serializeObject(this.getMetadataFromTransactionIds(this.serializer.deserializeObject(List.class, catalogServiceTransactionIdsObject)));
- }
-
- public String xmlrpc_getNextPage(String queryPagerObject)
- throws Exception {
- return this.serializer.serializeObject(this.getNextPage(this.serializer.deserializeObject(QueryPager.class, queryPagerObject)));
- }
-
- public String xmlrpc_getProperty(String key) throws Exception {
- return this.serializer.serializeObject(this.getProperty(key));
- }
-//
-// public String xmlrpc_getTransactionIdClass() throws Exception {
-// return this.serializer.serializeObject(this.getTransactionIdClass());
-// }
-
-// public String xmlrpc_getTransactionIdsForAllPages(
-// String queryPagerObject) throws Exception {
-// return this.serializer.serializeObject(this.getTransactionIdsForAllPages(this.serializer.deserializeObject(QueryPager.class, queryPagerObject)));
-// }
-
- public String xmlrpc_ingest(String metadataObject)
- throws Exception {
- return this.serializer.serializeObject(this.ingest(this.serializer.deserializeObject(Metadata.class, metadataObject)));
- }
-
- public String xmlrpc_isRestrictIngestPermissions() throws Exception {
- return this.serializer.serializeObject(new Boolean(this.isRestrictIngestPermissions()));
- }
-
- public String xmlrpc_isRestrictQueryPermissions() throws Exception {
- return this.serializer.serializeObject(new Boolean(this.isRestrictQueryPermissions()));
- }
-
- public String xmlrpc_query(String queryExpressionObject) throws Exception {
- return this.serializer.serializeObject(this.query(this.serializer.deserializeObject(QueryExpression.class, queryExpressionObject)));
- }
-
- public String xmlrpc_query(String queryExpressionObject, String catalogIdsObject) throws Exception {
- return this.serializer.serializeObject(this.query(this.serializer.deserializeObject(QueryExpression.class, queryExpressionObject), this.serializer.deserializeObject(Set.class, catalogIdsObject)));
- }
-
-// public String xmlrpc_getFirstPage(String queryExpressionObject) throws Exception {
-// return this.serializer.serializeObject(this.getFirstPage(this.serializer.deserializeObject(QueryExpression.class, queryExpressionObject)));
-// }
-//
-// public String xmlrpc_getFirstPage(String queryExpressionObject, String catalogIdsObject) throws Exception {
-// return this.serializer.serializeObject(this.getFirstPage(this.serializer.deserializeObject(QueryExpression.class, queryExpressionObject), this.serializer.deserializeObject(Set.class, catalogIdsObject)));
-// }
-
- public String xmlrpc_getNextPage2(String pageObject) throws Exception {
- return this.serializer.serializeObject(this.getNextPage(this.serializer.deserializeObject(Page.class, pageObject)));
- }
-
- public String xmlrpc_getPage(String pageInfoObject, String queryExpressionObject) throws Exception {
- return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfoObject), this.serializer.deserializeObject(QueryExpression.class, queryExpressionObject)));
- }
-
- public String xmlrpc_getPage(String pageInfoObject, String queryExpressionObject, String catalogIdsObject) throws Exception {
- return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfoObject), this.serializer.deserializeObject(QueryExpression.class, queryExpressionObject), this.serializer.deserializeObject(Set.class, catalogIdsObject)));
- }
-
-// public String xmlrpc_getLastPage(String queryExpressionObject) throws Exception {
-// return this.serializer.serializeObject(this.getLastPage(this.serializer.deserializeObject(QueryExpression.class, queryExpressionObject)));
-// }
-//
-// public String xmlrpc_getLastPage(String queryExpressionObject, String catalogIdsObject) throws Exception {
-// return this.serializer.serializeObject(this.getLastPage(this.serializer.deserializeObject(QueryExpression.class, queryExpressionObject), this.serializer.deserializeObject(Set.class, catalogIdsObject)));
-// }
-
- public String xmlrpc_getMetadata(String pageObject) throws Exception {
- return this.serializer.serializeObject(this.getMetadata(this.serializer.deserializeObject(Page.class, pageObject)));
- }
-
-// public String xmlrpc_query(String queryExpressionObject, String sortResultsObject) throws Exception {
-// System.out.println(this.getClass().getClassLoader());
-// return this.serializer.serializeObject(this.query(this.serializer.deserializeObject(QueryExpression.class, queryExpressionObject), this.serializer.deserializeObject(Boolean.class, sortResultsObject)));
-// }
-
- public boolean xmlrpc_removeCatalog(String catalogUrn) throws Exception {
- this.removeCatalog(catalogUrn);
- return true;
- }
-//
-// public boolean xmlrpc_removeCatalog(String catalogUrn, String preserveMappingObject) throws Exception {
-// this.removeCatalog(catalogUrn, this.serializer.deserializeObject(Boolean.class, preserveMappingObject));
-// return true;
-// }
-//
-// public boolean xmlrpc_setHasIngestPermissions(String restrictIngestPermissionsObject) throws Exception {
-// this.setHasIngestPermissions(this.serializer.deserializeObject(Boolean.class, restrictIngestPermissionsObject));
-// return true;
-// }
-//
-// public boolean xmlrpc_setRestrictQueryPermissions(String restrictQueryPermissionsObject) throws Exception {
-// this.setRestrictQueryPermissions(this.serializer.deserializeObject(Boolean.class, restrictQueryPermissionsObject));
-// return true;
-// }
-
-// public boolean setTransactionIdClass(String transactionIdClassObject) throws Exception {
-// this.setTransactionIdClass(this.serializer.deserializeObject(Class.class, transactionIdClassObject));
-// return true;
-// }
+ public String getAllPages(String queryPagerObject) throws Exception {
+ return this.serializer.serializeObject(this.getAllPages(this.serializer
+ .deserializeObject(QueryPager.class, queryPagerObject)));
+ }
+
+ public String getCalalogProperties() throws Exception {
+ return this.serializer.serializeObject(this.getCalalogProperties());
+ }
+
+ public String getCalalogProperties(String catalogUrn) throws Exception {
+ return this.serializer.serializeObject(this
+ .getCalalogProperties(catalogUrn));
+ }
+
+ public String getCatalogServiceTransactionId(
+ String catalogTransactionIdObject, String catalogUrn) throws Exception {
+ return this.serializer.serializeObject(this.getCatalogServiceTransactionId(
+ this.serializer.deserializeObject(TransactionId.class,
+ catalogTransactionIdObject), catalogUrn));
+ }
+
+ public String getCatalogServiceTransactionId2(String catalogReceiptObject,
+ String generateNewObject) throws Exception {
+ return this.serializer.serializeObject(this.getCatalogServiceTransactionId(
+ this.serializer.deserializeObject(CatalogReceipt.class,
+ catalogReceiptObject), this.serializer.deserializeObject(
+ Boolean.class, generateNewObject)));
+ }
+
+ public String getCatalogServiceTransactionIds(
+ String catalogTransactionIdsObject, String catalogUrn) throws Exception {
+ return this.serializer.serializeObject(this
+ .getCatalogServiceTransactionIds(this.serializer.deserializeObject(
+ List.class, catalogTransactionIdsObject), catalogUrn));
+ }
+
+ public String getCurrentCatalogIds() throws Exception {
+ return this.serializer.serializeObject(this.getCurrentCatalogIds());
+ }
+
+ public String getMetadataFromTransactionIdStrings(
+ String catalogServiceTransactionIdStringsObject) throws Exception {
+ return this.serializer.serializeObject(this
+ .getMetadataFromTransactionIdStrings(this.serializer.deserializeObject(
+ List.class, catalogServiceTransactionIdStringsObject)));
+ }
+
+ public String getMetadataFromTransactionIds(
+ String catalogServiceTransactionIdsObject) throws Exception {
+ return this.serializer.serializeObject(this
+ .getMetadataFromTransactionIds(this.serializer.deserializeObject(
+ List.class, catalogServiceTransactionIdsObject)));
+ }
+
+ public String getNextPage(String queryPagerObject) throws Exception {
+ return this.serializer.serializeObject(this.getNextPage(this.serializer
+ .deserializeObject(QueryPager.class, queryPagerObject)));
+ }
+
+ public String getProperty(String key) throws Exception {
+ return this.serializer.serializeObject(this.getProperty(key));
+ }
+
+ public String ingest(String metadataObject) throws Exception {
+ return this.serializer.serializeObject(this.ingest(this.serializer
+ .deserializeObject(Metadata.class, metadataObject)));
+ }
+
+ public String isRestrictIngestPermissions() throws Exception {
+ return this.serializer.serializeObject(new Boolean(this
+ .isRestrictIngestPermissions()));
+ }
+
+ public String isRestrictQueryPermissions() throws Exception {
+ return this.serializer.serializeObject(new Boolean(this
+ .isRestrictQueryPermissions()));
+ }
+
+ public String query(String queryExpressionObject) throws Exception {
+ return this.serializer.serializeObject(this.query(this.serializer
+ .deserializeObject(QueryExpression.class, queryExpressionObject)));
+ }
+
+ public String query(String queryExpressionObject, String catalogIdsObject)
+ throws Exception {
+ return this.serializer.serializeObject(this.query(this.serializer
+ .deserializeObject(QueryExpression.class, queryExpressionObject),
+ this.serializer.deserializeObject(Set.class, catalogIdsObject)));
+ }
+
+ public String getNextPage2(String pageObject) throws Exception {
+ return this.serializer.serializeObject(this.getNextPage(this.serializer
+ .deserializeObject(Page.class, pageObject)));
+ }
+
+ public String getPage(String pageInfoObject, String queryExpressionObject)
+ throws Exception {
+ return this.serializer.serializeObject(this.getPage(this.serializer
+ .deserializeObject(PageInfo.class, pageInfoObject), this.serializer
+ .deserializeObject(QueryExpression.class, queryExpressionObject)));
+ }
+
+ public String getPage(String pageInfoObject, String queryExpressionObject,
+ String catalogIdsObject) throws Exception {
+ return this.serializer.serializeObject(this.getPage(this.serializer
+ .deserializeObject(PageInfo.class, pageInfoObject), this.serializer
+ .deserializeObject(QueryExpression.class, queryExpressionObject),
+ this.serializer.deserializeObject(Set.class, catalogIdsObject)));
+ }
+
+ public String getMetadata(String pageObject) throws Exception {
+ return this.serializer.serializeObject(this.getMetadata(this.serializer
+ .deserializeObject(Page.class, pageObject)));
+ }
+
+ public boolean removeCatalog(String catalogUrn) throws Exception {
+ this.removeCatalog(catalogUrn);
+ return true;
+ }
}