incubator-oodt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfos...@apache.org
Subject svn commit: r1002752 [9/9] - in /incubator/oodt/trunk/catalog: ./ .externalToolBuilders/ .settings/ src/ src/main/ src/main/assembly/ src/main/bin/ src/main/java/ src/main/java/gov/ src/main/java/gov/nasa/ src/main/java/gov/nasa/jpl/ src/main/java/gov/...
Date Wed, 29 Sep 2010 17:19:15 GMT
Added: incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/util/Serializer.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/util/Serializer.java?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/util/Serializer.java (added)
+++ incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/util/Serializer.java Wed Sep 29 17:19:09 2010
@@ -0,0 +1,98 @@
+/*
+ * 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.catalog.util;
+
+//JDK imports
+import java.io.InputStream;
+import java.io.OutputStream;
+
+//XStream imports
+import com.thoughtworks.xstream.XStream;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ */
+public class Serializer {
+
+	protected ClassLoader classLoader;
+	protected boolean usePluginUrls;
+	
+	public Serializer() {
+		this(true);
+	}
+
+	public Serializer(boolean usePluginUrls) {
+		this.usePluginUrls = usePluginUrls;
+		this.refreshClassLoader();
+	}
+	
+	public void refreshClassLoader() {
+		if (usePluginUrls)
+			this.classLoader = new PluginClassLoader();
+		else
+			this.classLoader = Serializer.class.getClassLoader();
+	}
+	
+	public void setUsePluginUrls(boolean usePluginUrls) {
+		this.usePluginUrls = usePluginUrls;
+	}
+
+	public ClassLoader getClassLoader() {
+		return classLoader;
+	}
+	
+	/**
+	 * Serializes any java object into a java Serializable String
+	 * @param <T> Object type to be serialized
+	 * @param object The Object of type <T> to be serialized
+	 * @return A String for of the object arg
+	 */
+	public <T> String serializeObject(T object) {
+		XStream xStream = new XStream();
+		return xStream.toXML(object);
+	}
+	
+	public <T> void serializeObject(T object, OutputStream outStream) {
+		XStream xStream = new XStream();
+		xStream.toXML(object, outStream);
+	}
+	
+	/**
+	 * Deserializes any object that has been serialized by the serializedObject(T) method
+	 * @param <T> Type of Object that was originally serialized
+	 * @param clazz The class object representation of the object type
+	 * @param xmlObject The String for of the object to be deserialized
+	 * @return The deserialized object
+	 * @throws ClassNotFoundException
+	 * @throws InstantiationException
+	 * @throws IllegalAccessException
+	 */
+	public <T> T deserializeObject(Class<T> clazz, String xmlObject) {
+		XStream xStream = new XStream();
+		xStream.setClassLoader(getClassLoader());
+		return (T) xStream.fromXML(xmlObject);
+	}
+	
+	public <T> T deserializeObject(Class<T> clazz, InputStream inStream) {
+		XStream xStream = new XStream();
+		xStream.setClassLoader(getClassLoader());
+		return (T) xStream.fromXML(inStream);
+	}
+
+}

Added: incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/util/SpringUtils.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/util/SpringUtils.java?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/util/SpringUtils.java (added)
+++ incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/util/SpringUtils.java Wed Sep 29 17:19:09 2010
@@ -0,0 +1,54 @@
+/*
+ * 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.catalog.util;
+
+//JDK imports
+import java.util.HashSet;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.system.Catalog;
+
+//Spring imports
+import org.springframework.context.support.FileSystemXmlApplicationContext;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ */
+public class SpringUtils {
+
+	private static Logger LOG = Logger.getLogger(SpringUtils.class.getName());
+	
+	public static HashSet<Catalog> loadCatalogs(String catalogBeanRepo) throws Exception {
+        FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(catalogBeanRepo);
+        Map<String, Catalog> catalogsMap = appContext.getBeansOfType(Catalog.class);
+        HashSet<Catalog> catalogs = new HashSet<Catalog>();
+        for (String key : catalogsMap.keySet()) {
+        	Catalog curCatalog = catalogsMap.get(key);
+        	LOG.log(Level.INFO, "Loading catalog configuration for Catalog: '" + curCatalog + "'");
+        	if (catalogs.contains(curCatalog))
+        		throw new Exception("Catalog URN : '" + curCatalog + "' conflicts with another Catalog's URN.  **NOTE: URNs are created based on the following rule: urn:<namespace>:<id or name (if set)>");
+        	catalogs.add(curCatalog);
+        }
+        return catalogs;
+	}
+	
+}

Added: incubator/oodt/trunk/catalog/src/main/resources/REMOVE.log
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/resources/REMOVE.log?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/resources/REMOVE.log (added)
+++ incubator/oodt/trunk/catalog/src/main/resources/REMOVE.log Wed Sep 29 17:19:09 2010
@@ -0,0 +1,2 @@
+You can remove this file. It was only included to ensure that the log directory for this
+distribution was created on assembly.

Added: incubator/oodt/trunk/catalog/src/main/resources/catalog-service.properties
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/resources/catalog-service.properties?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/resources/catalog-service.properties (added)
+++ incubator/oodt/trunk/catalog/src/main/resources/catalog-service.properties Wed Sep 29 17:19:09 2010
@@ -0,0 +1,23 @@
+###########################################################################
+# 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.
+###########################################################################
+
+# Directory to store plugin jars
+org.apache.oodt.cas.catalog.plugin.dirs=/[PCS_SUPPORT_HOME]/cas-catalog/plugin-jars
+
+# CatalogService configuration file
+org.apache.oodt.cas.catalog.server.config.file=/[CATALOG_HOME]/policy/catserv-server-config.xml
+org.apache.oodt.cas.catalog.client.config.file=/[CATALOG_HOME]/policy/catserv-client-config.xml
\ No newline at end of file

