You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by le...@apache.org on 2015/09/08 06:25:18 UTC
svn commit: r1701724 [6/6] - in /oodt/branches/avro_rpc: ./
app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/
crawler/src/main/java/org/apache/oodt/cas/crawl/action/
crawler/src/main/java/org/apache/oodt/cas/crawl/comparator/ filem...
Added: oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/system/rpc/TestServerClientFactories.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/system/rpc/TestServerClientFactories.java?rev=1701724&view=auto
==============================================================================
--- oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/system/rpc/TestServerClientFactories.java (added)
+++ oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/system/rpc/TestServerClientFactories.java Tue Sep 8 04:25:17 2015
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.oodt.cas.filemgr.system.rpc;
+
+import junit.framework.TestCase;
+import org.apache.oodt.cas.filemgr.system.FileManagerServer;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Properties;
+
+public class TestServerClientFactories extends TestCase {
+
+ FileManagerServer fm;
+
+
+ public void setProprieties(){
+
+ //get all properties
+ Properties properties = new Properties(System.getProperties());
+
+ // first load the example configuration
+ try {
+ URL filemgrPropertiesUrl = this.getClass().getResource(
+ "/filemgr.properties");
+
+ properties.load(new FileInputStream(new File(filemgrPropertiesUrl.getFile())));
+ //set Properties so when the server will be instantiated from the right class.
+ System.setProperties(properties);
+
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+ }
+
+ public void setUp(){
+ setProprieties();
+ }
+
+ public void testServerInitialization(){
+ try {
+ fm = RpcCommunicationFactory.createServer(60001);
+ assertNotNull(fm);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+
+
+}
Modified: oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/tools/TestExpImpCatalog.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/tools/TestExpImpCatalog.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/tools/TestExpImpCatalog.java (original)
+++ oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/tools/TestExpImpCatalog.java Tue Sep 8 04:25:17 2015
@@ -22,8 +22,9 @@ package org.apache.oodt.cas.filemgr.tool
import org.apache.oodt.cas.filemgr.ingest.StdIngester;
import org.apache.oodt.cas.filemgr.metadata.CoreMetKeys;
import org.apache.oodt.cas.filemgr.structs.Product;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManager;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
+import org.apache.oodt.cas.filemgr.system.FileManagerServer;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
import org.apache.oodt.cas.metadata.Metadata;
import org.apache.oodt.cas.metadata.SerializableMetadata;
@@ -49,9 +50,9 @@ public class TestExpImpCatalog extends T
private static final int FM_PORT = 50010;
- private XmlRpcFileManager fm;
+ private FileManagerServer fm;
- private XmlRpcFileManager fm2;
+ private FileManagerServer fm2;
private ExpImpCatalog expImp;
@@ -79,8 +80,7 @@ public class TestExpImpCatalog extends T
// its name is test.txt
try {
- XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(
- new URL("http://localhost:" + (FM_PORT + 1)));
+ FileManagerClient fmClient = RpcCommunicationFactory.createClient(new URL("http://localhost:" + (FM_PORT + 1)));
assertEquals(1, fmClient.getNumProducts(fmClient
.getProductTypeByName("GenericFile")));
@@ -122,8 +122,7 @@ public class TestExpImpCatalog extends T
// now test that test.txt exists in cat 2
try {
- XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(
- new URL("http://localhost:" + (FM_PORT + 1)));
+ FileManagerClient fmClient = RpcCommunicationFactory.createClient(new URL("http://localhost:" + (FM_PORT + 1)));
assertEquals(2, fmClient.getNumProducts(fmClient
.getProductTypeByName("GenericFile")));
@@ -160,8 +159,7 @@ public class TestExpImpCatalog extends T
// now test that test.txt exists in cat 2
try {
- XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(
- new URL("http://localhost:" + (FM_PORT + 1)));
+ FileManagerClient fmClient = RpcCommunicationFactory.createClient(new URL("http://localhost:" + (FM_PORT + 1)));
Product prod = fmClient.getProductByName("test.txt");
assertNotNull(prod);
Metadata met = fmClient.getMetadata(prod);
@@ -187,8 +185,10 @@ public class TestExpImpCatalog extends T
URL ingestUrl = this.getClass().getResource("/ingest");
String cat1 = new File(ingestUrl.getFile()).getCanonicalPath() + "cat";
String cat2 = new File(ingestUrl.getFile()).getCanonicalPath() + "cat2";
- fm = startXmlRpcFileManager(FM_PORT, cat1);
- fm2 = startXmlRpcFileManager(FM_PORT + 1, cat2);
+ fm = startFileManager(FM_PORT, cat1);
+ fm.startUp();
+ fm2 = startFileManager(FM_PORT + 1, cat2);
+ fm2.startUp();
ingestTestFiles();
try {
expImp = new ExpImpCatalog(new URL("http://localhost:" + FM_PORT),
@@ -265,11 +265,11 @@ public class TestExpImpCatalog extends T
}
- private XmlRpcFileManager startXmlRpcFileManager(int port, String catPath) {
+ private FileManagerServer startFileManager(int port, String catPath) {
Properties properties = new Properties(System.getProperties());
- XmlRpcFileManager fileMgr = null;
+ FileManagerServer fileMgr = null;
// first make sure to load properties for the file manager
// and make sure to load logging properties as well
@@ -321,7 +321,7 @@ public class TestExpImpCatalog extends T
System.setProperties(properties);
try {
- fileMgr = new XmlRpcFileManager(port);
+ fileMgr = RpcCommunicationFactory.createServer(port);
} catch (Exception e) {
fail(e.getMessage());
}
Modified: oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/tools/TestMetadataBasedProductMover.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/tools/TestMetadataBasedProductMover.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/tools/TestMetadataBasedProductMover.java (original)
+++ oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/tools/TestMetadataBasedProductMover.java Tue Sep 8 04:25:17 2015
@@ -21,7 +21,8 @@ package org.apache.oodt.cas.filemgr.tool
//OODT imports
import org.apache.oodt.cas.filemgr.ingest.StdIngester;
import org.apache.oodt.cas.filemgr.metadata.CoreMetKeys;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManager;
+import org.apache.oodt.cas.filemgr.system.FileManagerServer;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
import org.apache.oodt.cas.metadata.Metadata;
import org.apache.oodt.cas.metadata.SerializableMetadata;
@@ -45,7 +46,7 @@ public class TestMetadataBasedProductMov
private static final int FM_PORT = 50010;
- private XmlRpcFileManager fm;
+ private FileManagerServer fm;
private String luceneCatLoc;
@@ -233,7 +234,8 @@ public class TestMetadataBasedProductMov
System.setProperties(properties);
try {
- fm = new XmlRpcFileManager(FM_PORT);
+ fm = RpcCommunicationFactory.createServer(FM_PORT);
+ fm.startUp();
} catch (Exception e) {
fail(e.getMessage());
}
Added: oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/util/TestAvroTypesFactory.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/util/TestAvroTypesFactory.java?rev=1701724&view=auto
==============================================================================
--- oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/util/TestAvroTypesFactory.java (added)
+++ oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/util/TestAvroTypesFactory.java Tue Sep 8 04:25:17 2015
@@ -0,0 +1,199 @@
+package org.apache.oodt.cas.filemgr.util;
+
+import com.google.common.collect.Lists;
+import junit.framework.TestCase;
+import org.apache.oodt.cas.filemgr.datatransfer.InPlaceDataTransferFactory;
+import org.apache.oodt.cas.filemgr.datatransfer.LocalDataTransferFactory;
+import org.apache.oodt.cas.filemgr.structs.*;
+import org.apache.oodt.cas.filemgr.structs.avrotypes.AvroProductType;
+import org.apache.oodt.cas.filemgr.structs.exceptions.ConnectionException;
+import org.apache.oodt.cas.filemgr.structs.exceptions.RepositoryManagerException;
+import org.apache.oodt.cas.filemgr.structs.type.TypeHandler;
+
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
+import org.apache.oodt.cas.filemgr.system.FileManagerServer;
+import org.apache.oodt.cas.metadata.Metadata;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.*;
+
+
+public class TestAvroTypesFactory extends TestCase {
+
+ final int FILEMGR_PORT = 9999;
+ FileManagerServer fmServer;
+ private Properties initialProperties = new Properties(
+ System.getProperties());
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ startRpcFileManager();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ fmServer.shutdown();
+
+ // Return system properties to their initial state from before this test
+ // was run.
+ System.setProperties(initialProperties);
+ }
+
+ public void testProductTypeMethods() throws RepositoryManagerException, MalformedURLException, ConnectionException {
+ FileManagerClient fmClient = RpcCommunicationFactory.createClient(new URL("http://localhost:" + FILEMGR_PORT));
+ fmClient.setDataTransfer(new LocalDataTransferFactory().createDataTransfer());
+
+ ProductType productType = fmClient.getProductTypeByName("GenericFile");
+ AvroProductType avroProductType = AvroTypeFactory.getAvroProductType(productType);
+
+ ProductType convBackProdType = AvroTypeFactory.getProductType(avroProductType);
+ assertTrue(productType.getProductTypeId().equals(convBackProdType.getProductTypeId()));
+ assertTrue(productType.getName().equals(convBackProdType.getName()));
+ assertTrue(productType.getDescription().equals(convBackProdType.getDescription()));
+ assertTrue(productType.getVersioner().equals(convBackProdType.getVersioner()));
+ assertTrue(productType.getProductRepositoryPath().equals(convBackProdType.getProductRepositoryPath()));
+ for (int i = 0; i < productType.getExtractors().size(); i++) {
+ ExtractorSpec spec1 = productType.getExtractors().get(i);
+ ExtractorSpec spec2 = convBackProdType.getExtractors().get(i);
+ assertTrue(spec1.getClassName().equals(spec2.getClassName()));
+ assertTrue(spec1.getConfiguration().equals(spec2.getConfiguration()));
+ }
+ for (int i = 0; i < productType.getHandlers().size(); i++) {
+ TypeHandler handler1 = productType.getHandlers().get(i);
+ TypeHandler handler2 = convBackProdType.getHandlers().get(i);
+ assertTrue(handler1.getClass().getCanonicalName().equals(handler2.getClass().getCanonicalName()));
+ assertTrue(handler1.getElementName().equals(handler2.getElementName()));
+ }
+ }
+
+ public void testProductMethods() throws Exception {
+ FileManagerClient fmClient = RpcCommunicationFactory.createClient(new URL("http://localhost:" + FILEMGR_PORT));
+ fmClient.setDataTransfer(new InPlaceDataTransferFactory().createDataTransfer());
+
+ Product product = new Product();
+ Product roundTripProduct = AvroTypeFactory.getProduct(
+ AvroTypeFactory.getAvroProduct(product));
+ assertEquals(product, roundTripProduct);
+
+ product = new Product();
+ product.setProductId("TestId");
+ product.setProductName("TestName");
+ product.setProductReferences(Lists.newArrayList(new Reference("file:///original/path", null, 2)));
+ product.setProductStructure("Flat");
+ product.setProductType(fmClient.getProductTypeByName("GenericFile"));
+ product.setRootRef(new Reference("file:///original/root", "file:///datastore/root", 3));
+ roundTripProduct = AvroTypeFactory.getProduct(
+ AvroTypeFactory.getAvroProduct(product));
+ assertEquals(product, roundTripProduct);
+ Metadata m = new Metadata();
+ m.addMetadata("TestKey", "TestValue");
+
+ roundTripProduct = fmClient.getProductById(
+ fmClient.ingestProduct(product, m, true));
+ assertEquals(product, roundTripProduct);
+ }
+
+ private void assertEquals(Product product1, Product product2) {
+ if (product1 == null) {
+ assertNull(product2);
+ return;
+ }
+ assertEquals(product1.getProductId(), product2.getProductId());
+ assertEquals(product1.getProductName(), product2.getProductName());
+ assertEquals(product1.getProductStructure(), product2.getProductStructure());
+ assertEquals(product1.getTransferStatus(), product2.getTransferStatus());
+ if (product1.getProductReferences() == null) {
+ assertEquals(product1.getProductReferences(), product2.getProductReferences());
+ } else {
+ for (int i = 0; i < product1.getProductReferences().size(); i++) {
+ assertEquals(product1.getProductReferences().get(i),
+ product2.getProductReferences().get(i));
+ }
+ }
+ if (product1.getProductType() == null) {
+ assertEquals(product1.getProductType(), product2.getProductType());
+ } else {
+ assertEquals(product1.getProductType().getDescription(), product2.getProductType().getDescription());
+ assertEquals(product1.getProductType().getName(), product2.getProductType().getName());
+ assertEquals(product1.getProductType().getProductRepositoryPath(), product2.getProductType().getProductRepositoryPath());
+ assertEquals(product1.getProductType().getProductTypeId(), product2.getProductType().getProductTypeId());
+ assertEquals(product1.getProductType().getVersioner(), product2.getProductType().getVersioner());
+ }
+ assertEquals(product1.getRootRef(), product2.getRootRef());
+ }
+
+ private void assertEquals(Reference ref1, Reference ref2) {
+ if (ref1 == null) {
+ assertNull(ref2);
+ return;
+ }
+ assertNotNull(ref2.getDataStoreReference());
+ assertEquals(ref1.getFileSize(), ref2.getFileSize());
+ assertEquals(ref1.getOrigReference(), ref2.getOrigReference());
+ assertEquals(ref1.getMimeType(), ref2.getMimeType());
+ }
+
+ private void startRpcFileManager() {
+
+ Properties properties = new Properties(System.getProperties());
+
+ // first make sure to load properties for the file manager
+ // and make sure to load logging properties as well
+
+ // set the log levels
+ URL loggingPropertiesUrl = this.getClass().getResource(
+ "/test.logging.properties");
+ properties.setProperty("java.util.logging.config.file",
+ new File(loggingPropertiesUrl.getFile()).getAbsolutePath());
+
+ // first load the example configuration
+ try {
+ URL filemgrPropertiesUrl = this.getClass().getResource(
+ "/filemgr.properties");
+ properties.load(new FileInputStream(
+ filemgrPropertiesUrl.getFile()));
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+
+ properties.setProperty("filemgr.catalog.factory",
+ "org.apache.oodt.cas.filemgr.catalog.MockCatalogFactory");
+
+ // now override the repo mgr policy
+ URL structFactoryUrl = this.getClass().getResource(
+ "/xmlrpc-struct-factory");
+ try {
+ properties.setProperty(
+ "org.apache.oodt.cas.filemgr.repositorymgr.dirs",
+ "file://" + new File(structFactoryUrl.getFile())
+ .getCanonicalPath());
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+
+ // now override the val layer ones
+ properties.setProperty("org.apache.oodt.cas.filemgr.validation.dirs",
+ "file://" + new File(structFactoryUrl.getFile()).getAbsolutePath());
+
+ // set up mime repo path
+ URL mimeTypesUrl = this.getClass().getResource("/mime-types.xml");
+ properties.setProperty(
+ "org.apache.oodt.cas.filemgr.mime.type.repository",
+ new File(mimeTypesUrl.getFile()).getAbsolutePath());
+
+ // Use the local properties object to set system properties.
+ System.setProperties(properties);
+
+ try {
+ fmServer = RpcCommunicationFactory.createServer(FILEMGR_PORT);
+ fmServer.startUp();
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+ }
+}
Modified: oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/util/TestXmlRpcStructFactory.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/util/TestXmlRpcStructFactory.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/util/TestXmlRpcStructFactory.java (original)
+++ oodt/branches/avro_rpc/filemgr/src/test/java/org/apache/oodt/cas/filemgr/util/TestXmlRpcStructFactory.java Tue Sep 8 04:25:17 2015
@@ -26,8 +26,8 @@ import org.apache.oodt.cas.filemgr.struc
import org.apache.oodt.cas.filemgr.structs.exceptions.ConnectionException;
import org.apache.oodt.cas.filemgr.structs.exceptions.RepositoryManagerException;
import org.apache.oodt.cas.filemgr.structs.type.TypeHandler;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManager;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
+import org.apache.oodt.cas.filemgr.system.FileManagerServer;
import org.apache.oodt.cas.metadata.Metadata;
//Google imports
@@ -53,7 +53,7 @@ import junit.framework.TestCase;
public class TestXmlRpcStructFactory extends TestCase {
final int FILEMGR_PORT = 9999;
- XmlRpcFileManager fmServer;
+ FileManagerServer fmServer;
private Properties initialProperties = new Properties(
System.getProperties());
@@ -74,7 +74,7 @@ public class TestXmlRpcStructFactory ext
}
public void testProductTypeMethods() throws RepositoryManagerException, MalformedURLException, ConnectionException {
- XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(new URL("http://localhost:" + FILEMGR_PORT));
+ FileManagerClient fmClient = RpcCommunicationFactory.createClient(new URL("http://localhost:" + FILEMGR_PORT));
fmClient.setDataTransfer(new LocalDataTransferFactory().createDataTransfer());
ProductType productType = fmClient.getProductTypeByName("GenericFile");
@@ -101,7 +101,7 @@ public class TestXmlRpcStructFactory ext
}
public void testProductMethods() throws Exception {
- XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(new URL("http://localhost:" + FILEMGR_PORT));
+ FileManagerClient fmClient = RpcCommunicationFactory.createClient(new URL("http://localhost:" + FILEMGR_PORT));
fmClient.setDataTransfer(new InPlaceDataTransferFactory().createDataTransfer());
Product product = new Product();
@@ -218,7 +218,8 @@ public class TestXmlRpcStructFactory ext
System.setProperties(properties);
try {
- fmServer = new XmlRpcFileManager(FILEMGR_PORT);
+ fmServer = RpcCommunicationFactory.createServer(FILEMGR_PORT);
+ fmServer.startUp();
} catch (Exception e) {
fail(e.getMessage());
}
Added: oodt/branches/avro_rpc/filemgr/src/test/resources/createProduct/test.txt
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/filemgr/src/test/resources/createProduct/test.txt?rev=1701724&view=auto
==============================================================================
--- oodt/branches/avro_rpc/filemgr/src/test/resources/createProduct/test.txt (added)
+++ oodt/branches/avro_rpc/filemgr/src/test/resources/createProduct/test.txt Tue Sep 8 04:25:17 2015
@@ -0,0 +1 @@
+This is a file test for avro rpc.
\ No newline at end of file
Modified: oodt/branches/avro_rpc/filemgr/src/test/resources/filemgr.properties
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/filemgr/src/test/resources/filemgr.properties?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/filemgr/src/test/resources/filemgr.properties (original)
+++ oodt/branches/avro_rpc/filemgr/src/test/resources/filemgr.properties Tue Sep 8 04:25:17 2015
@@ -15,6 +15,12 @@
# Test Configuration properties for the File Manager
+# rpc configuration, uncomment the avro implementations to use AvroRPC
+filemgr.server=org.apache.oodt.cas.filemgr.system.rpc.XmlRpcFileManagerServerFactory
+filemgr.client=org.apache.oodt.cas.filemgr.system.rpc.XmlRpcFileManagerClientFactory
+#filemgr.server=org.apache.oodt.cas.filemgr.system.rpc.AvroFileManagerServerFactory
+#filemgr.client=org.apache.oodt.cas.filemgr.system.rpc.AvroFileManagerClientFactory
+
# repository factory
filemgr.repository.factory=org.apache.oodt.cas.filemgr.repository.XMLRepositoryManagerFactory
Modified: oodt/branches/avro_rpc/mvn/archetypes/radix/src/main/resources/archetype-resources/filemgr/src/main/resources/bin/filemgr
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/mvn/archetypes/radix/src/main/resources/archetype-resources/filemgr/src/main/resources/bin/filemgr?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/mvn/archetypes/radix/src/main/resources/archetype-resources/filemgr/src/main/resources/bin/filemgr (original)
+++ oodt/branches/avro_rpc/mvn/archetypes/radix/src/main/resources/archetype-resources/filemgr/src/main/resources/bin/filemgr Tue Sep 8 04:25:17 2015
@@ -85,7 +85,7 @@ if [ "$1" = "start" ]; then
-Djava.util.logging.config.file="$FILEMGR_HOME"/etc/logging.properties \
-Dorg.apache.oodt.cas.filemgr.properties="$FILEMGR_HOME"/etc/filemgr.properties \
-Djava.io.tmpdir="$OODT_TMPDIR" \
- org.apache.oodt.cas.filemgr.system.XmlRpcFileManager \
+ org.apache.oodt.cas.filemgr.system.FileManagerServerMain \
--portNum $FILEMGR_PORT 2>&1 &
if [ ! -z "$FILEMGR_PID" ]; then
Modified: oodt/branches/avro_rpc/mvn/archetypes/radix/src/main/resources/archetype-resources/filemgr/src/main/resources/bin/filemgr-client
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/mvn/archetypes/radix/src/main/resources/archetype-resources/filemgr/src/main/resources/bin/filemgr-client?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/mvn/archetypes/radix/src/main/resources/archetype-resources/filemgr/src/main/resources/bin/filemgr-client (original)
+++ oodt/branches/avro_rpc/mvn/archetypes/radix/src/main/resources/archetype-resources/filemgr/src/main/resources/bin/filemgr-client Tue Sep 8 04:25:17 2015
@@ -74,4 +74,4 @@ cd "$FILEMGR_HOME"/bin
-Djava.util.logging.config.file="$FILEMGR_HOME"/etc/logging.properties \
-Dorg.apache.oodt.cas.cli.action.spring.config=file:"$FILEMGR_HOME"/policy/cmd-line-actions.xml \
-Dorg.apache.oodt.cas.cli.option.spring.config=file:"$FILEMGR_HOME"/policy/cmd-line-options.xml \
- org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient "$@"
+ org.apache.oodt.cas.filemgr.system.FileManagerClientMain "$@"
Modified: oodt/branches/avro_rpc/pcs/core/src/main/java/org/apache/oodt/pcs/util/FileManagerUtils.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/pcs/core/src/main/java/org/apache/oodt/pcs/util/FileManagerUtils.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/pcs/core/src/main/java/org/apache/oodt/pcs/util/FileManagerUtils.java (original)
+++ oodt/branches/avro_rpc/pcs/core/src/main/java/org/apache/oodt/pcs/util/FileManagerUtils.java Tue Sep 8 04:25:17 2015
@@ -18,6 +18,8 @@
package org.apache.oodt.pcs.util;
//OODT imports
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
import org.apache.oodt.pcs.metadata.PCSConfigMetadata;
import org.apache.oodt.pcs.query.FilenameQuery;
import org.apache.oodt.cas.filemgr.structs.Element;
@@ -29,7 +31,6 @@ import org.apache.oodt.cas.filemgr.struc
import org.apache.oodt.cas.filemgr.structs.exceptions.ConnectionException;
import org.apache.oodt.cas.filemgr.structs.exceptions.RepositoryManagerException;
import org.apache.oodt.cas.filemgr.structs.exceptions.ValidationLayerException;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
import org.apache.oodt.cas.metadata.Metadata;
//JDK imports
@@ -58,13 +59,13 @@ public class FileManagerUtils implements
private static Logger LOG = Logger
.getLogger(FileManagerUtils.class.getName());
- private XmlRpcFileManagerClient fmgrClient = null;
+ private FileManagerClient fmgrClient = null;
private URL fmUrl;
public FileManagerUtils(URL fileMgrUrl) {
try {
- fmgrClient = new XmlRpcFileManagerClient(fileMgrUrl);
+ fmgrClient = RpcCommunicationFactory.createClient(fileMgrUrl);
} catch (ConnectionException e) {
LOG.log(Level.SEVERE, "Unable to connect to file manager: ["
+ fileMgrUrl.toString() + "]");
@@ -78,7 +79,7 @@ public class FileManagerUtils implements
this(safeGetUrlFromString(fmUrlStr));
}
- public FileManagerUtils(XmlRpcFileManagerClient client) {
+ public FileManagerUtils(FileManagerClient client) {
this.fmgrClient = client;
}
@@ -395,7 +396,7 @@ public class FileManagerUtils implements
/**
* @return the fmgrClient
*/
- public XmlRpcFileManagerClient getFmgrClient() {
+ public FileManagerClient getFmgrClient() {
return fmgrClient;
}
@@ -403,7 +404,7 @@ public class FileManagerUtils implements
* @param fmgrClient
* the fmgrClient to set
*/
- public void setFmgrClient(XmlRpcFileManagerClient fmgrClient) {
+ public void setFmgrClient(FileManagerClient fmgrClient) {
this.fmgrClient = fmgrClient;
if (this.fmgrClient != null) {
this.fmUrl = this.fmgrClient.getFileManagerUrl();
Modified: oodt/branches/avro_rpc/pge/src/main/java/org/apache/oodt/cas/pge/staging/FileStager.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/pge/src/main/java/org/apache/oodt/cas/pge/staging/FileStager.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/pge/src/main/java/org/apache/oodt/cas/pge/staging/FileStager.java (original)
+++ oodt/branches/avro_rpc/pge/src/main/java/org/apache/oodt/cas/pge/staging/FileStager.java Tue Sep 8 04:25:17 2015
@@ -33,7 +33,8 @@ import org.apache.commons.lang.Validate;
import org.apache.oodt.cas.filemgr.structs.Product;
import org.apache.oodt.cas.filemgr.structs.Reference;
import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
import org.apache.oodt.cas.pge.config.FileStagingInfo;
import org.apache.oodt.cas.pge.metadata.PgeMetadata;
@@ -65,7 +66,7 @@ public abstract class FileStager {
}
}
if (!fileStagingInfo.getProductIds().isEmpty()) {
- XmlRpcFileManagerClient fmClient = createFileManagerClient(pgeMetadata);
+ FileManagerClient fmClient = createFileManagerClient(pgeMetadata);
for (String productId : fileStagingInfo.getProductIds()) {
logger.log(Level.INFO, "Staging product [" + productId
+ "] to directory ["
@@ -83,19 +84,19 @@ public abstract class FileStager {
}
@VisibleForTesting
- static XmlRpcFileManagerClient createFileManagerClient(PgeMetadata pgeMetadata)
+ static FileManagerClient createFileManagerClient(PgeMetadata pgeMetadata)
throws Exception {
String filemgrUrl = pgeMetadata.getMetadata(QUERY_FILE_MANAGER_URL);
if (filemgrUrl == null) {
throw new Exception("Must specify [" + QUERY_FILE_MANAGER_URL
+ "] if you want to stage product IDs");
}
- return new XmlRpcFileManagerClient(new URL(filemgrUrl));
+ return RpcCommunicationFactory.createClient(new URL(filemgrUrl));
}
@VisibleForTesting
static List<URI> getProductReferences(
- String productId, XmlRpcFileManagerClient fmClient)
+ String productId, FileManagerClient fmClient)
throws URISyntaxException, CatalogException {
List<URI> files = Lists.newArrayList();
Product product = new Product();
Modified: oodt/branches/avro_rpc/pge/src/main/java/org/apache/oodt/cas/pge/util/XmlHelper.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/pge/src/main/java/org/apache/oodt/cas/pge/util/XmlHelper.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/pge/src/main/java/org/apache/oodt/cas/pge/util/XmlHelper.java (original)
+++ oodt/branches/avro_rpc/pge/src/main/java/org/apache/oodt/cas/pge/util/XmlHelper.java Tue Sep 8 04:25:17 2015
@@ -64,8 +64,8 @@ import java.util.Arrays;
import java.util.List;
//OODT imports
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
import org.apache.oodt.cas.filemgr.util.QueryUtils;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
import org.apache.oodt.cas.filemgr.util.SqlParser;
import org.apache.oodt.cas.metadata.Metadata;
import org.apache.oodt.cas.metadata.filenaming.PathUtilsNamingConvention;
@@ -490,12 +490,12 @@ public class XmlHelper {
if (value.toUpperCase().matches(
"^\\s*SQL\\s*\\(.*\\)\\s*\\{.*\\}\\s*$"))
value = QueryUtils
- .getQueryResultsAsString(new XmlRpcFileManagerClient(
- new URL(inputMetadata
- .getMetadata(QUERY_FILE_MANAGER_URL
- .getName())))
+ .getQueryResultsAsString(RpcCommunicationFactory.createClient(new URL(inputMetadata
+ .getMetadata(QUERY_FILE_MANAGER_URL
+ .getName())))
.complexQuery(SqlParser
.parseSqlQueryMethod(value)));
+
return value;
} catch (Exception e) {
throw new Exception("Failed to parse value: " + value, e);
Modified: oodt/branches/avro_rpc/pge/src/test/java/org/apache/oodt/cas/pge/staging/TestFileStager.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/pge/src/test/java/org/apache/oodt/cas/pge/staging/TestFileStager.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/pge/src/test/java/org/apache/oodt/cas/pge/staging/TestFileStager.java (original)
+++ oodt/branches/avro_rpc/pge/src/test/java/org/apache/oodt/cas/pge/staging/TestFileStager.java Tue Sep 8 04:25:17 2015
@@ -33,8 +33,9 @@ import java.util.List;
import org.apache.oodt.cas.filemgr.structs.Product;
import org.apache.oodt.cas.filemgr.structs.Reference;
import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManager;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
+import org.apache.oodt.cas.filemgr.system.FileManagerServer;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
import org.apache.oodt.cas.pge.metadata.PgeMetadata;
import org.apache.oodt.cas.pge.metadata.PgeTaskMetKeys;
@@ -72,7 +73,8 @@ public class TestFileStager extends Test
System.setProperty("filemgr.catalog.factory", "");
System.setProperty("filemgr.repository.factory", "");
int port = 9876;
- XmlRpcFileManager filemgr = new XmlRpcFileManager(port);
+ FileManagerServer filemgr = RpcCommunicationFactory.createServer(port);
+ filemgr.startUp();
String filemgrUrl = "http://localhost:" + port;
pgeMetadata = createStrictMock(PgeMetadata.class);
expect(pgeMetadata.getMetadata(PgeTaskMetKeys.QUERY_FILE_MANAGER_URL))
@@ -96,7 +98,7 @@ public class TestFileStager extends Test
Reference ref2 = new Reference();
ref2.setDataStoreReference(uri2);
- XmlRpcFileManagerClient fmClient = createStrictMock(XmlRpcFileManagerClient.class);
+ FileManagerClient fmClient = createStrictMock(FileManagerClient.class);
expect(fmClient.getProductReferences(ProductIdMatcher.eqProductId(productId))).andReturn(
Lists.newArrayList(ref1, ref2));
replay(fmClient);
Modified: oodt/branches/avro_rpc/profile/src/main/java/org/apache/oodt/profile/handlers/cas/CASProfileHandler.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/profile/src/main/java/org/apache/oodt/profile/handlers/cas/CASProfileHandler.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/profile/src/main/java/org/apache/oodt/profile/handlers/cas/CASProfileHandler.java (original)
+++ oodt/branches/avro_rpc/profile/src/main/java/org/apache/oodt/profile/handlers/cas/CASProfileHandler.java Tue Sep 8 04:25:17 2015
@@ -24,7 +24,8 @@ import org.apache.oodt.cas.filemgr.struc
import org.apache.oodt.cas.filemgr.structs.ProductType;
import org.apache.oodt.cas.filemgr.structs.Query;
import org.apache.oodt.cas.filemgr.structs.TermQueryCriteria;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
import org.apache.oodt.cas.metadata.Metadata;
import org.apache.oodt.profile.handlers.cas.util.ProfileUtils;
@@ -60,7 +61,7 @@ public class CASProfileHandler implement
.getName());
/* our filemgr client */
- private XmlRpcFileManagerClient fmClient = null;
+ private FileManagerClient fmClient = null;
/* the base URL to the data delivery servlet for products */
/* AKA our "web-ified" product server */
@@ -77,7 +78,8 @@ public class CASProfileHandler implement
"org.apache.oodt.cas.profile.fmUrl", "http://localhost:9000");
try {
- fmClient = new XmlRpcFileManagerClient(new URL(filemgrUrlStr));
+ fmClient = RpcCommunicationFactory.createClient(new URL(filemgrUrlStr));
+
} catch (Exception e) {
throw new InstantiationException(
"Error communicating with the filemgr: [" + filemgrUrlStr
Modified: oodt/branches/avro_rpc/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/FileManagerConn.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/FileManagerConn.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/FileManagerConn.java (original)
+++ oodt/branches/avro_rpc/webapp/components/src/main/java/org/apache/oodt/cas/webcomponents/filemgr/FileManagerConn.java Tue Sep 8 04:25:17 2015
@@ -30,7 +30,8 @@ import org.apache.oodt.cas.filemgr.struc
import org.apache.oodt.cas.filemgr.structs.Reference;
import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException;
import org.apache.oodt.cas.filemgr.structs.exceptions.RepositoryManagerException;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
import org.apache.oodt.cas.metadata.Metadata;
/**
@@ -43,7 +44,7 @@ import org.apache.oodt.cas.metadata.Meta
*/
public class FileManagerConn {
- private XmlRpcFileManagerClient fm;
+ private FileManagerClient fm;
private static final Logger LOG = Logger.getLogger(FileManagerConn.class
.getName());
@@ -127,13 +128,13 @@ public class FileManagerConn {
return types;
}
- public XmlRpcFileManagerClient getFm() {
+ public FileManagerClient getFm() {
return this.fm;
}
public void initFm(String urlStr) {
try {
- this.fm = new XmlRpcFileManagerClient(new URL(urlStr));
+ this.fm = RpcCommunicationFactory.createClient(new URL(urlStr));
} catch (Exception e) {
LOG.log(Level.WARNING, "Unable to connect to the file manager at: ["
+ urlStr + "]");
Modified: oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/CASProductHandler.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/CASProductHandler.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/CASProductHandler.java (original)
+++ oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/CASProductHandler.java Tue Sep 8 04:25:17 2015
@@ -35,7 +35,8 @@ import org.apache.oodt.cas.filemgr.struc
import org.apache.oodt.cas.filemgr.structs.Reference;
import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException;
import org.apache.oodt.cas.filemgr.structs.exceptions.ConnectionException;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
import org.apache.oodt.cas.product.data.DataUtils;
import org.apache.oodt.product.LargeProductQueryHandler;
import org.apache.oodt.product.ProductException;
@@ -55,12 +56,11 @@ import static org.apache.oodt.cas.produc
*/
public class CASProductHandler implements LargeProductQueryHandler {
- private XmlRpcFileManagerClient fm;
+ private FileManagerClient fm;
public CASProductHandler() throws MalformedURLException,
ConnectionException {
- this.fm = new XmlRpcFileManagerClient(new URL(System.getProperty(
- "fm.url", "http://localhost:9000")));
+ this.fm = RpcCommunicationFactory.createClient(new URL(System.getProperty("fm.url", "http://localhost:9000")));
}
/*
Modified: oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DataDeliveryServlet.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DataDeliveryServlet.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DataDeliveryServlet.java (original)
+++ oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DataDeliveryServlet.java Tue Sep 8 04:25:17 2015
@@ -23,7 +23,8 @@ import org.apache.oodt.cas.filemgr.struc
import org.apache.oodt.cas.filemgr.structs.exceptions.ConnectionException;
import org.apache.oodt.cas.filemgr.structs.Product;
import org.apache.oodt.cas.filemgr.structs.Reference;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
import org.apache.oodt.cas.metadata.Metadata;
import org.apache.oodt.cas.metadata.util.PathUtils;
@@ -68,7 +69,7 @@ public class DataDeliveryServlet extends
}
if (fileMgrURL == null)
fileMgrURL = "http://localhost:9000";
- client = new XmlRpcFileManagerClient(new URL(fileMgrURL));
+ client = RpcCommunicationFactory.createClient(new URL(fileMgrURL));
} catch (MalformedURLException ex) {
throw new ServletException(ex);
} catch (ConnectionException ex) {
@@ -252,7 +253,7 @@ public class DataDeliveryServlet extends
}
/** Client i/f to filemgr server. */
- private XmlRpcFileManagerClient client;
+ private FileManagerClient client;
/** our log stream */
private static final Logger LOG = Logger.getLogger(DataDeliveryServlet.class
Modified: oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DatasetDeliveryServlet.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DatasetDeliveryServlet.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DatasetDeliveryServlet.java (original)
+++ oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/data/DatasetDeliveryServlet.java Tue Sep 8 04:25:17 2015
@@ -23,7 +23,8 @@ import org.apache.oodt.cas.filemgr.struc
import org.apache.oodt.cas.filemgr.structs.ProductPage;
import org.apache.oodt.cas.filemgr.structs.ProductType;
import org.apache.oodt.cas.filemgr.structs.exceptions.ConnectionException;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
import org.apache.oodt.cas.metadata.Metadata;
import org.apache.oodt.cas.metadata.util.PathUtils;
@@ -64,7 +65,7 @@ public class DatasetDeliveryServlet exte
private static final long serialVersionUID = -6692665690674186105L;
/* our file manager client */
- private XmlRpcFileManagerClient client;
+ private FileManagerClient client;
/* the working dir in which to create huge zip files */
private String workingDirPath;
@@ -255,7 +256,7 @@ public class DatasetDeliveryServlet exte
}
if (fileMgrURL == null)
fileMgrURL = "http://localhost:9000";
- client = new XmlRpcFileManagerClient(new URL(fileMgrURL));
+ client = RpcCommunicationFactory.createClient(new URL(fileMgrURL));
} catch (MalformedURLException ex) {
throw new ServletException(ex);
} catch (ConnectionException ex) {
Modified: oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/jaxrs/services/CasProductJaxrsService.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/jaxrs/services/CasProductJaxrsService.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/jaxrs/services/CasProductJaxrsService.java (original)
+++ oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/jaxrs/services/CasProductJaxrsService.java Tue Sep 8 04:25:17 2015
@@ -35,7 +35,7 @@ import org.apache.oodt.cas.filemgr.struc
import org.apache.oodt.cas.filemgr.structs.Product;
import org.apache.oodt.cas.filemgr.structs.ProductType;
import org.apache.oodt.cas.filemgr.structs.Reference;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
import org.apache.oodt.cas.metadata.Metadata;
import org.apache.oodt.cas.product.jaxrs.exceptions.BadRequestException;
import org.apache.oodt.cas.product.jaxrs.exceptions.NotFoundException;
@@ -90,7 +90,7 @@ public class CasProductJaxrsService
try
{
- XmlRpcFileManagerClient client = getContextClient();
+ FileManagerClient client = getContextClient();
Product product = client.getProductById(productId);
List<Reference> references = client.getProductReferences(product);
@@ -129,7 +129,7 @@ public class CasProductJaxrsService
try
{
- XmlRpcFileManagerClient client = getContextClient();
+ FileManagerClient client = getContextClient();
// Find the product.
Product product = client.getProductById(productId);
@@ -174,7 +174,7 @@ public class CasProductJaxrsService
try
{
- XmlRpcFileManagerClient client = getContextClient();
+ FileManagerClient client = getContextClient();
String datasetId;
String datasetName;
@@ -250,7 +250,7 @@ public class CasProductJaxrsService
try
{
- XmlRpcFileManagerClient client = getContextClient();
+ FileManagerClient client = getContextClient();
for (FileTransferStatus status : client.getCurrentFileTransfers())
{
Reference reference = status.getFileRef();
@@ -300,7 +300,7 @@ public class CasProductJaxrsService
{
List<TransferResource> transferResources =
new ArrayList<TransferResource>();
- XmlRpcFileManagerClient client = getContextClient();
+ FileManagerClient client = getContextClient();
for (FileTransferStatus status : client.getCurrentFileTransfers())
{
Product product = status.getParentProduct();
@@ -351,15 +351,15 @@ public class CasProductJaxrsService
* @throws Exception if an object cannot be retrieved from the context
* attribute
*/
- public XmlRpcFileManagerClient getContextClient()
+ public FileManagerClient getContextClient()
throws Exception
{
// Get the file manager client from the servlet context.
Object clientObject = context.getAttribute("client");
if (clientObject != null &&
- clientObject instanceof XmlRpcFileManagerClient)
+ clientObject instanceof FileManagerClient)
{
- return (XmlRpcFileManagerClient) clientObject;
+ return (FileManagerClient) clientObject;
}
String message = "Unable to get the file manager client from the "
Modified: oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/jaxrs/servlets/CasProductJaxrsServlet.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/jaxrs/servlets/CasProductJaxrsServlet.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/jaxrs/servlets/CasProductJaxrsServlet.java (original)
+++ oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/jaxrs/servlets/CasProductJaxrsServlet.java Tue Sep 8 04:25:17 2015
@@ -33,7 +33,8 @@ import javax.servlet.ServletException;
import org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet;
import org.apache.oodt.cas.filemgr.structs.exceptions.ConnectionException;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
import org.apache.oodt.cas.metadata.util.PathUtils;
import org.apache.oodt.cas.product.jaxrs.configurations.RdfConfiguration;
import org.apache.oodt.cas.product.jaxrs.configurations.RssConfiguration;
@@ -98,7 +99,7 @@ public class CasProductJaxrsServlet exte
// Attempt to connect the client to the file manager and if successful
// store the client as a context attribute for other objects to access.
- XmlRpcFileManagerClient client = new XmlRpcFileManagerClient(url);
+ FileManagerClient client = RpcCommunicationFactory.createClient(url);
context.setAttribute("client", client);
}
catch (MalformedURLException e)
Modified: oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFDatasetServlet.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFDatasetServlet.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFDatasetServlet.java (original)
+++ oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFDatasetServlet.java Tue Sep 8 04:25:17 2015
@@ -36,6 +36,9 @@ import java.util.Iterator;
import java.util.Vector;
import java.util.logging.Logger;
import java.util.logging.Level;
+
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import java.io.FileNotFoundException;
@@ -50,7 +53,6 @@ import org.apache.commons.lang.WordUtils
import org.apache.oodt.cas.filemgr.structs.exceptions.RepositoryManagerException;
import org.apache.oodt.cas.filemgr.structs.exceptions.ConnectionException;
import org.apache.oodt.cas.filemgr.structs.ProductType;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
import org.apache.oodt.cas.metadata.util.PathUtils;
import org.apache.oodt.commons.xml.XMLUtils;
@@ -71,7 +73,7 @@ public class RDFDatasetServlet extends H
private static final long serialVersionUID = -3660991271642533985L;
/* our client to the file manager */
- private static XmlRpcFileManagerClient fClient = null;
+ private static FileManagerClient fClient = null;
/* our log stream */
private Logger LOG = Logger.getLogger(RDFProductServlet.class.getName());
@@ -116,7 +118,7 @@ public class RDFDatasetServlet extends H
fClient = null;
try {
- fClient = new XmlRpcFileManagerClient(new URL(fileManagerUrl));
+ fClient = RpcCommunicationFactory.createClient(new URL(fileManagerUrl));
} catch (MalformedURLException e) {
LOG.log(Level.SEVERE,
"Unable to initialize file manager url in RDF Servlet: [url="
Modified: oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFProductServlet.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFProductServlet.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFProductServlet.java (original)
+++ oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rdf/RDFProductServlet.java Tue Sep 8 04:25:17 2015
@@ -36,6 +36,9 @@ import java.util.Iterator;
import java.util.Vector;
import java.util.logging.Logger;
import java.util.logging.Level;
+
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import java.io.FileNotFoundException;
@@ -53,7 +56,6 @@ import org.apache.oodt.cas.filemgr.struc
import org.apache.oodt.cas.filemgr.structs.Product;
import org.apache.oodt.cas.filemgr.structs.ProductPage;
import org.apache.oodt.cas.filemgr.structs.ProductType;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
import org.apache.oodt.commons.xml.XMLUtils;
import org.apache.oodt.cas.metadata.Metadata;
import org.apache.oodt.cas.metadata.util.PathUtils;
@@ -76,7 +78,7 @@ public class RDFProductServlet extends H
private static final long serialVersionUID = -3660991271646533985L;
/* our client to the file manager */
- private static XmlRpcFileManagerClient fClient = null;
+ private static FileManagerClient fClient = null;
/* our log stream */
private Logger LOG = Logger.getLogger(RDFProductServlet.class.getName());
@@ -121,7 +123,7 @@ public class RDFProductServlet extends H
fClient = null;
try {
- fClient = new XmlRpcFileManagerClient(new URL(fileManagerUrl));
+ fClient = RpcCommunicationFactory.createClient(new URL(fileManagerUrl));
} catch (MalformedURLException e) {
LOG.log(Level.SEVERE,
"Unable to initialize file manager url in RDF Servlet: [url="
Modified: oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductServlet.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductServlet.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductServlet.java (original)
+++ oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductServlet.java Tue Sep 8 04:25:17 2015
@@ -31,13 +31,14 @@ import javax.xml.transform.TransformerEx
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
-import java.util.HashMap;
import java.util.List;
import java.util.Date;
import java.util.Iterator;
-import java.util.Map;
import java.util.logging.Logger;
import java.util.logging.Level;
+
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import java.io.FileNotFoundException;
@@ -53,7 +54,6 @@ import org.apache.oodt.cas.filemgr.struc
import org.apache.oodt.cas.filemgr.structs.Product;
import org.apache.oodt.cas.filemgr.structs.ProductType;
import org.apache.oodt.cas.filemgr.structs.Reference;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
import org.apache.oodt.commons.xml.XMLUtils;
import org.apache.oodt.cas.metadata.Metadata;
import org.apache.oodt.cas.metadata.util.PathUtils;
@@ -75,7 +75,7 @@ public class RSSProductServlet extends H
private static final long serialVersionUID = -465321738239885777L;
/* our client to the file manager */
- private static XmlRpcFileManagerClient fm = null;
+ private static FileManagerClient fm = null;
/* rss config */
private RSSConfig conf;
@@ -317,7 +317,7 @@ public class RSSProductServlet extends H
private void getFileManager(String fileManagerUrl) {
try {
- this.fm = new XmlRpcFileManagerClient(new URL(fileManagerUrl));
+ this.fm = RpcCommunicationFactory.createClient(new URL(fileManagerUrl));
} catch (MalformedURLException e) {
LOG.log(Level.SEVERE,
"Unable to initialize file manager url in RSS Servlet: [url="
Modified: oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductTransferServlet.java
URL: http://svn.apache.org/viewvc/oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductTransferServlet.java?rev=1701724&r1=1701723&r2=1701724&view=diff
==============================================================================
--- oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductTransferServlet.java (original)
+++ oodt/branches/avro_rpc/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductTransferServlet.java Tue Sep 8 04:25:17 2015
@@ -36,6 +36,9 @@ import java.util.Date;
import java.util.Iterator;
import java.util.logging.Logger;
import java.util.logging.Level;
+
+import org.apache.oodt.cas.filemgr.system.FileManagerClient;
+import org.apache.oodt.cas.filemgr.util.RpcCommunicationFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import java.io.File;
@@ -51,7 +54,6 @@ import org.apache.oodt.cas.filemgr.struc
import org.apache.oodt.cas.filemgr.structs.exceptions.DataTransferException;
import org.apache.oodt.cas.filemgr.structs.exceptions.ConnectionException;
import org.apache.oodt.cas.filemgr.structs.FileTransferStatus;
-import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
import org.apache.oodt.commons.xml.XMLUtils;
import org.apache.oodt.cas.metadata.Metadata;
import org.apache.oodt.cas.metadata.util.PathUtils;
@@ -74,7 +76,7 @@ public class RSSProductTransferServlet e
private static final long serialVersionUID = -7983832512818339079L;
/* our client to the file manager */
- private static XmlRpcFileManagerClient fClient = null;
+ private static FileManagerClient fClient = null;
/* RSS config */
private RSSConfig rssconf;
@@ -119,7 +121,7 @@ public class RSSProductTransferServlet e
fClient = null;
try {
- fClient = new XmlRpcFileManagerClient(new URL(fileManagerUrl));
+ fClient = RpcCommunicationFactory.createClient(new URL(fileManagerUrl));
} catch (MalformedURLException e) {
LOG.log(Level.SEVERE,
"Unable to initialize file manager url in RSS Servlet: [url="