Created test cases for distributed configuration manager and publisher
Project: http://git-wip-us.apache.org/repos/asf/oodt/repo Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/a973c531 Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/a973c531 Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/a973c531 Branch: refs/heads/feature/zookeeper-config Commit: a973c531fee5bf37ebf4448334470c75943af1ec Parents: 27a28da Author: Imesha Sudasingha <[email protected]> Authored: Mon Jul 3 15:55:22 2017 +0530 Committer: Imesha Sudasingha <[email protected]> Committed: Mon Jul 3 15:55:22 2017 +0530 ---------------------------------------------------------------------- .../java/org/apache/oodt/config/Constants.java | 1 + .../DistributedConfigurationManager.java | 2 +- .../config/distributed/cli/CmdLineOptions.java | 4 +- .../cli/DistributedConfigurationPublisher.java | 48 +- .../config/distributed/utils/CuratorUtils.java | 42 +- .../src/main/resources/etc/config-publisher.xml | 9 +- config/src/main/resources/etc/log4j.xml | 6 + .../main/resources/examples/filemgr.properties | 114 - .../examples/filemgr/cmd-line-actions.xml | 123 + .../examples/filemgr/cmd-line-options.xml | 1175 +++++ .../examples/filemgr/filemgr.properties | 114 + .../resources/examples/filemgr/mime-types.xml | 4119 ++++++++++++++++++ .../examples/filemgr/oodt/elements.xml | 77 + .../filemgr/oodt/product-type-element-map.xml | 33 + .../examples/filemgr/oodt/product-types.xml | 53 + .../src/main/resources/examples/mime-types.xml | 4119 ------------------ .../examples/resmgr/cmd-line-actions.xml | 92 + .../examples/resmgr/cmd-line-options.xml | 601 +++ .../resources/examples/resmgr/jobs/exJob.xml | 30 + .../examples/resmgr/jobs/exLongJob.xml | 30 + .../examples/resmgr/logging.properties | 67 + .../examples/resmgr/node-to-queue-mapping.xml | 26 + .../main/resources/examples/resmgr/nodes.xml | 23 + .../examples/resmgr/resource.properties | 61 + .../config/distributed/AbstractTestCase.java | 49 + .../DistributedConfigurationManagerTest.java | 122 + .../DistributedConfigurationPublisherTest.java | 101 +- .../src/test/resources/etc/config-publisher.xml | 19 +- 28 files changed, 6976 insertions(+), 4284 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oodt/blob/a973c531/config/src/main/java/org/apache/oodt/config/Constants.java ---------------------------------------------------------------------- diff --git a/config/src/main/java/org/apache/oodt/config/Constants.java b/config/src/main/java/org/apache/oodt/config/Constants.java index d6969fe..8c6f624 100644 --- a/config/src/main/java/org/apache/oodt/config/Constants.java +++ b/config/src/main/java/org/apache/oodt/config/Constants.java @@ -63,6 +63,7 @@ public class Constants { public static class Components { public static final String FILE_MANAGER = "filemgr"; + public static final String RESOURCE_MANAGER = "resmgr"; } public static class ZPaths { http://git-wip-us.apache.org/repos/asf/oodt/blob/a973c531/config/src/main/java/org/apache/oodt/config/distributed/DistributedConfigurationManager.java ---------------------------------------------------------------------- diff --git a/config/src/main/java/org/apache/oodt/config/distributed/DistributedConfigurationManager.java b/config/src/main/java/org/apache/oodt/config/distributed/DistributedConfigurationManager.java index 1a3f390..67589fe 100644 --- a/config/src/main/java/org/apache/oodt/config/distributed/DistributedConfigurationManager.java +++ b/config/src/main/java/org/apache/oodt/config/distributed/DistributedConfigurationManager.java @@ -85,7 +85,7 @@ public class DistributedConfigurationManager extends ConfigurationManager { * {@link Properties#ZK_STARTUP_TIMEOUT} milli-seconds until the client connects to the zookeeper ensemble. */ private void startZookeeper() { - client = CuratorUtils.getCuratorFrameworkClient(connectString, logger); + client = CuratorUtils.newCuratorFrameworkClient(connectString, logger); client.start(); logger.info("Curator framework start operation invoked"); http://git-wip-us.apache.org/repos/asf/oodt/blob/a973c531/config/src/main/java/org/apache/oodt/config/distributed/cli/CmdLineOptions.java ---------------------------------------------------------------------- diff --git a/config/src/main/java/org/apache/oodt/config/distributed/cli/CmdLineOptions.java b/config/src/main/java/org/apache/oodt/config/distributed/cli/CmdLineOptions.java index afa6350..b6972d5 100644 --- a/config/src/main/java/org/apache/oodt/config/distributed/cli/CmdLineOptions.java +++ b/config/src/main/java/org/apache/oodt/config/distributed/cli/CmdLineOptions.java @@ -31,10 +31,10 @@ public class CmdLineOptions { @Option(name = "-publish", usage = "Publishes configuration specified in the spring config file to zookeeper. " + "Any current similar config in zookeeper will be overwritten. If not specified, command will be assumed as a publish") - private boolean publish = true; + private boolean publish = false; @Option(name = "-verify", usage = "Verifies the content in the local files and the published ones. Results will be printed.") - private boolean verify = true; + private boolean verify = false; @Option(name = "-clear", usage = "Unpublish any configuration which has been published earlier using the same spring config file") private boolean clear = false; http://git-wip-us.apache.org/repos/asf/oodt/blob/a973c531/config/src/main/java/org/apache/oodt/config/distributed/cli/DistributedConfigurationPublisher.java ---------------------------------------------------------------------- diff --git a/config/src/main/java/org/apache/oodt/config/distributed/cli/DistributedConfigurationPublisher.java b/config/src/main/java/org/apache/oodt/config/distributed/cli/DistributedConfigurationPublisher.java index 03cdfc7..8cdc6c6 100644 --- a/config/src/main/java/org/apache/oodt/config/distributed/cli/DistributedConfigurationPublisher.java +++ b/config/src/main/java/org/apache/oodt/config/distributed/cli/DistributedConfigurationPublisher.java @@ -87,7 +87,7 @@ public class DistributedConfigurationPublisher { * {@link Constants.Properties#ZK_STARTUP_TIMEOUT} milli-seconds until the client connects to the zookeeper ensemble. */ private void startZookeeper() { - client = CuratorUtils.getCuratorFrameworkClient(connectString, logger); + client = CuratorUtils.newCuratorFrameworkClient(connectString, logger); client.start(); logger.info("Curator framework start operation invoked"); @@ -107,6 +107,17 @@ public class DistributedConfigurationPublisher { logger.info("CuratorFramework client started successfully"); } + public void destroy() { + logger.debug("Destroying configuration publisher"); + try { + client.close(); + } catch (Exception e) { + logger.error("Error occurred when trying to close Curator client : {}", e); + } + + logger.info("Configuration publisher destroyed"); + } + /** * Publishes the configuration files specified to zookeeper. If an exception is thrown while configuration being * published, no further publishing attempts will be carried on. Error will be reported to user. @@ -138,6 +149,19 @@ public class DistributedConfigurationPublisher { } } + /** + * Removes all the nodes from zookeeper where the configuration corresponding to component {@link #componentName} is + * stored + * + * @throws Exception zookeeper errors + */ + public void clearConfiguration() throws Exception { + logger.debug("Clearing configuration from zookeeper"); + CuratorUtils.deleteChildNodes(client, zNodePaths.getPropertiesZNodePath()); + CuratorUtils.deleteChildNodes(client, zNodePaths.getConfigurationZNodePath()); + logger.info("Configuration cleared!"); + } + private void publishConfiguration(Map<String, String> fileMapping, boolean isProperties) throws Exception { for (Map.Entry<String, String> entry : fileMapping.entrySet()) { String filePath = entry.getKey(); @@ -150,7 +174,7 @@ public class DistributedConfigurationPublisher { if (client.checkExists().forPath(zNodePath) != null) { byte[] bytes = client.getData().forPath(zNodePath); String existingData = new String(bytes); - if (content.equals(existingData)) { + if (existingData.equals(content)) { logger.warn("{} already exists in zookeeper at {}", filePath, relativeZNodePath); } else { Stat stat = client.setData().forPath(zNodePath, content.getBytes()); @@ -266,22 +290,28 @@ public class DistributedConfigurationPublisher { System.out.println(String.format("Publishing configuration for : %s", publisher.getComponentName())); publisher.publishConfiguration(); System.out.println(String.format("Published configuration for : %s", publisher.getComponentName())); - System.out.printf("\n"); + System.out.println(); } if (cmdLineOptions.isVerify()) { System.out.println(String.format("Verifying configuration for : %s", publisher.getComponentName())); - publisher.verifyPublishedConfiguration(); - System.out.println(String.format("Verified configuration for : %s", publisher.getComponentName())); - System.out.printf("\n"); + if (publisher.verifyPublishedConfiguration()) { + System.out.println("OK... Configuration verified"); + System.out.println(String.format("Verified configuration for : %s", publisher.getComponentName())); + } else { + System.err.println("ERROR... Published configuration doesn't match the local files. Please check above logs"); + } + System.out.println(); } if (cmdLineOptions.isClear()) { System.out.println(String.format("Clearing configuration for : %s", publisher.getComponentName())); - // TODO: 7/2/17 Implement configuration removal + publisher.clearConfiguration(); System.out.println(String.format("Cleared configuration for : %s", publisher.getComponentName())); - System.out.printf("\n"); + System.out.println(); } + + publisher.destroy(); } } catch (BeansException e) { logger.error("Error occurred when obtaining configuration publisher beans", e); @@ -291,7 +321,7 @@ public class DistributedConfigurationPublisher { throw e; } - logger.info("Published configuration successfully"); + logger.info("Exiting CLI ..."); } public String getComponentName() { http://git-wip-us.apache.org/repos/asf/oodt/blob/a973c531/config/src/main/java/org/apache/oodt/config/distributed/utils/CuratorUtils.java ---------------------------------------------------------------------- diff --git a/config/src/main/java/org/apache/oodt/config/distributed/utils/CuratorUtils.java b/config/src/main/java/org/apache/oodt/config/distributed/utils/CuratorUtils.java index 1b10ef0..e591750 100644 --- a/config/src/main/java/org/apache/oodt/config/distributed/utils/CuratorUtils.java +++ b/config/src/main/java/org/apache/oodt/config/distributed/utils/CuratorUtils.java @@ -87,13 +87,24 @@ public class CuratorUtils { } /** + * Builds a {@link CuratorFramework} instance with given connect string. Will use the {@link CuratorUtils#logger} for + * logging. + * + * @param connectString zookeeper connect string + * @return CuratorFramework instance created + */ + public static CuratorFramework newCuratorFrameworkClient(String connectString) { + return newCuratorFrameworkClient(connectString, logger); + } + + /** * Builds a {@link CuratorFramework} instance using the given connectString. * * @param connectString connection string to connect to zookeeper * @param logger {@link Logger} instance of the calling class * @return Newly created CuratorFramework instance. */ - public static CuratorFramework getCuratorFrameworkClient(String connectString, Logger logger) { + public static CuratorFramework newCuratorFrameworkClient(String connectString, Logger logger) { int connectionTimeoutMs = Integer.parseInt(System.getProperty(Constants.Properties.ZK_CONNECTION_TIMEOUT, "15000")); int sessionTimeoutMs = Integer.parseInt(System.getProperty(Constants.Properties.ZK_CONNECTION_TIMEOUT, "60000")); int retryInitialWaitMs = Integer.parseInt(System.getProperty(Constants.Properties.ZK_CONNECTION_TIMEOUT, "1000")); @@ -133,6 +144,14 @@ public class CuratorUtils { return client; } + /** + * Get the leaf nodes in a given sub tree starting from a given ZNode. + * + * @param client {@link CuratorFramework} instance + * @param parentZNodePath root ZNode of the sub tree + * @return List of leaf nodes + * @throws Exception zookeeper exceptions + */ public static List<String> getLeafZNodePaths(CuratorFramework client, String parentZNodePath) throws Exception { List<String> leafZNodePaths = new ArrayList<>(); @@ -149,4 +168,25 @@ public class CuratorUtils { return leafZNodePaths; } + + /** + * Delete all the child ZNodes under a given ZNode. + * + * @param client {@link CuratorFramework} instance + * @param parentZNodePath ZNode path of which all the children are to be deleted + * @throws Exception + */ + public static void deleteChildNodes(CuratorFramework client, String parentZNodePath) throws Exception { + if (client.checkExists().forPath(parentZNodePath) != null) { + List<String> children = client.getChildren().forPath(parentZNodePath); + for (String child : children) { + String zNodePath = parentZNodePath + SEPARATOR + child; + logger.debug("Deleting child ZNode '{}' at {}", child, zNodePath); + client.delete().deletingChildrenIfNeeded().forPath(zNodePath); + } + logger.debug("Deleted children ZNodes of {}", parentZNodePath); + } else { + logger.warn("ZNode - {} doesn't exist. Nothing to delete"); + } + } } http://git-wip-us.apache.org/repos/asf/oodt/blob/a973c531/config/src/main/resources/etc/config-publisher.xml ---------------------------------------------------------------------- diff --git a/config/src/main/resources/etc/config-publisher.xml b/config/src/main/resources/etc/config-publisher.xml index cc1261e..015d1f2 100644 --- a/config/src/main/resources/etc/config-publisher.xml +++ b/config/src/main/resources/etc/config-publisher.xml @@ -23,12 +23,17 @@ <constructor-arg value="filemgr"/> <property name="propertiesFiles"> <map key-type="java.lang.String" value-type="java.lang.String"> - <entry key="../examples/filemgr.properties" value="/etc/filemgr.properties"/> + <entry key="../examples/filemgr/filemgr.properties" value="/etc/filemgr.properties"/> </map> </property> <property name="configFiles"> <map key-type="java.lang.String" value-type="java.lang.String"> - <entry key="../examples/mime-types.xml" value="/etc/mime-types.xml"/> + <entry key="../examples/filemgr/mime-types.xml" value="/etc/mime-types.xml"/> + <entry key="../examples/filemgr/cmd-line-actions.xml" value="/policy/cmd-line-actions.xml"/> + <entry key="../examples/filemgr/cmd-line-options.xml" value="/policy/cmd-line-options.xml"/> + <entry key="../examples/filemgr/oodt/elements.xml" value="/policy/oodt/elements.xml"/> + <entry key="../examples/filemgr/oodt/product-types.xml" value="/policy/oodt/product-types.xml"/> + <entry key="../examples/filemgr/oodt/product-type-element-map.xml" value="/policy/oodt/product-type-element-map.xml"/> </map> </property> </bean> http://git-wip-us.apache.org/repos/asf/oodt/blob/a973c531/config/src/main/resources/etc/log4j.xml ---------------------------------------------------------------------- diff --git a/config/src/main/resources/etc/log4j.xml b/config/src/main/resources/etc/log4j.xml index 8f49451..0421de2 100644 --- a/config/src/main/resources/etc/log4j.xml +++ b/config/src/main/resources/etc/log4j.xml @@ -31,4 +31,10 @@ <appender-ref ref="console"/> </root> + <logger name="org.apache.zookeeper"> + <level value="ERROR"/> + </logger> + <logger name="org.apache.curator"> + <level value="ERROR"/> + </logger> </log4j:configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/oodt/blob/a973c531/config/src/main/resources/examples/filemgr.properties ---------------------------------------------------------------------- diff --git a/config/src/main/resources/examples/filemgr.properties b/config/src/main/resources/examples/filemgr.properties deleted file mode 100644 index 4d8d957..0000000 --- a/config/src/main/resources/examples/filemgr.properties +++ /dev/null @@ -1,114 +0,0 @@ -# -# 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. -# - -# Configuration properties for the File Manager - -# repository factory -filemgr.repository.factory=org.apache.oodt.cas.filemgr.repository.XMLRepositoryManagerFactory - -# Lucene catalog factory -filemgr.catalog.factory=org.apache.oodt.cas.filemgr.catalog.LuceneCatalogFactory - -# data transfer factory -filemgr.datatransfer.factory=org.apache.oodt.cas.filemgr.datatransfer.LocalDataTransferFactory - -# validation layer factory -filemgr.validationLayer.factory=org.apache.oodt.cas.filemgr.validation.XMLValidationLayerFactory - -# xml rpc client configuration -org.apache.oodt.cas.filemgr.system.xmlrpc.connectionTimeout.minutes=20 -org.apache.oodt.cas.filemgr.system.xmlrpc.requestTimeout.minutes=60 -#org.apache.oodt.cas.filemgr.system.xmlrpc.connection.retries=0 -#org.apache.oodt.cas.filemgr.system.xmlrpc.connection.retry.interval.seconds=3 - -# mapped data source catalog configuration -#org.apache.oodt.cas.filemgr.catalog.mappeddatasource.mapFile=/path/to/ops.catalog.typemap.properties - -# lucene catalog configuration -org.apache.oodt.cas.filemgr.catalog.lucene.idxPath=[OODT_HOME]/data/catalog -org.apache.oodt.cas.filemgr.catalog.lucene.pageSize=20 -org.apache.oodt.cas.filemgr.catalog.lucene.commitLockTimeout.seconds=60 -org.apache.oodt.cas.filemgr.catalog.lucene.writeLockTimeout.seconds=60 -org.apache.oodt.cas.filemgr.catalog.lucene.mergeFactor=20 - -# XML repository manager configuration -org.apache.oodt.cas.filemgr.repositorymgr.dirs=file:[FILEMGR_HOME]/policy/oodt - -# XML validation layer configuration -org.apache.oodt.cas.filemgr.validation.dirs=file:[FILEMGR_HOME]/policy/oodt - -# remote data transfer configuration -org.apache.oodt.cas.filemgr.datatransfer.remote.chunkSize=1024 - -# location of Mime-Type repository -org.apache.oodt.cas.filemgr.mime.type.repository=[FILEMGR_HOME]/etc/mime-types.xml - - -############ data source configuration ################################## -# -# These 3 blocks of config properties can be used to setup a catalog, -# repository manager, and validation layer based on a RDBMS such as -# Oracle, MySQL, PostgreSQL, or any others that support a jdbc connection. -# Just un-comment the following blocks of properties and configure as -# needed. -# -######################################################################### - -# datasource catalog config -#org.apache.oodt.cas.filemgr.catalog.datasource.jdbc.url=some_jdbc_url -#org.apache.oodt.cas.filemgr.catalog.datasource.jdbc.user=user -#org.apache.oodt.cas.filemgr.catalog.datasource.jdbc.pass=pass -#org.apache.oodt.cas.filemgr.catalog.datasource.jdbc.driver=driver.class.name -#org.apache.oodt.cas.filemgr.catalog.datasource.quoteFields=false -#org.apache.oodt.cas.filemgr.catalog.datasource.pageSize=20 -#org.apache.oodt.cas.filemgr.catalog.datasource.cacheUpdateMinutes=5 - -# data source repository manager configuration -#org.apache.oodt.cas.filemgr.repositorymgr.datasource.jdbc.url=some_jdbc_url -#org.apache.oodt.cas.filemgr.repositorymgr.datasource.jdbc.user=user -#org.apache.oodt.cas.filemgr.repositorymgr.datasource.jdbc.pass=pass -#org.apache.oodt.cas.filemgr.repositorymgr.datasource.jdbc.driver=driver.class.name - -# data source validation layer configuration -#org.apache.oodt.cas.filemgr.validation.datasource.jdbc.url=some_jdbc_url -#org.apache.oodt.cas.filemgr.validation.datasource.jdbc.user=user -#org.apache.oodt.cas.filemgr.validation.datasource.jdbc.pass=pass -#org.apache.oodt.cas.filemgr.validation.datasource.jdbc.driver=driver.class.name -#org.apache.oodt.cas.filemgr.validation.datasource.quoteFields=false - - -# tells the file manager system layer to include product instance metadata -# NOTE: here are the expected field mappings -# -# product.getProductId() -> ProductId -# product.getProductName() -> ProductName -# product.getProductStructure() -> ProductStructure -# product.getTransferStatus() -> ProductTransferStatus -# product.getRootRef() -> ProductRootReference - -# for the references returned by product.getProductReferences() the following -# metadata fields will be added (order will be maintained, such that data store -# ref at index 0 will map to orig ref at index 0, etc.) -# -# ProductDataStoreReferences (list of all data store references: -# note already translated into path, not URI) -# ProductOrigReferences (list of all orig references: -# note already translated into path, not URI) -# ProductMimeType (list of all references' mime-types) -# ProductFileSize (list of all references' file sizes) - -org.apache.oodt.cas.filemgr.metadata.expandProduct=false \ No newline at end of file http://git-wip-us.apache.org/repos/asf/oodt/blob/a973c531/config/src/main/resources/examples/filemgr/cmd-line-actions.xml ---------------------------------------------------------------------- diff --git a/config/src/main/resources/examples/filemgr/cmd-line-actions.xml b/config/src/main/resources/examples/filemgr/cmd-line-actions.xml new file mode 100755 index 0000000..cf66c9d --- /dev/null +++ b/config/src/main/resources/examples/filemgr/cmd-line-actions.xml @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. + + Author: bfoster (Brian Foster) +--> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> + + <bean id="addProductType" class="org.apache.oodt.cas.filemgr.cli.action.AddProductTypeCliAction"> + <property name="description" value="Adds a ProductType to list of supported ProductTypes" /> + </bean> + <bean id="deleteProductByName" class="org.apache.oodt.cas.filemgr.cli.action.DeleteProductByNameCliAction"> + <property name="description" value="Delete Product by name" /> + </bean> + <bean id="deleteProductById" class="org.apache.oodt.cas.filemgr.cli.action.DeleteProductByIdCliAction"> + <property name="description" value="Delete Product by ID" /> + </bean> + <bean id="dumpMetadata" class="org.apache.oodt.cas.filemgr.cli.action.DumpMetadataCliAction"> + <property name="description" value="Dumps Product Metadata out to XML" /> + </bean> + <bean id="getCurrentTransfer" class="org.apache.oodt.cas.filemgr.cli.action.GetCurrentTransferCliAction"> + <property name="description" value="Gets the status of the current Product file transfer" /> + </bean> + <bean id="getCurrentTransfers" class="org.apache.oodt.cas.filemgr.cli.action.GetCurrentTransfersCliAction"> + <property name="description" value="Gets the status of the current Product file transfers" /> + </bean> + <bean id="getFilePercentTransferred" class="org.apache.oodt.cas.filemgr.cli.action.GetFilePercentTransferredCliAction"> + <property name="description" value="Gets the percent amount transferred of given file" /> + </bean> + <bean id="getFirstPage" class="org.apache.oodt.cas.filemgr.cli.action.GetFirstPageCliAction"> + <property name="description" value="Gets first page of Products of given ProductType" /> + </bean> + <bean id="getLastPage" class="org.apache.oodt.cas.filemgr.cli.action.GetLastPageCliAction"> + <property name="description" value="Gets last page of Products of given ProductType" /> + </bean> + <bean id="getNextPage" class="org.apache.oodt.cas.filemgr.cli.action.GetNextPageCliAction"> + <property name="description" value="Gets next page of Products of given ProductType" /> + </bean> + <bean id="getNumProducts" class="org.apache.oodt.cas.filemgr.cli.action.GetNumProductsCliAction"> + <property name="description" value="Gets number of Products ingested for a given ProductType" /> + </bean> + <bean id="getPrevPage" class="org.apache.oodt.cas.filemgr.cli.action.GetPrevPageCliAction"> + <property name="description" value="Gets prev page of Products of given ProductType" /> + </bean> + <bean id="getProductByName" class="org.apache.oodt.cas.filemgr.cli.action.GetProductByNameCliAction"> + <property name="description" value="Get Product info by name" /> + </bean> + <bean id="getProductById" class="org.apache.oodt.cas.filemgr.cli.action.GetProductByIdCliAction"> + <property name="description" value="Gets Product info by ID" /> + </bean> + <bean id="getProductPercentTransferred" class="org.apache.oodt.cas.filemgr.cli.action.GetProductPercentTransferredCliAction"> + <property name="description" value="Gets percent amount transferred of a Products data files" /> + </bean> + <bean id="getProductTypeByName" class="org.apache.oodt.cas.filemgr.cli.action.GetProductTypeByNameCliAction"> + <property name="description" value="Gets a ProductType by its name" /> + </bean> + <bean id="hasProduct" class="org.apache.oodt.cas.filemgr.cli.action.HasProductCliAction"> + <property name="description" value="Checks if Product with given name has been ingested" /> + </bean> + <bean id="ingestProduct" class="org.apache.oodt.cas.filemgr.cli.action.IngestProductCliAction"> + <property name="description" value="Ingests a Product" /> + </bean> + <bean id="luceneQuery" class="org.apache.oodt.cas.filemgr.cli.action.LuceneQueryCliAction"> + <property name="description" value="Queries by parsing an Lucene-like query into a FileManager Query" /> + </bean> + <bean id="retrieveFilesById" class="org.apache.oodt.cas.filemgr.cli.action.RetrieveFilesCliAction"> + <property name="description" value="Retrieve a Product's files by Product ID" /> + </bean> + <bean id="retrieveFilesByName" class="org.apache.oodt.cas.filemgr.cli.action.RetrieveFilesCliAction"> + <property name="description" value="Retrieve a Product's files by Product name" /> + </bean> + <bean id="sqlQuery" class="org.apache.oodt.cas.filemgr.cli.action.SqlQueryCliAction"> + <property name="description" value="Queries by parsing an SQL-like query into a FileManager Query" /> + <property name="detailedDescription"> + <value> + This supports sending queries to the FileManager in form of + SELECT [Elements] FROM [ProductTypes] WHERE [where-clause], where: + - [Elements]: is a comma separated list of Element names; may also be * which + represents all Elements + - [ProductTypes]: is a comma separated list of ProductType names; may also + be * which represents all ProductTypes + - [where-clause]: is an optional Element name filter supporting the following: + * AND and OR boolean operators + * () grouping of queries + * element-name == 'element-value' + * element-name < 'element-value' + * element-name > 'element-value' + * element-name <= 'element-value' + * element-name >= 'element-value'" + + An additional post-query FilterAlgor can also be specified where you specify + which Metadata fields which should be used as each Product's StartDateTime, + EndDateTime, and Priority values + </value> + </property> + <property name="examples"> + <value> + (Assume you have a ProductType, GenericFile, which supports the + Elements: Filename, NominalDate, Group, and DataVersion) + $ ./filemgr-client -u http://localhost:9000 -op -sql + -q "SELECT Filename FROM GenericFile WHERE (NominalDate == '2011-20-10' OR + NominalDate == '2011-20-11') AND Group == 'Test' AND DataVersion > '1.0'" + (Returns all Products in FileManager -- use with care) + $ ./filemgr-client -u http://localhost:9000 -op -sql -q "SELECT * FROM *" + </value> + </property> + </bean> +</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/oodt/blob/a973c531/config/src/main/resources/examples/filemgr/cmd-line-options.xml ---------------------------------------------------------------------- diff --git a/config/src/main/resources/examples/filemgr/cmd-line-options.xml b/config/src/main/resources/examples/filemgr/cmd-line-options.xml new file mode 100755 index 0000000..227def2 --- /dev/null +++ b/config/src/main/resources/examples/filemgr/cmd-line-options.xml @@ -0,0 +1,1175 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. + + Author: bfoster (Brian Foster) +--> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> + + <bean id="url" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="u" /> + <property name="longOption" value="url" /> + <property name="description" value="File Manager URL" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="url" /> + <property name="required" value="true" /> + <property name="handler"> + <bean + class="org.apache.oodt.cas.cli.option.handler.SetJavaPropertiesHandler"> + <property name="propertyNames"> + <list> + <value>org.apache.oodt.cas.filemgr.url</value> + </list> + </property> + </bean> + </property> + </bean> + + <bean id="operation" class="org.apache.oodt.cas.cli.option.GroupCmdLineOption"> + <property name="shortOption" value="op" /> + <property name="longOption" value="operation" /> + <property name="description" + value="Declare that you wish to present an operation" /> + <property name="hasArgs" value="false" /> + <property name="required" value="true" /> + <property name="subOptions"> + <list> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="addProductType" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="deleteProductById" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="deleteProductByName" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="ingestProduct" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="hasProduct" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="getProductTypeByName" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="getNumProducts" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="getFirstPage" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="getNextPage" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="getPrevPage" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="getLastPage" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="getCurrentTransfer" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="getCurrentTransfers" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="getProductById" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="getProductByName" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="getProductPctTransferred" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="getFilePctTransferred" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="sqlQuery" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="dumpMetadata" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="luceneQuery" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="retrieveFilesById" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="retrieveFilesByName" p:required="false" /> + </list> + </property> + </bean> + + <!-- AddProductType Options --> + <bean id="addProductType" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="addPT" /> + <property name="longOption" value="addProductType" /> + <property name="description" value="Triggers addProductType Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>addProductType</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="addProductType" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <bean id="typeName" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="tn" /> + <property name="longOption" value="typeName" /> + <property name="description" value="ProductType name" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="product-type-name" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="addProductType" p:relation="REQUIRED" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler"> + <property name="applyToActions"> + <list> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToAction" + p:actionName="addProductType" p:methodName="setProductTypeName" /> + </list> + </property> + </bean> + </property> + </bean> + + <bean id="typeDesc" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="td" /> + <property name="longOption" value="typeDesc" /> + <property name="description" value="ProductType description" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="description" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="addProductType" p:relation="REQUIRED" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler"> + <property name="applyToActions"> + <list> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToAction" + p:actionName="addProductType" p:methodName="setProductTypeDescription" /> + </list> + </property> + </bean> + </property> + </bean> + + <bean id="repository" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="repo" /> + <property name="longOption" value="repository" /> + <property name="description" value="ProductType repository" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="file-path" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="addProductType" p:relation="REQUIRED" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler"> + <property name="applyToActions"> + <list> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToAction" + p:actionName="addProductType" p:methodName="setFileRepositoryPath" /> + </list> + </property> + </bean> + </property> + </bean> + + <bean id="versionClass" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="vc" /> + <property name="longOption" value="versionClass" /> + <property name="description" value="ProductType versioner class" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="classpath" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="addProductType" p:relation="REQUIRED" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler"> + <property name="applyToActions"> + <list> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToAction" + p:actionName="addProductType" p:methodName="setVersioner" /> + </list> + </property> + </bean> + </property> + </bean> + + <!-- IngestProduct Options --> + <bean id="ingestProduct" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="ingest" /> + <property name="longOption" value="ingestProduct" /> + <property name="description" value="Triggers ingestProduct Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>ingestProduct</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="ingestProduct" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <bean id="productStructure" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="ps" /> + <property name="longOption" value="productStructure" /> + <property name="description" value="Hierarchical | Flat" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="structure-type" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="ingestProduct" p:relation="REQUIRED" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler"> + <property name="applyToActions"> + <list> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToAction" + p:actionName="ingestProduct" p:methodName="setProductStructure" /> + </list> + </property> + </bean> + </property> + </bean> + + <bean id="metadataFile" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="mf" /> + <property name="longOption" value="metadataFile" /> + <property name="description" value="Metadata XML file path or URL" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="file-path-or-url" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="ingestProduct" p:relation="REQUIRED" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <bean id="clientTransfer" class="org.apache.oodt.cas.cli.option.GroupCmdLineOption"> + <property name="shortOption" value="ct" /> + <property name="longOption" value="clientTransfer" /> + <property name="description" value="User client transferer" /> + <property name="hasArgs" value="false" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="ingestProduct" p:relation="OPTIONAL" /> + </list> + </property> + <property name="subOptions"> + <list> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="dataTransfer" p:required="true" /> + </list> + </property> + </bean> + + <bean id="dataTransfer" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="dt" /> + <property name="longOption" value="dataTransfer" /> + <property name="description" value="DataTransferer factory class" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="classpath" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="ingestProduct" p:relation="REQUIRED" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler"> + <property name="applyToActions"> + <list> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToAction" + p:actionName="ingestProduct" p:methodName="setDataTransferer" /> + </list> + </property> + </bean> + </property> + </bean> + + <bean id="refs" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="rs" /> + <property name="longOption" value="refs" /> + <property name="description" value="Data file path or URL" /> + <property name="type" value="java.util.List" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="file-path-or-url" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="ingestProduct" p:relation="REQUIRED" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler"> + <property name="applyToActions"> + <list> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToAction" + p:actionName="ingestProduct" p:methodName="setReferences" /> + </list> + </property> + </bean> + </property> + </bean> + + <!-- HasProduct Options --> + <bean id="hasProduct" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="product" /> + <property name="longOption" value="hasProduct" /> + <property name="description" value="Triggers hasProduct Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>hasProduct</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="hasProduct" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <!-- GetProductTypeByName Options --> + <bean id="getProductTypeByName" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="ptbyn" /> + <property name="longOption" value="getProductTypeByName" /> + <property name="description" value="Triggers getProductTypeByName Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>getProductTypeByName</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getProductTypeByName" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <!-- GetNumProducts Options --> + <bean id="getNumProducts" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="num" /> + <property name="longOption" value="getNumProducts" /> + <property name="description" value="Triggers getNumProducts Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>getNumProducts</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getNumProducts" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <!-- GetFirstPage Options --> + <bean id="getFirstPage" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="page1" /> + <property name="longOption" value="getFirstPage" /> + <property name="description" value="Triggers getFirstPage Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>getFirstPage</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getFirstPage" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <!-- GetNextPage Options --> + <bean id="getNextPage" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="next" /> + <property name="longOption" value="getNextPage" /> + <property name="description" value="Triggers getNextPage Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>getNextPage</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getNextPage" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <!-- GetPrevPage Options --> + <bean id="getPrevPage" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="prev" /> + <property name="longOption" value="getPrevPage" /> + <property name="description" value="Triggers getPrevPage Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>getPrevPage</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getPrevPage" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <!-- GetLastPage Options --> + <bean id="getLastPage" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="last" /> + <property name="longOption" value="getLastPage" /> + <property name="description" value="Triggers getLastPage Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>getLastPage</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getLastPage" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <!-- GetCurrentTransfer Options --> + <bean id="getCurrentTransfer" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="curTran" /> + <property name="longOption" value="getCurrentTransfer" /> + <property name="description" value="Triggers getCurrentTransfer Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>getCurrentTransfer</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getCurrentTransfer" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <!-- GetCurrentTransfers Options --> + <bean id="getCurrentTransfers" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="curTrans" /> + <property name="longOption" value="getCurrentTransfers" /> + <property name="description" value="Triggers getCurrentTransfers Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>getCurrentTransfers</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getCurrentTransfers" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <!-- GetProductPercentTransferred Options --> + <bean id="getProductPctTransferred" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="pctTrans" /> + <property name="longOption" value="getProductPctTransferred" /> + <property name="description" value="Triggers getProductPercentTransferred Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>getProductPercentTransferred</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getProductPercentTransferred" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <!-- GetFilePercentTransferred Options --> + <bean id="getFilePctTransferred" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="filePctTrans" /> + <property name="longOption" value="getFilePctTransferred" /> + <property name="description" value="Triggers getFilePercentTransferred Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>getFilePercentTransferred</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getFilePercentTransferred" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <bean id="origRef" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="or" /> + <property name="longOption" value="origRef" /> + <property name="description" value="Original reference" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="file-path-or-url" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getFilePercentTransferred" p:relation="REQUIRED" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <!-- SqlQuery Options --> + <bean id="sqlQuery" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="sql" /> + <property name="longOption" value="sqlQuery" /> + <property name="description" value="Triggers sqlQuery Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>sqlQuery</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="sqlQuery" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + + + <!-- GetProductById Options --> + <bean id="getProductById" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="pbyid" /> + <property name="longOption" value="getProductById" /> + <property name="description" value="Triggers getProductById Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>getProductById</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getProductById" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <!-- GetProductByName Options --> + <bean id="getProductByName" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="pbyn" /> + <property name="longOption" value="getProductByName" /> + <property name="description" value="Triggers getProductByName Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>getProductByName</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getProductByName" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <!-- DeleteProductById Options --> + <bean id="deleteProductById" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="dbyid" /> + <property name="longOption" value="deleteProductById" /> + <property name="description" value="Triggers deleteProductById Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>deleteProductById</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="deleteProductById" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <!-- DeleteProductByName Options --> + <bean id="deleteProductByName" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="dbyn" /> + <property name="longOption" value="deleteProductByName" /> + <property name="description" value="Triggers deleteProductByName Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>deleteProductByName</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="deleteProductByName" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <!-- DumpMetadata Options --> + <bean id="dumpMetadata" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="dmet" /> + <property name="longOption" value="dumpMetadata" /> + <property name="description" value="Triggers dumpMetadata Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>dumpMetadata</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="dumpMetadata" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <bean id="outputDir" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="out" /> + <property name="longOption" value="outputDir" /> + <property name="description" value="Output directory" /> + <property name="type" value="java.io.File" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="file-dir" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="dumpMetadata" p:relation="OPTIONAL" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <!-- LuceneQuery Options --> + <bean id="luceneQuery" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="lucene" /> + <property name="longOption" value="luceneQuery" /> + <property name="description" value="Triggers luceneQuery Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>luceneQuery</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="luceneQuery" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <bean id="reducedProductTypes" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="pts" /> + <property name="longOption" value="reducedProductTypes" /> + <property name="description" value="Limit query ProductTypes queried against" /> + <property name="type" value="java.util.List" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="list-of-product-types" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="luceneQuery" p:relation="OPTIONAL" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <bean id="reducedMetadataKeys" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="metKeys" /> + <property name="longOption" value="reducedMetadataKeys" /> + <property name="description" value="Limit Elements returned by query" /> + <property name="type" value="java.util.List" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="list-of-elements" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="luceneQuery" p:relation="OPTIONAL" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <!-- retrieveFiles Options --> + <bean id="retrieveFilesById" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="rfbyid" /> + <property name="longOption" value="retrieveFilesById" /> + <property name="description" value="Triggers retrieveFilesById Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>retrieveFilesById</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="retrieveFilesById" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <bean id="retrieveFilesByName" class="org.apache.oodt.cas.cli.option.ActionCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="rfbyn" /> + <property name="longOption" value="retrieveFilesByName" /> + <property name="description" value="Triggers retrieveFilesByName Action" /> + <property name="hasArgs" value="false" /> + <property name="staticArgs"> + <list> + <value>retrieveFilesByName</value> + </list> + </property> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="retrieveFilesByName" p:relation="REQUIRED" /> + </list> + </property> + </bean> + + <bean id="transferer" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="trans" /> + <property name="longOption" value="transferer" /> + <property name="description" value="Factory for creating DataTransfer which will perform the file transfer(s)" /> + <property name="type" value="org.apache.oodt.cas.filemgr.datatransfer.DataTransferFactory" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="transfer factory class" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="retrieveFilesById" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="retrieveFilesByName" p:relation="REQUIRED" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler"> + <property name="applyToActions"> + <list> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToAction" + p:actionName="retrieveFilesById" p:methodName="setDataTransferFactory" /> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToAction" + p:actionName="retrieveFilesByName" p:methodName="setDataTransferFactory" /> + </list> + </property> + </bean> + </property> + </bean> + + <bean id="destination" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="dest" /> + <property name="longOption" value="destination" /> + <property name="description" value="Directory to transfer Product file to" /> + <property name="type" value="java.io.File" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="directory" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="retrieveFilesById" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="retrieveFilesByName" p:relation="REQUIRED" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <!-- Options used for multiple Actions --> + <bean id="productId" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="pid" /> + <property name="longOption" value="productId" /> + <property name="description" value="Product ID" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="product-id" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getProductPercentTransferred" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getProductById" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="deleteProductById" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="dumpMetadata" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="retrieveFilesById" p:relation="REQUIRED" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <bean id="productName" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="pn" /> + <property name="longOption" value="productName" /> + <property name="description" value="Product name" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="product-name" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="ingestProduct" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="hasProduct" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getProductByName" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="deleteProductByName" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="retrieveFilesByName" p:relation="REQUIRED" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <bean id="productTypeName" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="ptn" /> + <property name="longOption" value="productTypeName" /> + <property name="description" value="ProductType name" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="product-type-name" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="ingestProduct" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getProductTypeByName" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getNumProducts" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getFirstPage" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getNextPage" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getPrevPage" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getLastPage" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getProductPercentTransferred" p:relation="REQUIRED" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <bean id="currentPageNum" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="curPage" /> + <property name="longOption" value="currentPageNum" /> + <property name="description" value="Current Page Number" /> + <property name="type" value="int" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="page-number" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getNextPage" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="getPrevPage" p:relation="REQUIRED" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <bean id="query" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="q" /> + <property name="longOption" value="query" /> + <property name="description" value="File Manager query" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="query" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="sqlQuery" p:relation="REQUIRED" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="luceneQuery" p:relation="REQUIRED" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <bean id="sortBy" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="sb" /> + <property name="longOption" value="sortBy" /> + <property name="description" value="Metadata field to sort query results by" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="metadata field" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="sqlQuery" p:relation="OPTIONAL" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="luceneQuery" p:relation="OPTIONAL" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <bean id="outputFormat" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="of" /> + <property name="longOption" value="outputFormat" /> + <property name="description" value="Output format string (i.e. Filename = $Filename)" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="output-format-string" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="sqlQuery" p:relation="OPTIONAL" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="luceneQuery" p:relation="OPTIONAL" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <bean id="delimiter" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption"> + <property name="shortOption" value="dlmtr" /> + <property name="longOption" value="delimiter" /> + <property name="description" value="String to use the separate query results" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="delimiter-string" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="sqlQuery" p:relation="OPTIONAL" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="luceneQuery" p:relation="OPTIONAL" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <bean id="filter" class="org.apache.oodt.cas.cli.option.GroupCmdLineOption"> + <property name="shortOption" value="f" /> + <property name="longOption" value="filter" /> + <property name="description" value="Query filter" /> + <property name="hasArgs" value="false" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="sqlQuery" p:relation="OPTIONAL" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="luceneQuery" p:relation="OPTIONAL" /> + </list> + </property> + <property name="subOptions"> + <list> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="algor" p:required="true" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="converter" p:required="false" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="startDateTimeMetKey" p:required="true" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="endDateTimeMetKey" p:required="true" /> + <bean class="org.apache.oodt.cas.cli.option.GroupSubOption" + p:option-ref="priorityMetKey" p:required="true" /> + </list> + </property> + </bean> + + <bean id="algor" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="algor" /> + <property name="longOption" value="algor" /> + <property name="description" value="FilterAlgor class" /> + <property name="type" value="org.apache.oodt.cas.filemgr.structs.query.filter.FilterAlgor" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="classpath" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="sqlQuery" p:relation="OPTIONAL" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="luceneQuery" p:relation="OPTIONAL" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <bean id="converter" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="conv" /> + <property name="longOption" value="converter" /> + <property name="description" value="VersionConverter class" /> + <property name="type" value="org.apache.oodt.cas.filemgr.structs.query.conv.VersionConverter" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="classpath" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="sqlQuery" p:relation="OPTIONAL" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="luceneQuery" p:relation="OPTIONAL" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <bean id="startDateTimeMetKey" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="sdtMetKey" /> + <property name="longOption" value="startDateTimeMetKey" /> + <property name="description" value="Start date time metadata key" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="metadata-key" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="sqlQuery" p:relation="OPTIONAL" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="luceneQuery" p:relation="OPTIONAL" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <bean id="endDateTimeMetKey" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="edtMetKey" /> + <property name="longOption" value="endDateTimeMetKey" /> + <property name="description" value="End date time metadata key" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="metadata-key" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="sqlQuery" p:relation="OPTIONAL" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="luceneQuery" p:relation="OPTIONAL" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> + + <bean id="priorityMetKey" class="org.apache.oodt.cas.cli.option.AdvancedCmdLineOption" + p:isSubOption="true"> + <property name="shortOption" value="prMetKey" /> + <property name="longOption" value="priorityMetKey" /> + <property name="description" value="Priority metadata key" /> + <property name="hasArgs" value="true" /> + <property name="argsDescription" value="metadata-key" /> + <property name="requirementRules"> + <list> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="sqlQuery" p:relation="OPTIONAL" /> + <bean class="org.apache.oodt.cas.cli.option.require.ActionDependencyRule" + p:actionName="luceneQuery" p:relation="OPTIONAL" /> + </list> + </property> + <property name="handler"> + <bean class="org.apache.oodt.cas.cli.option.handler.ApplyToActionHandler" /> + </property> + </bean> +</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/oodt/blob/a973c531/config/src/main/resources/examples/filemgr/filemgr.properties ---------------------------------------------------------------------- diff --git a/config/src/main/resources/examples/filemgr/filemgr.properties b/config/src/main/resources/examples/filemgr/filemgr.properties new file mode 100644 index 0000000..4d8d957 --- /dev/null +++ b/config/src/main/resources/examples/filemgr/filemgr.properties @@ -0,0 +1,114 @@ +# +# 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. +# + +# Configuration properties for the File Manager + +# repository factory +filemgr.repository.factory=org.apache.oodt.cas.filemgr.repository.XMLRepositoryManagerFactory + +# Lucene catalog factory +filemgr.catalog.factory=org.apache.oodt.cas.filemgr.catalog.LuceneCatalogFactory + +# data transfer factory +filemgr.datatransfer.factory=org.apache.oodt.cas.filemgr.datatransfer.LocalDataTransferFactory + +# validation layer factory +filemgr.validationLayer.factory=org.apache.oodt.cas.filemgr.validation.XMLValidationLayerFactory + +# xml rpc client configuration +org.apache.oodt.cas.filemgr.system.xmlrpc.connectionTimeout.minutes=20 +org.apache.oodt.cas.filemgr.system.xmlrpc.requestTimeout.minutes=60 +#org.apache.oodt.cas.filemgr.system.xmlrpc.connection.retries=0 +#org.apache.oodt.cas.filemgr.system.xmlrpc.connection.retry.interval.seconds=3 + +# mapped data source catalog configuration +#org.apache.oodt.cas.filemgr.catalog.mappeddatasource.mapFile=/path/to/ops.catalog.typemap.properties + +# lucene catalog configuration +org.apache.oodt.cas.filemgr.catalog.lucene.idxPath=[OODT_HOME]/data/catalog +org.apache.oodt.cas.filemgr.catalog.lucene.pageSize=20 +org.apache.oodt.cas.filemgr.catalog.lucene.commitLockTimeout.seconds=60 +org.apache.oodt.cas.filemgr.catalog.lucene.writeLockTimeout.seconds=60 +org.apache.oodt.cas.filemgr.catalog.lucene.mergeFactor=20 + +# XML repository manager configuration +org.apache.oodt.cas.filemgr.repositorymgr.dirs=file:[FILEMGR_HOME]/policy/oodt + +# XML validation layer configuration +org.apache.oodt.cas.filemgr.validation.dirs=file:[FILEMGR_HOME]/policy/oodt + +# remote data transfer configuration +org.apache.oodt.cas.filemgr.datatransfer.remote.chunkSize=1024 + +# location of Mime-Type repository +org.apache.oodt.cas.filemgr.mime.type.repository=[FILEMGR_HOME]/etc/mime-types.xml + + +############ data source configuration ################################## +# +# These 3 blocks of config properties can be used to setup a catalog, +# repository manager, and validation layer based on a RDBMS such as +# Oracle, MySQL, PostgreSQL, or any others that support a jdbc connection. +# Just un-comment the following blocks of properties and configure as +# needed. +# +######################################################################### + +# datasource catalog config +#org.apache.oodt.cas.filemgr.catalog.datasource.jdbc.url=some_jdbc_url +#org.apache.oodt.cas.filemgr.catalog.datasource.jdbc.user=user +#org.apache.oodt.cas.filemgr.catalog.datasource.jdbc.pass=pass +#org.apache.oodt.cas.filemgr.catalog.datasource.jdbc.driver=driver.class.name +#org.apache.oodt.cas.filemgr.catalog.datasource.quoteFields=false +#org.apache.oodt.cas.filemgr.catalog.datasource.pageSize=20 +#org.apache.oodt.cas.filemgr.catalog.datasource.cacheUpdateMinutes=5 + +# data source repository manager configuration +#org.apache.oodt.cas.filemgr.repositorymgr.datasource.jdbc.url=some_jdbc_url +#org.apache.oodt.cas.filemgr.repositorymgr.datasource.jdbc.user=user +#org.apache.oodt.cas.filemgr.repositorymgr.datasource.jdbc.pass=pass +#org.apache.oodt.cas.filemgr.repositorymgr.datasource.jdbc.driver=driver.class.name + +# data source validation layer configuration +#org.apache.oodt.cas.filemgr.validation.datasource.jdbc.url=some_jdbc_url +#org.apache.oodt.cas.filemgr.validation.datasource.jdbc.user=user +#org.apache.oodt.cas.filemgr.validation.datasource.jdbc.pass=pass +#org.apache.oodt.cas.filemgr.validation.datasource.jdbc.driver=driver.class.name +#org.apache.oodt.cas.filemgr.validation.datasource.quoteFields=false + + +# tells the file manager system layer to include product instance metadata +# NOTE: here are the expected field mappings +# +# product.getProductId() -> ProductId +# product.getProductName() -> ProductName +# product.getProductStructure() -> ProductStructure +# product.getTransferStatus() -> ProductTransferStatus +# product.getRootRef() -> ProductRootReference + +# for the references returned by product.getProductReferences() the following +# metadata fields will be added (order will be maintained, such that data store +# ref at index 0 will map to orig ref at index 0, etc.) +# +# ProductDataStoreReferences (list of all data store references: +# note already translated into path, not URI) +# ProductOrigReferences (list of all orig references: +# note already translated into path, not URI) +# ProductMimeType (list of all references' mime-types) +# ProductFileSize (list of all references' file sizes) + +org.apache.oodt.cas.filemgr.metadata.expandProduct=false \ No newline at end of file