Added: incubator/oodt/trunk/catalog/src/main/resources/logging.properties
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/resources/logging.properties?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/resources/logging.properties (added)
+++ incubator/oodt/trunk/catalog/src/main/resources/logging.properties Wed Sep 29 17:19:09 2010
@@ -0,0 +1,50 @@
+###########################################################################
+# 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.
+###########################################################################
+
+# Specify the handlers to create in the root logger
+# (all loggers are children of the root logger)
+# The following creates two handlers
+handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler
+
+# Set the default logging level for the root logger
+.level = ALL
+    
+# Set the default logging level for new ConsoleHandler instances
+java.util.logging.ConsoleHandler.level = ALL
+java.util.logging.FileHandler.level = ALL
+        
+# Set the default formatter for new ConsoleHandler instances
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+
+# default file output is in user's home directory.
+java.util.logging.FileHandler.pattern = ../logs/cas_catalog%g.log
+java.util.logging.FileHandler.limit = 50000
+java.util.logging.FileHandler.count = 5
+java.util.logging.FileHandler.append = true
+java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
+
+# control the underlying commons-httpclient transport layer for xmlrpc 
+org.apache.commons.httpclient.level = INFO
+httpclient.wire.header.level = INFO
+httpclient.wire.level = INFO
+
+# airs dom loggin
+sun.rmi.level = INFO
+
+# spring logging
+org.springframework.level = INFO
+

Added: incubator/oodt/trunk/catalog/src/main/resources/oracle/create-transaction-id-map-table.sql
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/resources/oracle/create-transaction-id-map-table.sql?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/resources/oracle/create-transaction-id-map-table.sql (added)
+++ incubator/oodt/trunk/catalog/src/main/resources/oracle/create-transaction-id-map-table.sql Wed Sep 29 17:19:09 2010
@@ -0,0 +1,29 @@
+ -- 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.
+ 
+CREATE TABLE CatalogServiceMapper (
+  CAT_SERV_TRANS_ID VARCHAR2(255) NOT NULL ,
+  CAT_SERV_TRANS_FACTORY VARCHAR2(255) NOT NULL ,
+  CAT_TRANS_ID VARCHAR2(255) NOT NULL ,
+  CAT_TRANS_FACTORY VARCHAR2(255) NOT NULL ,
+  CAT_TRANS_DATE VARCHAR2(255) NOT NULL ,
+  CATALOG_ID VARCHAR2(255) NOT NULL
+);
+
+CREATE INDEX CatalogServiceMapper_CSTId_idx ON CatalogServiceMapper(CAT_SERV_TRANS_ID);  
+CREATE INDEX CatalogServiceMapper_CTId_idx ON CatalogServiceMapper(CAT_TRANS_ID);  
+CREATE INDEX CatalogServiceMapper_CatId_idx ON CatalogServiceMapper(CATALOG_ID);  
+
+EXIT;

Added: incubator/oodt/trunk/catalog/src/main/resources/oracle/create-transaction-index-table.sql
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/resources/oracle/create-transaction-index-table.sql?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/resources/oracle/create-transaction-index-table.sql (added)
+++ incubator/oodt/trunk/catalog/src/main/resources/oracle/create-transaction-index-table.sql Wed Sep 29 17:19:09 2010
@@ -0,0 +1,31 @@
+ -- 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.
+ 
+CREATE TABLE transactions
+(
+  transaction_id varchar2(256) NOT NULL,
+  transaction_date varchar2(256) NOT NULL
+);
+
+CREATE TABLE transaction_terms
+(
+  transaction_id varchar2(256) NOT NULL,
+  bucket_name varchar2(256) NOT NULL,
+  term_name varchar2(256) NOT NULL,
+  term_value varchar2(1000) NOT NULL
+);
+
+CREATE INDEX transactions_transid_idx ON transactions(transaction_id);  
+CREATE INDEX transaction_terms_transid_idx ON transaction_terms(transaction_id);  
\ No newline at end of file

