incubator-oodt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattm...@apache.org
Subject svn commit: r963454 - /incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/
Date Mon, 12 Jul 2010 19:59:06 GMT
Author: mattmann
Date: Mon Jul 12 19:59:06 2010
New Revision: 963454

URL: http://svn.apache.org/viewvc?rev=963454&view=rev
Log:
- progress towards OODT-15 One trunk for all OODT components with top level build

Modified:
    incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/CatalogServiceServerAction.java
    incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/GetSupportedCatalogIds.java
    incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/LoadCatalogRepositoryServerAction.java
    incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/LoadCatalogsServerAction.java
    incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/PagedQueryServerAction.java
    incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/QueryServerAction.java
    incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/ReducedPagedQueryServerAction.java
    incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/ReducedQueryServerAction.java
    incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/ShutdownServerAction.java

Modified: incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/CatalogServiceServerAction.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/CatalogServiceServerAction.java?rev=963454&r1=963453&r2=963454&view=diff
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/CatalogServiceServerAction.java
(original)
+++ incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/CatalogServiceServerAction.java
Mon Jul 12 19:59:06 2010
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -17,11 +17,18 @@
 
 package org.apache.oodt.cas.catalog.server.action;
 
+//Spring imports
 import org.springframework.beans.factory.annotation.Required;
 
+//OODT imports
 import org.apache.oodt.cas.catalog.system.impl.CatalogServiceClient;
 import org.apache.oodt.cas.commons.spring.SpringSetIdInjectionType;
 
