oodt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfos...@apache.org
Subject svn commit: r1052147 [6/12] - in /oodt/branches/wengine-branch/wengine: ./ src/ src/main/ src/main/assembly/ src/main/bin/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/oodt/ src/main/java/org/apache/oodt/cas/ src...
Date Thu, 23 Dec 2010 02:47:22 GMT
Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/DescribeWorkflow.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/DescribeWorkflow.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/DescribeWorkflow.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/DescribeWorkflow.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,53 @@
+/*
+ * 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.workflow.server.action;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+import org.apache.oodt.cas.workflow.processor.ProcessorSkeleton;
+import org.apache.oodt.cas.workflow.util.WorkflowUtils;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Action for print out workflow metadata, state, priority info, etc ...
+ * <p>
+ */
+public class DescribeWorkflow extends WorkflowEngineServerAction {
+
+	private String instanceId;
+	private String modelId;
+	
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		ProcessorSkeleton skeleton = weClient.getWorkflow(this.instanceId);
+		if (this.modelId != null) 
+			skeleton = WorkflowUtils.findSkeleton(skeleton, this.modelId);
+		System.out.println(WorkflowUtils.describe(skeleton));
+	}
+	
+	public void setInstanceId(String instanceId) {
+		this.instanceId = instanceId;
+	}
+
+	public void setModelId(String modelId) {
+		this.modelId = modelId;
+	}
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/FilteredAction.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/FilteredAction.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/FilteredAction.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/FilteredAction.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,97 @@
+/*
+ * 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.workflow.server.action;
+
+//JDK imports
+import java.util.Collections;
+import java.util.Hashtable;
+import java.util.List;
+
+//OODT imports
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+import org.apache.oodt.cas.workflow.exceptions.EngineException;
+import org.apache.oodt.cas.workflow.page.PageFilter;
+import org.apache.oodt.cas.workflow.processor.ProcessorStub;
+import org.apache.oodt.cas.workflow.state.StateUtils;
+import org.apache.oodt.cas.workflow.state.WorkflowState;
+
+/**
+ * 
+ * @author bfoster
+ *
+ */
+public abstract class FilteredAction extends WorkflowEngineServerAction {
+
+	protected String categoryName;
+	protected String stateName;
+	protected String modelId;
+	protected Hashtable<String, Object> filterKeys = new Hashtable<String, Object>();
+	protected Metadata metadata;
+	
+	
+	public PageFilter createFilter(WorkflowEngineClient weClient) throws EngineException {
+		final List<WorkflowState> supportedStates = weClient.getSupportedStates();
+		if (this.filterKeys.size() > 0) 
+			(metadata = new Metadata()).addMetadata(filterKeys);
+		return new PageFilter() {
+			
+			private String modelId = FilteredAction.this.modelId;
+			private WorkflowState state = FilteredAction.this.stateName != null ? StateUtils.getStateByName(supportedStates, FilteredAction.this.stateName) : null;
+			private WorkflowState.Category category = FilteredAction.this.categoryName != null ? StateUtils.getCategoryByName(supportedStates, FilteredAction.this.categoryName) : null;
+			private Metadata metadata = FilteredAction.this.metadata;
+			
+			public boolean accept(ProcessorStub stub,
+					Metadata cachedMetadata) {
+				if (modelId != null) 
+					if (!stub.getModelId().equals(modelId))
+						return false;
+				if (state != null) 
+					if (!stub.getState().equals(state))
+						return false;
+				if (category != null) 
+					if (!stub.getState().getCategory().equals(category))
+						return false;
+				if (metadata != null) {
+					for (String key : metadata.getAllKeys()) {
+						List<String> values = cachedMetadata.getAllMetadata(key);
+						if (values == null || Collections.disjoint(metadata.getAllMetadata(key), values))
+							return false;
+					}
+				}
+				return true;
+			}
+		};
+	}
+	
+	public void setModelId(String modelId) {
+		this.modelId = modelId;
+	}
+
+	public void setCategory(String category) {
+		this.categoryName = category;
+	}
+	
+	public void setState(String state) {
+		this.stateName = state;
+	}
+	
+	public void replaceFilterMetadata(List<String> keyValues) {
+		this.filterKeys.put(keyValues.get(0), keyValues.subList(1, keyValues.size()));
+	}
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetExecutingPage.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetExecutingPage.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetExecutingPage.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetExecutingPage.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,56 @@
+/*
+ * 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.workflow.server.action;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.page.PageInfo;
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+import org.apache.oodt.cas.workflow.page.RunnablesPage;
+import org.apache.oodt.cas.workflow.processor.ProcessorStub;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Action for print out a page of executing TaskProcessors
+ * <p>
+ */
+public class GetExecutingPage extends WorkflowEngineServerAction {
+
+	private int pageNum;
+	private int pageSize;
+	
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		PageInfo pageInfo = new PageInfo(pageSize, pageNum);
+		RunnablesPage page = weClient.getExecutingPage(pageInfo);
+		System.out.println("Workflows (Page: " + page.getPageInfo().getPageNum() + "/" + (int) page.getPageInfo().getTotalPages() +  "; Total: " + page.getPageInfo().getNumOfHits() + "):");
+		for (ProcessorStub stub : page.getStubs()) 
+			System.out.println("  - InstanceId = '" + stub.getInstanceId() + "', ModelId = '" + stub.getModelId() +"', State = '" + stub.getState().getName() + "'");
+		System.out.println();
+	}
+	
+	public void setPageNum(int pageNum) {
+		this.pageNum = pageNum;
+	}
+	
+	public void setPageSize(int pageSize) {
+		this.pageSize = pageSize;
+	}
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetPage.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetPage.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetPage.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetPage.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,85 @@
+/*
+ * 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.workflow.server.action;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.page.PageInfo;
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+import org.apache.oodt.cas.workflow.page.QueuePage;
+import org.apache.oodt.cas.workflow.processor.ProcessorStub;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Action for print out a page of queued up WorkflowProcessors
+ * <p>
+ */
+public class GetPage extends FilteredAction {
+
+	private int pageNum;
+	private int pageSize;
+	private boolean showMessage;
+	
+	public GetPage() {
+		super();
+		this.pageNum = 1;
+		this.pageSize = 10;
+		this.showMessage = false;
+	}
+	
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		PageInfo pageInfo = new PageInfo(pageSize, pageNum);
+		QueuePage page = weClient.getPage(pageInfo, this.createFilter(weClient));
+		System.out.println("Workflows " + getFilterAsString() + " (Page: " + page.getPageInfo().getPageNum() + "/" + page.getPageInfo().getTotalPages() +  "; Total: " + page.getPageInfo().getNumOfHits() + "):");
+		for (ProcessorStub stub : page.getStubs()) {
+			System.out.println("  - InstanceId = '" + stub.getInstanceId() + "', ModelId = '" + stub.getModelId() +"', State = '" + stub.getState().getName() + "'");
+			if (this.showMessage)
+				System.out.println("      (Message = '" + stub.getState().getMessage() + "')");
+		}
+		System.out.println();
+	}
+	
+	public void setPageNum(int pageNum) {
+		this.pageNum = pageNum;
+	}
+	
+	public void setPageSize(int pageSize) {
+		this.pageSize = pageSize;
+	}
+	
+	public void showMessage(boolean showMessage) {
+		this.showMessage = showMessage;
+	}
+	
+	protected String getFilterAsString() {
+		String filter = "[";
+		if (this.stateName != null)
+			filter += "state='" + this.stateName + "'";
+		if (this.categoryName != null)
+			filter += "category='" + this.categoryName + "'";
+		if (this.modelId != null)
+			filter += "modelId='" + this.modelId + "'";
+		if (this.filterKeys.size() > 0)
+			filter += this.filterKeys.toString();
+		filter += "]";
+		return filter;
+	}
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetPercentLoaded.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetPercentLoaded.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetPercentLoaded.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetPercentLoaded.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,56 @@
+/*
+ * 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.workflow.server.action;
+
+//JDK imports
+import java.text.DecimalFormat;
+import java.util.Date;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Action for print out percent loaded/cached of WorkflowProcessors
+ * <p>
+ */
+public class GetPercentLoaded extends WorkflowEngineServerAction {
+
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		try {
+			long timePassedInMillis = new Date().getTime() - weClient.getLaunchDate().getTime();
+			long loaded = weClient.getNumOfLoadedProcessors();
+			long total = weClient.getNumOfWorkflows();
+			long etaInMins = 0;
+			if (loaded != total)
+				etaInMins = (long) ((((double) (total - loaded) * (double) timePassedInMillis) / (double) loaded) / 1000.0 / 60.0);
+			double factionLoaded = (double) loaded / (double) total;
+			System.out
+					.println("Workflows Loaded (Percent: '" + (int) (factionLoaded * 100.0) + "%', Decimal: '"
+							+ new DecimalFormat("#.###").format(factionLoaded) + "', Faction: '"
+							+ loaded + "/" + total + "', ETA: '" + etaInMins + " mins')");
+		} catch (Exception e) {
+			throw new Exception("Failed to get percent loaded workflows : "
+					+ e.getMessage(), e);
+		}
+	}
+
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetRunnablesPage.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetRunnablesPage.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetRunnablesPage.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetRunnablesPage.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,56 @@
+/*
+ * 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.workflow.server.action;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.page.PageInfo;
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+import org.apache.oodt.cas.workflow.page.RunnablesPage;
+import org.apache.oodt.cas.workflow.processor.ProcessorStub;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Action for print out a page of ready TaskProcessors
+ * <p>
+ */
+public class GetRunnablesPage extends WorkflowEngineServerAction {
+
+	private int pageNum;
+	private int pageSize;
+	
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		PageInfo pageInfo = new PageInfo(pageSize, pageNum);
+		RunnablesPage page = weClient.getRunnablesPage(pageInfo);
+		System.out.println("Workflows (Page: " + page.getPageInfo().getPageNum() + "/" + (int) page.getPageInfo().getTotalPages() +  "; Total: " + page.getPageInfo().getNumOfHits() + "):");
+		for (ProcessorStub stub : page.getStubs()) 
+			System.out.println("  - InstanceId = '" + stub.getInstanceId() + "', ModelId = '" + stub.getModelId() +"', State = '" + stub.getState().getName() + "'");
+		System.out.println();
+	}
+	
+	public void setPageNum(int pageNum) {
+		this.pageNum = pageNum;
+	}
+	
+	public void setPageSize(int pageSize) {
+		this.pageSize = pageSize;
+	}
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetSortedPage.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetSortedPage.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetSortedPage.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetSortedPage.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,171 @@
+/*
+ * 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.workflow.server.action;
+
+//JDK imports
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.page.PageInfo;
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+import org.apache.oodt.cas.workflow.page.QueuePage;
+import org.apache.oodt.cas.workflow.processor.ProcessorStub;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Action for print out a page of sorted queued WorkflowProcessors
+ * <p>
+ */
+public class GetSortedPage extends WorkflowEngineServerAction {
+
+	private int pageNum;
+	private int pageSize;
+	private boolean reverse = false;
+	
+	public static enum COMPARATOR { 
+				
+		CreationDate {
+			@Override
+			public Comparator<ProcessorStub> getComparator() {
+				return new Comparator<ProcessorStub>() {
+					public int compare(ProcessorStub o1,
+							ProcessorStub o2) {
+						return o1.getProcessorInfo().getCreationDate()
+							.compareTo(o2.getProcessorInfo().getCreationDate());
+					}
+				};
+			}
+		},
+		ExecutionDate {
+			@Override
+			public Comparator<ProcessorStub> getComparator() {
+				return new Comparator<ProcessorStub>() {
+					public int compare(ProcessorStub o1,
+							ProcessorStub o2) {
+						if (o1.getProcessorInfo().getExecutionDate() != null
+								&& o2.getProcessorInfo().getExecutionDate() != null) {
+							return o1.getProcessorInfo().getExecutionDate()
+								.compareTo(o2.getProcessorInfo().getExecutionDate());
+						}else if (o1.getProcessorInfo().getExecutionDate() != null) {
+							return -1;
+						}else if (o2.getProcessorInfo().getExecutionDate() != null) {
+							return 1;
+						}else {
+							return 0;
+						}
+					}
+				};
+			}
+		},
+		CompletionDate {
+			@Override
+			public Comparator<ProcessorStub> getComparator() {
+				return new Comparator<ProcessorStub>() {
+					public int compare(ProcessorStub o1,
+							ProcessorStub o2) {
+						if (o1.getProcessorInfo().getCompletionDate() != null
+								&& o2.getProcessorInfo().getCompletionDate() != null) {
+							return o1.getProcessorInfo().getCompletionDate()
+								.compareTo(o2.getProcessorInfo().getCompletionDate());
+						}else if (o1.getProcessorInfo().getCompletionDate() != null) {
+							return -1;
+						}else if (o2.getProcessorInfo().getCompletionDate() != null) {
+							return 1;
+						}else {
+							return 0;
+						}
+					}
+				};
+			}
+		},
+		AliveTime {
+			@Override
+			public Comparator<ProcessorStub> getComparator() {
+				return new Comparator<ProcessorStub>() {
+					public int compare(ProcessorStub o1,
+							ProcessorStub o2) {
+						Date nowDate = new Date();
+						Date o1CompDate = o1.getProcessorInfo().getCompletionDate() != null ? o1.getProcessorInfo().getCompletionDate() : nowDate;
+						Date o2CompDate = o2.getProcessorInfo().getCompletionDate() != null ? o2.getProcessorInfo().getCompletionDate() : nowDate;
+						return Long.valueOf(o1CompDate.getTime() - o1.getProcessorInfo().getCreationDate().getTime())
+							.compareTo(o2CompDate.getTime() - o2.getProcessorInfo().getCreationDate().getTime());
+					}
+				};
+			}
+		},
+		TimesBlocked {
+			@Override
+			public Comparator<ProcessorStub> getComparator() {
+				return new Comparator<ProcessorStub>() {
+					public int compare(ProcessorStub o1,
+							ProcessorStub o2) {
+						return Integer.valueOf(o2.getTimesBlocked()).compareTo(Integer.valueOf(o1.getTimesBlocked()));
+					}
+				};
+			}
+		};
+		
+		public abstract Comparator<ProcessorStub> getComparator();
+		
+	};
+	private COMPARATOR comparator;
+	
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		PageInfo pageInfo = new PageInfo(pageSize, pageNum);
+		QueuePage page = (this.comparator != null) ? weClient.getPage(pageInfo, this.reverse ? Collections.reverseOrder(this.comparator.getComparator()) : this.comparator.getComparator()) : weClient.getPage(pageInfo);
+		System.out.println("Workflows (Page: " + page.getPageInfo().getPageNum() + "/" + page.getPageInfo().getTotalPages() +  "; Total: " + page.getPageInfo().getNumOfHits() + "):");
+		for (ProcessorStub stub : page.getStubs()) {
+			System.out.print("  - InstanceId = '" + stub.getInstanceId() + "', ModelId = '" + stub.getModelId() +"', State = '" + stub.getState().getName() + "'");
+			if (this.comparator == null)
+				System.out.println();
+			else if (this.comparator.name().equals(COMPARATOR.CreationDate.name()))
+				System.out.println(", CreationDate = '" + stub.getProcessorInfo().getCreationDate() + "'");
+			else if (this.comparator.name().equals(COMPARATOR.ExecutionDate.name()))
+				System.out.println(", ExecutionDate = '" + stub.getProcessorInfo().getExecutionDate() + "'");
+			else if (this.comparator.name().equals(COMPARATOR.CompletionDate.name()))
+				System.out.println(", CompletionDate = '" + stub.getProcessorInfo().getCompletionDate() + "'");
+			else if (this.comparator.name().equals(COMPARATOR.AliveTime.name())) 
+				System.out.println(", AliveTime = '" + (stub.getProcessorInfo().getCompletionDate() != null ? ((stub.getProcessorInfo().getCompletionDate().getTime() - stub.getProcessorInfo().getCreationDate().getTime()) / 1000 / 60) : ((System.currentTimeMillis() - stub.getProcessorInfo().getCreationDate().getTime()) / 1000 / 60)) + " mins'");
+			else if (this.comparator.name().equals(COMPARATOR.TimesBlocked.name())) 
+				System.out.println(", TimesBlocked = '" + stub.getTimesBlocked() + "'");
+		}
+		System.out.println();
+	}
+	
+	public void setPageNum(int pageNum) {
+		this.pageNum = pageNum;
+	}
+	
+	public void setPageSize(int pageSize) {
+		this.pageSize = pageSize;
+	}
+
+	public void setComparator(String comparator) {
+		this.comparator = COMPARATOR.valueOf(COMPARATOR.class, comparator);
+	}
+	
+	public void setReverse(boolean reverse) {
+		this.reverse = reverse;
+	}
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetStatusByCategory.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetStatusByCategory.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetStatusByCategory.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetStatusByCategory.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,59 @@
+/*
+ * 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.workflow.server.action;
+
+//JDK imports
+import java.util.Arrays;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Action for printing out status of workflows by state
+ * <p>
+ */
+public class GetStatusByCategory extends WorkflowEngineServerAction {
+	
+	private int pageSize = 5;
+	private boolean showMessage = false;
+
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		System.out.println("\nTotal Number of Workflows: " + weClient.getNumOfWorkflows() + "\n");
+		for (String category : Arrays.asList("RUNNING", "WAITING", "TRANSITION", "DONE", "HOLDING")) {
+			GetPage action = new GetPage();
+			action.setPageNum(1);
+			action.setPageSize(pageSize);
+			action.setCategory(category);
+			action.showMessage(this.showMessage);
+			action.performAction(weClient);
+		}
+	}
+	
+	public void setPageSize(int pageSize) {
+		this.pageSize = pageSize;
+	}
+
+	public void showMessage(boolean showMessage) {
+		this.showMessage = showMessage;
+	}
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetStatusByState.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetStatusByState.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetStatusByState.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetStatusByState.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,59 @@
+/*
+ * 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.workflow.server.action;
+
+//JDK imports
+import java.util.Arrays;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Action for printing out status of workflows by state
+ * <p>
+ */
+public class GetStatusByState extends WorkflowEngineServerAction {
+	
+	private int pageSize = 5;
+	private boolean showMessage = false;
+	
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		System.out.println("\nTotal Number of Workflows: " + weClient.getNumOfWorkflows() + "\n");
+		for (String state : Arrays.asList("Blocked", "Queued", "WaitingOnResources(PreConditionEval)", "PreConditionEval", "PreConditionSuccess", "WaitingOnResources(Executing)", "Executing", "ExecutionComplete", "WaitingOnResources(PostConditionEval)", "PostConditionEval", "Success", "Failure")) {
+			GetPage action = new GetPage();
+			action.setPageNum(1);
+			action.setPageSize(pageSize);
+			action.setState(state);
+			action.showMessage(this.showMessage);
+			action.performAction(weClient);
+		}
+	}
+	
+	public void setPageSize(int pageSize) {
+		this.pageSize = pageSize;
+	}
+	
+	public void showMessage(boolean showMessage) {
+		this.showMessage = showMessage;
+	}
+
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetSupportedStates.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetSupportedStates.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetSupportedStates.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetSupportedStates.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,57 @@
+/*
+ * 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.workflow.server.action;
+
+//JDK imports
+import java.util.HashMap;
+import java.util.List;
+import java.util.Vector;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+import org.apache.oodt.cas.workflow.state.WorkflowState;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Action for print out states supported by server workflow engine
+ * <p>
+ */
+public class GetSupportedStates extends WorkflowEngineServerAction {
+
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		HashMap<WorkflowState.Category, List<WorkflowState>> supportedStates = new HashMap<WorkflowState.Category, List<WorkflowState>>();
+		for (WorkflowState supportedState : weClient.getSupportedStates()) {
+			List<WorkflowState> states = supportedStates.get(supportedState.getCategory());
+			if (states == null)
+				states = new Vector<WorkflowState>();
+			states.add(supportedState);
+			supportedStates.put(supportedState.getCategory(), states);
+		}
+		
+		for (WorkflowState.Category category : supportedStates.keySet()) {
+			System.out.println("Category '" + category + "':");
+			for (WorkflowState state : supportedStates.get(category)) 
+				System.out.println("  - " + state.getName() + " : " + state.getDescription());
+			System.out.println();
+		}
+	}
+
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetSupportedWorkflows.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetSupportedWorkflows.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetSupportedWorkflows.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/GetSupportedWorkflows.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,42 @@
+/*
+ * 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.workflow.server.action;
+
+//JDK imports
+import java.util.List;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+import org.apache.oodt.cas.workflow.model.WorkflowGraph;
+
+/**
+ * 
+ * @author bfoster
+ *
+ */
+public class GetSupportedWorkflows extends WorkflowEngineServerAction {
+
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		List<WorkflowGraph> graphs = weClient.getWorkflowGraphs();
+		System.out.println("Supported Workflow ModelIds:");
+		for (WorkflowGraph graph : graphs) 
+			System.out.println("  - " + graph.getModel().getId());
+		System.out.println();
+	}
+
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/MultiStartWorkflowByDate.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/MultiStartWorkflowByDate.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/MultiStartWorkflowByDate.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/MultiStartWorkflowByDate.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,83 @@
+/*
+ * 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.workflow.server.action;
+
+//JDK imports
+import java.text.SimpleDateFormat;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+
+/**
+ * 
+ * @author bfoster
+ *
+ */
+public class MultiStartWorkflowByDate extends StartWorkflow {
+
+	private static final Logger LOG = Logger.getLogger(MultiStartWorkflowByDate.class.getName());
+
+	protected String startDateString;
+	protected String endDateString;
+	protected String dateFormatString;
+	protected int incrementMinutes;
+	protected List<String> dateMetadataKeys;
+	
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+	    SimpleDateFormat dateFormat = new SimpleDateFormat(dateFormatString);
+	    GregorianCalendar startDate = new GregorianCalendar();
+	    startDate.setTime(dateFormat.parse(startDateString));
+	    GregorianCalendar endDate = new GregorianCalendar();
+	    endDate.setTime(dateFormat.parse(endDateString));
+	    
+	    while (startDate.getTimeInMillis() < endDate.getTimeInMillis()) {
+	    	for (String dateMetadataKey : this.dateMetadataKeys)
+	    		this.replaceInputMetadata(Arrays.asList(dateMetadataKey, dateFormat.format(startDate.getTime())));
+			LOG.log(Level.INFO, "Starting workflow for date '" + dateFormat.format(startDate.getTime()) + "'");	
+	    	super.performAction(weClient);
+	    	startDate.add(Calendar.MINUTE, this.incrementMinutes);
+	    }
+	}
+	
+	public void setDateMetadataKeys(List<String> dateMetadataKeys) {
+		this.dateMetadataKeys = dateMetadataKeys;
+	}
+	
+	public void setStartDate(String startDate) {
+		this.startDateString = startDate;
+	}
+	
+	public void setEndDate(String endDate) {
+		this.endDateString = endDate;
+	}
+	
+	public void setDateFormat(String dateFormat) {
+		this.dateFormatString = dateFormat;
+	}
+	
+	public void setIncrementMinutes(int incrementMinutes) {
+		this.incrementMinutes = incrementMinutes;
+	}
+
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/PagedQuery.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/PagedQuery.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/PagedQuery.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/PagedQuery.java Thu Dec 23 02:47:16 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.workflow.server.action;
+
+//JDK imports
+import java.util.List;
+
+//APACHE imports
+import org.apache.commons.lang.StringUtils;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.page.PageInfo;
+import org.apache.oodt.cas.catalog.query.QueryExpression;
+import org.apache.oodt.cas.catalog.query.parser.QueryParser;
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+import org.apache.oodt.cas.workflow.page.QueryPage;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Action for print out a page of reduced Workflow Instance Metadata
+ * <p>
+ */
+public class PagedQuery extends WorkflowEngineServerAction {
+
+	protected int pageNum;
+	protected int pageSize;
+	protected String query;
+	protected List<String> termNames;
+	
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		QueryExpression queryExpression = QueryParser.parseQueryExpression(query);
+		QueryPage page = weClient.getPage(new PageInfo(pageSize, pageNum), queryExpression);
+		List<Metadata> metadata = weClient.getMetadata(page);
+		System.out.println("Task Instance Metadata (Page: " + page.getPageNum() + "/" + page.getTotalPages() + "; Total: " + page.getNumOfHits() + ")");
+		if (termNames != null) {
+			for (Metadata met : metadata) {
+				System.out.print("Metadata: (");
+				StringBuffer sb = new StringBuffer("");
+				for (String termName : this.termNames) {
+					if (termName.startsWith("+")) {
+						List<String> keys = met.getAllKeysWithName(termName.substring(1));
+						if (keys.size() > 0) 
+							for (String key : keys)
+								sb.append(key + " = '" + StringUtils.join(met.getAllMetadata(key).iterator(), ",") + "', ");
+					}else {
+						sb.append(termName + " = '" + (!met.containsKey(termName) ? "null" : StringUtils.join(met.getAllMetadata(termName).iterator(), ",")) + "', ");
+					}
+				}
+				if (sb.length() > 0)
+					System.out.print(sb.substring(0, sb.length() - 2));
+				System.out.println(")");
+			}
+		}else {
+			for (Metadata met : metadata) {
+				System.out.print("Metadata: (");
+				StringBuffer sb = new StringBuffer("");
+				for (String metKey : met.getAllKeys()) 
+					sb.append(metKey + "=" + met.getAllMetadata(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 setReducedTerms(List<String> termNames) {
+		this.termNames = termNames;
+	}
+
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/PauseRunner.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/PauseRunner.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/PauseRunner.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/PauseRunner.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,37 @@
+/*
+ * 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.workflow.server.action;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Pauses the job submission runner thread
+ * <p>
+ */
+public class PauseRunner extends WorkflowEngineServerAction {
+
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		weClient.pauseRunner();
+	}
+
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/PrintSupportedEvents.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/PrintSupportedEvents.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/PrintSupportedEvents.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/PrintSupportedEvents.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,49 @@
+/*
+ * 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.workflow.server.action;
+
+//JDK imports
+import java.io.PrintStream;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+import org.apache.oodt.cas.workflow.event.WorkflowEngineEvent;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Action for print out events supported by server workflow engine
+ * <p>
+ */
+public class PrintSupportedEvents extends WorkflowEngineServerAction {
+
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		PrintStream ps = new PrintStream(System.out);
+        ps.println("Events:");
+        for (WorkflowEngineEvent event : weClient.getRegisteredEvents()) {
+            ps.println("  Event:");
+            ps.println("    Id: " + event.getId());
+            ps.println("    Description: " + event.getDescription());
+            ps.println();
+        }
+        ps.close();
+	}
+
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/PrintWorkflow.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/PrintWorkflow.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/PrintWorkflow.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/PrintWorkflow.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,45 @@
+/*
+ * 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.workflow.server.action;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+import org.apache.oodt.cas.workflow.util.WorkflowUtils;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Action for print out a WorkflowProcessors skeleton
+ * <p>
+ */
+public class PrintWorkflow extends WorkflowEngineServerAction {
+
+	private String instanceId;
+	
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		System.out.println("Instance '" + this.instanceId + "'");
+		System.out.println(WorkflowUtils.toString(weClient.getWorkflow(this.instanceId)));
+	}
+	
+	public void setInstanceId(String instanceId) {
+		this.instanceId = instanceId;
+	}
+
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/ResumeRunner.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/ResumeRunner.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/ResumeRunner.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/ResumeRunner.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,37 @@
+/*
+ * 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.workflow.server.action;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Resumes the job submission runner thread
+ * <p>
+ */
+public class ResumeRunner extends WorkflowEngineServerAction {
+
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		weClient.resumeRunner();
+	}
+
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/Shutdown.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/Shutdown.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/Shutdown.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/Shutdown.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,37 @@
+/*
+ * 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.workflow.server.action;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Action for shutting down server
+ * <p>
+ */
+public class Shutdown extends WorkflowEngineServerAction {
+
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		weClient.shutdown();
+	}
+
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/StartWorkflow.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/StartWorkflow.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/StartWorkflow.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/StartWorkflow.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,83 @@
+/*
+ * 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.workflow.server.action;
+
+//JDK imports
+import java.util.Collections;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+//OODT imports
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+import org.apache.oodt.cas.workflow.model.repo.XmlWorkflowModelRepositoryFactory;
+import org.apache.oodt.cas.workflow.priority.Priority;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Action for starting a workflow
+ * <p>
+ */
+public class StartWorkflow extends WorkflowEngineServerAction {
+
+	private static final Logger LOG = Logger.getLogger(StartWorkflow.class.getName());
+	
+	private String modelId;
+	private Priority priority;
+	private String modelXmlDefinition;
+	private Metadata inputMetadata;
+	
+	public StartWorkflow() {
+		this.inputMetadata = new Metadata();
+	}
+	
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		String instanceId = null;
+		if (this.modelXmlDefinition != null) {
+			XmlWorkflowModelRepositoryFactory factory = new XmlWorkflowModelRepositoryFactory();
+			factory.setModelFiles(Collections.singletonList(this.modelXmlDefinition));
+			instanceId = weClient.startWorkflow(factory.createModelRepository().loadGraphs(weClient.getSupportedProcessorIds()).get(this.modelId), this.inputMetadata, this.priority);
+		}else if (this.modelId != null) {
+			instanceId = weClient.startWorkflow(modelId, inputMetadata, this.priority);
+		}else {
+			LOG.log(Level.WARNING, "Failed to start workflow [ModelId = '" + this.modelId + "']");	
+		}
+		LOG.log(Level.INFO, "Started workflow [ModelId = '" + this.modelId + "',InstanceId = '" + instanceId + "']");	
+	}
+
+	public void setModelId(String modelId) {
+		this.modelId = modelId;
+	}
+	
+	public void setPriority(double priority) {
+		this.priority = Priority.getPriority(priority);
+	}
+	
+	public void setModelXmlDefinition(String modelXmlDefinition) {
+		this.modelXmlDefinition = modelXmlDefinition;
+	}
+	
+	public void replaceInputMetadata(List<String> keyValues) {
+		this.inputMetadata.replaceMetadata(keyValues.get(0), keyValues.subList(1, keyValues.size()));
+	}
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/TriggerEvent.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/TriggerEvent.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/TriggerEvent.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/TriggerEvent.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,61 @@
+/*
+ * 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.workflow.server.action;
+
+//JDK imports
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+//OODT imports
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Action for trigger an event on the server workflow engine
+ * <p>
+ */
+public class TriggerEvent extends WorkflowEngineServerAction {
+	
+	private static final Logger LOG = Logger.getLogger(TriggerEvent.class.getName());
+
+	private String eventId;
+	private Metadata inputMetadata;
+	
+	public TriggerEvent() {
+		this.inputMetadata = new Metadata();
+	}
+	
+	@Override
+	public void performAction(WorkflowEngineClient weClient) throws Exception {
+		weClient.triggerEvent(this.eventId, this.inputMetadata);
+		LOG.log(Level.INFO, "Successfully triggered event '" + eventId + "' with input metadata '" + this.inputMetadata.getHashtable() + "'");
+	}
+	
+	public void setEventId(String eventId) {
+		this.eventId = eventId;
+	}
+
+	public void replaceInputMetadata(List<String> keyValues) {
+		this.inputMetadata.replaceMetadata(keyValues.get(0), keyValues.subList(1, keyValues.size()));
+	}
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/WorkflowEngineServerAction.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/WorkflowEngineServerAction.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/WorkflowEngineServerAction.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/action/WorkflowEngineServerAction.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,59 @@
+/*
+ * 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.workflow.server.action;
+
+//Spring imports
+import org.springframework.beans.factory.annotation.Required;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClient;
+import org.apache.oodt.cas.workflow.precondition.PreConditionedComponent;
+import org.apache.oodt.commons.spring.SpringSetIdInjectionType;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Action to perform on server workflow engine by client
+ * <p>
+ */
+public abstract class WorkflowEngineServerAction extends PreConditionedComponent implements SpringSetIdInjectionType {
+		
+	protected String id;
+	protected String description;
+	
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+	
+	@Required
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	
+	public String getDescription() {
+		return this.description;
+	}
+	
+	public abstract void performAction(WorkflowEngineClient weClient) throws Exception;
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/AbstractCommunicationChannelClient.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/AbstractCommunicationChannelClient.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/AbstractCommunicationChannelClient.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/AbstractCommunicationChannelClient.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,43 @@
+/*
+ * 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.workflow.server.channel;
+
+//JDK imports
+import java.util.logging.Logger;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.util.Serializer;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Communication Channel between for client to talk to server
+ * <p>
+ */
+public abstract class AbstractCommunicationChannelClient implements CommunicationChannelClient {
+	
+	private static Logger LOG = Logger.getLogger(AbstractCommunicationChannelClient.class.getName());
+	protected Serializer serializer;
+	
+	public AbstractCommunicationChannelClient() {
+		this.serializer = new Serializer(false);
+	}
+	
+}
+



Mime
View raw message