Added: incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-beans.xml
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-beans.xml?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-beans.xml (added)
+++ incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-beans.xml Wed Sep 29 17:19:09 2010
@@ -0,0 +1,81 @@
+<?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.
+-->
+<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.5.xsd">
+        
+    <bean class="org.apache.oodt.commons.spring.postprocessor.SetIdBeanPostProcessor"/>    
+    
+    <!-- Catalog Services -->
+    <bean id="CatalogServiceLocalFactory" lazy-init="true" class="org.apache.oodt.cas.catalog.system.impl.CatalogServiceLocalFactory">
+        <property name="transactionIdFactory" value="org.apache.oodt.cas.catalog.struct.impl.transaction.UuidTransactionIdFactory"/>
+        <property name="catalogRepositoryFactory" ref="SerializedCatalogRepositoryFactory"/>
+        <property name="ingestMapperFactory" ref="InMemoryIngestMapperFactory"/>
+        <property name="pluginStorageDir" value="${pcs.support.home}/cas-catalog/plugin-jars/"/>
+        <property name="restrictQueryPermissions" value="false"/>
+        <property name="restrictIngestPermissions" value="false"/>
+    	<property name="oneCatalogFailsAllFail" value="true"/>
+    	<property name="simplifyQueries" value="true"/>
+    </bean>    
+    <bean id="CatalogServiceClientFactory" lazy-init="true" class="org.apache.oodt.cas.catalog.system.impl.CatalogServiceClientFactory">
+        <property name="communicationChannelClientFactory" ref="XmlRpcClientFactory"/>
+        <property name="autoPagerSize" value="1000"/>
+    </bean>
+    
+    <!-- Communication Channels -->
+    <bean id="XmlRpcServerFactory" lazy-init="true" class="org.apache.oodt.cas.catalog.server.channel.xmlrpc.XmlRpcCommunicationChannelServerFactory">
+        <property name="port" value="${catalog.port}"/>
+        <property name="catalogServiceFactory" ref="CatalogServiceLocalFactory"/>
+    </bean> 
+    <bean id="XmlRpcClientFactory" lazy-init="true" class="org.apache.oodt.cas.catalog.server.channel.xmlrpc.XmlRpcCommunicationChannelClientFactory">
+        <property name="serverUrl" value="${catalog.url}"/>
+        <property name="requestTimeout" value="20"/>
+        <property name="connectionTimeout" value="60"/>
+        <property name="chunkSize" value="1024"/>
+    </bean> 
+    
+    <!-- Catalog Repositories -->
+    <bean id="SpringCatalogRepositoryFactory" lazy-init="true" class="org.apache.oodt.cas.catalog.repository.SpringCatalogRepositoryFactory">
+        <property name="catalogBeanRepo" value="${catalog.home}/policy/filemgr-catalog-beans.xml"/>
+    </bean>
+    <bean id="WorkflowManagerRepositoryFactory" lazy-init="true" class="org.apache.oodt.cas.catalog.repository.SpringCatalogRepositoryFactory">
+        <property name="catalogBeanRepo" value="${catalog.home}/policy/workflow-manager-beans.xml"/>
+    </bean>
+    <bean id="SerializedCatalogRepositoryFactory" lazy-init="true" class="org.apache.oodt.cas.catalog.repository.SerializedCatalogRepositoryFactory">
+        <property name="storageDir" value="${pcs.support.home}/cas-catalog/catalog-repo"/>
+    </bean>
+    
+    <!-- Mapper Indexes -->
+    <bean id="DataSourceIngestMapperFactory" lazy-init="true" class="org.apache.oodt.cas.catalog.mapping.DataSourceIngestMapperFactory">
+        <property name="jdbcUrl" value="jdbc:oracle:thin:@dew.jpl.nasa.gov:1521:npptest"/>
+        <property name="user" value="sa"/>
+        <property name="pass" value=""/>
+        <property name="driver" value="oracle.jdbc.driver.OracleDriver"/>
+    </bean>
+    <bean id="InMemoryIngestMapperFactory" lazy-init="true" class="org.apache.oodt.cas.catalog.mapping.InMemoryIngestMapperFactory">
+        <property name="jdbcUrl" value="jdbc:hsqldb:file:${pcs.support.home}/hsqldb;shutdown=true"/>
+        <property name="user" value="sa"/>
+        <property name="pass" value=""/>
+        <property name="driver" value="org.hsqldb.jdbcDriver"/>
+        <property name="tablesFile" value="${catalog.home}/policy/in-memory-ingest-mapper.sql"/>        
+    </bean>
+    <bean id="MemoryBasedIngestMapperFactory" lazy-init="true" class="org.apache.oodt.cas.catalog.mapping.MemoryBasedIngestMapperFactory"/>
+    
+</beans>
+

Added: incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-client-action-beans.xml
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-client-action-beans.xml?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-client-action-beans.xml (added)
+++ incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-client-action-beans.xml Wed Sep 29 17:19:09 2010
@@ -0,0 +1,51 @@
+<?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.
+-->
+<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.5.xsd">
+    
+    <bean class="org.apache.oodt.commons.spring.postprocessor.SetIdBeanPostProcessor"/>    
+    
+    <bean id="shutdown" class="org.apache.oodt.cas.catalog.server.action.ShutdownServerAction">
+        <property name="description" value="Shuts down the server for which the given client connects"/>
+    </bean>
+    <bean id="query_all" class="org.apache.oodt.cas.catalog.server.action.QueryServerAction">
+        <property name="description" value="Performs a un-paged query to the server which the given client connects"/>        
+    </bean>
+    <bean id="reduced_query_all" class="org.apache.oodt.cas.catalog.server.action.ReducedQueryServerAction">
+        <property name="description" value="Performs a un-paged query to the server which the given client connects"/>        
+    </bean>
+    <bean id="query_paged" class="org.apache.oodt.cas.catalog.server.action.PagedQueryServerAction">
+        <property name="description" value="Performs a paged query to the server which the given client connects"/>        
+    </bean>
+    <bean id="reduced_query_paged" class="org.apache.oodt.cas.catalog.server.action.ReducedPagedQueryServerAction">
+        <property name="description" value="Performs a paged query to the server which the given client connects"/>        
+    </bean>
+    <bean id="load_catalogs" class="org.apache.oodt.cas.catalog.server.action.LoadCatalogsServerAction">
+        <property name="description" value="Loads the catalogs from the given spring xml file into the server for which the given client connects"/>        
+    </bean>
+    <bean id="load_catalog_repo" class="org.apache.oodt.cas.catalog.server.action.LoadCatalogRepositoryServerAction">
+        <property name="description" value="Loads the catalogs from the given repository from the given spring xml file into the server for which the given client connects"/>        
+    </bean>
+    <bean id="get_catalog_ids" class="org.apache.oodt.cas.catalog.server.action.GetSupportedCatalogIds">
+        <property name="description" value="Gets a list of supported catalog ids from the server which the given client connects"/>        
+    </bean>
+    
+</beans>
+