+/**
+ * 
+ * Describe your class here.
+ * 
+ */
 public abstract class CatalogServiceServerAction implements SpringSetIdInjectionType {
 	
 	protected String id;

Modified: incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/GetSupportedCatalogIds.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/GetSupportedCatalogIds.java?rev=963454&r1=963453&r2=963454&view=diff
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/GetSupportedCatalogIds.java
(original)
+++ incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/GetSupportedCatalogIds.java
Mon Jul 12 19:59:06 2010
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -17,12 +17,18 @@
 
 package org.apache.oodt.cas.catalog.server.action;
 
+//OODT imports
 import org.apache.oodt.cas.catalog.system.impl.CatalogServiceClient;
 
+/**
+ * 
+ * Describe your class here.
+ * 
+ */
 public class GetSupportedCatalogIds extends CatalogServiceServerAction {
-	
-	public void performAction(CatalogServiceClient csClient) throws Exception {
-		System.out.println("CatalogIDs: " + csClient.getCurrentCatalogIds());
-	}
+
+  public void performAction(CatalogServiceClient csClient) throws Exception {
+    System.out.println("CatalogIDs: " + csClient.getCurrentCatalogIds());
+  }
 
 }

Modified: incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/LoadCatalogRepositoryServerAction.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/LoadCatalogRepositoryServerAction.java?rev=963454&r1=963453&r2=963454&view=diff
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/LoadCatalogRepositoryServerAction.java
(original)
+++ incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/LoadCatalogRepositoryServerAction.java
Mon Jul 12 19:59:06 2010
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -17,46 +17,58 @@
 
 package org.apache.oodt.cas.catalog.server.action;
 
+//JDK imports
 import java.util.Set;
 
+//Spring imports
 import org.springframework.context.support.FileSystemXmlApplicationContext;
 
+//OODT imports
 import org.apache.oodt.cas.catalog.repository.CatalogRepository;
 import org.apache.oodt.cas.catalog.repository.CatalogRepositoryFactory;
 import org.apache.oodt.cas.catalog.system.Catalog;
 import org.apache.oodt.cas.catalog.system.impl.CatalogServiceClient;
 import org.apache.oodt.cas.catalog.util.Serializer;
 
-public class LoadCatalogRepositoryServerAction extends CatalogServiceServerAction {
+/**
+ * 
+ * Describe your class here.
+ * 
+ */
+public class LoadCatalogRepositoryServerAction extends
+    CatalogServiceServerAction {
+
+  protected String beanId;
+  protected String beanRepo;
 
-	protected String beanId;
-	protected String beanRepo;
-	
-	@Override
-	public void performAction(CatalogServiceClient csClient) throws Exception {
-		FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(new String[]
{ this.beanRepo }, false);
-		appContext.setClassLoader(new Serializer().getClassLoader());
-		appContext.refresh();
-		CatalogRepositoryFactory factory = (CatalogRepositoryFactory) appContext.getBean(this.beanId,
CatalogRepositoryFactory.class);
-		CatalogRepository catalogRepository = factory.createRepository();
-		Set<Catalog> catalogs = catalogRepository.deserializeAllCatalogs();
-		System.out.println("Deserialized Catalogs: " + catalogs.toString());
-		for (Catalog catalog : catalogs) {
-			try {
-				System.out.println("Adding Catalog: " + catalog);
-				csClient.addCatalog(catalog);
-			}catch (Exception e) {
-				e.printStackTrace();
-				System.err.println("Failed to add catalog '" + catalog + "' to server : " + e.getMessage());
-			}
-		}		
-	}
-	
-	public void setBeanId(String beanId) {
-		this.beanId = beanId;
-	}
-	
-	public void setBeanRepo(String beanRepo) {
-		this.beanRepo = beanRepo;
-	}
+  @Override
+  public void performAction(CatalogServiceClient csClient) throws Exception {
+    FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(
+        new String[] { this.beanRepo }, false);
+    appContext.setClassLoader(new Serializer().getClassLoader());
+    appContext.refresh();
+    CatalogRepositoryFactory factory = (CatalogRepositoryFactory) appContext
+        .getBean(this.beanId, CatalogRepositoryFactory.class);
+    CatalogRepository catalogRepository = factory.createRepository();
+    Set<Catalog> catalogs = catalogRepository.deserializeAllCatalogs();
+    System.out.println("Deserialized Catalogs: " + catalogs.toString());
+    for (Catalog catalog : catalogs) {
+      try {
+        System.out.println("Adding Catalog: " + catalog);
+        csClient.addCatalog(catalog);
+      } catch (Exception e) {
+        e.printStackTrace();
+        System.err.println("Failed to add catalog '" + catalog
+            + "' to server : " + e.getMessage());
+      }
+    }
+  }
+
+  public void setBeanId(String beanId) {
+    this.beanId = beanId;
+  }
+
+  public void setBeanRepo(String beanRepo) {
+    this.beanRepo = beanRepo;
+  }
 }

Modified: incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/LoadCatalogsServerAction.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/LoadCatalogsServerAction.java?rev=963454&r1=963453&r2=963454&view=diff
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/LoadCatalogsServerAction.java
(original)
+++ incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/LoadCatalogsServerAction.java
Mon Jul 12 19:59:06 2010
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -17,30 +17,40 @@
 
 package org.apache.oodt.cas.catalog.server.action;
 
+//JDK imports
 import java.util.Map;
 
+//OODT imports
 import org.apache.oodt.cas.catalog.system.Catalog;
 import org.apache.oodt.cas.catalog.system.impl.CatalogServiceClient;
 import org.apache.oodt.cas.catalog.util.Serializer;
 
+//Spring imports
 import org.springframework.context.support.FileSystemXmlApplicationContext;
 
+/**
+ * 
+ * Describe your class here.
+ * 
+ */
 public class LoadCatalogsServerAction extends CatalogServiceServerAction {
 
-	protected String beanRepo;
-	
-	@Override
-	public void performAction(CatalogServiceClient csClient) throws Exception {
-		FileSystemXmlApplicationContext repoAppContext = new FileSystemXmlApplicationContext(new
String[] { this.beanRepo }, false);
-		repoAppContext.setClassLoader(new Serializer().getClassLoader());
-		repoAppContext.refresh();
-		Map<String, Catalog> catalogs = repoAppContext.getBeansOfType(Catalog.class);
-		for (Catalog catalog : catalogs.values())
-			csClient.addCatalog(catalog);
-	}
-	
-	public void setBeanRepo(String beanRepo) {
-		this.beanRepo = beanRepo;
-	}
+  protected String beanRepo;
+
+  @Override
+  public void performAction(CatalogServiceClient csClient) throws Exception {
+    FileSystemXmlApplicationContext repoAppContext = new FileSystemXmlApplicationContext(
+        new String[] { this.beanRepo }, false);
+    repoAppContext.setClassLoader(new Serializer().getClassLoader());
+    repoAppContext.refresh();
+    Map<String, Catalog> catalogs = repoAppContext
+        .getBeansOfType(Catalog.class);
+    for (Catalog catalog : catalogs.values())
+      csClient.addCatalog(catalog);
+  }
+
+  public void setBeanRepo(String beanRepo) {
+    this.beanRepo = beanRepo;
+  }
 
 }

Modified: incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/PagedQueryServerAction.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/PagedQueryServerAction.java?rev=963454&r1=963453&r2=963454&view=diff
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/PagedQueryServerAction.java
(original)
+++ incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/PagedQueryServerAction.java
Mon Jul 12 19:59:06 2010
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -17,57 +17,70 @@
 
 package org.apache.oodt.cas.catalog.server.action;
 
+//JDK imports
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
+//OODT imports
 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.pagination.Page;
+import org.apache.oodt.cas.catalog.pagination.PageInfo;
 import org.apache.oodt.cas.catalog.query.QueryExpression;
 import org.apache.oodt.cas.catalog.query.parser.QueryParser;
 import org.apache.oodt.cas.catalog.system.impl.CatalogServiceClient;
 
+/**
+ * 
+ * Describe your class here.
+ * 
+ */
 public class PagedQueryServerAction extends CatalogServiceServerAction {
 
-	protected int pageNum;
-	protected int pageSize;
-	protected String query;
-	protected Set<String> catalogIds;
-	
-	public void performAction(CatalogServiceClient csClient) throws Exception {
-		QueryExpression queryExpression = QueryParser.parseQueryExpression(query);
-		System.out.println(queryExpression);
-		Page page = null;
-		if (catalogIds == null) 
-			page = csClient.getPage(new PageInfo(pageSize, pageNum), queryExpression);
-		else
-			page = csClient.getPage(new PageInfo(pageSize, pageNum), queryExpression, catalogIds);
-		List<TransactionalMetadata> transactionMetadatas = csClient.getMetadata(page);
-		for (TransactionalMetadata tMet : transactionMetadatas) {
-			System.out.print("ID: " + tMet.getTransactionId() + " ; CatalogIDs: " + tMet.getCatalogIds()
+ " ; Metadata: (");
-			StringBuffer sb = new StringBuffer("");
-			for (Object metKey : tMet.getMetadata().getHashtable().keySet()) {
-				sb.append(metKey + "=" + tMet.getMetadata().getAllMetadata((String) metKey).toString().replaceAll("[\\[\\]]",
"'") + ", ");
-			}
-			System.out.println(sb.substring(0, sb.length() - 2) + ")");
-		}
-	}
-	
-	public void setPageSize(int pageSize) {
-		this.pageSize = pageSize;
-	}
-	
-	public void setPageNum(int pageNum) {
-		this.pageNum = pageNum;
-	}
-	 
-	public void setQuery(String query) {
-		this.query = query;
-	}
-	
-	public void setCatalogIds(List<String> catalogIds) {
-		this.catalogIds = new HashSet<String>(catalogIds);
-	}
+  protected int pageNum;
+  protected int pageSize;
+  protected String query;
+  protected Set<String> catalogIds;
+
+  public void performAction(CatalogServiceClient csClient) throws Exception {
+    QueryExpression queryExpression = QueryParser.parseQueryExpression(query);
+    System.out.println(queryExpression);
+    Page page = null;
+    if (catalogIds == null)
+      page = csClient.getPage(new PageInfo(pageSize, pageNum), queryExpression);
+    else
+      page = csClient.getPage(new PageInfo(pageSize, pageNum), queryExpression,
+          catalogIds);
+    List<TransactionalMetadata> transactionMetadatas = csClient
+        .getMetadata(page);
+    for (TransactionalMetadata tMet : transactionMetadatas) {
+      System.out.print("ID: " + tMet.getTransactionId() + " ; CatalogIDs: "
+          + tMet.getCatalogIds() + " ; Metadata: (");
+      StringBuffer sb = new StringBuffer("");
+      for (Object metKey : tMet.getMetadata().getHashtable().keySet()) {
+        sb.append(metKey
+            + "="
+            + tMet.getMetadata().getAllMetadata((String) metKey).toString()
+                .replaceAll("[\\[\\]]", "'") + ", ");
+      }
+      System.out.println(sb.substring(0, sb.length() - 2) + ")");
+    }
+  }
+
+  public void setPageSize(int pageSize) {
+    this.pageSize = pageSize;
+  }
+
+  public void setPageNum(int pageNum) {
+    this.pageNum = pageNum;
+  }
+
+  public void setQuery(String query) {
+    this.query = query;
+  }
+
+  public void setCatalogIds(List<String> catalogIds) {
+    this.catalogIds = new HashSet<String>(catalogIds);
+  }
 
 }

Modified: incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/QueryServerAction.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/QueryServerAction.java?rev=963454&r1=963453&r2=963454&view=diff
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/QueryServerAction.java
(original)
+++ incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/QueryServerAction.java
Mon Jul 12 19:59:06 2010
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -17,47 +17,59 @@
 
 package org.apache.oodt.cas.catalog.server.action;
 
+//JDK imports
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
+//OODT imports
 import org.apache.oodt.cas.catalog.metadata.TransactionalMetadata;
-import org.apache.oodt.cas.catalog.page.QueryPager;
+import org.apache.oodt.cas.catalog.pagination.QueryPager;
 import org.apache.oodt.cas.catalog.query.QueryExpression;
 import org.apache.oodt.cas.catalog.query.parser.QueryParser;
 import org.apache.oodt.cas.catalog.system.impl.CatalogServiceClient;
 
+/**
+ * 
+ * Describe your class here.
+ * 
+ */
 public class QueryServerAction extends CatalogServiceServerAction {
 
-	protected String query;
-	protected Set<String> catalogIds;
-	
-	public void performAction(CatalogServiceClient csClient) throws Exception {
-		System.out.println(query);
-		QueryExpression queryExpression = QueryParser.parseQueryExpression(query);
-		System.out.println(queryExpression);
-		QueryPager queryPager = null;
-		if (catalogIds == null) 
-			queryPager = csClient.query(queryExpression);
-		else
-			queryPager = csClient.query(queryExpression, catalogIds);
-		List<TransactionalMetadata> transactionMetadatas = csClient.getAllPages(queryPager);
-		for (TransactionalMetadata tMet : transactionMetadatas) {
-			System.out.print("ID: " + tMet.getTransactionId() + " ; CatalogIDs: " + tMet.getCatalogIds()
+ " ; Metadata: (");
-			StringBuffer sb = new StringBuffer("");
-			for (Object metKey : tMet.getMetadata().getHashtable().keySet()) {
-				sb.append(metKey + "=" + tMet.getMetadata().getAllMetadata((String) metKey).toString().replaceAll("[\\[\\]]",
"'") + ", ");
-			}
-			System.out.println(sb.substring(0, sb.length() - 2) + ")");
-		}
-	}
-	
-	public void setQuery(String query) {
-		this.query = query;
-	}
-	
-	public void setCatalogIds(List<String> catalogIds) {
-		this.catalogIds = new HashSet<String>(catalogIds);
-	}
+  protected String query;
+  protected Set<String> catalogIds;
+
+  public void performAction(CatalogServiceClient csClient) throws Exception {
+    System.out.println(query);
+    QueryExpression queryExpression = QueryParser.parseQueryExpression(query);
+    System.out.println(queryExpression);
+    QueryPager queryPager = null;
+    if (catalogIds == null)
+      queryPager = csClient.query(queryExpression);
+    else
+      queryPager = csClient.query(queryExpression, catalogIds);
+    List<TransactionalMetadata> transactionMetadatas = csClient
+        .getAllPages(queryPager);
+    for (TransactionalMetadata tMet : transactionMetadatas) {
+      System.out.print("ID: " + tMet.getTransactionId() + " ; CatalogIDs: "
+          + tMet.getCatalogIds() + " ; Metadata: (");
+      StringBuffer sb = new StringBuffer("");
+      for (Object metKey : tMet.getMetadata().getHashtable().keySet()) {
+        sb.append(metKey
+            + "="
+            + tMet.getMetadata().getAllMetadata((String) metKey).toString()
+                .replaceAll("[\\[\\]]", "'") + ", ");
+      }
+      System.out.println(sb.substring(0, sb.length() - 2) + ")");
+    }
+  }
+
+  public void setQuery(String query) {
+    this.query = query;
+  }
+
+  public void setCatalogIds(List<String> catalogIds) {
+    this.catalogIds = new HashSet<String>(catalogIds);
+  }
 
 }

Modified: incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/ReducedPagedQueryServerAction.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/ReducedPagedQueryServerAction.java?rev=963454&r1=963453&r2=963454&view=diff
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/ReducedPagedQueryServerAction.java
(original)
+++ incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/ReducedPagedQueryServerAction.java
Mon Jul 12 19:59:06 2010
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -17,64 +17,78 @@
 
 package org.apache.oodt.cas.catalog.server.action;
 
+//JDK imports
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
+//APACHE imports
 import org.apache.commons.lang.StringUtils;
 
+//OODT imports
 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.pagination.Page;
+import org.apache.oodt.cas.catalog.pagination.PageInfo;
 import org.apache.oodt.cas.catalog.query.QueryExpression;
 import org.apache.oodt.cas.catalog.query.parser.QueryParser;
 import org.apache.oodt.cas.catalog.system.impl.CatalogServiceClient;
 
+/**
+ * 
+ * Describe your class here.
+ * 
+ */
 public class ReducedPagedQueryServerAction extends CatalogServiceServerAction {
 
-	protected int pageNum;
-	protected int pageSize;
-	protected String query;
-	protected Set<String> catalogIds;
-	protected List<String> termNames;
-	
-	public void performAction(CatalogServiceClient csClient) throws Exception {
-		QueryExpression queryExpression = QueryParser.parseQueryExpression(query);
-		System.out.println(queryExpression);
-		Page page = null;
-		if (catalogIds == null) 
-			page = csClient.getPage(new PageInfo(pageSize, pageNum), queryExpression);
-		else
-			page = csClient.getPage(new PageInfo(pageSize, pageNum), queryExpression, catalogIds);
-		List<TransactionalMetadata> transactionMetadatas = csClient.getMetadata(page);
-		for (TransactionalMetadata tMet : transactionMetadatas) {
-			StringBuffer sb = new StringBuffer("");
-			for (String termName : this.termNames) {
-				List<String> values = tMet.getMetadata().getAllMetadata((String) termName);
-				sb.append(termName + " = '" + (values == null ? "null" : StringUtils.join(values.iterator(),
",")) + "', ");
-			}
-			System.out.println(sb.substring(0, sb.length() - 2));
-		}
-	}
-	
-	public void setPageSize(int pageSize) {
-		this.pageSize = pageSize;
-	}
-	
-	public void setPageNum(int pageNum) {
-		this.pageNum = pageNum;
-	}
-	 
-	public void setQuery(String query) {
-		this.query = query;
-	}
-	
-	public void setCatalogIds(List<String> catalogIds) {
-		this.catalogIds = new HashSet<String>(catalogIds);
-	}
-	
-	public void setReducedTerms(List<String> termNames) {
-		this.termNames = termNames;
-	}
+  protected int pageNum;
+  protected int pageSize;
+  protected String query;
+  protected Set<String> catalogIds;
+  protected List<String> termNames;
+
+  public void performAction(CatalogServiceClient csClient) throws Exception {
+    QueryExpression queryExpression = QueryParser.parseQueryExpression(query);
+    System.out.println(queryExpression);
+    Page page = null;
+    if (catalogIds == null)
+      page = csClient.getPage(new PageInfo(pageSize, pageNum), queryExpression);
+    else
+      page = csClient.getPage(new PageInfo(pageSize, pageNum), queryExpression,
+          catalogIds);
+    List<TransactionalMetadata> transactionMetadatas = csClient
+        .getMetadata(page);
+    for (TransactionalMetadata tMet : transactionMetadatas) {
+      StringBuffer sb = new StringBuffer("");
+      for (String termName : this.termNames) {
+        List<String> values = tMet.getMetadata().getAllMetadata(
+            (String) termName);
+        sb.append(termName
+            + " = '"
+            + (values == null ? "null" : StringUtils.join(values.iterator(),
+                ",")) + "', ");
+      }
+      System.out.println(sb.substring(0, sb.length() - 2));
+    }
+  }
+
+  public void setPageSize(int pageSize) {
+    this.pageSize = pageSize;
+  }
+
+  public void setPageNum(int pageNum) {
+    this.pageNum = pageNum;
+  }
+
+  public void setQuery(String query) {
+    this.query = query;
+  }
+
+  public void setCatalogIds(List<String> catalogIds) {
+    this.catalogIds = new HashSet<String>(catalogIds);
+  }
+
+  public void setReducedTerms(List<String> termNames) {
+    this.termNames = termNames;
+  }
 
 }

Modified: incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/ReducedQueryServerAction.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/ReducedQueryServerAction.java?rev=963454&r1=963453&r2=963454&view=diff
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/ReducedQueryServerAction.java
(original)
+++ incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/ReducedQueryServerAction.java
Mon Jul 12 19:59:06 2010
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -17,54 +17,67 @@
 
 package org.apache.oodt.cas.catalog.server.action;
 
+//JDK imports
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
+//APACHE imports
 import org.apache.commons.lang.StringUtils;
 
+//OODT imports
 import org.apache.oodt.cas.catalog.metadata.TransactionalMetadata;
-import org.apache.oodt.cas.catalog.page.QueryPager;
+import org.apache.oodt.cas.catalog.pagination.QueryPager;
 import org.apache.oodt.cas.catalog.query.QueryExpression;
 import org.apache.oodt.cas.catalog.query.parser.QueryParser;
 import org.apache.oodt.cas.catalog.system.impl.CatalogServiceClient;
 
+/**
+ * 
+ * Describe your class here.
+ * 
+ */
 public class ReducedQueryServerAction extends CatalogServiceServerAction {
 
-	protected String query;
-	protected Set<String> catalogIds;
-	protected List<String> termNames;
-	
-	public void performAction(CatalogServiceClient csClient) throws Exception {
-		System.out.println(query);
-		QueryExpression queryExpression = QueryParser.parseQueryExpression(query);
-		System.out.println(queryExpression);
-		QueryPager queryPager = null;
-		if (catalogIds == null) 
-			queryPager = csClient.query(queryExpression);
-		else
-			queryPager = csClient.query(queryExpression, catalogIds);
-		List<TransactionalMetadata> transactionMetadatas = csClient.getAllPages(queryPager);
-		for (TransactionalMetadata tMet : transactionMetadatas) {
-			StringBuffer sb = new StringBuffer("");
-			for (String termName : this.termNames) {
-				List<String> values = tMet.getMetadata().getAllMetadata((String) termName);
-				sb.append(termName + " = '" + (values == null ? "null" : StringUtils.join(values.iterator(),
",")) + "', ");
-			}
-			System.out.println(sb.substring(0, sb.length() - 2));
-		}
-	}
-	
-	public void setQuery(String query) {
-		this.query = query;
-	}
-	
-	public void setCatalogIds(List<String> catalogIds) {
-		this.catalogIds = new HashSet<String>(catalogIds);
-	}
-	
-	public void setReducedTerms(List<String> termNames) {
-		this.termNames = termNames;
-	}
+  protected String query;
+  protected Set<String> catalogIds;
+  protected List<String> termNames;
+
+  public void performAction(CatalogServiceClient csClient) throws Exception {
+    System.out.println(query);
+    QueryExpression queryExpression = QueryParser.parseQueryExpression(query);
+    System.out.println(queryExpression);
+    QueryPager queryPager = null;
+    if (catalogIds == null)
+      queryPager = csClient.query(queryExpression);
+    else
+      queryPager = csClient.query(queryExpression, catalogIds);
+    List<TransactionalMetadata> transactionMetadatas = csClient
+        .getAllPages(queryPager);
+    for (TransactionalMetadata tMet : transactionMetadatas) {
+      StringBuffer sb = new StringBuffer("");
+      for (String termName : this.termNames) {
+        List<String> values = tMet.getMetadata().getAllMetadata(
+            (String) termName);
+        sb.append(termName
+            + " = '"
+            + (values == null ? "null" : StringUtils.join(values.iterator(),
+                ",")) + "', ");
+      }
+      System.out.println(sb.substring(0, sb.length() - 2));
+    }
+  }
+
+  public void setQuery(String query) {
+    this.query = query;
+  }
+
+  public void setCatalogIds(List<String> catalogIds) {
+    this.catalogIds = new HashSet<String>(catalogIds);
+  }
+
+  public void setReducedTerms(List<String> termNames) {
+    this.termNames = termNames;
+  }
 
 }

Modified: incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/ShutdownServerAction.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/ShutdownServerAction.java?rev=963454&r1=963453&r2=963454&view=diff
==============================================================================
--- incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/ShutdownServerAction.java
(original)
+++ incubator/oodt/trunk/catalog/src/main/java/org/apache/oodt/cas/catalog/server/action/ShutdownServerAction.java
Mon Jul 12 19:59:06 2010
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -17,12 +17,18 @@
 
 package org.apache.oodt.cas.catalog.server.action;
 
+//OODT imports
 import org.apache.oodt.cas.catalog.system.impl.CatalogServiceClient;
 
+/**
+ * 
+ * Describe your class here.
+ * 
+ */
 public class ShutdownServerAction extends CatalogServiceServerAction {
 
-	public void performAction(CatalogServiceClient csClient) throws Exception {
-		csClient.shutdown();
-	}
+  public void performAction(CatalogServiceClient csClient) throws Exception {
+    csClient.shutdown();
+  }
 
 }



Mime
View raw message