You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by bf...@apache.org on 2010/12/23 03:44:31 UTC
svn commit: r1052143 [7/11] - in /oodt/branches/wengine-branch: ./ 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/main/ja...
Added: oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/CommunicationChannelClient.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/CommunicationChannelClient.java?rev=1052143&view=auto
==============================================================================
--- oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/CommunicationChannelClient.java (added)
+++ oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/CommunicationChannelClient.java Thu Dec 23 02:44:23 2010
@@ -0,0 +1,146 @@
+/*
+ * 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;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.page.PageInfo;
+import org.apache.oodt.cas.catalog.query.QueryExpression;
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.workflow.event.WorkflowEngineEvent;
+import org.apache.oodt.cas.workflow.instance.repo.WorkflowInstanceRepository;
+import org.apache.oodt.cas.workflow.model.WorkflowGraph;
+import org.apache.oodt.cas.workflow.model.WorkflowModel;
+import org.apache.oodt.cas.workflow.page.PageFilter;
+import org.apache.oodt.cas.workflow.page.QueryPage;
+import org.apache.oodt.cas.workflow.page.QueuePage;
+import org.apache.oodt.cas.workflow.page.RunnablesPage;
+import org.apache.oodt.cas.workflow.priority.Priority;
+import org.apache.oodt.cas.workflow.processor.ProcessorInfo;
+import org.apache.oodt.cas.workflow.processor.ProcessorSkeleton;
+import org.apache.oodt.cas.workflow.processor.ProcessorStub;
+import org.apache.oodt.cas.workflow.state.WorkflowState;
+
+//JDK imports
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Communication Channel for client to talk to server
+ * <p>
+ */
+public interface CommunicationChannelClient {
+
+ public void shutdown() throws Exception;
+
+ public void pauseRunner() throws Exception;
+
+ public void resumeRunner() throws Exception;
+
+ public Date getLaunchDate() throws Exception;
+
+ public String startWorkflow(WorkflowGraph workflow, Metadata metadata) throws Exception;
+
+ public String startWorkflow(WorkflowGraph workflow, Metadata metadata, Priority priority) throws Exception;
+
+ public String startWorkflow(String modelId, Metadata inputMetadata) throws Exception;
+
+ public String startWorkflow(String modelId, Metadata inputMetadata, Priority priority) throws Exception;
+
+ public void deleteWorkflow(String instanceId) throws Exception;
+
+ public void stopWorkflow(String instanceId) throws Exception;
+
+ public void pauseWorkflow(String instanceId) throws Exception;
+
+ public void resumeWorkflow(String instanceId) throws Exception;
+
+ public WorkflowModel getModel(String modelId) throws Exception;
+
+ public WorkflowGraph getWorkflowGraph(String modelId) throws Exception;
+
+ public Set<String> getSupportedProcessorIds() throws Exception;
+
+ public List<WorkflowModel> getModels() throws Exception;
+
+ public List<WorkflowGraph> getWorkflowGraphs() throws Exception;
+
+ public ProcessorInfo getProcessorInfo(String instanceId, String modelId) throws Exception;
+
+ public WorkflowInstanceRepository getInstanceRepository() throws Exception;
+
+ public void updateWorkflowMetadata(String instanceId, String modelId, Metadata metadata) throws Exception;
+
+ public void updateInstanceMetadata(String jobId, Metadata metadata) throws Exception;
+
+ public void updateWorkflowAndInstance(String instanceId, String modelId, WorkflowState state, Metadata metadata, String jobId, Metadata instanceMetadata) throws Exception;
+
+ public void setWorkflowState(String instanceId, String modelId, WorkflowState state) throws Exception;
+
+ public void setWorkflowPriority(String instanceId, String modelId, Priority priority) throws Exception;
+
+ public Metadata getWorkflowMetadata(String instanceId, String modelId) throws Exception;
+
+ public Metadata getInstanceMetadata(String jobId) throws Exception;
+
+ public void registerEvent(WorkflowEngineEvent event) throws Exception;
+
+ public void triggerEvent(String eventId, Metadata inputMetadata) throws Exception;
+
+ public List<WorkflowEngineEvent> getRegisteredEvents() throws Exception;
+
+ public List<WorkflowState> getSupportedStates() throws Exception;
+
+ public int getNumOfLoadedProcessors() throws Exception;
+
+ public int getNumOfWorkflows() throws Exception;
+
+ public RunnablesPage getExecutingPage(PageInfo pageInfo) throws Exception;
+
+ public RunnablesPage getRunnablesPage(PageInfo pageInfo) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, PageFilter filter) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, Comparator<ProcessorStub> comparator) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, WorkflowState state) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, WorkflowState.Category category) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, String modelId) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, Map<String, List<String>> keyValPairs) throws Exception;
+
+ public QueuePage getNextPage(QueuePage page) throws Exception;
+
+ public ProcessorSkeleton getWorkflow(String instanceId) throws Exception;
+
+ public QueryPage getNextPage(QueryPage page) throws Exception;
+
+ public QueryPage getPage(PageInfo pageInfo, QueryExpression queryExpression) throws Exception;
+
+ public List<Metadata> getMetadata(QueryPage page) throws Exception;
+
+}
Added: oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/CommunicationChannelClientFactory.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/CommunicationChannelClientFactory.java?rev=1052143&view=auto
==============================================================================
--- oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/CommunicationChannelClientFactory.java (added)
+++ oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/CommunicationChannelClientFactory.java Thu Dec 23 02:44:23 2010
@@ -0,0 +1,35 @@
+/*
+ * 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;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * A Factory for creating CommunicationChannelClient
+ * <p>
+ */
+public interface CommunicationChannelClientFactory {
+
+ public CommunicationChannelClient createCommunicationChannelClient();
+
+ public void setServerUrl(String url);
+
+ public String getServerUrl();
+
+}
Added: oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/CommunicationChannelServer.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/CommunicationChannelServer.java?rev=1052143&view=auto
==============================================================================
--- oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/CommunicationChannelServer.java (added)
+++ oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/CommunicationChannelServer.java Thu Dec 23 02:44:23 2010
@@ -0,0 +1,153 @@
+/*
+ * 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.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.page.PageInfo;
+import org.apache.oodt.cas.catalog.query.QueryExpression;
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.workflow.engine.WorkflowEngine;
+import org.apache.oodt.cas.workflow.event.WorkflowEngineEvent;
+import org.apache.oodt.cas.workflow.instance.repo.WorkflowInstanceRepository;
+import org.apache.oodt.cas.workflow.model.WorkflowGraph;
+import org.apache.oodt.cas.workflow.model.WorkflowModel;
+import org.apache.oodt.cas.workflow.page.PageFilter;
+import org.apache.oodt.cas.workflow.page.QueryPage;
+import org.apache.oodt.cas.workflow.page.QueuePage;
+import org.apache.oodt.cas.workflow.page.RunnablesPage;
+import org.apache.oodt.cas.workflow.priority.Priority;
+import org.apache.oodt.cas.workflow.processor.ProcessorInfo;
+import org.apache.oodt.cas.workflow.processor.ProcessorSkeleton;
+import org.apache.oodt.cas.workflow.processor.ProcessorStub;
+import org.apache.oodt.cas.workflow.state.WorkflowState;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Communication Channel between for server to respond to client calls
+ * <p>
+ */
+public interface CommunicationChannelServer {
+
+ public void setPort(int port) throws Exception;
+
+ public void setWorkflowEngine(WorkflowEngine workflowEngine) throws Exception;
+
+ public void startup() throws Exception;
+
+ public void shutdown() throws Exception;
+
+ public void pauseRunner() throws Exception;
+
+ public void resumeRunner() throws Exception;
+
+ public Date getLaunchDate() throws Exception;
+
+ public String startWorkflow(WorkflowGraph workflow, Metadata metadata) throws Exception;
+
+ public String startWorkflow(WorkflowGraph workflow, Metadata metadata, Priority priority) throws Exception;
+
+ public String startWorkflow(String modelId, Metadata inputMetadata) throws Exception;
+
+ public String startWorkflow(String modelId, Metadata inputMetadata, Priority priority) throws Exception;
+
+ public void deleteWorkflow(String instanceId) throws Exception;
+
+ public void stopWorkflow(String instanceId) throws Exception;
+
+ public void pauseWorkflow(String instanceId) throws Exception;
+
+ public void resumeWorkflow(String instanceId) throws Exception;
+
+ public Set<String> getSupportedProcessorIds() throws Exception;
+
+ public WorkflowModel getModel(String modelId) throws Exception;
+
+ public WorkflowGraph getWorkflowGraph(String modelId) throws Exception;
+
+ public List<WorkflowModel> getModels() throws Exception;
+
+ public List<WorkflowGraph> getWorkflowGraphs() throws Exception;
+
+ public ProcessorInfo getProcessorInfo(String instanceId, String modelId) throws Exception;
+
+ public WorkflowInstanceRepository getInstanceRepository() throws Exception;
+
+ public void updateWorkflowMetadata(String instanceId, String modelId, Metadata metadata) throws Exception;
+
+ public void updateInstanceMetadata(String jobId, Metadata metadata) throws Exception;
+
+ public void updateWorkflowAndInstance(String instanceId, String modelId, WorkflowState state, Metadata metadata, String jobId, Metadata instanceMetadata) throws Exception;
+
+ public void setWorkflowState(String instanceId, String modelId, WorkflowState state) throws Exception;
+
+ public void setWorkflowPriority(String instanceId, String modelId, Priority priority) throws Exception;
+
+ public Metadata getWorkflowMetadata(String instanceId, String modelId) throws Exception;
+
+ public Metadata getInstanceMetadata(String jobId) throws Exception;
+
+ public void registerEvent(WorkflowEngineEvent event) throws Exception;
+
+ public void triggerEvent(String eventId, Metadata inputMetadata) throws Exception;
+
+ public List<WorkflowEngineEvent> getRegisteredEvents() throws Exception;
+
+ public List<WorkflowState> getSupportedStates() throws Exception;
+
+ public int getNumOfLoadedProcessors() throws Exception;
+
+ public int getNumOfWorkflows() throws Exception;
+
+ public RunnablesPage getExecutingPage(PageInfo pageInfo) throws Exception;
+
+ public RunnablesPage getRunnablesPage(PageInfo pageInfo) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, PageFilter filter) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, Comparator<ProcessorStub> comparator) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, WorkflowState state) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, WorkflowState.Category category) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, String modelId) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, Map<String, List<String>> keyValPairs) throws Exception;
+
+ public QueuePage getNextPage(QueuePage page) throws Exception;
+
+ public ProcessorSkeleton getWorkflow(String instanceId) throws Exception;
+
+ public QueryPage getNextPage(QueryPage page) throws Exception;
+
+ public QueryPage getPage(PageInfo pageInfo, QueryExpression queryExpression) throws Exception;
+
+ public List<Metadata> getMetadata(QueryPage page) throws Exception;
+
+}
Added: oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/CommunicationChannelServerFactory.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/CommunicationChannelServerFactory.java?rev=1052143&view=auto
==============================================================================
--- oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/CommunicationChannelServerFactory.java (added)
+++ oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/CommunicationChannelServerFactory.java Thu Dec 23 02:44:23 2010
@@ -0,0 +1,40 @@
+/*
+ * 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;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineFactory;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * A Factory for creating CommunicationChannelServer
+ * <p>
+ */
+public interface CommunicationChannelServerFactory {
+
+ public CommunicationChannelServer createCommunicationChannelServer();
+
+ public void setPort(int port);
+
+ public int getPort();
+
+ public void setWorkflowEngineFactory(WorkflowEngineFactory workflowEngineFactory);
+
+}
Added: oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/MultiCommunicationChannelClient.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/MultiCommunicationChannelClient.java?rev=1052143&view=auto
==============================================================================
--- oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/MultiCommunicationChannelClient.java (added)
+++ oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/MultiCommunicationChannelClient.java Thu Dec 23 02:44:23 2010
@@ -0,0 +1,264 @@
+/*
+ * 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;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.page.PageInfo;
+import org.apache.oodt.cas.catalog.query.QueryExpression;
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.workflow.event.WorkflowEngineEvent;
+import org.apache.oodt.cas.workflow.instance.repo.WorkflowInstanceRepository;
+import org.apache.oodt.cas.workflow.model.WorkflowGraph;
+import org.apache.oodt.cas.workflow.model.WorkflowModel;
+import org.apache.oodt.cas.workflow.page.PageFilter;
+import org.apache.oodt.cas.workflow.page.QueryPage;
+import org.apache.oodt.cas.workflow.page.QueuePage;
+import org.apache.oodt.cas.workflow.page.RunnablesPage;
+import org.apache.oodt.cas.workflow.priority.Priority;
+import org.apache.oodt.cas.workflow.processor.ProcessorInfo;
+import org.apache.oodt.cas.workflow.processor.ProcessorSkeleton;
+import org.apache.oodt.cas.workflow.processor.ProcessorStub;
+import org.apache.oodt.cas.workflow.state.WorkflowState;
+import org.apache.oodt.cas.workflow.state.WorkflowState.Category;
+
+//JDK imports
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ *
+ * @author bfoster
+ *
+ */
+public class MultiCommunicationChannelClient extends
+ AbstractCommunicationChannelClient {
+
+ private CommunicationChannelClient useClient;
+ private List<CommunicationChannelClient> clients;
+
+ public MultiCommunicationChannelClient(CommunicationChannelClient useClient, List<CommunicationChannelClient> clients) {
+ this.useClient = useClient;
+ this.clients = clients;
+ }
+
+ public void shutdown() throws Exception {
+ for (CommunicationChannelClient client : this.clients)
+ client.shutdown();
+ }
+
+ public void pauseRunner() throws Exception {
+ this.useClient.pauseRunner();
+ }
+
+ public void resumeRunner() throws Exception {
+ this.useClient.resumeRunner();
+ }
+
+ public void deleteWorkflow(String instanceId) throws Exception {
+ useClient.deleteWorkflow(instanceId);
+ }
+
+ public RunnablesPage getExecutingPage(PageInfo pageInfo) throws Exception {
+ return useClient.getExecutingPage(pageInfo);
+ }
+
+ public Metadata getInstanceMetadata(String jobId) throws Exception {
+ return useClient.getInstanceMetadata(jobId);
+ }
+
+ public WorkflowInstanceRepository getInstanceRepository() throws Exception {
+ return useClient.getInstanceRepository();
+ }
+
+ public Date getLaunchDate() throws Exception {
+ return useClient.getLaunchDate();
+ }
+
+ public List<Metadata> getMetadata(QueryPage page) throws Exception {
+ return useClient.getMetadata(page);
+ }
+
+ public WorkflowModel getModel(String modelId) throws Exception {
+ return useClient.getModel(modelId);
+ }
+
+ public List<WorkflowModel> getModels() throws Exception {
+ return useClient.getModels();
+ }
+
+ public QueuePage getNextPage(QueuePage page) throws Exception {
+ return useClient.getNextPage(page);
+ }
+
+ public QueryPage getNextPage(QueryPage page) throws Exception {
+ return useClient.getNextPage(page);
+ }
+
+ public int getNumOfLoadedProcessors() throws Exception {
+ return useClient.getNumOfLoadedProcessors();
+ }
+
+ public int getNumOfWorkflows() throws Exception {
+ return useClient.getNumOfWorkflows();
+ }
+
+ public QueuePage getPage(PageInfo pageInfo) throws Exception {
+ return useClient.getPage(pageInfo);
+ }
+
+ public QueuePage getPage(PageInfo pageInfo, PageFilter filter)
+ throws Exception {
+ return useClient.getPage(pageInfo, filter);
+ }
+
+ public QueuePage getPage(PageInfo pageInfo,
+ Comparator<ProcessorStub> comparator) throws Exception {
+ return useClient.getPage(pageInfo, comparator);
+ }
+
+ public QueuePage getPage(PageInfo pageInfo, WorkflowState state)
+ throws Exception {
+ return useClient.getPage(pageInfo, state);
+ }
+
+ public QueuePage getPage(PageInfo pageInfo, Category category)
+ throws Exception {
+ return useClient.getPage(pageInfo, category);
+ }
+
+ public QueuePage getPage(PageInfo pageInfo, String modelId)
+ throws Exception {
+ return useClient.getPage(pageInfo, modelId);
+ }
+
+ public QueuePage getPage(PageInfo pageInfo,
+ Map<String, List<String>> keyValPairs) throws Exception {
+ return useClient.getPage(pageInfo, keyValPairs);
+ }
+
+ public QueryPage getPage(PageInfo pageInfo, QueryExpression queryExpression)
+ throws Exception {
+ return useClient.getPage(pageInfo, queryExpression);
+ }
+
+ public ProcessorInfo getProcessorInfo(String instanceId, String modelId)
+ throws Exception {
+ return useClient.getProcessorInfo(instanceId, modelId);
+ }
+
+ public List<WorkflowEngineEvent> getRegisteredEvents() throws Exception {
+ return useClient.getRegisteredEvents();
+ }
+
+ public RunnablesPage getRunnablesPage(PageInfo pageInfo) throws Exception {
+ return useClient.getRunnablesPage(pageInfo);
+ }
+
+ public Set<String> getSupportedProcessorIds() throws Exception {
+ return useClient.getSupportedProcessorIds();
+ }
+
+ public List<WorkflowState> getSupportedStates() throws Exception {
+ return useClient.getSupportedStates();
+ }
+
+ public ProcessorSkeleton getWorkflow(String instanceId) throws Exception {
+ return useClient.getWorkflow(instanceId);
+ }
+
+ public WorkflowGraph getWorkflowGraph(String modelId) throws Exception {
+ return useClient.getWorkflowGraph(modelId);
+ }
+
+ public List<WorkflowGraph> getWorkflowGraphs() throws Exception {
+ return useClient.getWorkflowGraphs();
+ }
+
+ public Metadata getWorkflowMetadata(String instanceId, String modelId)
+ throws Exception {
+ return useClient.getWorkflowMetadata(instanceId, modelId);
+ }
+
+ public void pauseWorkflow(String instanceId) throws Exception {
+ useClient.pauseWorkflow(instanceId);
+ }
+
+ public void registerEvent(WorkflowEngineEvent event) throws Exception {
+ useClient.registerEvent(event);
+ }
+
+ public void resumeWorkflow(String instanceId) throws Exception {
+ useClient.resumeWorkflow(instanceId);
+ }
+
+ public void setWorkflowPriority(String instanceId, String modelId,
+ Priority priority) throws Exception {
+ useClient.setWorkflowPriority(instanceId, modelId, priority);
+ }
+
+ public void setWorkflowState(String instanceId, String modelId,
+ WorkflowState state) throws Exception {
+ useClient.setWorkflowState(instanceId, modelId, state);
+ }
+
+ public String startWorkflow(WorkflowGraph workflow, Metadata metadata)
+ throws Exception {
+ return useClient.startWorkflow(workflow, metadata);
+ }
+
+ public String startWorkflow(WorkflowGraph workflow, Metadata metadata,
+ Priority priority) throws Exception {
+ return useClient.startWorkflow(workflow, metadata, priority);
+ }
+
+ public String startWorkflow(String modelId, Metadata inputMetadata)
+ throws Exception {
+ return useClient.startWorkflow(modelId, inputMetadata);
+ }
+
+ public String startWorkflow(String modelId, Metadata inputMetadata,
+ Priority priority) throws Exception {
+ return useClient.startWorkflow(modelId, inputMetadata, priority);
+ }
+
+ public void stopWorkflow(String instanceId) throws Exception {
+ useClient.stopWorkflow(instanceId);
+ }
+
+ public void triggerEvent(String eventId, Metadata inputMetadata)
+ throws Exception {
+ useClient.triggerEvent(eventId, inputMetadata);
+ }
+
+ public void updateInstanceMetadata(String jobId, Metadata metadata)
+ throws Exception {
+ useClient.updateInstanceMetadata(jobId, metadata);
+ }
+
+ public void updateWorkflowMetadata(String instanceId, String modelId,
+ Metadata metadata) throws Exception {
+ useClient.updateWorkflowMetadata(instanceId, modelId, metadata);
+ }
+
+ public void updateWorkflowAndInstance(String instanceId, String modelId, WorkflowState state, Metadata metadata, String jobId, Metadata instanceMetadata) throws Exception {
+ useClient.updateWorkflowAndInstance(instanceId, modelId, state, metadata, jobId, instanceMetadata);
+ }
+
+}
Added: oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/MultiCommunicationChannelClientFactory.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/MultiCommunicationChannelClientFactory.java?rev=1052143&view=auto
==============================================================================
--- oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/MultiCommunicationChannelClientFactory.java (added)
+++ oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/MultiCommunicationChannelClientFactory.java Thu Dec 23 02:44:23 2010
@@ -0,0 +1,73 @@
+/*
+ * 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.net.URL;
+import java.util.List;
+import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ *
+ * @author bfoster
+ *
+ */
+public class MultiCommunicationChannelClientFactory implements
+ CommunicationChannelClientFactory {
+
+ private static final Logger LOG = Logger.getLogger(MultiCommunicationChannelClientFactory.class.getName());
+
+ private String serverUrl;
+ private CommunicationChannelClientFactory useClientFactory;
+ private List<CommunicationChannelClientFactory> clientFactories;
+
+ public MultiCommunicationChannelClient createCommunicationChannelClient() {
+ try {
+ CommunicationChannelClient useClient = this.useClientFactory.createCommunicationChannelClient();
+ Vector<CommunicationChannelClient> clients = new Vector<CommunicationChannelClient>();
+ URL url = new URL(this.serverUrl);
+ int portCounter = url.getPort();
+ for (CommunicationChannelClientFactory factory : this.clientFactories) {
+ factory.setServerUrl(url.getProtocol() + "://" + url.getHost() + ":" + portCounter++);
+ clients.add(factory.createCommunicationChannelClient());
+ }
+ return new MultiCommunicationChannelClient(useClient, clients);
+ }catch (Exception e) {
+ LOG.log(Level.SEVERE, "Failed to create '" + MultiCommunicationChannelClientFactory.class.getName() + " : " + e.getMessage(), e);
+ return null;
+ }
+ }
+
+ public String getServerUrl() {
+ return this.serverUrl;
+ }
+
+ public void setServerUrl(String serverUrl) {
+ this.serverUrl = serverUrl;
+ }
+
+ public void setUseClientFactory(CommunicationChannelClientFactory useClientFactory) {
+ this.useClientFactory = useClientFactory;
+ }
+
+ public void setClientFactories(List<CommunicationChannelClientFactory> clientFactories) {
+ this.clientFactories = clientFactories;
+ }
+
+}
Added: oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/MultiCommunicationChannelServer.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/MultiCommunicationChannelServer.java?rev=1052143&view=auto
==============================================================================
--- oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/MultiCommunicationChannelServer.java (added)
+++ oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/MultiCommunicationChannelServer.java Thu Dec 23 02:44:23 2010
@@ -0,0 +1,46 @@
+/*
+ * 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.List;
+
+/**
+ *
+ * @author bfoster
+ *
+ */
+public class MultiCommunicationChannelServer extends
+ AbstractCommunicationChannelServer {
+
+ private List<CommunicationChannelServer> servers;
+
+ public MultiCommunicationChannelServer(List<CommunicationChannelServer> servers) {
+ this.servers = servers;
+ }
+
+ public void startup() throws Exception {
+ for (CommunicationChannelServer server : servers)
+ server.startup();
+ }
+
+// public void shutdown() throws Exception {
+// for (CommunicationChannelServer server : servers)
+// server.shutdown();
+// }
+
+}
Added: oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/MultiCommunicationChannelServerFactory.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/MultiCommunicationChannelServerFactory.java?rev=1052143&view=auto
==============================================================================
--- oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/MultiCommunicationChannelServerFactory.java (added)
+++ oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/MultiCommunicationChannelServerFactory.java Thu Dec 23 02:44:23 2010
@@ -0,0 +1,86 @@
+/*
+ * 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.List;
+import java.util.Vector;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngine;
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineFactory;
+
+/**
+ *
+ * @author bfoster
+ *
+ */
+public class MultiCommunicationChannelServerFactory implements
+ CommunicationChannelServerFactory {
+
+ private WorkflowEngineFactory workflowEngineFactory;
+ private int port;
+ private List<CommunicationChannelServerFactory> serverFactories;
+
+ public CommunicationChannelServer createCommunicationChannelServer() {
+ try {
+ if (serverFactories != null) {
+ WorkflowEngine engine = workflowEngineFactory.createEngine();
+ Vector<CommunicationChannelServer> servers = new Vector<CommunicationChannelServer>();
+ int portCounter = port;
+ for (CommunicationChannelServerFactory factory : this.serverFactories) {
+ factory.setWorkflowEngineFactory(new WorkflowEngineFactory() {
+ public WorkflowEngine createEngine() {
+ return null;
+ }
+ });
+ CommunicationChannelServer server = factory.createCommunicationChannelServer();
+ server.setWorkflowEngine(engine);
+ server.setPort(portCounter++);
+ servers.add(server);
+ }
+ return new MultiCommunicationChannelServer(servers);
+ }else {
+ throw new Exception("Must set server factories!");
+ }
+ }catch (Exception e) {
+ return null;
+ }
+ }
+
+ public int getPort() {
+ return this.port;
+ }
+
+ public void setPort(int port) {
+ this.port = port;
+ }
+
+ public void setWorkflowEngineFactory(
+ WorkflowEngineFactory workflowEngineFactory) {
+ this.workflowEngineFactory = workflowEngineFactory;
+ }
+
+ public void setServerFactories(List<CommunicationChannelServerFactory> serverFactories) {
+ this.serverFactories = serverFactories;
+ }
+
+ public List<CommunicationChannelServerFactory> getServerFactories() {
+ return this.serverFactories;
+ }
+
+}
Added: oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelClient.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelClient.java?rev=1052143&view=auto
==============================================================================
--- oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelClient.java (added)
+++ oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelClient.java Thu Dec 23 02:44:23 2010
@@ -0,0 +1,254 @@
+/*
+ * 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.rmi;
+
+//JDK imports
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.rmi.Naming;
+import java.rmi.NotBoundException;
+import java.rmi.RemoteException;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.page.PageInfo;
+import org.apache.oodt.cas.catalog.query.QueryExpression;
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.workflow.event.WorkflowEngineEvent;
+import org.apache.oodt.cas.workflow.instance.repo.WorkflowInstanceRepository;
+import org.apache.oodt.cas.workflow.model.WorkflowGraph;
+import org.apache.oodt.cas.workflow.model.WorkflowModel;
+import org.apache.oodt.cas.workflow.page.PageFilter;
+import org.apache.oodt.cas.workflow.page.QueryPage;
+import org.apache.oodt.cas.workflow.page.QueuePage;
+import org.apache.oodt.cas.workflow.page.RunnablesPage;
+import org.apache.oodt.cas.workflow.priority.Priority;
+import org.apache.oodt.cas.workflow.processor.ProcessorInfo;
+import org.apache.oodt.cas.workflow.processor.ProcessorSkeleton;
+import org.apache.oodt.cas.workflow.processor.ProcessorStub;
+import org.apache.oodt.cas.workflow.server.channel.AbstractCommunicationChannelClient;
+import org.apache.oodt.cas.workflow.state.WorkflowState;
+
+/**
+ *
+ * @author bfoster
+ *
+ */
+public class RmiCommunicationChannelClient extends
+ AbstractCommunicationChannelClient {
+
+ private URL url;
+ private String name;
+
+ public RmiCommunicationChannelClient(URL url, String name) throws MalformedURLException, RemoteException, NotBoundException {
+ this.url = url;
+ this.name = name;
+ }
+
+ public void shutdown() throws Exception {
+ this.getRmiServer().rmi_shutdown();
+ }
+
+ public void pauseRunner() throws Exception {
+ this.getRmiServer().rmi_pauseRunner();
+ }
+
+ public void resumeRunner() throws Exception {
+ this.getRmiServer().rmi_resumeRunner();
+ }
+
+ public Date getLaunchDate() throws Exception {
+ return this.serializer.deserializeObject(Date.class, this.getRmiServer().rmi_getLaunchDate());
+ }
+
+ public String startWorkflow(WorkflowGraph workflow, Metadata metadata) throws Exception {
+ return this.getRmiServer().rmi_startWorkflow_WithModel(this.serializer.serializeObject(workflow), this.serializer.serializeObject(metadata));
+ }
+
+ public String startWorkflow(WorkflowGraph workflow, Metadata metadata, Priority priority) throws Exception {
+ return this.getRmiServer().rmi_startWorkflow_WithModel(this.serializer.serializeObject(workflow), this.serializer.serializeObject(metadata), this.serializer.serializeObject(priority));
+ }
+
+ public String startWorkflow(String modelId, Metadata inputMetadata) throws Exception {
+ return this.getRmiServer().rmi_startWorkflow_WithModelId(modelId, this.serializer.serializeObject(inputMetadata));
+ }
+
+ public String startWorkflow(String modelId, Metadata inputMetadata, Priority priority) throws Exception {
+ return this.getRmiServer().rmi_startWorkflow_WithModelId(modelId, this.serializer.serializeObject(inputMetadata), this.serializer.serializeObject(priority));
+ }
+
+ public void deleteWorkflow(String instanceId) throws Exception {
+ this.getRmiServer().rmi_deleteWorkflow(instanceId);
+ }
+
+ public void stopWorkflow(String instanceId) throws Exception {
+ this.getRmiServer().rmi_stopWorkflow(instanceId);
+ }
+
+ public void pauseWorkflow(String instanceId) throws Exception {
+ this.getRmiServer().rmi_pauseWorkflow(instanceId);
+ }
+
+ public void resumeWorkflow(String instanceId) throws Exception {
+ this.getRmiServer().rmi_resumeWorkflow(instanceId);
+ }
+
+ public WorkflowModel getModel(String modelId) throws Exception {
+ return this.serializer.deserializeObject(WorkflowModel.class, this.getRmiServer().rmi_getModel(modelId));
+ }
+
+ public WorkflowGraph getWorkflowGraph(String modelId) throws Exception {
+ return this.serializer.deserializeObject(WorkflowGraph.class, this.getRmiServer().rmi_getWorkflowGraph(modelId));
+ }
+
+ public Set<String> getSupportedProcessorIds() throws Exception {
+ return (Set<String>) this.serializer.deserializeObject(Set.class, this.getRmiServer().rmi_getSupportedProcessorIds());
+ }
+
+ public List<WorkflowModel> getModels() throws Exception {
+ return (List<WorkflowModel>) this.serializer.deserializeObject(List.class, this.getRmiServer().rmi_getModels());
+ }
+
+ public List<WorkflowGraph> getWorkflowGraphs() throws Exception {
+ return (List<WorkflowGraph>) this.serializer.deserializeObject(List.class, this.getRmiServer().rmi_getWorkflowGraphs());
+ }
+
+ public ProcessorInfo getProcessorInfo(String instanceId, String modelId) throws Exception {
+ return this.serializer.deserializeObject(ProcessorInfo.class, this.getRmiServer().rmi_getProcessorInfo(instanceId, modelId));
+ }
+
+ public WorkflowInstanceRepository getInstanceRepository() throws Exception {
+ return this.serializer.deserializeObject(WorkflowInstanceRepository.class, this.getRmiServer().rmi_getInstanceRepository());
+ }
+
+ public void updateWorkflowMetadata(String instanceId, String modelId, Metadata metadata) throws Exception {
+ this.getRmiServer().rmi_updateWorkflowMetadata(instanceId, modelId, this.serializer.serializeObject(metadata));
+ }
+
+ public void updateInstanceMetadata(String jobId, Metadata metadata) throws Exception {
+ this.getRmiServer().rmi_updateInstanceMetadata(jobId, this.serializer.serializeObject(metadata));
+ }
+
+ public void updateWorkflowAndInstance(String instanceId, String modelId, WorkflowState state, Metadata metadata, String jobId, Metadata instanceMetadata) throws Exception {
+ this.getRmiServer().rmi_updateWorkflowAndInstance(instanceId, modelId, this.serializer.serializeObject(state), this.serializer.serializeObject(metadata), jobId, this.serializer.serializeObject(instanceMetadata));
+ }
+
+ public void setWorkflowState(String instanceId, String modelId, WorkflowState state) throws Exception {
+ this.getRmiServer().rmi_setWorkflowState(instanceId, modelId, this.serializer.serializeObject(state));
+ }
+
+ public void setWorkflowPriority(String instanceId, String modelId, Priority priority) throws Exception {
+ this.getRmiServer().rmi_setWorkflowPriority(instanceId, modelId, this.serializer.serializeObject(priority));
+ }
+
+ public Metadata getWorkflowMetadata(String instanceId, String modelId) throws Exception {
+ return this.serializer.deserializeObject(Metadata.class, this.getRmiServer().rmi_getWorkflowMetadata(instanceId, modelId));
+ }
+
+ public Metadata getInstanceMetadata(String jobId) throws Exception {
+ return this.serializer.deserializeObject(Metadata.class, this.getRmiServer().rmi_getInstanceMetadata(jobId));
+ }
+
+ public void registerEvent(WorkflowEngineEvent event) throws Exception {
+ this.getRmiServer().rmi_registerEvent(this.serializer.serializeObject(event));
+ }
+
+ public void triggerEvent(String eventId, Metadata inputMetadata) throws Exception {
+ this.getRmiServer().rmi_triggerEvent(eventId, this.serializer.serializeObject(inputMetadata));
+ }
+
+ public List<WorkflowEngineEvent> getRegisteredEvents() throws Exception {
+ return (List<WorkflowEngineEvent>) this.serializer.deserializeObject(List.class, this.getRmiServer().rmi_getRegisteredEvents());
+ }
+
+ public List<WorkflowState> getSupportedStates() throws Exception {
+ return (List<WorkflowState>) this.serializer.deserializeObject(List.class, this.getRmiServer().rmi_getSupportedStates());
+ }
+
+ public int getNumOfLoadedProcessors() throws Exception {
+ return this.serializer.deserializeObject(Integer.class, this.getRmiServer().rmi_getNumOfLoadedProcessors());
+ }
+
+ public int getNumOfWorkflows() throws Exception {
+ return this.serializer.deserializeObject(Integer.class, this.getRmiServer().rmi_getNumOfWorkflows());
+ }
+
+ public RunnablesPage getExecutingPage(PageInfo pageInfo) throws Exception {
+ return this.serializer.deserializeObject(RunnablesPage.class, this.getRmiServer().rmi_getExecutingPage(this.serializer.serializeObject(pageInfo)));
+ }
+
+ public RunnablesPage getRunnablesPage(PageInfo pageInfo) throws Exception {
+ return this.serializer.deserializeObject(RunnablesPage.class, this.getRmiServer().rmi_getRunnablesPage(this.serializer.serializeObject(pageInfo)));
+ }
+
+ public QueuePage getPage(PageInfo pageInfo) throws Exception {
+ return this.serializer.deserializeObject(QueuePage.class, this.getRmiServer().rmi_getPage(this.serializer.serializeObject(pageInfo)));
+ }
+
+ public QueuePage getPage(PageInfo pageInfo, PageFilter filter) throws Exception {
+ return this.serializer.deserializeObject(QueuePage.class, this.getRmiServer().rmi_getPage_WithFilter(this.serializer.serializeObject(pageInfo), this.serializer.serializeObject(filter)));
+ }
+
+ public QueuePage getPage(PageInfo pageInfo, Comparator<ProcessorStub> comparator) throws Exception {
+ return this.serializer.deserializeObject(QueuePage.class, this.getRmiServer().rmi_getPage_WithComparator(this.serializer.serializeObject(pageInfo), this.serializer.serializeObject(comparator)));
+ }
+
+ public QueuePage getPage(PageInfo pageInfo, WorkflowState state) throws Exception {
+ return this.serializer.deserializeObject(QueuePage.class, this.getRmiServer().rmi_getPage_WithState(this.serializer.serializeObject(pageInfo), this.serializer.serializeObject(state)));
+ }
+
+ public QueuePage getPage(PageInfo pageInfo, WorkflowState.Category category) throws Exception {
+ return this.serializer.deserializeObject(QueuePage.class, this.getRmiServer().rmi_getPage_WithCategory(this.serializer.serializeObject(pageInfo), this.serializer.serializeObject(category)));
+ }
+
+ public QueuePage getPage(PageInfo pageInfo, String modelId) throws Exception {
+ return this.serializer.deserializeObject(QueuePage.class, this.getRmiServer().rmi_getPage_WithModelId(this.serializer.serializeObject(pageInfo), this.serializer.serializeObject(modelId)));
+ }
+
+ public QueuePage getPage(PageInfo pageInfo, Map<String, List<String>> keyValPairs) throws Exception {
+ return this.serializer.deserializeObject(QueuePage.class, this.getRmiServer().rmi_getPage_WithMap(this.serializer.serializeObject(pageInfo), this.serializer.serializeObject(keyValPairs)));
+ }
+
+ public QueuePage getNextPage(QueuePage page) throws Exception {
+ return this.serializer.deserializeObject(QueuePage.class, this.getRmiServer().rmi_getNextQueuePage(this.serializer.serializeObject(page)));
+ }
+
+ public ProcessorSkeleton getWorkflow(String instanceId) throws Exception {
+ return this.serializer.deserializeObject(ProcessorSkeleton.class, this.getRmiServer().rmi_getWorkflow(instanceId));
+ }
+
+ public QueryPage getNextPage(QueryPage page) throws Exception {
+ return this.serializer.deserializeObject(QueryPage.class, this.getRmiServer().rmi_getNextQueryPage(this.serializer.serializeObject(page)));
+ }
+
+ public QueryPage getPage(PageInfo pageInfo, QueryExpression queryExpression) throws Exception {
+ return this.serializer.deserializeObject(QueryPage.class, this.getRmiServer().rmi_getQueryPage(this.serializer.serializeObject(pageInfo), this.serializer.serializeObject(queryExpression)));
+ }
+
+ public List<Metadata> getMetadata(QueryPage page) throws Exception {
+ return (List<Metadata>) this.serializer.deserializeObject(List.class, this.getRmiServer().rmi_getMetadata(this.serializer.serializeObject(page)));
+ }
+
+ protected RmiCommunicationChannelServerInterface getRmiServer() throws Exception {
+ return (RmiCommunicationChannelServerInterface) Naming.lookup("rmi://" + url.getHost() + ":" + url.getPort() + "/" + this.name);
+ }
+
+}
Added: oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelClientFactory.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelClientFactory.java?rev=1052143&view=auto
==============================================================================
--- oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelClientFactory.java (added)
+++ oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelClientFactory.java Thu Dec 23 02:44:23 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.channel.rmi;
+
+//JDK imports
+import java.net.URL;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.server.channel.CommunicationChannelClientFactory;
+
+/**
+ *
+ * @author bfoster
+ *
+ */
+public class RmiCommunicationChannelClientFactory implements
+ CommunicationChannelClientFactory {
+
+ private static final Logger LOG = Logger.getLogger(RmiCommunicationChannelClientFactory.class.getName());
+
+ private String url;
+ private String name;
+
+ public RmiCommunicationChannelClient createCommunicationChannelClient() {
+ try {
+ return new RmiCommunicationChannelClient(new URL(this.url), this.name);
+ }catch (Exception e) {
+ LOG.log(Level.SEVERE, "Failed to create RMI client channel : " + e.getMessage(), e);
+ return null;
+ }
+ }
+
+ public String getServerUrl() {
+ return url;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setServerUrl(String url) {
+ this.url = url;
+ }
+
+}
Added: oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServer.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServer.java?rev=1052143&view=auto
==============================================================================
--- oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServer.java (added)
+++ oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServer.java Thu Dec 23 02:44:23 2010
@@ -0,0 +1,466 @@
+/*
+ * 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.rmi;
+
+//JDK imports
+import java.lang.management.ManagementFactory;
+import java.rmi.Naming;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.server.UnicastRemoteObject;
+import java.util.Comparator;
+import java.util.Map;
+import java.util.logging.Level;
+
+//JAVAX imports
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.page.PageInfo;
+import org.apache.oodt.cas.catalog.query.QueryExpression;
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.workflow.event.WorkflowEngineEvent;
+import org.apache.oodt.cas.workflow.model.WorkflowGraph;
+import org.apache.oodt.cas.workflow.page.PageFilter;
+import org.apache.oodt.cas.workflow.page.QueryPage;
+import org.apache.oodt.cas.workflow.page.QueuePage;
+import org.apache.oodt.cas.workflow.priority.Priority;
+import org.apache.oodt.cas.workflow.server.channel.AbstractCommunicationChannelServer;
+import org.apache.oodt.cas.workflow.state.WorkflowState;
+
+/**
+ *
+ * @author bfoster
+ *
+ */
+public class RmiCommunicationChannelServer extends AbstractCommunicationChannelServer implements RmiCommunicationChannelServerInterface, RmiCommunicationChannelServerMBean {
+
+ private String name;
+ private MBeanServer mbs;
+ private ObjectName objName;
+
+ public RmiCommunicationChannelServer(int port, String name) throws MalformedObjectNameException, NullPointerException {
+ this.port = port;
+ this.name = name;
+ }
+
+ public void startup() throws Exception {
+
+ //register JMX
+ try {
+ this.objName = new ObjectName(
+ "org.apache.oodt.cas.workflow.server.channel.rmi:type=RmiCommunicationChannelServer");
+ LocateRegistry.createRegistry(this.port);
+ mbs = ManagementFactory.getPlatformMBeanServer();
+ mbs.registerMBean(this, objName);
+ } catch (Exception e) {
+ LOG.log(Level.SEVERE,
+ "Failed to register DaemonLauncher as a MBean Object : "
+ + e.getMessage(), e);
+ }
+
+ //bind RMI
+ try {
+ Naming.bind("//localhost:" + this.port + "/" + name, UnicastRemoteObject.exportObject(this, this.port));
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RemoteException("Failed to bind Workflow Engine to RMI registry at port "
+ + this.port);
+ }
+
+ }
+
+ public int getPort() {
+ return this.port;
+ }
+
+ public void rmi_shutdown() throws RemoteException {
+ try {
+ this.shutdown();
+ Naming.unbind("//localhost:" + this.port + "/" + this.name);
+ this.mbs.unregisterMBean(this.objName);
+ UnicastRemoteObject.unexportObject(this, true);
+ this.mbs = null;
+ this.objName = null;
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public void rmi_pauseRunner() throws RemoteException {
+ try {
+ this.pauseRunner();
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public void rmi_resumeRunner() throws RemoteException {
+ try {
+ this.resumeRunner();
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getLaunchDate() throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getLaunchDate());
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_startWorkflow_WithModel(String workflow, String metadata) throws RemoteException {
+ try {
+ return this.startWorkflow(this.serializer.deserializeObject(WorkflowGraph.class, workflow), this.serializer.deserializeObject(Metadata.class, metadata));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_startWorkflow_WithModel(String workflow, String metadata, String priority) throws RemoteException {
+ try {
+ return this.startWorkflow(this.serializer.deserializeObject(WorkflowGraph.class, workflow), this.serializer.deserializeObject(Metadata.class, metadata), this.serializer.deserializeObject(Priority.class, priority));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_startWorkflow_WithModelId(String modelId, String inputMetadata) throws RemoteException {
+ try {
+ return this.startWorkflow(modelId, this.serializer.deserializeObject(Metadata.class, inputMetadata));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_startWorkflow_WithModelId(String modelId, String inputMetadata, String priority) throws RemoteException {
+ try {
+ return this.startWorkflow(modelId, this.serializer.deserializeObject(Metadata.class, inputMetadata), this.serializer.deserializeObject(Priority.class, priority));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public void rmi_deleteWorkflow(String instanceId) throws RemoteException {
+ try {
+ this.deleteWorkflow(instanceId);
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public void rmi_stopWorkflow(String instanceId) throws RemoteException {
+ try {
+ this.stopWorkflow(instanceId);
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public void rmi_pauseWorkflow(String instanceId) throws RemoteException {
+ try {
+ this.pauseWorkflow(instanceId);
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public void rmi_resumeWorkflow(String instanceId) throws RemoteException {
+ try {
+ this.resumeWorkflow(instanceId);
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getModel(String modelId) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getModel(modelId));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getWorkflowGraph(String modelId) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getWorkflowGraph(modelId));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getSupportedProcessorIds() throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getSupportedProcessorIds());
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getModels() throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getModels());
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getWorkflowGraphs() throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getWorkflowGraphs());
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getProcessorInfo(String instanceId, String modelId) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getProcessorInfo(instanceId, modelId));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getInstanceRepository() throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getInstanceRepository());
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public void rmi_updateWorkflowMetadata(String instanceId, String modelId, String metadata) throws RemoteException {
+ try {
+ this.updateWorkflowMetadata(instanceId, modelId, this.serializer.deserializeObject(Metadata.class, metadata));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public void rmi_updateInstanceMetadata(String jobId, String metadata) throws RemoteException {
+ try {
+ this.updateInstanceMetadata(jobId, this.serializer.deserializeObject(Metadata.class, metadata));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public void rmi_updateWorkflowAndInstance(String instanceId, String modelId, String state, String metadata, String jobId, String instanceMetadata) throws RemoteException {
+ try {
+ this.updateWorkflowAndInstance(instanceId, modelId, this.serializer.deserializeObject(WorkflowState.class, state), this.serializer.deserializeObject(Metadata.class, metadata), jobId, this.serializer.deserializeObject(Metadata.class, instanceMetadata));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public void rmi_setWorkflowState(String instanceId, String modelId, String state) throws RemoteException {
+ try {
+ this.setWorkflowState(instanceId, modelId, this.serializer.deserializeObject(WorkflowState.class, state));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public void rmi_setWorkflowPriority(String instanceId, String modelId, String priority) throws RemoteException {
+ try {
+ this.setWorkflowPriority(instanceId, modelId, this.serializer.deserializeObject(Priority.class, priority));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getWorkflowMetadata(String instanceId, String modelId) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getWorkflowMetadata(instanceId, modelId));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getInstanceMetadata(String jobId) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getInstanceMetadata(jobId));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public void rmi_registerEvent(String event) throws RemoteException {
+ try {
+ this.registerEvent(this.serializer.deserializeObject(WorkflowEngineEvent.class, event));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public void rmi_triggerEvent(String eventId, String inputMetadata) throws RemoteException {
+ try {
+ this.triggerEvent(eventId, this.serializer.deserializeObject(Metadata.class, inputMetadata));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getRegisteredEvents() throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getRegisteredEvents());
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getSupportedStates() throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getSupportedStates());
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getNumOfLoadedProcessors() throws RemoteException {
+ try {
+ return this.serializer.serializeObject(new Integer(this.getNumOfLoadedProcessors()));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getNumOfWorkflows() throws RemoteException {
+ try {
+ return this.serializer.serializeObject(new Integer(this.getNumOfWorkflows()));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getExecutingPage(String pageInfo) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getExecutingPage(this.serializer.deserializeObject(PageInfo.class, pageInfo)));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getRunnablesPage(String pageInfo) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getRunnablesPage(this.serializer.deserializeObject(PageInfo.class, pageInfo)));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getPage(String pageInfo) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo)));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getPage_WithFilter(String pageInfo, String filter) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(PageFilter.class, filter)));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getPage_WithComparator(String pageInfo, String comparator) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(Comparator.class, comparator)));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getPage_WithState(String pageInfo, String state) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(WorkflowState.class, state)));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getPage_WithCategory(String pageInfo, String category) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(WorkflowState.Category.class, category)));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getPage_WithModelId(String pageInfo, String modelId) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), modelId));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getPage_WithMap(String pageInfo, String keyValPairs) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(Map.class, keyValPairs)));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getNextQueuePage(String page) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getNextPage(this.serializer.deserializeObject(QueuePage.class, page)));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getWorkflow(String instanceId) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getWorkflow(instanceId));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getNextQueryPage(String page) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getNextPage(this.serializer.deserializeObject(QueryPage.class, page)));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getQueryPage(String pageInfo, String queryExpression) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(QueryExpression.class, queryExpression)));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+ public String rmi_getMetadata(String page) throws RemoteException {
+ try {
+ return this.serializer.serializeObject(this.getMetadata(this.serializer.deserializeObject(QueryPage.class, page)));
+ }catch (Exception e) {
+ throw new RemoteException(e.getMessage(), e);
+ }
+ }
+
+}
Added: oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerFactory.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerFactory.java?rev=1052143&view=auto
==============================================================================
--- oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerFactory.java (added)
+++ oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerFactory.java Thu Dec 23 02:44:23 2010
@@ -0,0 +1,69 @@
+/*
+ * 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.rmi;
+
+//JDK imports
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineFactory;
+import org.apache.oodt.cas.workflow.server.channel.CommunicationChannelServerFactory;
+
+/**
+ *
+ * @author bfoster
+ *
+ */
+public class RmiCommunicationChannelServerFactory implements
+ CommunicationChannelServerFactory {
+
+ private static final Logger LOG = Logger.getLogger(RmiCommunicationChannelServerFactory.class.getName());
+
+ private int port;
+ private String name;
+ private WorkflowEngineFactory workflowEngineFactory;
+
+ public RmiCommunicationChannelServer createCommunicationChannelServer() {
+ try {
+ RmiCommunicationChannelServer rmiServer = new RmiCommunicationChannelServer(this.port, this.name);
+ rmiServer.setWorkflowEngine(workflowEngineFactory.createEngine());
+ return rmiServer;
+ }catch (Exception e) {
+ LOG.log(Level.SEVERE, "Failed to create RMI server channel : " + e.getMessage(), e);
+ return null;
+ }
+ }
+
+ public int getPort() {
+ return this.port;
+ }
+
+ public void setPort(int port) {
+ this.port = port;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setWorkflowEngineFactory(
+ WorkflowEngineFactory workflowEngineFactory) {
+ this.workflowEngineFactory = workflowEngineFactory;
+ }
+
+}
Added: oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerInterface.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerInterface.java?rev=1052143&view=auto
==============================================================================
--- oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerInterface.java (added)
+++ oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerInterface.java Thu Dec 23 02:44:23 2010
@@ -0,0 +1,122 @@
+/*
+ * 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.rmi;
+
+//JDK imports
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ *
+ * @author bfoster
+ *
+ */
+public interface RmiCommunicationChannelServerInterface extends Remote {
+
+ public void rmi_shutdown() throws RemoteException;
+
+ public void rmi_pauseRunner() throws RemoteException;
+
+ public void rmi_resumeRunner() throws RemoteException;
+
+ public String rmi_getLaunchDate() throws RemoteException;
+
+ public String rmi_startWorkflow_WithModel(String workflow, String metadata) throws RemoteException;
+
+ public String rmi_startWorkflow_WithModel(String workflow, String metadata, String priority) throws RemoteException;
+
+ public String rmi_startWorkflow_WithModelId(String modelId, String inputMetadata) throws RemoteException;
+
+ public String rmi_startWorkflow_WithModelId(String modelId, String inputMetadata, String priority) throws RemoteException;
+
+ public void rmi_deleteWorkflow(String instanceId) throws RemoteException;
+
+ public void rmi_stopWorkflow(String instanceId) throws RemoteException;
+
+ public void rmi_pauseWorkflow(String instanceId) throws RemoteException;
+
+ public void rmi_resumeWorkflow(String instanceId) throws RemoteException;
+
+ public String rmi_getModel(String modelId) throws RemoteException;
+
+ public String rmi_getWorkflowGraph(String modelId) throws RemoteException;
+
+ public String rmi_getSupportedProcessorIds() throws RemoteException;
+
+ public String rmi_getModels() throws RemoteException;
+
+ public String rmi_getWorkflowGraphs() throws RemoteException;
+
+ public String rmi_getProcessorInfo(String instanceId, String modelId) throws RemoteException;
+
+ public String rmi_getInstanceRepository() throws RemoteException;
+
+ public void rmi_updateWorkflowMetadata(String instanceId, String modelId, String metadata) throws RemoteException;
+
+ public void rmi_updateInstanceMetadata(String jobId, String metadata) throws RemoteException;
+
+ public void rmi_updateWorkflowAndInstance(String instanceId, String modelId, String state, String metadata, String jobId, String instanceMetadata) throws RemoteException;
+
+ public void rmi_setWorkflowState(String instanceId, String modelId, String state) throws RemoteException;
+
+ public void rmi_setWorkflowPriority(String instanceId, String modelId, String priority) throws RemoteException;
+
+ public String rmi_getWorkflowMetadata(String instanceId, String modelId) throws RemoteException;
+
+ public String rmi_getInstanceMetadata(String jobId) throws RemoteException;
+
+ public void rmi_registerEvent(String event) throws RemoteException;
+
+ public void rmi_triggerEvent(String eventId, String inputMetadata) throws RemoteException;
+
+ public String rmi_getRegisteredEvents() throws RemoteException;
+
+ public String rmi_getSupportedStates() throws RemoteException;
+
+ public String rmi_getNumOfLoadedProcessors() throws RemoteException;
+
+ public String rmi_getNumOfWorkflows() throws RemoteException;
+
+ public String rmi_getExecutingPage(String pageInfo) throws RemoteException;
+
+ public String rmi_getRunnablesPage(String pageInfo) throws RemoteException;
+
+ public String rmi_getPage(String pageInfo) throws RemoteException;
+
+ public String rmi_getPage_WithFilter(String pageInfo, String filter) throws RemoteException;
+
+ public String rmi_getPage_WithComparator(String pageInfo, String comparator) throws RemoteException;
+
+ public String rmi_getPage_WithState(String pageInfo, String state) throws RemoteException ;
+
+ public String rmi_getPage_WithCategory(String pageInfo, String category) throws RemoteException;
+
+ public String rmi_getPage_WithModelId(String pageInfo, String modelId) throws RemoteException;
+
+ public String rmi_getPage_WithMap(String pageInfo, String keyValPairs) throws RemoteException;
+
+ public String rmi_getNextQueuePage(String page) throws RemoteException;
+
+ public String rmi_getWorkflow(String instanceId) throws RemoteException;
+
+ public String rmi_getNextQueryPage(String page) throws RemoteException;
+
+ public String rmi_getQueryPage(String pageInfo, String queryExpression) throws RemoteException;
+
+ public String rmi_getMetadata(String page) throws RemoteException;
+
+}
Added: oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerMBean.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerMBean.java?rev=1052143&view=auto
==============================================================================
--- oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerMBean.java (added)
+++ oodt/branches/wengine-branch/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerMBean.java Thu Dec 23 02:44:23 2010
@@ -0,0 +1,141 @@
+/*
+ * 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.rmi;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.page.PageInfo;
+import org.apache.oodt.cas.catalog.query.QueryExpression;
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.workflow.event.WorkflowEngineEvent;
+import org.apache.oodt.cas.workflow.instance.repo.WorkflowInstanceRepository;
+import org.apache.oodt.cas.workflow.model.WorkflowGraph;
+import org.apache.oodt.cas.workflow.model.WorkflowModel;
+import org.apache.oodt.cas.workflow.page.PageFilter;
+import org.apache.oodt.cas.workflow.page.QueryPage;
+import org.apache.oodt.cas.workflow.page.QueuePage;
+import org.apache.oodt.cas.workflow.page.RunnablesPage;
+import org.apache.oodt.cas.workflow.priority.Priority;
+import org.apache.oodt.cas.workflow.processor.ProcessorInfo;
+import org.apache.oodt.cas.workflow.processor.ProcessorSkeleton;
+import org.apache.oodt.cas.workflow.processor.ProcessorStub;
+import org.apache.oodt.cas.workflow.state.WorkflowState;
+
+//JDK imports
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ *
+ * @author bfoster
+ *
+ */
+public interface RmiCommunicationChannelServerMBean {
+
+ public void shutdown() throws Exception;
+
+ public void pauseRunner() throws Exception;
+
+ public void resumeRunner() throws Exception;
+
+ public Date getLaunchDate() throws Exception;
+
+ public String startWorkflow(WorkflowGraph workflow, Metadata inputMetadata) throws Exception;
+
+ public String startWorkflow(WorkflowGraph workflow, Metadata inputMetadata, Priority priority) throws Exception;
+
+ public String startWorkflow(String modelId, Metadata inputMetadata) throws Exception;
+
+ public String startWorkflow(String modelId, Metadata inputMetadata, Priority priority) throws Exception;
+
+ public void deleteWorkflow(String instanceId) throws Exception;
+
+ public void stopWorkflow(String instanceId) throws Exception;
+
+ public void pauseWorkflow(String instanceId) throws Exception;
+
+ public void resumeWorkflow(String instanceId) throws Exception;
+
+ public WorkflowModel getModel(String modelId) throws Exception;
+
+ public Set<String> getSupportedProcessorIds() throws Exception;
+
+ public List<WorkflowModel> getModels() throws Exception;
+
+ public WorkflowGraph getWorkflowGraph(String modelId) throws Exception;
+
+ public List<WorkflowGraph> getWorkflowGraphs() throws Exception;
+
+ public WorkflowInstanceRepository getInstanceRepository() throws Exception;
+
+ public ProcessorInfo getProcessorInfo(String instanceId, String modelId) throws Exception;
+
+ public void updateWorkflowMetadata(String instanceId, String modelId, Metadata metadata) throws Exception;
+
+ public void updateInstanceMetadata(String jobId, Metadata metadata) throws Exception;
+
+ public void setWorkflowState(String instanceId, String modelId, WorkflowState state) throws Exception;
+
+ public void setWorkflowPriority(String instanceId, String modelId, Priority priority) throws Exception;
+
+ public Metadata getWorkflowMetadata(String instanceId, String modelId) throws Exception;
+
+ public Metadata getInstanceMetadata(String jobId) throws Exception;
+
+ public void registerEvent(WorkflowEngineEvent event) throws Exception;
+
+ public void triggerEvent(String eventId, Metadata inputMetadata) throws Exception;
+
+ public List<WorkflowEngineEvent> getRegisteredEvents() throws Exception;
+
+ public List<WorkflowState> getSupportedStates() throws Exception;
+
+ public int getNumOfLoadedProcessors() throws Exception;
+
+ public int getNumOfWorkflows() throws Exception;
+
+ public RunnablesPage getExecutingPage(PageInfo pageInfo) throws Exception;
+
+ public RunnablesPage getRunnablesPage(PageInfo pageInfo) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, PageFilter filter) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, Comparator<ProcessorStub> comparator) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, WorkflowState state) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, WorkflowState.Category category) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, String modelId) throws Exception;
+
+ public QueuePage getPage(PageInfo pageInfo, Map<String, List<String>> keyValPairs) throws Exception;
+
+ public QueuePage getNextPage(QueuePage page) throws Exception;
+
+ public ProcessorSkeleton getWorkflow(String instanceId) throws Exception;
+
+ public QueryPage getNextPage(QueryPage page) throws Exception;
+
+ public QueryPage getPage(PageInfo pageInfo, QueryExpression queryExpression) throws Exception;
+
+ public List<Metadata> getMetadata(QueryPage page) throws Exception;
+
+}