Added: incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-client-cmd-line-beans.xml
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-client-cmd-line-beans.xml?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-client-cmd-line-beans.xml (added)
+++ incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-client-cmd-line-beans.xml Wed Sep 29 17:19:09 2010
@@ -0,0 +1,302 @@
+<?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.
+-->
+<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.5.xsd">
+    
+    <bean class="org.apache.oodt.commons.spring.postprocessor.SetIdBeanPostProcessor"/>
+    
+    <!-- CAS-Catalog Cmd-Line-Options -->
+    <bean id="action" class="org.apache.oodt.commons.option.CmdLineOption">
+        <property name="shortOption" value="a"/>
+        <property name="longOption" value="action"/>
+        <property name="description" value="The CatalogService Action Bean to run"/>
+        <property name="hasArgs" value="true"/>
+        <property name="optionArgName" value="bean id"/>
+        <property name="required" value="true"/>
+    </bean>
+    
+    <bean id="clientFactoryBeanId" class="org.apache.oodt.commons.option.CmdLineOption">
+        <property name="shortOption" value="cfb"/>
+        <property name="longOption" value="clientFactoryBeanId"/>
+        <property name="description" value="CatalogServiceClientFactory Bean Id"/>
+        <property name="hasArgs" value="true"/>
+        <property name="optionArgName" value="bean id"/>
+        <property name="required" value="true"/>
+    </bean>
+    
+    <bean id="query" class="org.apache.oodt.commons.option.CmdLineOption">
+        <property name="shortOption" value="q"/>
+        <property name="longOption" value="query"/>
+        <property name="description" value="CatalogService String Query"/>
+        <property name="hasArgs" value="true"/>
+        <property name="optionArgName" value="query"/>
+        <property name="requiredOptions">
+            <list>
+                <bean class="org.apache.oodt.commons.option.required.RequiredOption">
+                    <property name="optionLongName" value="action"/>
+                    <property name="requireAllValues" value="false"/>
+                    <property name="optionValues">
+                        <list>
+                            <value>query_all</value>
+                            <value>reduced_query_all</value>
+                            <value>query_paged</value>
+                            <value>reduced_query_paged</value>                            
+                        </list>
+                    </property>
+                </bean>
+            </list>
+        </property>
+        <property name="handler">
+            <bean class="org.apache.oodt.commons.option.handler.CmdLineOptionBeanHandler">
+                <property name="applyToBeans">
+                    <list>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo"
+                            p:bean-ref="query_all"/>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo"
+                            p:bean-ref="reduced_query_all"/>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo"
+                            p:bean-ref="query_paged"/>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo"
+                            p:bean-ref="reduced_query_paged"/>
+                    </list>
+                </property>
+            </bean>
+        </property>
+    </bean>
+    
+    <bean id="pageSize" class="org.apache.oodt.commons.option.CmdLineOption">
+        <property name="shortOption" value="ps"/>
+        <property name="longOption" value="pageSize"/>
+        <property name="description" value="Paged Query PageSize"/>
+        <property name="hasArgs" value="true"/>
+        <property name="optionArgName" value="integer"/>
+        <property name="type" value="int"/>
+        <property name="requiredOptions">
+            <list>
+                <bean class="org.apache.oodt.commons.option.required.RequiredOption">
+                    <property name="optionLongName" value="action"/>
+                    <property name="requireAllValues" value="false"/>
+                    <property name="optionValues">
+                        <list>
+                            <value>query_paged</value>
+                            <value>reduced_query_paged</value>
+                        </list>
+                    </property>
+                </bean>
+            </list>
+        </property>
+        <property name="handler">
+            <bean class="org.apache.oodt.commons.option.handler.CmdLineOptionBeanHandler">
+                <property name="applyToBeans">
+                    <list>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo"
+                            p:bean-ref="query_paged"/>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo"
+                            p:bean-ref="reduced_query_paged"/>
+                    </list>
+                </property>
+            </bean>
+        </property>
+    </bean>
+    
+    <bean id="pageNum" class="org.apache.oodt.commons.option.CmdLineOption">
+        <property name="shortOption" value="pn"/>
+        <property name="longOption" value="pageNum"/>
+        <property name="description" value="Paged Query PageNum"/>
+        <property name="hasArgs" value="true"/>
+        <property name="optionArgName" value="integer"/>
+        <property name="type" value="int"/>
+        <property name="requiredOptions">
+            <list>
+                <bean class="org.apache.oodt.commons.option.required.RequiredOption">
+                    <property name="optionLongName" value="action"/>
+                    <property name="requireAllValues" value="false"/>
+                    <property name="optionValues">
+                        <list>
+                            <value>query_paged</value>
+                            <value>reduced_query_paged</value>                            
+                        </list>
+                    </property>
+                </bean>
+            </list>
+        </property>
+        <property name="handler">
+            <bean class="org.apache.oodt.commons.option.handler.CmdLineOptionBeanHandler">
+                <property name="applyToBeans">
+                    <list>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo"
+                            p:bean-ref="query_paged"/>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo"
+                            p:bean-ref="reduced_query_paged"/>
+                    </list>
+                </property>
+            </bean>
+        </property>
+    </bean>
+    
+    <bean id="reducedTerms" class="org.apache.oodt.commons.option.CmdLineOption">
+        <property name="shortOption" value="rt"/>
+        <property name="longOption" value="reducedTerms"/>
+        <property name="description" value="Term filter for query results"/>
+        <property name="hasArgs" value="true"/>
+        <property name="optionArgName" value="list"/>
+        <property name="type" value="java.util.List"/>        
+        <property name="requiredOptions">
+            <list>
+                <bean class="org.apache.oodt.commons.option.required.RequiredOption">
+                    <property name="optionLongName" value="action"/>
+                    <property name="requireAllValues" value="false"/>
+                    <property name="optionValues">
+                        <list>
+                            <value>reduced_query_all</value>
+                            <value>reduced_query_paged</value>                            
+                        </list>
+                    </property>
+                </bean>
+            </list>
+        </property>
+        <property name="handler">
+            <bean class="org.apache.oodt.commons.option.handler.CmdLineOptionBeanHandler">
+                <property name="applyToBeans">
+                    <list>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo"
+                            p:bean-ref="reduced_query_all"/>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo"
+                            p:bean-ref="reduced_query_paged"/>
+                    </list>
+                </property>
+            </bean>
+        </property>
+    </bean>
+    
+    <bean id="beanId" class="org.apache.oodt.commons.option.CmdLineOption">
+        <property name="shortOption" value="bid"/>
+        <property name="longOption" value="beanId"/>
+        <property name="description" value="Spring Bean Id"/>
+        <property name="hasArgs" value="true"/>
+        <property name="optionArgName" value="bean id"/>
+        <property name="requiredOptions">
+            <list>
+                <bean class="org.apache.oodt.commons.option.required.RequiredOption">
+                    <property name="optionLongName" value="action"/>
+                    <property name="requireAllValues" value="false"/>
+                    <property name="optionValues">
+                        <list>
+                            <value>load_catalog_repo</value>
+                        </list>
+                    </property>
+                </bean>
+            </list>
+        </property>
+        <property name="handler">
+            <bean class="org.apache.oodt.commons.option.handler.CmdLineOptionBeanHandler">
+                <property name="applyToBeans">
+                    <list>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo" p:bean-ref="load_catalog_repo"/>
+                    </list>
+                </property>
+            </bean>
+        </property>
+    </bean>
+    
+    <bean id="catalogIds" class="org.apache.oodt.commons.option.CmdLineOption">
+        <property name="shortOption" value="cid"/>
+        <property name="longOption" value="catalogIds"/>
+        <property name="description" value="List of Catalog IDs to query"/>
+        <property name="hasArgs" value="true"/>
+        <property name="optionArgName" value="catalog ids"/>
+        <property name="type" value="java.util.List"/>
+        <property name="handler">
+            <bean class="org.apache.oodt.commons.option.handler.CmdLineOptionBeanHandler">
+                <property name="applyToBeans">
+                    <list>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo" p:bean-ref="query_all"/>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo" p:bean-ref="reduced_query_all"/>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo" p:bean-ref="query_paged"/>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo" p:bean-ref="reduced_query_paged"/>
+                    </list>
+                </property>
+            </bean>
+        </property>
+    </bean>
+    
+    <bean id="beanRepo" class="org.apache.oodt.commons.option.CmdLineOption">
+        <property name="shortOption" value="br"/>
+        <property name="longOption" value="beanRepo"/>
+        <property name="description" value="Spring Bean XML File"/>
+        <property name="hasArgs" value="true"/>
+        <property name="optionArgName" value="file path"/>
+        <property name="requiredOptions">
+            <list>
+                <bean class="org.apache.oodt.commons.option.required.RequiredOption">
+                    <property name="optionLongName" value="action"/>
+                    <property name="requireAllValues" value="false"/>
+                    <property name="optionValues">
+                        <list>
+                            <value>load_catalogs</value>
+                            <value>load_catalog_repo</value>                            
+                        </list>
+                    </property>
+                </bean>
+            </list>
+        </property>
+        <property name="handler">
+            <bean class="org.apache.oodt.commons.option.handler.CmdLineOptionBeanHandler">
+                <property name="applyToBeans">
+                    <list>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo" p:bean-ref="load_catalogs"/>
+                        <bean class="org.apache.oodt.commons.option.handler.BeanInfo" p:bean-ref="load_catalog_repo"/>
+                    </list>
+                </property>
+            </bean>
+        </property>
+    </bean>
+    
+    <bean id="printSupportedActions" class="org.apache.oodt.commons.option.CmdLineOption">
+        <property name="shortOption" value="psa"/>
+        <property name="longOption" value="printSupportedActions"/>
+        <property name="description" value="Prints a list and description of all supported CatalogServiceServerActions"/>
+        <property name="hasArgs" value="false"/>
+        <property name="required" value="false"/>
+        <property name="performAndQuit" value="true"/>
+        <property name="handler">
+            <bean class="org.apache.oodt.cas.catalog.server.option.PrintSupportedActionsHandler">
+                <property name="beanRepo" value="/${catalog.home}/policy/catserv-client-config.xml"/>
+            </bean>
+        </property>
+    </bean>
+    
+    <bean id="printSupportedClients" class="org.apache.oodt.commons.option.CmdLineOption">
+        <property name="shortOption" value="psc"/>
+        <property name="longOption" value="printSupportedClients"/>
+        <property name="description" value="Prints a list and description of all supported CatalogServiceClientFactories"/>
+        <property name="hasArgs" value="false"/>
+        <property name="required" value="false"/>
+        <property name="performAndQuit" value="true"/>
+        <property name="handler">
+            <bean class="org.apache.oodt.cas.catalog.server.option.PrintSupportedClientsHandler">
+                <property name="beanRepo" value="/${catalog.home}/policy/catserv-client-config.xml"/>
+            </bean>
+        </property>
+    </bean>
+    
+</beans>
+
+

Added: incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-client-config.xml
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-client-config.xml?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-client-config.xml (added)
+++ incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-client-config.xml Wed Sep 29 17:19:09 2010
@@ -0,0 +1,29 @@
+<?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.
+-->
+<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.5.xsd">
+    
+    <import resource="catserv-properties.xml"/>
+    <import resource="catserv-beans.xml"/>
+    <import resource="catserv-client-action-beans.xml"/>
+    <import resource="catserv-client-cmd-line-beans.xml"/>
+    
+</beans>
+

Added: incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-properties.xml
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-properties.xml?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-properties.xml (added)
+++ incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-properties.xml Wed Sep 29 17:19:09 2010
@@ -0,0 +1,43 @@
+<?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.
+-->
+<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.5.xsd">
+    
+    <bean class="org.apache.oodt.cas.catalog.util.CasPropertyPlaceholderConfigurer">
+        
+        <!-- Allow for system-level properties to override all properties below -->
+        <property name="systemPropertiesMode" value="2"/>
+        
+        <!-- Properties -->
+        <property name="properties">
+            <props>
+                <prop key="catalog.url">[CATALOG_URL];http://localhost:10000</prop>           
+                <prop key="catalog.port">[CATALOG_PORT];10000</prop>           
+                <prop key="pcs.support.home">[PCS_SUPPORT_HOME];/tmp</prop>       
+                <!--prop key="filemgr.home">[FILEMGR_HOME];/tmp</prop-->           
+                <prop key="workflowmgr.home">[WORKFLOWMGR_HOME];/tmp</prop>           
+                <prop key="catalog.home">[CATALOG_HOME];/tmp</prop>           
+            </props>
+        </property>
+        
+    </bean>
+    
+</beans>
+

Added: incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-server-cmd-line-beans.xml
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-server-cmd-line-beans.xml?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-server-cmd-line-beans.xml (added)
+++ incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-server-cmd-line-beans.xml Wed Sep 29 17:19:09 2010
@@ -0,0 +1,51 @@
+<?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.
+-->
+<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.5.xsd">
+
+    <bean class="org.apache.oodt.commons.spring.postprocessor.SetIdBeanPostProcessor"/>
+
+    <!-- CAS-Catalog Cmd-Line-Options -->
+    <bean id="serverFactoryBeanId" class="org.apache.oodt.commons.option.CmdLineOption">
+        <property name="shortOption" value="sfb"/>
+        <property name="longOption" value="serverFactoryBeanId"/>
+        <property name="description" value="CommunicationChannelServerFactory Bean Id"/>
+        <property name="hasArgs" value="true"/>
+        <property name="optionArgName" value="bean id"/>
+        <property name="required" value="true"/>
+    </bean>
+
+    <bean id="printSupportedServers" class="org.apache.oodt.commons.option.CmdLineOption">
+        <property name="shortOption" value="pss"/>
+        <property name="longOption" value="printSupportedServers"/>
+        <property name="description" value="Prints a list and description of all supported CommunicationChannelServerFactories"/>
+        <property name="hasArgs" value="false"/>
+        <property name="required" value="false"/>
+        <property name="performAndQuit" value="true"/>
+        <property name="handler">
+            <bean class="org.apache.oodt.cas.catalog.server.option.PrintSupportedServersHandler">
+                <property name="beanRepo" value="/${catalog.home}/policy/catserv-server-config.xml"/>
+            </bean>
+        </property>
+    </bean>
+
+</beans>
+
+

Added: incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-server-config.xml
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-server-config.xml?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-server-config.xml (added)
+++ incubator/oodt/trunk/catalog/src/main/resources/policy/catserv-server-config.xml Wed Sep 29 17:19:09 2010
@@ -0,0 +1,28 @@
+<?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.
+-->
+<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.5.xsd">
+    
+    <import resource="catserv-properties.xml"/>
+    <import resource="catserv-beans.xml"/>
+    <import resource="catserv-server-cmd-line-beans.xml"/>
+    
+</beans>
+

Added: incubator/oodt/trunk/catalog/src/main/resources/policy/in-memory-index-cat.sql
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/resources/policy/in-memory-index-cat.sql?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/resources/policy/in-memory-index-cat.sql (added)
+++ incubator/oodt/trunk/catalog/src/main/resources/policy/in-memory-index-cat.sql Wed Sep 29 17:19:09 2010
@@ -0,0 +1,32 @@
+ -- 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.
+ 
+DROP TABLE transactions IF EXISTS;
+DROP TABLE transaction_terms IF EXISTS;
+
+CREATE TABLE transactions
+(
+  transaction_id varchar(256) NOT NULL,
+  transaction_date varchar(256) NOT NULL
+);
+
+CREATE TABLE transaction_terms
+(
+  transaction_id varchar(256) NOT NULL,
+  bucket_name varchar(256) NOT NULL,
+  term_name varchar(256) NOT NULL,
+  term_value varchar(1000) NOT NULL
+);
+

Added: incubator/oodt/trunk/catalog/src/main/resources/policy/in-memory-ingest-mapper.sql
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/resources/policy/in-memory-ingest-mapper.sql?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/resources/policy/in-memory-ingest-mapper.sql (added)
+++ incubator/oodt/trunk/catalog/src/main/resources/policy/in-memory-ingest-mapper.sql Wed Sep 29 17:19:09 2010
@@ -0,0 +1,26 @@
+ -- 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.
+ 
+DROP TABLE CatalogServiceMapper IF EXISTS;
+
+CREATE TABLE CatalogServiceMapper (
+  CAT_SERV_TRANS_ID VARCHAR(255) NOT NULL ,
+  CAT_SERV_TRANS_FACTORY VARCHAR(255) NOT NULL ,
+  CAT_TRANS_ID VARCHAR(255) NOT NULL ,
+  CAT_TRANS_FACTORY VARCHAR(255) NOT NULL ,
+  CAT_TRANS_DATE VARCHAR(255) NOT NULL ,
+  CATALOG_ID VARCHAR(255) NOT NULL
+);
+

Added: incubator/oodt/trunk/catalog/src/main/resources/policy/workflow-catalog-beans.xml
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/resources/policy/workflow-catalog-beans.xml?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/resources/policy/workflow-catalog-beans.xml (added)
+++ incubator/oodt/trunk/catalog/src/main/resources/policy/workflow-catalog-beans.xml Wed Sep 29 17:19:09 2010
@@ -0,0 +1,56 @@
+<?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.
+-->
+<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.5.xsd">
+    
+    <bean id="WorkflowManagerCatalog" factory-bean="WorkflowManagerCatalogFactory" factory-method="createCatalog"/>
+    <bean id="WorkflowManagerCatalogFactory" class="org.apache.oodt.cas.catalog.system.CatalogFactory">
+        <property name="catalogId" value="urn:PEATE:WorkflowInstancesCatalog"/>
+        <property name="indexFactory" ref="WorkflowManagerDataSourceIndexFactory"/>
+        <property name="dictionaryFactories">
+            <list>
+                <ref bean="WorkflowManagerDictionaryFactory"/>
+            </list>
+        </property>
+        <property name="restrictQueryPermissions" value="false"/>
+        <property name="restrictIngestPermissions" value="false"/>
+    </bean>
+    
+    <!-- WorkflowManager Indexes -->
+    <bean id="WorkflowManagerDataSourceIndexFactory" class="org.apache.oodt.cas.catalog.struct.impl.index.WorkflowManagerDataSourceIndexFactory">
+        <property name="jdbcUrl" value="jdbc:oracle:thin:@dew.jpl.nasa.gov:1521:npptest"/>        
+        <property name="user" value="nppint"/>
+        <property name="pass" value="Peate"/>
+        <property name="driver" value="oracle.jdbc.driver.OracleDriver"/>
+    </bean>
+    <bean id="InMemoryIndexFactory" class="org.apache.oodt.cas.catalog.struct.impl.index.InMemoryIndexFactory">
+        <property name="jdbcUrl" value="jdbc:hsqldb:file:${pcs.support.home}/hsqldb;shutdown=true"/>        
+        <property name="user" value="sa"/>
+        <property name="pass" value=""/>
+        <property name="driver" value="org.hsqldb.jdbcDriver"/>
+        <property name="tablesFile" value="${workflowmgr.home}/policy/in-memory-index-cat.sql"/>
+    </bean>
+    
+    <!-- WorkflowManager Dictionary -->
+    <bean id="WorkflowManagerDictionaryFactory" class="org.apache.oodt.cas.catalog.struct.impl.dictionary.WorkflowManagerDictionaryFactory"/>
+    
+</beans>
+
+

Added: incubator/oodt/trunk/catalog/src/test/org/apache/oodt/cas/catalog/system/impl/TestCatalogServiceLocal.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/test/org/apache/oodt/cas/catalog/system/impl/TestCatalogServiceLocal.java?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/test/org/apache/oodt/cas/catalog/system/impl/TestCatalogServiceLocal.java (added)
+++ incubator/oodt/trunk/catalog/src/test/org/apache/oodt/cas/catalog/system/impl/TestCatalogServiceLocal.java Wed Sep 29 17:19:09 2010
@@ -0,0 +1,189 @@
+/*
+ * 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.catalog.system.impl;
+
+//JDK imports
+import java.io.File;
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.Collections;
+import java.util.List;
+import java.util.Vector;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.exception.CatalogServiceException;
+import org.apache.oodt.cas.catalog.mapping.InMemoryIngestMapperFactory;
+import org.apache.oodt.cas.catalog.metadata.TransactionalMetadata;
+import org.apache.oodt.cas.catalog.page.Page;
+import org.apache.oodt.cas.catalog.page.PageInfo;
+import org.apache.oodt.cas.catalog.page.QueryPager;
+import org.apache.oodt.cas.catalog.page.TransactionReceipt;
+import org.apache.oodt.cas.catalog.query.QueryExpression;
+import org.apache.oodt.cas.catalog.query.parser.ParseException;
+import org.apache.oodt.cas.catalog.query.parser.QueryParser;
+import org.apache.oodt.cas.catalog.query.parser.TokenMgrError;
+import org.apache.oodt.cas.catalog.repository.MemoryBasedCatalogRepositoryFactory;
+import org.apache.oodt.cas.catalog.struct.impl.index.DataSourceIndexFactory;
+import org.apache.oodt.cas.catalog.struct.impl.index.InMemoryIndexFactory;
+import org.apache.oodt.cas.catalog.struct.impl.transaction.UuidTransactionIdFactory;
+import org.apache.oodt.cas.catalog.system.CatalogFactory;
+import org.apache.oodt.cas.catalog.system.impl.CatalogServiceLocal;
+import org.apache.oodt.cas.catalog.system.impl.CatalogServiceLocalFactory;
+import org.apache.oodt.cas.metadata.Metadata;
+
+//JUnit imports
+import junit.framework.TestCase;
+
+/**
+ * 
+ * @author bfoster
+ * @version $Revision$
+ *
+ */
+public class TestCatalogServiceLocal extends TestCase {
+
+	private CatalogServiceLocal cs;
+	
+	public TestCatalogServiceLocal() throws ClassNotFoundException, InstantiationException, IllegalAccessException, CatalogServiceException, IOException, SQLException {
+        File tempFile = File.createTempFile("foo", "bar");
+        tempFile.deleteOnExit();
+        File tempDir = tempFile.getParentFile();
+        String tmpDirPath = tempDir.getAbsolutePath();
+		
+		CatalogServiceLocalFactory factory = new CatalogServiceLocalFactory();
+		factory.setCatalogRepositoryFactory(new MemoryBasedCatalogRepositoryFactory());
+		factory.setIngestMapperFactory(this.getOracleIngestMapperFactory(tmpDirPath));
+		factory.setOneCatalogFailsAllFail(true);
+		factory.setSimplifyQueries(true);
+		factory.setPluginStorageDir("/dev/null");
+		factory.setRestrictIngestPermissions(false);
+		factory.setRestrictQueryPermissions(false);
+		factory.setTransactionIdFactory(UuidTransactionIdFactory.class.getCanonicalName());
+		cs = factory.createCatalogService();
+		
+		CatalogFactory catalogFactory = new CatalogFactory();
+		catalogFactory.setCatalogId("TestCatalog1");
+		catalogFactory.setDictionaryFactories(null);
+		catalogFactory.setIndexFactory(getInMemoryDSFactory(tmpDirPath + "/1/"));
+		catalogFactory.setRestrictIngestPermissions(false);
+		catalogFactory.setRestrictQueryPermissions(false);
+		cs.addCatalog(catalogFactory.createCatalog());
+		catalogFactory.setCatalogId("TestCatalog2");
+		catalogFactory.setIndexFactory(getInMemoryDSFactory(tmpDirPath + "/2/"));
+		cs.addCatalog(catalogFactory.createCatalog());
+	}
+	
+	public void testDataSourceCatalogIngestQueryAndDelete() throws CatalogServiceException, ParseException, TokenMgrError {
+		//test ingest
+		Metadata m = new Metadata();
+		m.addMetadata("testkey1", "testval1");
+		TransactionReceipt tr = cs.ingest(m);
+		Vector<TransactionReceipt> receipts = new Vector<TransactionReceipt>();
+		receipts.add(tr);
+		List<TransactionalMetadata> metadatas = cs.getMetadata(receipts);
+		assertEquals(metadatas.size(), 1);
+		Metadata ingestedMetadata = metadatas.get(0).getMetadata();
+		assertEquals(ingestedMetadata.getMetadata("testkey1"), "testval1");
+		assertEquals(ingestedMetadata.getAllMetadata("testkey1").size(), 2);
+
+		//test ingest update
+		m.replaceMetadata(CatalogServiceLocal.CATALOG_SERVICE_TRANSACTION_ID_MET_KEY.toString(), tr.getTransactionId().toString());
+		tr = cs.ingest(m);
+		receipts = new Vector<TransactionReceipt>();
+		receipts.add(tr);
+		metadatas = cs.getMetadata(receipts);
+		assertEquals(metadatas.size(), 1);
+		ingestedMetadata = metadatas.get(0).getMetadata();
+		assertEquals(ingestedMetadata.getMetadata("testkey1"), "testval1");
+		assertEquals(ingestedMetadata.getAllMetadata("testkey1").size(), 2);
+
+		//test query using querypager
+		QueryExpression qe = QueryParser.parseQueryExpression("testkey1 == 'testval1'");
+		QueryPager pager = cs.query(qe);
+		metadatas = cs.getNextPage(pager);
+		assertEquals(metadatas.size(), 1);
+		ingestedMetadata = metadatas.get(0).getMetadata();
+		assertEquals(ingestedMetadata.getMetadata("testkey1"), "testval1");
+		assertEquals(ingestedMetadata.getAllMetadata("testkey1").size(), 2);
+
+		//test query using std paging
+		qe = QueryParser.parseQueryExpression("testkey1 == 'testval1'");
+		Page page = cs.getPage(new PageInfo(20, PageInfo.FIRST_PAGE), qe);
+		metadatas = cs.getMetadata(page);
+		assertEquals(metadatas.size(), 1);
+		ingestedMetadata = metadatas.get(0).getMetadata();
+		assertEquals(ingestedMetadata.getMetadata("testkey1"), "testval1");
+		assertEquals(ingestedMetadata.getAllMetadata("testkey1").size(), 2);
+
+		//test query using std paging with catalog restriction
+		qe = QueryParser.parseQueryExpression("testkey1 == 'testval1'");
+		page = cs.getPage(new PageInfo(20, PageInfo.FIRST_PAGE), qe, Collections.singleton("TestCatalog1"));
+		metadatas = cs.getMetadata(page);
+		assertEquals(metadatas.size(), 1);
+		ingestedMetadata = metadatas.get(0).getMetadata();
+		assertEquals(ingestedMetadata.getMetadata("testkey1"), "testval1");
+		assertEquals(ingestedMetadata.getAllMetadata("testkey1").size(), 1);
+
+		//test delete
+		m = new Metadata();
+		m.addMetadata(CatalogServiceLocal.CATALOG_SERVICE_TRANSACTION_ID_MET_KEY.toString(), tr.getTransactionId().toString());
+		cs.delete(m);
+		assertEquals(cs.getMetadata(Collections.singletonList(tr)).size(), 0);
+	}
+	
+	private InMemoryIngestMapperFactory getOracleIngestMapperFactory(String tmpDirPath) throws SQLException, IOException {
+        new File(tmpDirPath).deleteOnExit();
+
+//		OracleIngestMapperFactory factory = new OracleIngestMapperFactory();
+		String user = "sa";
+		String pass = "";
+		String driver = "org.hsqldb.jdbcDriver";
+		String url = "jdbc:hsqldb:file:" + tmpDirPath + "/testMapperCat;shutdown=true";
+//        DataSource ds = DatabaseConnectionBuilder.buildDataSource(user, pass,
+//                driver, url);
+		InMemoryIngestMapperFactory factory = new InMemoryIngestMapperFactory();
+
+//        SqlScript coreSchemaScript = new SqlScript(new File("./src/testdata/test-mapper-cat.sql").getAbsolutePath(), ds);
+//        coreSchemaScript.loadScript();
+//        coreSchemaScript.execute();
+        
+		factory.setDriver(driver);
+		factory.setJdbcUrl(url);
+		factory.setPass(pass);
+		factory.setUser(user);	
+		factory.setTablesFile("./src/testdata/test-mapper-cat.sql");
+		return factory;
+	}
+	
+	private DataSourceIndexFactory getInMemoryDSFactory(String tmpDirPath) throws IOException, SQLException {
+        new File(tmpDirPath).deleteOnExit();
+        
+        String user = "sa";
+		String pass = "";
+		String driver = "org.hsqldb.jdbcDriver";
+		String url = "jdbc:hsqldb:file:" + tmpDirPath + "/testIndexCat;shutdown=true";
+
+		InMemoryIndexFactory indexFactory = new InMemoryIndexFactory();
+		indexFactory.setDriver(driver);
+		indexFactory.setJdbcUrl(url);
+		indexFactory.setPass(pass);
+		indexFactory.setUser(user);
+		indexFactory.setTablesFile("./src/testdata/test-index-cat.sql");
+		return indexFactory;
+	}
+	
+}

Added: incubator/oodt/trunk/catalog/src/testdata/test-index-cat.sql
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/testdata/test-index-cat.sql?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/testdata/test-index-cat.sql (added)
+++ incubator/oodt/trunk/catalog/src/testdata/test-index-cat.sql Wed Sep 29 17:19:09 2010
@@ -0,0 +1,32 @@
+ -- 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.
+ 
+DROP TABLE transactions IF EXISTS;
+DROP TABLE transaction_terms IF EXISTS;
+
+CREATE TABLE transactions
+(
+  transaction_id varchar(256) NOT NULL,
+  transaction_date varchar(256) NOT NULL
+);
+
+CREATE TABLE transaction_terms
+(
+  transaction_id varchar(256) NOT NULL,
+  bucket_name varchar(256) NOT NULL,
+  term_name varchar(256) NOT NULL,
+  term_value varchar(1000) NOT NULL
+);
+

Added: incubator/oodt/trunk/catalog/src/testdata/test-mapper-cat.sql
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/testdata/test-mapper-cat.sql?rev=1002752&view=auto
==============================================================================
--- incubator/oodt/trunk/catalog/src/testdata/test-mapper-cat.sql (added)
+++ incubator/oodt/trunk/catalog/src/testdata/test-mapper-cat.sql Wed Sep 29 17:19:09 2010
@@ -0,0 +1,26 @@
+ -- 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.
+ 
+DROP TABLE CatalogServiceMapper IF EXISTS;
+
+CREATE TABLE CatalogServiceMapper (
+  CAT_SERV_TRANS_ID VARCHAR(255) NOT NULL ,
+  CAT_SERV_TRANS_FACTORY VARCHAR(255) NOT NULL ,
+  CAT_TRANS_ID VARCHAR(255) NOT NULL ,
+  CAT_TRANS_FACTORY VARCHAR(255) NOT NULL ,
+  CAT_TRANS_DATE VARCHAR(255) NOT NULL ,
+  CATALOG_ID VARCHAR(255) NOT NULL
+);
+



Mime
View raw message