index
int64
0
0
repo_id
stringlengths
9
205
file_path
stringlengths
31
246
content
stringlengths
1
12.2M
__index_level_0__
int64
0
10k
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/PublishedWorkflowRegistry.java
/* * * 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.airavata.registry.api; import java.util.List; import java.util.Map; import org.apache.airavata.registry.api.exception.RegistryException; import org.apache.airavata.registry.api.exception.gateway.PublishedWorkflowAlreadyExistsException; import org.apache.airavata.registry.api.exception.gateway.PublishedWorkflowDoesNotExistsException; import org.apache.airavata.registry.api.exception.worker.UserWorkflowDoesNotExistsException; public interface PublishedWorkflowRegistry extends AiravataSubRegistry { public boolean isPublishedWorkflowExists(String workflowName) throws RegistryException; public void publishWorkflow(String workflowName, String publishWorkflowName) throws PublishedWorkflowAlreadyExistsException, UserWorkflowDoesNotExistsException, RegistryException; public void publishWorkflow(String workflowName) throws PublishedWorkflowAlreadyExistsException, UserWorkflowDoesNotExistsException, RegistryException; public String getPublishedWorkflowGraphXML(String workflowName) throws PublishedWorkflowDoesNotExistsException, RegistryException; public List<String> getPublishedWorkflowNames() throws RegistryException; public Map<String,String> getPublishedWorkflows() throws RegistryException; public ResourceMetadata getPublishedWorkflowMetadata(String workflowName) throws RegistryException; public void removePublishedWorkflow(String workflowName)throws PublishedWorkflowDoesNotExistsException, RegistryException; }
9,300
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/Gateway.java
/* * * 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.airavata.registry.api; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement public class Gateway { private String gatewayName = "default"; public Gateway() { } public Gateway(String gatewayName) { setGatewayName(gatewayName); } public String getGatewayName() { return gatewayName; } public void setGatewayName(String gatewayName) { this.gatewayName = gatewayName; } }
9,301
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry2.java
/* * * 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.airavata.registry.api; import org.apache.airavata.registry.api.exception.RegistryException; import java.net.URI; import java.util.Observable; public abstract class AiravataRegistry2 extends Observable implements DescriptorRegistry, ProjectsRegistry, PublishedWorkflowRegistry, UserWorkflowRegistry, ConfigurationRegistry, ProvenanceRegistry,OrchestratorRegistry, UserRegistry, CredentialRegistry{ private Gateway gateway; private AiravataUser user; protected static final int SERVICE_TTL=180; protected void preInitialize(URI connectionURI, Gateway gateway, AiravataUser user, PasswordCallback callback) { setConnectionURI(connectionURI); setGateway(gateway); setUser(user); setCallback(callback); } /** * Initialize the Airavata Registry * @throws RegistryException */ protected abstract void initialize() throws RegistryException; public Gateway getGateway() { return gateway; } public void setGateway(Gateway gateway) { this.gateway = gateway; } public AiravataUser getUser() { return user; } public void setUser(AiravataUser user) { this.user = user; } }
9,302
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/ConfigurationRegistry.java
/* * * 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.airavata.registry.api; import java.net.URI; import java.util.Date; import java.util.List; import org.apache.airavata.registry.api.exception.RegistryException; public interface ConfigurationRegistry extends AiravataSubRegistry { public Object getConfiguration(String key) throws RegistryException; public List<Object> getConfigurationList(String key) throws RegistryException; public void setConfiguration(String key, String value, Date expire) throws RegistryException; public void addConfiguration(String key, String value, Date expire) throws RegistryException; public void removeAllConfiguration(String key) throws RegistryException; public void removeConfiguration(String key, String value) throws RegistryException; public List<URI> getGFacURIs() throws RegistryException; public List<URI> getLiveGFacURIs() throws RegistryException; public List<URI> getWorkflowInterpreterURIs() throws RegistryException; public URI getEventingServiceURI() throws RegistryException; public URI getMessageBoxURI() throws RegistryException; public void addGFacURI(URI uri) throws RegistryException; public void addWorkflowInterpreterURI(URI uri) throws RegistryException; public void setEventingURI(URI uri) throws RegistryException; public void setMessageBoxURI(URI uri) throws RegistryException; public void addGFacURI(URI uri, Date expire) throws RegistryException; public void addWorkflowInterpreterURI(URI uri, Date expire) throws RegistryException; public void setEventingURI(URI uri, Date expire) throws RegistryException; public void setMessageBoxURI(URI uri, Date expire) throws RegistryException; public void removeGFacURI(URI uri) throws RegistryException; public void removeAllGFacURI() throws RegistryException; public void removeWorkflowInterpreterURI(URI uri) throws RegistryException; public void removeAllWorkflowInterpreterURI() throws RegistryException; public void unsetEventingURI() throws RegistryException; public void unsetMessageBoxURI() throws RegistryException; }
9,303
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistryConnectionDataProvider.java
/* * * 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.airavata.registry.api; import org.apache.airavata.registry.api.exception.RegistrySettingsException; import org.apache.airavata.registry.api.exception.UnknownRegistryConnectionDataException; public interface AiravataRegistryConnectionDataProvider { public void setIdentity(Gateway gateway, AiravataUser use); public Object getValue(String key) throws RegistrySettingsException; }
9,304
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/CredentialRegistry.java
/* * * 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.airavata.registry.api; import org.apache.airavata.registry.api.exception.RegistryException; public interface CredentialRegistry extends AiravataSubRegistry{ /** * Checks whether a credential exists in the credential store for given gateway and token * @param String gatewayId * @param String tokenId * @return a boolean (true is credential exists, false if not) * @throws RegistryException */ public boolean isCredentialExist(String gatewayId, String tokenId) throws RegistryException; /** * Get the public key for a credential in the credential store for given gateway and token * @param String gatewayId * @param String tokenId * @return String The public key of the credential * @throws RegistryException */ public String getCredentialPublicKey(String gatewayId, String tokenId) throws RegistryException; /** * Creates a new SSH credential for given gateway and token, encrypts it with a randomly * generated password and stores it in the credential store * @param String gatewayId * @param String tokenId * @return String The public key of the credential * @throws RegistryException */ public String createCredential(String gatewayId, String tokenId) throws RegistryException; /** * Creates a new SSH credential for given gateway and token, encrypts it with the given password * and stores it in the credential store * @param String gatewayId * @param String tokenId * @param String username * @return String The public key of the credential * @throws RegistryException */ public String createCredential(String gatewayId, String tokenId, String username) throws RegistryException; }
9,305
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataUser.java
/* * * 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.airavata.registry.api; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement public class AiravataUser { private String userName; public AiravataUser() { } public AiravataUser(String userName) { setUserName(userName); } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } }
9,306
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/OrchestratorRegistry.java
/* * * 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.airavata.registry.api; import org.apache.airavata.common.utils.AiravataJobState; import org.apache.airavata.registry.api.exception.RegistryException; import java.util.List; import java.util.Map; public interface OrchestratorRegistry extends AiravataSubRegistry { /** * this return information about GFAC instances running in the system. * @return * @throws RegistryException */ Map<String, Integer> getGFACNodeList() throws RegistryException; /** * This method will add an entry to job management table in database * With the default initial status of ACCEPTED * @param userName * @param experimentID * @return * @throws RegistryException */ boolean storeExperiment(String userName,String experimentID)throws RegistryException; /** * This can be used to change the status to any valid status * @param userName * @param experimentID * @param state * @return * @throws RegistryException */ boolean changeStatus(String userName,String experimentID,AiravataJobState.State state)throws RegistryException; /** * This method can be used to seek the status of a given experiment * @param experimentID * @return * @throws RegistryException */ AiravataJobState getState(String experimentID)throws RegistryException; /** * This returns all the jobs with the given state * @param state give any state user wants to retrieve all the experiment IDs * @return * @throws RuntimeException */ List<String> getAllJobsWithState(AiravataJobState state) throws RuntimeException; /** * This will return list of experimentID of jobs which are in * ACCEPTED state * @return * @throws RegistryException */ List<String> getAllAcceptedJobs()throws RegistryException; /** * This will pick one job from jobs in ACCEPTED state and change its status to * FETCHED * @return experimentID * @throws RegistryException */ String fetchAJob()throws RegistryException; /** * This will return all the hanged jobs, the logic to determine * whether job is hanged or not is depend on the implementation * @return * @throws RegistryException */ List<String> getAllHangedJobs()throws RegistryException; /** * return the number of jobs hanged, it not normal that jobs are hanged * all the time, so users can use this method before try to retrieve * list of hanged jobs * @return number of hanged jobs * @throws RegistryException */ int getHangedJobCount()throws RegistryException; /** * reset hanged jobs based on previous state * @param experimentID * @return true if operation is successful * @throws RegistryException */ boolean resetHangedJob(String experimentID)throws RegistryException; }
9,307
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/ProvenanceRegistry.java
/* * * 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.airavata.registry.api; import java.util.Date; import java.util.HashMap; import java.util.List; import org.apache.airavata.registry.api.exception.RegistryException; import org.apache.airavata.registry.api.workflow.*; import org.apache.airavata.registry.api.workflow.ApplicationJob.ApplicationJobStatus; import org.apache.airavata.registry.api.workflow.WorkflowExecutionStatus.State; public interface ProvenanceRegistry extends AiravataSubRegistry{ /*------------------------------------------- Experiment data ---------------------------------------------*/ /** * Returns true if the experiment exists * @param experimentId * @return * @throws RegistryException */ public boolean isExperimentExists(String experimentId) throws RegistryException; public boolean isExperimentExists(String experimentId, boolean createIfNotPresent) throws RegistryException; /** * Save the username of the user who runs this experiment * @param experimentId * @param user * @return * @throws RegistryException */ public void updateExperimentExecutionUser(String experimentId, String user) throws RegistryException; /** * Retrieve the user who is runing the experiment * @param experimentId * @return * @throws RegistryException */ public String getExperimentExecutionUser(String experimentId) throws RegistryException; /** * check whether the experiment name exists * @param experimentName * @return * @throws RegistryException */ public boolean isExperimentNameExist(String experimentName) throws RegistryException; /** * Get the name of the workflow intance * @param experimentId * @return * @throws RegistryException */ public String getExperimentName(String experimentId) throws RegistryException; /** * Save a name for this workflow execution * @param experimentId * @param experimentName * @return * @throws RegistryException */ public void updateExperimentName(String experimentId,String experimentName)throws RegistryException; /** * Return the metadata information saved for the experiment * @param experimentId * @return * @throws RegistryException */ public String getExperimentMetadata(String experimentId) throws RegistryException; /** * Save the metadata for the experiment * @param experimentId * @param metadata * @return * @throws RegistryException */ public void updateExperimentMetadata(String experimentId, String metadata) throws RegistryException; /** * Return the template name of the workflow that this intance was created from * @param workflowInstanceId * @return * @throws RegistryException */ public String getWorkflowExecutionTemplateName(String workflowInstanceId) throws RegistryException; /** * Save the template name of the workflow that this intance was created from * @param workflowInstanceId * @param templateName * @throws RegistryException */ public void setWorkflowInstanceTemplateName(String workflowInstanceId, String templateName) throws RegistryException; public List<WorkflowExecution> getExperimentWorkflowInstances(String experimentId) throws RegistryException; /*-------------------------------------- Experiment Workflow instance node data ----------------------------------------*/ public boolean isWorkflowInstanceExists(String instanceId) throws RegistryException; public boolean isWorkflowInstanceExists(String instanceId, boolean createIfNotPresent) throws RegistryException; /** * Save a status for this workflow execution with the current time at the moment * @param instanceId * @param status - contains the status * @return * @throws RegistryException */ public void updateWorkflowInstanceStatus(String instanceId,State status)throws RegistryException; /** * Save a status for this workflow execution * @param status - contains the status * @return * @throws RegistryException */ public void updateWorkflowInstanceStatus(WorkflowExecutionStatus status)throws RegistryException; /** * Return the status of the execution * @param instanceId * @return * @throws RegistryException */ public WorkflowExecutionStatus getWorkflowInstanceStatus(String instanceId)throws RegistryException; /** * Save the input data of a node in the workflow instance of an experiment * @param node * @param data * @return true if successfully saved * @throws RegistryException */ public void updateWorkflowNodeInput(WorkflowInstanceNode node, String data) throws RegistryException; /** * Save the output data of a node in the workflow instance of an experiment * @param node * @return true if successfully saved * @throws RegistryException */ public void updateWorkflowNodeOutput(WorkflowInstanceNode node, String data)throws RegistryException; /** * Return a list of data passed as input for service node which regex matched nodeId, workflow template id & experiment id * @param experimentIdRegEx * @param workflowNameRegEx - this is the workflowName or workflow template Id of an experiment * @param nodeNameRegEx - nodeId * @return * @throws RegistryException */ public List<WorkflowNodeIOData> searchWorkflowInstanceNodeInput(String experimentIdRegEx, String workflowNameRegEx, String nodeNameRegEx)throws RegistryException; /** * Return a list of data returned as output from service node which regex matched nodeId, workflow template id & experiment id * @param experimentIdRegEx * @param workflowNameRegEx - this is the workflowName or workflow template Id of an experiment * @param nodeNameRegEx - nodeId * @return * @throws RegistryException */ public List<WorkflowNodeIOData> searchWorkflowInstanceNodeOutput(String experimentIdRegEx, String workflowNameRegEx, String nodeNameRegEx)throws RegistryException; public List<WorkflowNodeIOData> getWorkflowInstanceNodeInput(String workflowInstanceId, String nodeType)throws RegistryException; public List<WorkflowNodeIOData> getWorkflowInstanceNodeOutput(String workflowInstanceId, String nodeType)throws RegistryException; /** * Saves the results of output nodes in a workflow * @deprecated * @param experimentId - also the workflow id * @param outputNodeName * @param output * @return * @throws RegistryException */ public void saveWorkflowExecutionOutput(String experimentId,String outputNodeName,String output) throws RegistryException; /** * Saves the results of output nodes in a workflow * @deprecated * @param experimentId - also the workflow id * @param data * @return * @throws RegistryException */ public void saveWorkflowExecutionOutput(String experimentId, WorkflowIOData data) throws RegistryException; /** * Get the output results of a output node of an experiment * @deprecated * @param experimentId - also the workflow id * @param outputNodeName * @return * @throws RegistryException */ public WorkflowIOData getWorkflowExecutionOutput(String experimentId,String outputNodeName) throws RegistryException; /** * Get the list of output node results of an experiment * @deprecated * @param experimentId - also the workflow id * @return * @throws RegistryException */ public List<WorkflowIOData> getWorkflowExecutionOutput(String experimentId) throws RegistryException; /** * Get the names of the output nodes of a workflow instance run * @deprecated * @param exeperimentId - also the workflow id * @return * @throws RegistryException */ public String[] getWorkflowExecutionOutputNames(String exeperimentId) throws RegistryException; /*--------------------------------------- Retrieving Experiment ------------------------------------------*/ /** * Return workflow execution object fully populated with data currently avaialble for that experiment * @param experimentId * @return * @throws RegistryException */ public ExperimentData getExperiment(String experimentId) throws RegistryException; public ExperimentData getExperimentMetaInformation(String experimentId)throws RegistryException; public List<ExperimentData> getAllExperimentMetaInformation(String user)throws RegistryException; /** * Retrieve experiments which their names match the regular expression experimentNameRegex * @param user * @param experimentNameRegex * @return * @throws RegistryException */ public List<ExperimentData> searchExperiments(String user, String experimentNameRegex)throws RegistryException; /** * Return experiment ids of experiments launched by the given user * @param user - a regex user id * @return - experiment id list * @throws RegistryException */ public List<String> getExperimentIdByUser(String user) throws RegistryException; /** * Return experiments launched by the given user * @param user * @return experiment object list each populated by current data of that experiment * @throws RegistryException */ public List<ExperimentData> getExperimentByUser(String user) throws RegistryException; public List<ExperimentData> getExperiments(HashMap<String, String> params) throws RegistryException; /** * Return the pageNo set of experiments launched by the given user if grouped in to pages of size pageSize * @param user * @param pageSize * @param pageNo * @return * @throws RegistryException */ public List<ExperimentData> getExperimentByUser(String user, int pageSize, int pageNo) throws RegistryException; /** * This will update the workflowStatus for given experimentID,workflowInstanceID combination. * @param workflowStatusNode * @return */ public void updateWorkflowNodeStatus(NodeExecutionStatus workflowStatusNode)throws RegistryException; public void updateWorkflowNodeStatus(String workflowInstanceId, String nodeId, State status)throws RegistryException; public void updateWorkflowNodeStatus(WorkflowInstanceNode workflowNode, State status)throws RegistryException; public NodeExecutionStatus getWorkflowNodeStatus(WorkflowInstanceNode workflowNode)throws RegistryException; public Date getWorkflowNodeStartTime(WorkflowInstanceNode workflowNode)throws RegistryException; public Date getWorkflowStartTime(WorkflowExecution workflowInstance)throws RegistryException; /** * @deprecated - Will be removed from 0.9 release onwards. Use {@see #addApplicationJob #updateApplicationJob(ApplicationJob) etc.} functions instead. * This will store the gram specific data in to repository, this can be called before submitting the workflow in to Grid * @param workflowNodeGramData * @return */ public void updateWorkflowNodeGramData(WorkflowNodeGramData workflowNodeGramData)throws RegistryException; public WorkflowExecutionData getWorkflowInstanceData(String workflowInstanceId)throws RegistryException; public boolean isWorkflowInstanceNodePresent(String workflowInstanceId, String nodeId)throws RegistryException; public boolean isWorkflowInstanceNodePresent(String workflowInstanceId, String nodeId, boolean createIfNotPresent)throws RegistryException; public NodeExecutionData getWorkflowInstanceNodeData(String workflowInstanceId, String nodeId)throws RegistryException; public void addWorkflowInstance(String experimentId, String workflowInstanceId, String templateName) throws RegistryException; public void updateWorkflowNodeType(WorkflowInstanceNode node, WorkflowNodeType type) throws RegistryException; public void addWorkflowInstanceNode(String workflowInstance, String nodeId) throws RegistryException; /*--------------------------------------- Errors in experiment executions ------------------------------------------*/ /** * Return errors defined at the experiment level * @param experimentId * @return * @throws RegistryException */ public List<ExperimentExecutionError> getExperimentExecutionErrors(String experimentId) throws RegistryException; /** * Return errors defined at the workflow level * @param experimentId * @param workflowInstanceId * @return * @throws RegistryException */ public List<WorkflowExecutionError> getWorkflowExecutionErrors(String experimentId, String workflowInstanceId) throws RegistryException; /** * Return errors defined at the node level * @param experimentId * @param workflowInstanceId * @param nodeId * @return * @throws RegistryException */ public List<NodeExecutionError> getNodeExecutionErrors(String experimentId, String workflowInstanceId, String nodeId) throws RegistryException; /** * Return errors defined for a Application job * @param experimentId * @param workflowInstanceId * @param nodeId * @param jobId * @return * @throws RegistryException */ public List<ApplicationJobExecutionError> getApplicationJobErrors(String experimentId, String workflowInstanceId, String nodeId, String jobId) throws RegistryException; /** * Return errors defined for a Application job * @param jobId * @return * @throws RegistryException */ public List<ApplicationJobExecutionError> getApplicationJobErrors(String jobId) throws RegistryException; /** * Return errors filtered by the parameters * @param experimentId * @param workflowInstanceId * @param nodeId * @param jobId * @param filterBy - what type of source types the results should contain * @return * @throws RegistryException */ public List<ExecutionError> getExecutionErrors(String experimentId, String workflowInstanceId, String nodeId, String jobId, ExecutionErrors.Source...filterBy) throws RegistryException; /** * Adds an experiment execution error * @param error * @return * @throws RegistryException */ public int addExperimentError(ExperimentExecutionError error) throws RegistryException; /** * Adds an workflow execution error * @param error * @return * @throws RegistryException */ public int addWorkflowExecutionError(WorkflowExecutionError error) throws RegistryException; /** * Adds an node execution error * @param error * @return * @throws RegistryException */ public int addNodeExecutionError(NodeExecutionError error) throws RegistryException; /** * Adds an Application job execution error * @param error * @return * @throws RegistryException */ public int addApplicationJobExecutionError(ApplicationJobExecutionError error) throws RegistryException; /*--------------------------------------- Managing Data for Application Jobs ------------------------------------------*/ /** * Returns <code>true</code> if a Application job data is existing in the registry * @param jobId * @return * @throws RegistryException */ public boolean isApplicationJobExists(String jobId) throws RegistryException; /** * Adding data related to a new Application job submission * @param job - the <code>jobId</code> cannot be <code>null</code>. * @throws RegistryException */ public void addApplicationJob(ApplicationJob job) throws RegistryException; /** * update data related to a existing Application job record in the registry * @param job - the <code>jobId</code> cannot be <code>null</code> and should already exist in registry * @throws RegistryException */ public void updateApplicationJob(ApplicationJob job) throws RegistryException; /** * Update the status of the job * @param jobId * @param status * @param statusUpdateTime * @throws RegistryException */ public void updateApplicationJobStatus(String jobId, ApplicationJobStatus status, Date statusUpdateTime) throws RegistryException; /** * Update the job data. GFacProvider implementation should decide the job data. Typically it'll * be a serialization of the submitted job query (eg: rsl for a GRAM job) * @param jobId * @param jobdata * @throws RegistryException */ public void updateApplicationJobData(String jobId, String jobdata) throws RegistryException; /** * Update the time of job submission or job started executing * @param jobId * @param submitted * @throws RegistryException */ public void updateApplicationJobSubmittedTime(String jobId, Date submitted) throws RegistryException; /** * Update the time of current job status is valid. * @param jobId * @param statusUpdateTime * @throws RegistryException */ public void updateApplicationJobStatusUpdateTime(String jobId, Date statusUpdateTime) throws RegistryException; /** * Custom data field for users * @param jobId * @param metadata * @throws RegistryException */ public void updateApplicationJobMetadata(String jobId, String metadata) throws RegistryException; /** * Retrieve the Application Job for the given job id * @param jobId * @return * @throws RegistryException */ public ApplicationJob getApplicationJob(String jobId) throws RegistryException; /** * Retrieve a list of Application jobs executed for the given descriptors * @param serviceDescriptionId - should be <code>null</code> if user does not care what service description the job corresponds to * @param hostDescriptionId - should be <code>null</code> if user does not care what host description the job corresponds to * @param applicationDescriptionId - should be <code>null</code> if user does not care what application description the job corresponds to * @return * @throws RegistryException */ public List<ApplicationJob> getApplicationJobsForDescriptors(String serviceDescriptionId, String hostDescriptionId, String applicationDescriptionId) throws RegistryException; /** * Retrieve a list of Application jobs executed for the given experiment credentials * @param experimentId - should be <code>null</code> if user does not care what experiment the job corresponds to * @param workflowExecutionId - - should be <code>null</code> if user does not care what workflow execution the job corresponds to * @param nodeId - should be <code>null</code> if user does not care what node id the job corresponds to * @return * @throws RegistryException */ public List<ApplicationJob> getApplicationJobs(String experimentId, String workflowExecutionId, String nodeId) throws RegistryException; /** * Retrieve the list all the status updates for an application job. * @param jobId - Application job id * @return * @throws RegistryException */ public List<ApplicationJobStatusData> getApplicationJobStatusHistory(String jobId) throws RegistryException; }
9,308
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/UserRegistry.java
/* * * 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.airavata.registry.api; import java.util.List; import org.apache.airavata.registry.api.exception.RegistryException; public interface UserRegistry extends AiravataSubRegistry{ /** * Retrieve all the users in the registry * @return a list of airavata users from the registry * @throws RegistryException */ public List<AiravataUser> getUsers() throws RegistryException; }
9,309
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataSubRegistry.java
/* * * 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.airavata.registry.api; import java.net.URI; import org.apache.airavata.common.utils.Version; public interface AiravataSubRegistry { /** * Determines whether this registry is active. If true the registry is ready to do the * transaction * @return */ public abstract boolean isActive(); /** * Set airavata registry instrance * @param registry instance of <code>AiravataRegistry2</code> */ public abstract void setAiravataRegistry(AiravataRegistry2 registry); /** * Set airavata user * @param user current airavata registry user */ public abstract void setAiravataUser(AiravataUser user); /** * Set gateway of the airavata system * @param gateway airavata gateway */ public abstract void setGateway(Gateway gateway); /** * Set connection url for the registry * @param connectionURI connection url for the database */ public void setConnectionURI(URI connectionURI); /** * Set custom <code>PasswordCallback</code> implementation class * @param callback instance of PasswordCallback implementation */ public void setCallback(PasswordCallback callback); /** * Retrieve the gateway of the airavata system * @return gateway */ public abstract Gateway getGateway(); /** * Retrieve the current registry user of the system * @return current registry user */ public abstract AiravataUser getAiravataUser(); /** * Return the version of the Registry API * @return version */ public Version getVersion(); /** * Retrieve connection URI for the database * @return database connection URI */ public URI getConnectionURI(); /** * Retrieve PasswordCallback implementation class * @return PasswordCallback impl */ public PasswordCallback getCallback(); }
9,310
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/ExecutionErrors.java
/* * * 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.airavata.registry.api; public class ExecutionErrors { public static enum Source{ ALL, EXPERIMENT, WORKFLOW, NODE, APPLICATION } }
9,311
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/WorkspaceProject.java
/* * * 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.airavata.registry.api; import java.util.Date; import java.util.List; import org.apache.airavata.registry.api.exception.RegistryException; import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement public class WorkspaceProject{ private String projectName; private Gateway gateway; private AiravataUser airavataUser; @XmlTransient private ProjectsRegistry projectsRegistry; public WorkspaceProject() { } public WorkspaceProject(String projectName, ProjectsRegistry registry) { setProjectName(projectName); setProjectsRegistry(registry); setGateway(registry.getGateway()); setAiravataUser(registry.getAiravataUser()); } public String getProjectName() { return projectName; } public void setProjectName(String projectName) { this.projectName = projectName; } public ProjectsRegistry getProjectsRegistry() { return projectsRegistry; } public void setProjectsRegistry(ProjectsRegistry projectsRegistry) { this.projectsRegistry = projectsRegistry; } public void createExperiment(AiravataExperiment experiment) throws RegistryException{ getProjectsRegistry().addExperiment(getProjectName(), experiment); } public List<AiravataExperiment> getExperiments() throws RegistryException{ return getProjectsRegistry().getExperiments(getProjectName()); } public List<AiravataExperiment> getExperiments(Date from, Date to) throws RegistryException{ return getProjectsRegistry().getExperiments(getProjectName(),from, to); } public Gateway getGateway() { return gateway; } public AiravataUser getAiravataUser() { return airavataUser; } public void setGateway(Gateway gateway) { this.gateway = gateway; } public void setAiravataUser(AiravataUser airavataUser) { this.airavataUser = airavataUser; } }
9,312
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/DataRegistry.java
/* * * 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.airavata.registry.api; import java.util.List; import org.apache.airavata.registry.api.exception.RegistryException; import org.apache.airavata.commons.gfac.type.ActualParameter; public interface DataRegistry { /** * Save output from workflow execution. * * @param workflowId * @param parameters * @return * @throws RegistryException */ public String saveOutput(String workflowId, List<ActualParameter> parameters) throws RegistryException; /** * Load output from workflow execution. * * @param workflowId * @return List of parameters * @throws RegistryException */ public List<ActualParameter> loadOutput(String workflowId) throws RegistryException; }
9,313
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/impl/ExperimentDataImpl.java
/* * * 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.airavata.registry.api.impl; import java.util.ArrayList; import java.util.Date; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import org.apache.airavata.registry.api.exception.worker.ExperimentLazyLoadedException; import org.apache.airavata.registry.api.workflow.*; import org.apache.airavata.registry.api.workflow.WorkflowNodeType.WorkflowNode; @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement public class ExperimentDataImpl implements ExperimentData{ private WorkflowExecutionStatus executionStatus; private String user; private List<WorkflowIOData> output; private String experimentId; private String metadata; private String workflowInstanceName; private List<WorkflowExecutionDataImpl> workflowInstanceDataList=new ArrayList<WorkflowExecutionDataImpl>(); private boolean lazyLoaded=false; public ExperimentDataImpl() { this(false); } public ExperimentDataImpl(boolean lazyLoaded) { this.lazyLoaded = lazyLoaded; } public String getMetadata() { return metadata; } public void setMetadata(String metadata) { this.metadata = metadata; } public String getExperimentId() { return experimentId; } @Override public String getTemplateName() throws ExperimentLazyLoadedException { return getWorkflowExecutionDataList().get(0).getTemplateName(); } @Override public WorkflowExecutionStatus.State getState() throws ExperimentLazyLoadedException { if (executionStatus != null) return executionStatus.getExecutionStatus(); else return getWorkflowExecutionDataList().get(0).getState(); } @Override public Date getStatusUpdateTime() throws ExperimentLazyLoadedException { if (executionStatus != null) return executionStatus.getStatusUpdateTime(); else return getWorkflowExecutionDataList().get(0).getStatusUpdateTime(); } @Override public ExperimentData getExperimentData() throws ExperimentLazyLoadedException { return getWorkflowExecutionDataList().get(0).getExperimentData(); } @Override public void setExperimentData(ExperimentDataImpl experimentData) throws ExperimentLazyLoadedException { getWorkflowExecutionDataList().get(0).setExperimentData(experimentData); } public void setExperimentId(String experimentId) { this.experimentId = experimentId; } public String getTopic() { return experimentId; } public void setTopic(String topic) { this.experimentId = topic; } public WorkflowExecutionStatus getExecutionStatus() { return executionStatus; } public void setExecutionStatus(WorkflowExecutionStatus executionStatus) { this.executionStatus = executionStatus; } public String getUser() { return user; } public void setUser(String user) { this.user = user; } public List<WorkflowIOData> getOutput() { if (output==null){ output=new ArrayList<WorkflowIOData>(); } return output; } public void setOutput(List<WorkflowIOData> output) { this.output = output; } public void addOutput(WorkflowIOData output) { getOutput().add(output); } public WorkflowIOData getOutput(String nodeId) { return (WorkflowNodeIOData)getIOData(nodeId, getOutput()); } private WorkflowIOData getIOData(String nodeId, List<?> list) { for (Object data : list) { WorkflowIOData iodata=(WorkflowIOData)data; if (iodata.getNodeId().equals(nodeId)){ return iodata; } } return null; } @Override public String getExperimentName() { return workflowInstanceName; } @Override public void setExperimentName(String workflowInstanceName) { this.workflowInstanceName=workflowInstanceName; } @Override public WorkflowExecutionData getWorkflowExecutionData(String workflowInstanceID) throws ExperimentLazyLoadedException { for(WorkflowExecutionData workflowInstanceData : getWorkflowExecutionDataList()){ if(workflowInstanceData.getId().equals(workflowInstanceID)){ return workflowInstanceData; } } return null; } @Override public List<WorkflowExecutionDataImpl> getWorkflowExecutionDataList() throws ExperimentLazyLoadedException{ if (isLazyLoaded()){ throw new ExperimentLazyLoadedException(getExperimentId()); } return workflowInstanceDataList; } public boolean isLazyLoaded() { return lazyLoaded; } public void setLazyLoaded(boolean lazyLoaded) { this.lazyLoaded = lazyLoaded; } @Override public WorkflowExecution getWorkflowExecution() throws ExperimentLazyLoadedException{ return getWorkflowExecutionDataList().get(0).getWorkflowExecution(); } @Override public List<NodeExecutionData> getNodeDataList() throws ExperimentLazyLoadedException{ return getWorkflowExecutionDataList().get(0).getNodeDataList(); } @Override public void addNodeData(NodeExecutionData... nodeData) throws ExperimentLazyLoadedException { getWorkflowExecutionDataList().get(0).addNodeData(nodeData); } @Override public NodeExecutionData getNodeData(String nodeId) throws ExperimentLazyLoadedException { return getWorkflowExecutionDataList().get(0).getNodeData(nodeId); } @Override public String getId() { return getExperimentId(); } @Override public List<NodeExecutionData> getNodeDataList(WorkflowNode type) throws ExperimentLazyLoadedException { return getWorkflowExecutionDataList().get(0).getNodeDataList(type); } @Override public List<InputData> getWorkflowInputs() throws ExperimentLazyLoadedException{ return getWorkflowExecutionDataList().get(0).getWorkflowInputs(); } @Override public List<OutputData> getWorkflowOutputs()throws ExperimentLazyLoadedException { return getWorkflowExecutionDataList().get(0).getWorkflowOutputs(); } }
9,314
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/impl/WorkflowExecutionDataImpl.java
/* * * 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.airavata.registry.api.impl; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; import org.apache.airavata.registry.api.impl.ExperimentDataImpl; import org.apache.airavata.registry.api.workflow.*; import org.apache.airavata.registry.api.workflow.WorkflowExecutionStatus.State; import org.apache.airavata.registry.api.workflow.WorkflowNodeType.WorkflowNode; import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement public class WorkflowExecutionDataImpl implements WorkflowExecutionData { private WorkflowExecution workflowInstance; @XmlTransient private ExperimentDataImpl experimentData; private WorkflowExecutionStatus workflowInstanceStatus; private List<NodeExecutionData> nodeDataList; public WorkflowExecutionDataImpl() { } public WorkflowExecutionDataImpl(ExperimentData experimentData, WorkflowExecution workflowInstance, WorkflowExecutionStatus workflowInstanceStatus, List<NodeExecutionData> nodeDataList) { this.experimentData = (ExperimentDataImpl) experimentData; this.workflowInstance = workflowInstance; this.workflowInstanceStatus = workflowInstanceStatus; this.nodeDataList = nodeDataList; } public WorkflowExecution getWorkflowExecution() { return workflowInstance; } public List<NodeExecutionData> getNodeDataList() { if (nodeDataList == null) { nodeDataList = new ArrayList<NodeExecutionData>(); } return nodeDataList; } public void addNodeData(NodeExecutionData... nodeData) { getNodeDataList().addAll(Arrays.asList(nodeData)); } public String getExperimentId() { return workflowInstance.getExperimentId(); } /** * @deprecated Use "getWorkflowInstanceID() instead * @return */ public String getTopicId() { return workflowInstance.getWorkflowExecutionId(); } /** * @deprecated Use getId() instead */ public String getWorkflowInstanceId() { return workflowInstance.getWorkflowExecutionId(); } /** * @deprecated Use "WorkflowInstanceData.getTemplateName()" instead * @return */ public String getWorkflowName() { return getTemplateName(); } public String getTemplateName() { return workflowInstance.getTemplateName(); } public State getState() { return workflowInstanceStatus.getExecutionStatus(); } public Date getStatusUpdateTime() { return workflowInstanceStatus.getStatusUpdateTime(); } public NodeExecutionData getNodeData(String nodeId) { for (NodeExecutionData nodeData : getNodeDataList()) { if (nodeData.getWorkflowInstanceNode().getNodeId().equals(nodeId)) { return nodeData; } } return null; } public ExperimentData getExperimentData() { return experimentData; } public void setExperimentData(ExperimentDataImpl experimentData) { this.experimentData = experimentData; } public String getId() { return workflowInstance.getWorkflowExecutionId(); } @Override public List<InputData> getWorkflowInputs() { List<InputData> workflowInstanceNodePortDatas = new ArrayList<InputData>(); for (NodeExecutionData workflowInstanceNodeData : getNodeDataList(WorkflowNodeType.WorkflowNode.INPUTNODE)) { workflowInstanceNodePortDatas.addAll(convertToInputDataList(workflowInstanceNodeData.getOutputData())); } return workflowInstanceNodePortDatas; } private List<InputData> convertToInputDataList(List<OutputData> outputData) { List<InputData> i = new ArrayList<InputData>(); for (OutputData o : outputData) { i.add(new InputData(o.getWorkflowInstanceNode(),o.getName(),o.getValue())); } return i; } private List<OutputData> convertToOutputDataList(List<InputData> outputData) { List<OutputData> i = new ArrayList<OutputData>(); for (InputData o : outputData) { i.add(new OutputData(o.getWorkflowInstanceNode(),o.getName(),o.getValue())); } return i; } @Override public List<NodeExecutionData> getNodeDataList(WorkflowNode type) { List<NodeExecutionData> workflowInstanceNodePortDatas = new ArrayList<NodeExecutionData>(); for (NodeExecutionData workflowInstanceNodeData : getNodeDataList()) { if (workflowInstanceNodeData.getType().equals(type)) { workflowInstanceNodePortDatas.add(workflowInstanceNodeData); } } return workflowInstanceNodePortDatas; } @Override public List<OutputData> getWorkflowOutputs() { List<OutputData> workflowInstanceNodePortDatas = new ArrayList<OutputData>(); for (NodeExecutionData workflowInstanceNodeData : getNodeDataList(WorkflowNodeType.WorkflowNode.OUTPUTNODE)) { workflowInstanceNodePortDatas.addAll(convertToOutputDataList(workflowInstanceNodeData .getInputData())); } return workflowInstanceNodePortDatas; } }
9,315
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistryConstants.java
/* * * 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.airavata.registry.api.util; public class RegistryConstants { public static final String KEY_DEFAULT_GATEWAY_ID = "default.registry.gateway"; public static final String KEY_DEFAULT_REGISTRY_USER = "registry.user"; public static final String KEY_DEFAULT_REGISTRY_URL = "registry.jdbc.url"; public static final String CONFIGURATION_REGISTRY_ACCESSOR_CLASS = "class.configuration.registry.accessor"; public static final String DESCRIPTOR_REGISTRY_ACCESSOR_CLASS = "class.descriptor.registry.accessor"; public static final String PROJECT_REGISTRY_ACCESSOR_CLASS = "class.project.registry.accessor"; public static final String PROVENANCE_REGISTRY_ACCESSOR_CLASS = "class.provenance.registry.accessor"; public static final String USER_WF_REGISTRY_ACCESSOR_CLASS = "class.user.workflow.registry.accessor"; public static final String PUBLISHED_WF_REGISTRY_ACCESSOR_CLASS = "class.published.workflow.registry.accessor"; public static final String USER_REGISTRY_ACCESSOR_CLASS = "class.user.registry.accessor"; }
9,316
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistryUtils.java
/* * * 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.airavata.registry.api.util; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import org.apache.airavata.common.exception.AiravataConfigurationException; import org.apache.airavata.common.exception.ApplicationSettingsException; import org.apache.airavata.common.utils.ServerSettings; import org.apache.airavata.registry.api.AiravataRegistry2; import org.apache.airavata.registry.api.AiravataRegistryFactory; import org.apache.airavata.registry.api.AiravataUser; import org.apache.airavata.registry.api.Gateway; import org.apache.airavata.registry.api.exception.RegistryAccessorInstantiateException; import org.apache.airavata.registry.api.exception.RegistryAccessorInvalidException; import org.apache.airavata.registry.api.exception.RegistryAccessorNotFoundException; import org.apache.airavata.registry.api.exception.RegistryAccessorUndefinedException; import org.apache.airavata.registry.api.exception.RegistryException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class RegistryUtils { private static final Logger log = LoggerFactory.getLogger(RegistryUtils.class); public static String validateAxisService(String urlString)throws RegistryException { if(!urlString.endsWith("?wsdl")){ urlString = urlString + "?wsdl"; } try { URL url = new URL(urlString); URLConnection conn = url.openConnection(); conn.connect(); } catch (MalformedURLException e) { // the URL is not in a valid form throw new RegistryException("Given Axis2 Service URL : " + urlString + " is Invalid",e); } catch (IOException e) { // the connection couldn't be established throw new RegistryException("Given Axis2 Service URL : " + urlString + " is Invalid",e); } return urlString; } public static String validateURL(String urlString)throws RegistryException{ try { URL url = new URL(urlString); URLConnection conn = url.openConnection(); conn.connect(); } catch (MalformedURLException e) { // the URL is not in a valid form throw new RegistryException("Given URL: " + urlString + " is Invalid",e); } catch (IOException e) { // the connection couldn't be established throw new RegistryException("Given URL: " + urlString + " is Invalid",e); } return urlString; } // public static boolean validateRegistryCredentials(String userName,String password,String url)throws RegistryException{ // HashMap<String, String> map = new HashMap<String, String>(); // map.put("org.apache.jackrabbit.repository.uri", url); // try { // AiravataJCRRegistry airavataJCRRegistry = new AiravataJCRRegistry(new URI(url), "org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory", userName, password, map); // airavataJCRRegistry.saveGFacDescriptor("dummy"); //// airavataJCRRegistry.deleteGFacDescriptor("dummy"); // } catch (Exception e) { // throw new RegistryException("Check the properties file for JCR Registry Configuration",e); // } // return true; // } public static AiravataRegistry2 getRegistryFromServerSettings() { String username = ""; // Properties properties = new Properties(); AiravataRegistry2 registry = null; // try { //// properties.load(url.openStream()); // username=ServerSettings.getSystemUser(); //// if (properties.get(REGISTRY_USER) != null) { //// username = (String) properties.get(REGISTRY_USER); //// } // } catch (MalformedURLException e) { // e.printStackTrace(); // } catch (IOException e) { // e.printStackTrace(); // } try { username=ServerSettings.getSystemUser(); registry = AiravataRegistryFactory.getRegistry(new Gateway(ServerSettings.getSystemUserGateway()), new AiravataUser(username)); } catch (AiravataConfigurationException e) { log.error("Error initializing AiravataRegistry2"); } catch (RegistryAccessorNotFoundException e) { log.error("Error initializing AiravataRegistry2"); } catch (RegistryAccessorInstantiateException e) { log.error("Error initializing AiravataRegistry2"); } catch (RegistryAccessorInvalidException e) { log.error("Error initializing AiravataRegistry2"); } catch (RegistryAccessorUndefinedException e) { log.error("Error initializing AiravataRegistry2"); } catch (ApplicationSettingsException e) { log.error("Error initializing AiravataRegistry2",e); } catch (RegistryException e) { log.error("Error initializing AiravataRegistry2",e); } return registry; } }
9,317
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java
/* * * 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.airavata.registry.api.util; import org.apache.airavata.commons.gfac.type.ServiceDescription; import org.apache.airavata.commons.gfac.wsdl.WSDLConstants; import org.apache.airavata.commons.gfac.wsdl.WSDLGenerator; import org.apache.airavata.schemas.gfac.*; import java.util.Hashtable; public class WebServiceUtil { public static String generateWSDL(ServiceDescription service) { StringBuilder builder = new StringBuilder(); builder.append("<wsdl:definitions xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:ns1=\"http://org.apache.axis2/xsd\" xmlns:ns=\"http://www.wso2.org/types\" xmlns:wsaw=\"http://www.w3.org/2006/05/addressing/wsdl\" xmlns:http=\"http://schemas.xmlsoap.org/wsdl/http/\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:mime=\"http://schemas.xmlsoap.org/wsdl/mime/\" xmlns:soap12=\"http://schemas.xmlsoap.org/wsdl/soap12/\" targetNamespace=\"http://www.wso2.org/types\">"); builder.append("<wsdl:documentation>"); builder.append(service.getType().getName()); builder.append("</wsdl:documentation>"); builder.append("<wsdl:types>"); builder.append("<xs:schema attributeFormDefault=\"qualified\" elementFormDefault=\"unqualified\" targetNamespace=\"http://www.wso2.org/types\">"); boolean isInputParametersPresent = service.getType().getInputParametersArray() != null && service.getType().getInputParametersArray().length > 0; if (isInputParametersPresent) { builder.append("<xs:element name=\"invoke\">"); builder.append("<xs:complexType>"); builder.append("<xs:sequence>"); ServiceDescriptionType p = service.getType(); for (int i = 0; i < p.getInputParametersArray().length; i++) { generateElementFromInputType(p.getInputParametersArray(i), builder); } builder.append("</xs:sequence>"); builder.append("</xs:complexType>"); builder.append("</xs:element>"); } boolean isOutputParametersPresent = service.getType().getOutputParametersArray() != null && service.getType().getOutputParametersArray().length > 0; if (isOutputParametersPresent) { builder.append("<xs:element name=\"invokeResponse\">"); builder.append("<xs:complexType>"); builder.append("<xs:sequence>"); ServiceDescriptionType p = service.getType(); for (int i = 0; i < p.getOutputParametersArray().length; i++) { generateElementFromOutputType(p.getOutputParametersArray(i), builder); } builder.append("</xs:sequence>"); builder.append("</xs:complexType>"); builder.append("</xs:element>"); } builder.append("</xs:schema>"); builder.append("</wsdl:types>"); builder.append("<wsdl:message name=\"invokeRequest\">"); if (isInputParametersPresent) { builder.append("<wsdl:part name=\"parameters\" element=\"ns:invoke\"/>"); } builder.append("</wsdl:message>"); if (isOutputParametersPresent) { builder.append("<wsdl:message name=\"invokeResponse\">"); builder.append("<wsdl:part name=\"parameters\" element=\"ns:invokeResponse\"/>"); builder.append("</wsdl:message>"); } builder.append("<wsdl:portType name=\""); builder.append(service.getType().getName()); builder.append("\">"); builder.append("<wsdl:operation name=\"invoke\">"); builder.append("<wsdl:input message=\"ns:invokeRequest\" wsaw:Action=\"urn:invoke\"/>"); if (isOutputParametersPresent) { builder.append("<wsdl:output message=\"ns:invokeResponse\" wsaw:Action=\"urn:invokeResponse\"/>"); } builder.append("</wsdl:operation>"); builder.append("</wsdl:portType>"); builder.append("</wsdl:definitions>"); return builder.toString(); } private static void generateElementFromInputType(InputParameterType parameter, StringBuilder builder) { String type = parameter.getParameterType().getName(); if (type.equals("String")) { builder.append("<xs:element minOccurs=\"0\" name=\""); builder.append(parameter.getParameterName()); builder.append("\" nillable=\"true\" type=\"xs:string\"/>"); } else if (type.equals("Integer")) { builder.append("<xs:element minOccurs=\"0\" name=\""); builder.append(parameter.getParameterName()); builder.append("\" type=\"xs:int\"/>"); } else if (type.equals("Boolean")) { builder.append("<xs:element minOccurs=\"0\" name=\""); builder.append(parameter.getParameterName()); builder.append("\" type=\"xs:boolean\"/>"); } else if (type.equals("Double")) { builder.append("<xs:element minOccurs=\"0\" name=\""); builder.append(parameter.getParameterName()); builder.append("\" type=\"xs:double\"/>"); } else if (type.equals("Float")) { builder.append("<xs:element minOccurs=\"0\" name=\""); builder.append(parameter.getParameterName()); builder.append("\" type=\"xs:float\"/>"); } else if (type.equals("File")) { // TODO adding this means adding a new complex type for File type // builder.append("<xs:element minOccurs=\"0\" name=\""); // builder.append(parameter.getName()); // builder.append("\" nillable=\"true\" type=\"ax22:File\"/>"); } } private static void generateElementFromOutputType(OutputParameterType parameter, StringBuilder builder) { String type = parameter.getParameterType().getName(); if (type.equals("String")) { builder.append("<xs:element minOccurs=\"0\" name=\""); builder.append(parameter.getParameterName()); builder.append("\" nillable=\"true\" type=\"xs:string\"/>"); } else if (type.equals("Integer")) { builder.append("<xs:element minOccurs=\"0\" name=\""); builder.append(parameter.getParameterName()); builder.append("\" type=\"xs:int\"/>"); } else if (type.equals("Boolean")) { builder.append("<xs:element minOccurs=\"0\" name=\""); builder.append(parameter.getParameterName()); builder.append("\" type=\"xs:boolean\"/>"); } else if (type.equals("Double")) { builder.append("<xs:element minOccurs=\"0\" name=\""); builder.append(parameter.getParameterName()); builder.append("\" type=\"xs:double\"/>"); } else if (type.equals("Float")) { builder.append("<xs:element minOccurs=\"0\" name=\""); builder.append(parameter.getParameterName()); builder.append("\" type=\"xs:float\"/>"); } else if (type.equals("File")) { // TODO adding this means adding a new complex type for File type // builder.append("<xs:element minOccurs=\"0\" name=\""); // builder.append(parameter.getName()); // builder.append("\" nillable=\"true\" type=\"ax22:File\"/>"); } } public static String getWSDL(ServiceDescription service) throws Exception{ try { ServiceType type = service.getType().addNewService(); ServiceType.ServiceName name = type.addNewServiceName(); name.setStringValue(service.getType().getName()); name.setTargetNamespace("http://airavata.apache.org/schemas/gfac/2012/12"); if(service.getType().getPortType() == null){ PortTypeType portType = service.getType().addNewPortType(); MethodType methodType = portType.addNewMethod(); methodType.setMethodName("invoke"); }else{ MethodType method = service.getType().getPortType().getMethod(); if (method == null) { MethodType methodType = service.getType().getPortType().addNewMethod(); methodType.setMethodName("invoke"); } else { service.getType().getPortType().getMethod().setMethodName("invoke"); } } WSDLGenerator generator = new WSDLGenerator(); Hashtable table = generator.generateWSDL(null, null, null, service.getType(), true); return (String) table.get(WSDLConstants.AWSDL); } catch (Exception e) { throw new RuntimeException(e); } } }
9,318
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistrySettings.java
/* * * 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.airavata.registry.api.util; import java.net.URL; import java.util.Properties; import org.apache.airavata.common.utils.AiravataUtils; import org.apache.airavata.common.utils.ApplicationSettings; import org.apache.airavata.registry.api.exception.RegistrySettingsException; import org.apache.airavata.registry.api.exception.RegistrySettingsLoadException; public class RegistrySettings { private static final String REPOSITORY_PROPERTIES = "registry.properties"; private static Properties properties = new Properties(); private static Exception propertyLoadException; private static final String REGISTRY_ACCESSOR_CLASS = "class.registry.accessor"; private static final String SAVE_APPLICATION_JOB_STATUS_HISTORY="enable.application.job.status.history"; static{ URL url = RegistrySettings.class.getClassLoader() .getResource(REPOSITORY_PROPERTIES); if (url == null) { if (AiravataUtils.isServer()){ url=RegistrySettings.class.getClassLoader().getResource(ApplicationSettings.SERVER_PROPERTIES); if(url == null){ url=RegistrySettings.class.getClassLoader().getResource(ApplicationSettings.CLIENT_PROPERTIES); } }else if (AiravataUtils.isClient()){ url=RegistrySettings.class.getClassLoader().getResource(ApplicationSettings.CLIENT_PROPERTIES); if(url == null){ url=RegistrySettings.class.getClassLoader().getResource(ApplicationSettings.SERVER_PROPERTIES); } }else{ //unknown execution mode... If so, first assume its client, if not server... url=RegistrySettings.class.getClassLoader().getResource(ApplicationSettings.CLIENT_PROPERTIES); if (url==null){ url=RegistrySettings.class.getClassLoader().getResource(ApplicationSettings.SERVER_PROPERTIES); } } } try { properties.load(url.openStream()); } catch (Exception e) { propertyLoadException=e; } } private static void validateSuccessfulPropertyFileLoad() throws RegistrySettingsException{ if (propertyLoadException!=null){ throw new RegistrySettingsLoadException(propertyLoadException); } } public static String getSetting(String key) throws RegistrySettingsException{ validateSuccessfulPropertyFileLoad(); if (properties.containsKey(key)){ return properties.getProperty(key); } return null; // throw new UnspecifiedRegistrySettingsException(key); } public static String getSetting(String key, String defaultValue){ try { validateSuccessfulPropertyFileLoad(); if (properties.containsKey(key)){ return properties.getProperty(key); } } catch (RegistrySettingsException e) { //we'll ignore this error since a default value is provided } return defaultValue; } public static String getRegistryAccessorClass() throws RegistrySettingsException{ return getSetting(REGISTRY_ACCESSOR_CLASS); } public static boolean isApplicationJobStatusHistoryEnabled(){ return "true".equalsIgnoreCase(getSetting(SAVE_APPLICATION_JOB_STATUS_HISTORY, "false")); } }
9,319
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowExecution.java
/* * * 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.airavata.registry.api.workflow; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class WorkflowExecution { private String experimentId; private String workflowExecutionId; private String templateName; public WorkflowExecution() { } public WorkflowExecution(String experimentId,String instanceId) { setExperimentId(experimentId); setWorkflowExecutionId(instanceId); } public WorkflowExecution(String experimentId, String workflowInstanceId, String templateName) { this.experimentId = experimentId; this.workflowExecutionId = workflowInstanceId; this.templateName = templateName; } public String getWorkflowExecutionId() { return workflowExecutionId; } public void setWorkflowExecutionId(String workflowExecutionId) { this.workflowExecutionId = workflowExecutionId; } public String getExperimentId() { return experimentId; } public void setExperimentId(String experimentId) { this.experimentId = experimentId; } public String getTemplateName() { return templateName; } public void setTemplateName(String templateName) { this.templateName = templateName; } }
9,320
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ApplicationJobExecutionError.java
/* * * 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.airavata.registry.api.workflow; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class ApplicationJobExecutionError extends ExecutionError { private String experimentId; private String workflowInstanceId; private String nodeId; private String jobId; public String getExperimentId() { return experimentId; } public void setExperimentId(String experimentId) { this.experimentId = experimentId; } public String getWorkflowInstanceId() { return workflowInstanceId; } public void setWorkflowInstanceId(String workflowInstanceId) { this.workflowInstanceId = workflowInstanceId; } public String getNodeId() { return nodeId; } public void setNodeId(String nodeId) { this.nodeId = nodeId; } public String getJobId() { return jobId; } public void setJobId(String jobId) { this.jobId = jobId; } }
9,321
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowExecutionData.java
package org.apache.airavata.registry.api.workflow;/* * * 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. * */ import org.apache.airavata.registry.api.exception.worker.ExperimentLazyLoadedException; import org.apache.airavata.registry.api.impl.ExperimentDataImpl; import org.apache.airavata.registry.api.impl.WorkflowExecutionDataImpl; import org.apache.airavata.registry.api.workflow.WorkflowNodeType.WorkflowNode; import javax.jws.WebService; import javax.xml.bind.annotation.XmlSeeAlso; import java.util.Date; import java.util.List; @WebService @XmlSeeAlso(WorkflowExecutionDataImpl.class) public interface WorkflowExecutionData { /** * Get workflow execution id * @return */ public String getId(); /** * Retrieve all node data in this workflow execution * @return * @throws ExperimentLazyLoadedException */ public List<NodeExecutionData> getNodeDataList() throws ExperimentLazyLoadedException; /** * Retrieve all node data of the type <code>type</code> * @param type * @return * @throws ExperimentLazyLoadedException */ public List<NodeExecutionData> getNodeDataList(WorkflowNode type)throws ExperimentLazyLoadedException; /** * Retrieve the node data with the given node Id * @param nodeId * @return * @throws ExperimentLazyLoadedException */ public NodeExecutionData getNodeData(String nodeId) throws ExperimentLazyLoadedException; /** * Add node data to the workflow execution * @param nodeData * @throws ExperimentLazyLoadedException */ public void addNodeData(NodeExecutionData...nodeData) throws ExperimentLazyLoadedException; /** * Get id of the experiment which this workflow execution belongs to * @return */ public String getExperimentId(); /** * Get the workflow template name corresponding to this workflow execution * @return * @throws ExperimentLazyLoadedException */ public String getTemplateName() throws ExperimentLazyLoadedException; /** * Get current state of the execution of this workflow * @return * @throws ExperimentLazyLoadedException */ public WorkflowExecutionStatus.State getState() throws ExperimentLazyLoadedException; /** * Get current state updated time * @return * @throws ExperimentLazyLoadedException */ public Date getStatusUpdateTime() throws ExperimentLazyLoadedException; /** * Retrieve inputs to the workflow execution * @return * @throws ExperimentLazyLoadedException */ public List<InputData> getWorkflowInputs () throws ExperimentLazyLoadedException; /** * Retrieve outputs to the workflow execution * @return * @throws ExperimentLazyLoadedException */ public List<OutputData> getWorkflowOutputs ()throws ExperimentLazyLoadedException; @Deprecated public WorkflowExecution getWorkflowExecution() throws ExperimentLazyLoadedException; @Deprecated public ExperimentData getExperimentData() throws ExperimentLazyLoadedException; @Deprecated public void setExperimentData(ExperimentDataImpl experimentData) throws ExperimentLazyLoadedException; }
9,322
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowNodeGramData.java
/* * * 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.airavata.registry.api.workflow; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class WorkflowNodeGramData { String NodeID; String rsl; String invokedHost; String gramJobID; private String workflowInstanceId; public WorkflowNodeGramData() { } public WorkflowNodeGramData(String workflowInstanceId, String nodeID, String rsl, String invokedHost, String gramJobID) { NodeID = nodeID; this.rsl = rsl; this.invokedHost = invokedHost; this.gramJobID = gramJobID; this.setWorkflowInstanceId(workflowInstanceId); } public void setNodeID(String nodeID) { NodeID = nodeID; } public void setRsl(String rsl) { this.rsl = rsl; } public void setInvokedHost(String invokedHost) { this.invokedHost = invokedHost; } public void setGramJobID(String gramJobID) { this.gramJobID = gramJobID; } public String getNodeID() { return NodeID; } public String getRsl() { return rsl; } public String getInvokedHost() { return invokedHost; } public String getGramJobID() { return gramJobID; } public String getWorkflowInstanceId() { return workflowInstanceId; } public void setWorkflowInstanceId(String workflowInstanceId) { this.workflowInstanceId = workflowInstanceId; } }
9,323
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/NodeExecutionData.java
/* * * 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.airavata.registry.api.workflow; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import org.apache.airavata.common.utils.StringUtil; import org.apache.airavata.registry.api.workflow.WorkflowExecutionStatus.State; import java.util.ArrayList; import java.util.Date; import java.util.List; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class NodeExecutionData { private WorkflowInstanceNode workflowInstanceNode; private List<InputData> inputData; private List<OutputData> outputData; private String input; private String output; private NodeExecutionStatus status; private WorkflowNodeType.WorkflowNode type; private String experimentId; private String workflowExecutionId; private String nodeId; public NodeExecutionData() { } /** * deprecated Use <code>NodeExecutionData(String experimentId, String workflowExecutionId, String nodeId)</code> instead * @param workflowInstanceNode */ public NodeExecutionData(WorkflowInstanceNode workflowInstanceNode) { this(workflowInstanceNode.getWorkflowInstance().getExperimentId(),workflowInstanceNode.getWorkflowInstance().getWorkflowExecutionId(),workflowInstanceNode.getNodeId()); setWorkflowInstanceNode(workflowInstanceNode); } public NodeExecutionData(String experimentId, String workflowExecutionId, String nodeId) { this.experimentId=experimentId; this.workflowExecutionId=workflowExecutionId; this.nodeId=nodeId; } /* (non-Javadoc) * @see org.apache.airavata.registry.api.workflow.INodeExecutionData#getId() */ public String getId(){ return nodeId; } /* (non-Javadoc) * @see org.apache.airavata.registry.api.workflow.INodeExecutionData#getExperimentId() */ public String getExperimentId(){ return experimentId; } /* (non-Javadoc) * @see org.apache.airavata.registry.api.workflow.INodeExecutionData#getWorkflowExecutionId() */ public String getWorkflowExecutionId(){ return workflowExecutionId; } /* (non-Javadoc) * @see org.apache.airavata.registry.api.workflow.INodeExecutionData#getWorkflowInstanceNode() */ public WorkflowInstanceNode getWorkflowInstanceNode() { return workflowInstanceNode; } /* (non-Javadoc) * @see org.apache.airavata.registry.api.workflow.INodeExecutionData#setWorkflowInstanceNode(org.apache.airavata.registry.api.workflow.WorkflowInstanceNode) */ public void setWorkflowInstanceNode(WorkflowInstanceNode workflowInstanceNode) { this.workflowInstanceNode = workflowInstanceNode; } /* (non-Javadoc) * @see org.apache.airavata.registry.api.workflow.INodeExecutionData#getStatus() */ public NodeExecutionStatus getStatus() { return status; } /* (non-Javadoc) * @see org.apache.airavata.registry.api.workflow.INodeExecutionData#setStatus(org.apache.airavata.registry.api.workflow.NodeExecutionStatus) */ public void setStatus(NodeExecutionStatus status) { this.status = status; } /* (non-Javadoc) * @see org.apache.airavata.registry.api.workflow.INodeExecutionData#setStatus(org.apache.airavata.registry.api.workflow.WorkflowExecutionStatus.State, java.util.Date) */ public void setStatus(WorkflowExecutionStatus.State status, Date date) { setStatus(new NodeExecutionStatus(this.workflowInstanceNode, status, date)); } /* (non-Javadoc) * @see org.apache.airavata.registry.api.workflow.INodeExecutionData#getInputData() */ public List<InputData> getInputData() { if (inputData==null){ inputData=new ArrayList<InputData>(); List<NameValue> data = getIOParameterData(getInput()); for (NameValue nameValue : data) { inputData.add(new InputData(getWorkflowInstanceNode(), nameValue.name, nameValue.value)); } } return inputData; } /* (non-Javadoc) * @see org.apache.airavata.registry.api.workflow.INodeExecutionData#getOutputData() */ public List<OutputData> getOutputData() { if (outputData==null){ outputData=new ArrayList<OutputData>(); List<NameValue> data = getIOParameterData(getOutput()); for (NameValue nameValue : data) { outputData.add(new OutputData(getWorkflowInstanceNode(), nameValue.name, nameValue.value)); } } return outputData; } /* (non-Javadoc) * @see org.apache.airavata.registry.api.workflow.INodeExecutionData#setInputData(java.util.List) */ public void setInputData(List<InputData> inputData) { this.inputData = inputData; } /* (non-Javadoc) * @see org.apache.airavata.registry.api.workflow.INodeExecutionData#setOutputData(java.util.List) */ public void setOutputData(List<OutputData> outputData) { this.outputData = outputData; } public String getInput() { return input; } public void setInput(String input) { this.input = input; } public String getOutput() { return output; } public void setOutput(String output) { this.output = output; } /* (non-Javadoc) * @see org.apache.airavata.registry.api.workflow.INodeExecutionData#getType() */ public WorkflowNodeType.WorkflowNode getType() { return type; } /* (non-Javadoc) * @see org.apache.airavata.registry.api.workflow.INodeExecutionData#setType(org.apache.airavata.registry.api.workflow.WorkflowNodeType.WorkflowNode) */ public void setType(WorkflowNodeType.WorkflowNode type) { this.type = type; } public State getState() { return status.getExecutionStatus(); } public Date getStatusUpdateTime() { return status.getStatusUpdateTime(); } private static class NameValue{ String name; String value; public NameValue(String name, String value) { this.name=name; this.value=value; } } private static List<NameValue> getIOParameterData(String data){ List<NameValue> parameters=new ArrayList<NameValue>(); if (data!=null && !data.trim().equals("")) { String[] pairs = StringUtil.getElementsFromString(data); for (String paras : pairs) { String name=paras.trim(); String value=""; int i = name.indexOf("="); //if the paras has a value as well if (i!=-1){ value=name.substring(i+1); name=name.substring(0,i); parameters.add(new NameValue(name,StringUtil.quoteString(value))); }else{ parameters.get(parameters.size()-1).value=parameters.get(parameters.size()-1).value+","+StringUtil.quoteString(name); } } } return parameters; } }
9,324
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/InputData.java
/* * * 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.airavata.registry.api.workflow; public class InputData extends WorkflowInstanceNodePortData { public InputData() { super(); } public InputData(WorkflowInstanceNode workflowInstanceNode, String portName, String portValue) { super(workflowInstanceNode, portName, portValue); } public InputData(WorkflowInstanceNode workflowInstanceNode, String data) { super(workflowInstanceNode, data); } }
9,325
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentMetadata.java
/* * * 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.airavata.registry.api.workflow; public class ExperimentMetadata { private String experimentId; private String metadata; public ExperimentMetadata(String experimentId, String metadata) { setExperimentId(experimentId); setMetadata(metadata); } public String getMetadata() { return metadata; } public void setMetadata(String metadata) { this.metadata = metadata; } public String getExperimentId() { return experimentId; } public void setExperimentId(String experimentId) { this.experimentId = experimentId; } }
9,326
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNode.java
/* * * 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.airavata.registry.api.workflow; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement public class WorkflowInstanceNode{ private WorkflowExecution workflowInstance; private String nodeId; private String originalNodeID; private int executionIndex; public WorkflowInstanceNode() { } public WorkflowInstanceNode(WorkflowExecution workflowInstance, String nodeId) { setWorkflowInstance(workflowInstance); setNodeId(nodeId); } public WorkflowExecution getWorkflowInstance() { return workflowInstance; } public void setWorkflowInstance(WorkflowExecution workflowInstance) { this.workflowInstance = workflowInstance; } public String getNodeId() { return nodeId; } public void setNodeId(String nodeId) { this.nodeId = nodeId; } public String getOriginalNodeID() { return originalNodeID; } public int getExecutionIndex() { return executionIndex; } }
9,327
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentName.java
/* * * 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.airavata.registry.api.workflow; public class ExperimentName { private String experimentId; private String instanceName; public ExperimentName(String experimentId, String instanceName) { setExperimentId(experimentId); setInstanceName(instanceName); } public String getInstanceName() { return instanceName; } public void setInstanceName(String instanceName) { this.instanceName = instanceName; } public String getExperimentId() { return experimentId; } public void setExperimentId(String experimentId) { this.experimentId = experimentId; } }
9,328
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowExecutionError.java
/* * * 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.airavata.registry.api.workflow; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class WorkflowExecutionError extends ExecutionError { private String experimentId; private String workflowInstanceId; public String getExperimentId() { return experimentId; } public void setExperimentId(String experimentId) { this.experimentId = experimentId; } public String getWorkflowInstanceId() { return workflowInstanceId; } public void setWorkflowInstanceId(String workflowInstanceId) { this.workflowInstanceId = workflowInstanceId; } }
9,329
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentExecutionError.java
/* * * 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.airavata.registry.api.workflow; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class ExperimentExecutionError extends ExecutionError { private String experimentId; public String getExperimentId() { return experimentId; } public void setExperimentId(String experimentId) { this.experimentId = experimentId; } }
9,330
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowNodeIOData.java
/* * * 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.airavata.registry.api.workflow; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement public class WorkflowNodeIOData extends WorkflowIOData { private String experimentId; private String workflowName; private String workflowId; private String workflowInstanceId; private WorkflowNodeType nodeType; /** when you construct this object it set to STARTED state **/ private WorkflowExecutionStatus nodeStatus = new WorkflowExecutionStatus(new WorkflowExecution(experimentId,workflowId,workflowName), WorkflowExecutionStatus.State.STARTED); public WorkflowNodeIOData() { } public WorkflowNodeIOData(String data, String experimentId,String workflowInstanceID, String workflowId, String nodeId,String workflowName) { super(nodeId,data); setExperimentId(experimentId); setWorkflowInstanceId(workflowInstanceID); setWorkflowId(workflowId); setWorkflowName(workflowName); } public WorkflowNodeIOData(String data, String experimentId,String workflowInstanceID, String nodeId,String workflowName) { this(data, experimentId, experimentId,workflowInstanceID, nodeId, workflowName); } public WorkflowNodeIOData(String experimentId,String workflowInstanceID, String workflowName, String workflowId, WorkflowNodeType nodeType) { this.experimentId = experimentId; this.workflowInstanceId = workflowInstanceID; this.workflowName = workflowName; this.workflowId = workflowId; this.nodeType = nodeType; } public String getExperimentId() { return experimentId; } public void setExperimentId(String experimentId) { this.experimentId = experimentId; } public String getWorkflowName() { return workflowName; } public void setWorkflowName(String workflowName) { this.workflowName = workflowName; } public String getWorkflowId() { return workflowId; } public void setWorkflowId(String workflowId) { this.workflowId = workflowId; } public String getWorkflowInstanceId() { return workflowInstanceId; } public void setWorkflowInstanceId(String workflowInstanceId) { this.workflowInstanceId = workflowInstanceId; } public void setNodeType(WorkflowNodeType nodeType) { this.nodeType = nodeType; } public WorkflowNodeType getNodeType() { return nodeType; } public WorkflowExecutionStatus getNodeStatus() { return nodeStatus; } public void setNodeStatus(WorkflowExecutionStatus nodeStatus) { this.nodeStatus = nodeStatus; } }
9,331
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentData.java
/* * * 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.airavata.registry.api.workflow; import java.util.List; import org.apache.airavata.registry.api.exception.worker.ExperimentLazyLoadedException; import org.apache.airavata.registry.api.impl.ExperimentDataImpl; import org.apache.airavata.registry.api.impl.WorkflowExecutionDataImpl; import javax.jws.WebService; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSeeAlso; //@XmlRootElement //@XmlAccessorType(XmlAccessType.FIELD) @WebService @XmlSeeAlso(ExperimentDataImpl.class) public interface ExperimentData extends WorkflowExecutionData { //Current Id and Topic values are similar /** * Returns the ExperimentID of the workflow Run * @return */ public String getId(); /** * Returns the Experiment Topic... Currently the ID and the Topic are identical * @return */ public String getTopic(); /** * Returns the user of the workflow run * @return */ public String getUser(); /** * Returns metadata related to the workflow run * @return */ public String getMetadata(); /** * Returns the Experiment Name of the workflow run, This is given in the XBaya-GUI when you user run a workflow * @return */ public String getExperimentName(); /** * get data related to a particular experiment, this returns all the workflow runs for the given Experiment * @return * @throws ExperimentLazyLoadedException */ public List<WorkflowExecutionDataImpl> getWorkflowExecutionDataList() throws ExperimentLazyLoadedException; /** * Reut * @param workflowExecutionID * @return * @throws ExperimentLazyLoadedException */ public WorkflowExecutionData getWorkflowExecutionData(String workflowExecutionID) throws ExperimentLazyLoadedException; /** * * @param experimentId */ public void setExperimentId(String experimentId); /** * * @param topic */ public void setTopic(String topic); /** * * @param user */ public void setUser(String user); /** * * @param metadata */ public void setMetadata(String metadata); /** * * @param experimentName */ public void setExperimentName(String experimentName); /** * * @return */ public String getExperimentId(); }
9,332
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowExecutionStatus.java
/* * * 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.airavata.registry.api.workflow; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import java.util.Calendar; import java.util.Date; @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement public class WorkflowExecutionStatus { public WorkflowExecutionStatus() { } public WorkflowExecutionStatus(String experimentID, String workflowInstanceID) { workflowInstance.setExperimentId(experimentID); workflowInstance.setWorkflowExecutionId(workflowInstanceID); } public enum State { STARTED { public String toString() { return "STARTED"; } }, RUNNING { public String toString() { return "RUNNING"; } }, FAILED { public String toString() { return "FAILED"; } }, PAUSED { public String toString() { return "PAUSED"; } }, FINISHED { public String toString() { return "FINISHED"; } }, PENDING { public String toString() { return "PENDING"; } }, ACTIVE { public String toString() { return "ACTIVE"; } }, DONE { public String toString() { return "DONE"; } }, UNKNOWN { public String toString() { return "UNKNOWN"; } } } private State executionStatus=State.UNKNOWN; private Date statusUpdateTime = null; private WorkflowExecution workflowInstance; public State getExecutionStatus() { return executionStatus; } public void setExecutionStatus(State executionStatus) { this.executionStatus = executionStatus; } public Date getStatusUpdateTime() { return statusUpdateTime; } public void setStatusUpdateTime(Date statusUpdateTime) { this.statusUpdateTime = statusUpdateTime; } public WorkflowExecutionStatus(WorkflowExecution workflowInstance, State executionStatus) { this(workflowInstance, executionStatus, null); } public WorkflowExecutionStatus(WorkflowExecution workflowInstance, State executionStatus, Date statusUpdateTime) { statusUpdateTime = statusUpdateTime == null ? Calendar.getInstance().getTime() : statusUpdateTime; setWorkflowInstance(workflowInstance); setExecutionStatus(executionStatus); setStatusUpdateTime(statusUpdateTime); } public WorkflowExecution getWorkflowInstance() { return workflowInstance; } public void setWorkflowInstance(WorkflowExecution workflowInstance) { this.workflowInstance = workflowInstance; } }
9,333
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentUser.java
/* * * 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.airavata.registry.api.workflow; public class ExperimentUser { private String experimentId; private String user; public ExperimentUser(String experimentId, String user) { setExperimentId(experimentId); setUser(user); } public String getUser() { return user; } public void setUser(String user) { this.user = user; } public String getExperimentId() { return experimentId; } public void setExperimentId(String experimentId) { this.experimentId = experimentId; } }
9,334
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowRunTimeData.java
/* * * 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.airavata.registry.api.workflow; import java.sql.Timestamp; public class WorkflowRunTimeData { String experimentID; String workflowInstanceID; String templateID; Timestamp startTime; WorkflowExecutionStatus.State workflowStatus; Timestamp lastUpdateTime; public WorkflowRunTimeData(String experimentID, String workflowInstanceID, String templateID, Timestamp startTime, WorkflowExecutionStatus.State workflowStatus, Timestamp lastUpdateTime) { this.experimentID = experimentID; this.workflowInstanceID = workflowInstanceID; this.templateID = templateID; this.startTime = startTime; this.workflowStatus = workflowStatus; this.lastUpdateTime = lastUpdateTime; } public String getExperimentID() { return experimentID; } public String getWorkflowInstanceID() { return workflowInstanceID; } public String getTemplateID() { return templateID; } public Timestamp getStartTime() { return startTime; } public WorkflowExecutionStatus.State getWorkflowStatus() { return workflowStatus; } public Timestamp getLastUpdateTime() { return lastUpdateTime; } public void setExperimentID(String experimentID) { this.experimentID = experimentID; } public void setWorkflowInstanceID(String workflowInstanceID) { this.workflowInstanceID = workflowInstanceID; } public void setTemplateID(String templateID) { this.templateID = templateID; } public void setStartTime(Timestamp startTime) { this.startTime = startTime; } public void setWorkflowStatus(WorkflowExecutionStatus.State workflowStatus) { this.workflowStatus = workflowStatus; } public void setLastUpdateTime(Timestamp lastUpdateTime) { this.lastUpdateTime = lastUpdateTime; } }
9,335
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExecutionError.java
/* * * 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.airavata.registry.api.workflow; import java.util.Date; import org.apache.airavata.registry.api.ExecutionErrors; import org.codehaus.jackson.annotate.JsonTypeInfo; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSeeAlso; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @JsonTypeInfo(use=JsonTypeInfo.Id.CLASS, include=JsonTypeInfo.As.PROPERTY, property="@class") public abstract class ExecutionError { public ExecutionErrors.Source source; public Date errorTime; public String errorCode; public String errorMessage; public String errorDescription; public String errorLocation; public String actionTaken; private String errorReported; private int errorReference; public ExecutionErrors.Source getSource() { return source; } public void setSource(ExecutionErrors.Source source) { this.source = source; } public Date getErrorTime() { return errorTime; } public void setErrorTime(Date errorTime) { this.errorTime = errorTime; } public String getErrorCode() { return errorCode; } public void setErrorCode(String errorCode) { this.errorCode = errorCode; } public String getErrorMessage() { return errorMessage; } public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } public String getErrorDescription() { return errorDescription; } public void setErrorDescription(String errorDescription) { this.errorDescription = errorDescription; } public String getErrorLocation() { return errorLocation; } public void setErrorLocation(String errorLocation) { this.errorLocation = errorLocation; } public String getActionTaken() { return actionTaken; } public void setActionTaken(String actionTaken) { this.actionTaken = actionTaken; } public String getErrorReported() { return errorReported; } public void setErrorReported(String errorReported) { this.errorReported = errorReported; } public int getErrorReference() { return errorReference; } public void setErrorReference(int errorReference) { this.errorReference = errorReference; } }
9,336
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowIOData.java
/* * * 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.airavata.registry.api.workflow; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement public class WorkflowIOData { private String value; private String nodeId; public WorkflowIOData() { } public WorkflowIOData(String nodeId,String value) { setValue(value); setNodeId(nodeId); } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public String getNodeId() { return nodeId; } public void setNodeId(String nodeId) { this.nodeId = nodeId; } }
9,337
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ApplicationJob.java
/* * * 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.airavata.registry.api.workflow; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import java.util.Date; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class ApplicationJob { /** * Represents the status of the application job execution life cycle.<br /> * <em><strong>Note</strong> : The applicable <code>ApplicationJobStatus</code> values and the * particular actions that define or lead to those <code>ApplicationJobStatus</code> values is * based on type of application (eg: GRAM, EC2) being executed</em>. */ public static enum ApplicationJobStatus{ /** * Job not yet submitted to Gram */ UN_SUBMITTED, /** * Validating the application job input data and configurations */ VALIDATE_INPUT, /** * Input data/files is being staged for the application job. */ STAGING, /** * Authenticating */ AUTHENTICATE, /** * Application job is being initialized. */ INITIALIZE, /** * Application job is submitted, possibly waiting to start executing. */ SUBMITTED, /** * Application job is waiting to start/continue its executing. */ PENDING, /** * Application job is being executed. */ EXECUTING, /** * Application job is being active. */ ACTIVE, /** * Application job is paused/suspended */ SUSPENDED, /** * Application job is waiting for data or a trigger to continue its execution. */ WAIT_FOR_DATA, /** * Finalizing the execution of the application job. */ FINALIZE, /** * Results of the application job execution are being generated. */ RESULTS_GEN, /** * Generated results from the application job execution is being retrieved. */ RESULTS_RETRIEVE, /** * Validating the application job execution results */ VALIDATE_OUTPUT, /** * Application job completed successfully. */ FINISHED, /** * Error occurred during the application job execution and the job was terminated. */ FAILED, /** * Execution of the application job was cancelled. */ CANCELLED, /** * Execution of the application job was cancelled. */ CANCELED, /** * Unable to determine the current status of the application job. <br /> * <em><strong>Note: </strong>More information may be available on the application job * </em><code>metadata</code>. */ UNKNOWN } private String experimentId; private String workflowExecutionId; private String nodeId; private String serviceDescriptionId; private String hostDescriptionId; private String applicationDescriptionId; private String jobId; private String jobData; private Date submittedTime; private Date statusUpdateTime; private ApplicationJobStatus status; private String metadata; /** * The id of the experiment which this application job corresponds to * @return */ public String getExperimentId() { return experimentId; } public void setExperimentId(String experimentId) { this.experimentId = experimentId; } /** * The id of the workflow instance execution which this application job corresponds to */ public String getWorkflowExecutionId() { return workflowExecutionId; } public void setWorkflowExecutionId(String workflowExecutionId) { this.workflowExecutionId = workflowExecutionId; } /** * The id of the node which this application job corresponds to */ public String getNodeId() { return nodeId; } public void setNodeId(String nodeId) { this.nodeId = nodeId; } /** * The id of the service description which this application job corresponds to */ public String getServiceDescriptionId() { return serviceDescriptionId; } public void setServiceDescriptionId(String serviceDescriptionId) { this.serviceDescriptionId = serviceDescriptionId; } /** * The id of the host description which this application job corresponds to <br /> * <em><strong>Note: </strong>For data saved using the deprecated API function * {@code updateWorkflowNodeGramData(...)} this will be the address of the host</em> */ public String getHostDescriptionId() { return hostDescriptionId; } public void setHostDescriptionId(String hostDescriptionId) { this.hostDescriptionId = hostDescriptionId; } /** * The id of the application description which this application job corresponds to */ public String getApplicationDescriptionId() { return applicationDescriptionId; } public void setApplicationDescriptionId(String applicationDescriptionId) { this.applicationDescriptionId = applicationDescriptionId; } /** * id representing the application job uniquely identified in the Airavata system <br /> * <em><strong>Note: </strong>This id may or may not correspond to an id that can identify a * resource execution in the computational middleware</em> */ public String getJobId() { return jobId; } /** * Set a unique id which represents this job in the Airavata system. */ public void setJobId(String jobId) { this.jobId = jobId; } /** * Configuration, execution and input data relating to the execution of the application job. <br /> * <em><strong>Note: </strong>The structure of the data is determined by the type of application * <code>(eg: GRAM, EC2) being executed.</code></em> */ public String getJobData() { return jobData; } /** * Set the configuration, execution and input data relating to the execution of the application. * job. <br /> * <em><strong>Note: </strong>The structure of the data is up to the Provider implementation * <code>(eg: GRAMProvider, EC2Provider)</code>. It is strongly encouraged to include in this * field all the information (excluding descriptor data & any sensitive data such as password * credentials) necessary for a 3rd party to repeat the execution of application job if * necessary.</em> */ public void setJobData(String jobData) { this.jobData = jobData; } /** * When was this application job was submitted. */ public Date getSubmittedTime() { return submittedTime; } public void setSubmittedTime(Date submittedTime) { this.submittedTime = submittedTime; } /** * When was the status of this application job was last updated. * @return */ public Date getStatusUpdateTime() { return statusUpdateTime; } public void setStatusUpdateTime(Date statusUpdateTime) { this.statusUpdateTime = statusUpdateTime; } /** * Get the currently recorded status of the application job. * @return */ public ApplicationJobStatus getStatus() { return status; } public void setStatus(ApplicationJobStatus status) { this.status = status; } /** * Custom metadata maintained for the application job containing that may contain any additional * information relating to the execution. * @return */ public String getMetadata() { return metadata; } public void setMetadata(String metadata) { this.metadata = metadata; } }
9,338
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/NodeExecutionStatus.java
/* * * 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.airavata.registry.api.workflow; import java.util.Calendar; import java.util.Date; import org.apache.airavata.registry.api.workflow.WorkflowExecutionStatus.State; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement public class NodeExecutionStatus { private State executionStatus; private Date statusUpdateTime = null; private WorkflowInstanceNode workflowInstanceNode; public NodeExecutionStatus() { } public State getExecutionStatus() { return executionStatus; } public void setExecutionStatus(State executionStatus) { this.executionStatus = executionStatus; } public Date getStatusUpdateTime() { return statusUpdateTime; } public void setStatusUpdateTime(Date statusUpdateTime) { this.statusUpdateTime = statusUpdateTime; } public NodeExecutionStatus(WorkflowInstanceNode workflowInstanceNode, State executionStatus) { this(workflowInstanceNode, executionStatus, null); } public NodeExecutionStatus(WorkflowInstanceNode workflowInstanceNode, State executionStatus, Date statusUpdateTime) { statusUpdateTime = statusUpdateTime == null ? Calendar.getInstance().getTime() : statusUpdateTime; setWorkflowInstanceNode(workflowInstanceNode); setExecutionStatus(executionStatus); setStatusUpdateTime(statusUpdateTime); } public WorkflowInstanceNode getWorkflowInstanceNode() { return workflowInstanceNode; } public void setWorkflowInstanceNode(WorkflowInstanceNode workflowInstanceNode) { this.workflowInstanceNode = workflowInstanceNode; } }
9,339
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowNodeType.java
/* * * 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.airavata.registry.api.workflow; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement public class WorkflowNodeType { public WorkflowNodeType(WorkflowNode nodeType) { this.nodeType = nodeType; } public WorkflowNodeType() { } public enum WorkflowNode { SERVICENODE { public String toString() { return "SERVICE_NODE"; } }, CONTROLNODE { public String toString() { return "CONTROL_NODE"; } }, INPUTNODE { public String toString() { return "INPUT_NODE"; } }, OUTPUTNODE { public String toString() { return "OUTPUT_NODE"; } }, UNKNOWN { public String toString() { return "UNKNOWN_NODE"; } }, } private WorkflowNode nodeType; public WorkflowNode getNodeType() { return nodeType; } public void setNodeType(WorkflowNode nodeType) { this.nodeType = nodeType; } public static WorkflowNodeType getType(String type){ for(WorkflowNode w:WorkflowNode.values()){ if (w.toString().equalsIgnoreCase(type)){ return new WorkflowNodeType(w); } } return new WorkflowNodeType(WorkflowNode.UNKNOWN); } }
9,340
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/OutputData.java
/* * * 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.airavata.registry.api.workflow; public class OutputData extends WorkflowInstanceNodePortData { public OutputData() { super(); } public OutputData(WorkflowInstanceNode workflowInstanceNode, String portName, String portValue) { super(workflowInstanceNode, portName, portValue); } public OutputData(WorkflowInstanceNode workflowInstanceNode, String data) { super(workflowInstanceNode, data); } }
9,341
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/NodeExecutionError.java
/* * * 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.airavata.registry.api.workflow; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class NodeExecutionError extends ExecutionError { private String experimentId; private String workflowInstanceId; private String nodeId; public String getExperimentId() { return experimentId; } public void setExperimentId(String experimentId) { this.experimentId = experimentId; } public String getWorkflowInstanceId() { return workflowInstanceId; } public void setWorkflowInstanceId(String workflowInstanceId) { this.workflowInstanceId = workflowInstanceId; } public String getNodeId() { return nodeId; } public void setNodeId(String nodeId) { this.nodeId = nodeId; } }
9,342
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ApplicationJobStatusData.java
/* * * 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.airavata.registry.api.workflow; import java.util.Date; import org.apache.airavata.registry.api.workflow.ApplicationJob.ApplicationJobStatus; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class ApplicationJobStatusData { private String jobId; private ApplicationJobStatus status; private Date time; public ApplicationJobStatusData(String jobId, ApplicationJobStatus status, Date time) { setJobId(jobId); setStatus(status); setTime(time); } public String getJobId() { return jobId; } private void setJobId(String jobId) { this.jobId = jobId; } public ApplicationJobStatus getStatus() { return status; } private void setStatus(ApplicationJobStatus status) { this.status = status; } public Date getTime() { return time; } private void setTime(Date time) { this.time = time; } }
9,343
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNodePortData.java
/* * * 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.airavata.registry.api.workflow; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class WorkflowInstanceNodePortData { private WorkflowInstanceNode workflowInstanceNode; private String name; private String value; public WorkflowInstanceNodePortData() { } public WorkflowInstanceNodePortData(WorkflowInstanceNode workflowInstanceNode, String portName, String portValue) { setWorkflowInstanceNode(workflowInstanceNode); setName(portName); setValue(portValue); } public WorkflowInstanceNodePortData(WorkflowInstanceNode workflowInstanceNode, String data) { setWorkflowInstanceNode(workflowInstanceNode); setValue(data); } public WorkflowInstanceNode getWorkflowInstanceNode() { return workflowInstanceNode; } public void setWorkflowInstanceNode(WorkflowInstanceNode workflowInstanceNode) { this.workflowInstanceNode = workflowInstanceNode; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getId(){ return getName(); } public String getExperimentId(){ return getWorkflowInstanceNode().getWorkflowInstance().getExperimentId(); } public String getWorkflowInstanceId(){ return getWorkflowInstanceNode().getWorkflowInstance().getWorkflowExecutionId(); } public String getWorkflowInstanceNodeId(){ return getWorkflowInstanceNode().getNodeId(); } }
9,344
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/RegistryAccessorInvalidException.java
/* * * 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.airavata.registry.api.exception; public class RegistryAccessorInvalidException extends RegistryException { private static final long serialVersionUID = -2679914107485739140L; public RegistryAccessorInvalidException(String className){ super("Registry accessor '"+className+"' is not valid!!!"); } }
9,345
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/RegistryAPIVersionIncompatibleException.java
/* * * 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.airavata.registry.api.exception; import org.apache.airavata.registry.api.exception.RegistryException; public class RegistryAPIVersionIncompatibleException extends RegistryException { private static final long serialVersionUID = -2679914107485739141L; public RegistryAPIVersionIncompatibleException() { this("Incompatible versions with Airavata registry and Airavata API"); } public RegistryAPIVersionIncompatibleException(String message) { this(message,null); } public RegistryAPIVersionIncompatibleException(String message, Exception e){ super(message, e); } }
9,346
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/ServiceDescriptionRetrieveException.java
/* * * 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.airavata.registry.api.exception; public class ServiceDescriptionRetrieveException extends RegistryException { private final static String ERROR_MESSAGE = "Error occured while attempting to retrieve existing service descriptions"; /** * */ private static final long serialVersionUID = -2849422320139467602L; public ServiceDescriptionRetrieveException(Exception e) { super(ERROR_MESSAGE, e); } }
9,347
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/RegistrySettingsException.java
/* * * 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.airavata.registry.api.exception; public class RegistrySettingsException extends RegistryException { private static final long serialVersionUID = -4901850535475160411L; public RegistrySettingsException(String message) { super(message); } public RegistrySettingsException(String message, Throwable e) { super(message, e); } }
9,348
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/AiravataRegistryUninitializedException.java
/* * * 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.airavata.registry.api.exception; public class AiravataRegistryUninitializedException extends RegistryException { public AiravataRegistryUninitializedException(String message, Throwable e) { super(message, e); } private static final long serialVersionUID = -6873054164386608256L; }
9,349
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/RegistryAccessorInstantiateException.java
/* * * 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.airavata.registry.api.exception; public class RegistryAccessorInstantiateException extends RegistryException { private static final long serialVersionUID = -2679914107485739140L; public RegistryAccessorInstantiateException(String className, Exception e){ super("There was an exception instantiating the Registry accessor class '"+className+"'!!!", e); } }
9,350
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/UnknownRegistryConnectionDataException.java
/* * * 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.airavata.registry.api.exception; public class UnknownRegistryConnectionDataException extends RegistryException { private static final long serialVersionUID = -6483101227925383562L; public UnknownRegistryConnectionDataException(String message) { super(message); } public UnknownRegistryConnectionDataException(String message, Throwable e) { super(message, e); } }
9,351
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/UnspecifiedRegistrySettingsException.java
/* * * 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.airavata.registry.api.exception; public class UnspecifiedRegistrySettingsException extends RegistrySettingsException { private static final long serialVersionUID = -1159027432434546003L; public UnspecifiedRegistrySettingsException(String key) { super("The '"+key+"' is not configured in Registry settings!!!"); } }
9,352
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/HostDescriptionRetrieveException.java
/* * * 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.airavata.registry.api.exception; public class HostDescriptionRetrieveException extends RegistryException { private final static String ERROR_MESSAGE = "Error occured while attempting to retrieve existing hosts"; private static final long serialVersionUID = -2849422320139467602L; public HostDescriptionRetrieveException(Exception e) { super(ERROR_MESSAGE, e); } }
9,353
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/RegistryAccessorUndefinedException.java
/* * * 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.airavata.registry.api.exception; public class RegistryAccessorUndefinedException extends RegistryException { private static final long serialVersionUID = -2679914107485739140L; public RegistryAccessorUndefinedException() { this("A registry accessor was not defined in the registry settings"); } public RegistryAccessorUndefinedException(String message) { this(message,null); } public RegistryAccessorUndefinedException(String message, Exception e){ super(message, e); } }
9,354
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/RegistryAccessorNotFoundException.java
/* * * 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.airavata.registry.api.exception; public class RegistryAccessorNotFoundException extends RegistryException { private static final long serialVersionUID = -2679914107485739140L; public RegistryAccessorNotFoundException(String className, Exception e){ super("Registry accessor class '"+className+"' was not found in classpath!!!", e); } }
9,355
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/UnimplementedRegistryOperationException.java
/* * * 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.airavata.registry.api.exception; public class UnimplementedRegistryOperationException extends RegistryException { private static final long serialVersionUID = 8565882892195989548L; public UnimplementedRegistryOperationException() { super("This operation is not implemented!!!"); } }
9,356
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/RegistryException.java
/* * * 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.airavata.registry.api.exception; public class RegistryException extends Exception { private static final long serialVersionUID = -2849422320139467602L; public RegistryException(Throwable e) { super(e); } public RegistryException(String message) { super(message, null); } public RegistryException(String message, Throwable e) { super(message, e); } }
9,357
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/GatewayNotRegisteredException.java
/* * * 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.airavata.registry.api.exception; public class GatewayNotRegisteredException extends RegistryException { private static final long serialVersionUID = -139586125325993500L; public GatewayNotRegisteredException(String gatewayName) { super("The gateway id '"+gatewayName+"' is not registered within Airavata"); } }
9,358
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/DeploymentDescriptionRetrieveException.java
/* * * 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.airavata.registry.api.exception; public class DeploymentDescriptionRetrieveException extends RegistryException { private final static String ERROR_MESSAGE = "Error occured while attempting to retrieve existing deployment descriptions"; /** * */ private static final long serialVersionUID = -2849422320139467602L; public DeploymentDescriptionRetrieveException(Exception e) { super(ERROR_MESSAGE,e); } }
9,359
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/RegistrySettingsLoadException.java
/* * * 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.airavata.registry.api.exception; public class RegistrySettingsLoadException extends RegistrySettingsException { private static final long serialVersionUID = -5102090895499711299L; public RegistrySettingsLoadException(String message) { super(message); } public RegistrySettingsLoadException(Throwable e) { this(e.getMessage(),e); } public RegistrySettingsLoadException(String message, Throwable e) { super(message,e); } }
9,360
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/WorkflowInstanceNodeAlreadyExistsException.java
/* * * 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.airavata.registry.api.exception.worker; import org.apache.airavata.registry.api.exception.RegistryException; public class WorkflowInstanceNodeAlreadyExistsException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public WorkflowInstanceNodeAlreadyExistsException(String instanceId, String nodeId) { super("The node "+nodeId+" for the workflow instance "+instanceId+" is already in the registry!!!"); } }
9,361
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/WorkflowInstanceNodeDoesNotExistsException.java
/* * * 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.airavata.registry.api.exception.worker; import org.apache.airavata.registry.api.exception.RegistryException; public class WorkflowInstanceNodeDoesNotExistsException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public WorkflowInstanceNodeDoesNotExistsException(String instanceId, String nodeId) { super("The node "+nodeId+" for the workflow instance "+instanceId+" is not present in the registry!!!"); } }
9,362
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/WorkflowInstanceDoesNotExistsException.java
/* * * 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.airavata.registry.api.exception.worker; import org.apache.airavata.registry.api.exception.RegistryException; public class WorkflowInstanceDoesNotExistsException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public WorkflowInstanceDoesNotExistsException(String instanceId) { super("The workflow instance "+instanceId+" is not present in the registry!!!"); } }
9,363
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/WorkflowInstanceAlreadyExistsException.java
/* * * 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.airavata.registry.api.exception.worker; import org.apache.airavata.registry.api.exception.RegistryException; public class WorkflowInstanceAlreadyExistsException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public WorkflowInstanceAlreadyExistsException(String instanceId) { super("The workflow instance "+instanceId+" is already added to the registry & workflowInstanceId should be unique for the system!!!"); } }
9,364
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/WorkspaceProjectAlreadyExistsException.java
/* * * 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.airavata.registry.api.exception.worker; import org.apache.airavata.registry.api.exception.RegistryException; public class WorkspaceProjectAlreadyExistsException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public WorkspaceProjectAlreadyExistsException(String projectName) { super("The workspace project "+projectName+" already exists!!!"); } }
9,365
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/WorkspaceProjectDoesNotExistsException.java
/* * * 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.airavata.registry.api.exception.worker; import org.apache.airavata.registry.api.exception.RegistryException; public class WorkspaceProjectDoesNotExistsException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public WorkspaceProjectDoesNotExistsException(String projectName) { super("The workspace project "+projectName+" does not exists!!!"); } }
9,366
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ApplicationJobAlreadyExistsException.java
/* * * 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.airavata.registry.api.exception.worker; import org.apache.airavata.registry.api.exception.RegistryException; public class ApplicationJobAlreadyExistsException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public ApplicationJobAlreadyExistsException(String jobId) { super("A Application job from the ID '"+jobId+"' is already present in the registry!!!"); } }
9,367
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentLazyLoadedException.java
/* * * 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.airavata.registry.api.exception.worker; import org.apache.airavata.common.exception.LazyLoadedDataException; public class ExperimentLazyLoadedException extends LazyLoadedDataException { private static final long serialVersionUID = -8006347245307495767L; public ExperimentLazyLoadedException(String experimentId) { super("The experiment "+experimentId+" is lazy loaded by the client!!!"); } }
9,368
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ApplicationJobDoesNotExistsException.java
/* * * 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.airavata.registry.api.exception.worker; import org.apache.airavata.registry.api.exception.RegistryException; public class ApplicationJobDoesNotExistsException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public ApplicationJobDoesNotExistsException(String jobId) { super("There is no Application job corresponding to ID '"+jobId+"' present in the registry!!!"); } }
9,369
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentAlreadyExistsException.java
/* * * 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.airavata.registry.api.exception.worker; import org.apache.airavata.registry.api.exception.RegistryException; public class ExperimentAlreadyExistsException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public ExperimentAlreadyExistsException(String experimentId) { super("The experiment "+experimentId+" already added to the registry!!!"); } }
9,370
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentDoesNotExistsException.java
/* * * 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.airavata.registry.api.exception.worker; import org.apache.airavata.registry.api.exception.RegistryException; public class ExperimentDoesNotExistsException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public ExperimentDoesNotExistsException(String experimentId) { super("The experiment "+experimentId+" is not present in the registry!!!"); } }
9,371
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/UserWorkflowDoesNotExistsException.java
/* * * 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.airavata.registry.api.exception.worker; import org.apache.airavata.registry.api.exception.RegistryException; public class UserWorkflowDoesNotExistsException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public UserWorkflowDoesNotExistsException(String workflowTemplateName) { super("The workflow "+workflowTemplateName+" does not exists in user space!!!"); } }
9,372
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/InvalidApplicationJobIDException.java
/* * * 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.airavata.registry.api.exception.worker; import org.apache.airavata.registry.api.exception.RegistryException; public class InvalidApplicationJobIDException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public InvalidApplicationJobIDException() { super("The Application job ID cannot be null or empty!!!"); } }
9,373
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/UserWorkflowAlreadyExistsException.java
/* * * 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.airavata.registry.api.exception.worker; import org.apache.airavata.registry.api.exception.RegistryException; public class UserWorkflowAlreadyExistsException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public UserWorkflowAlreadyExistsException(String workflowTemplateName) { super("The workflow "+workflowTemplateName+" already exists in user space!!!"); } }
9,374
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/InsufficientDataException.java
/* * * 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.airavata.registry.api.exception.gateway; import org.apache.airavata.registry.api.exception.RegistryException; public class InsufficientDataException extends RegistryException { private static final long serialVersionUID = 7706410845538952164L; public InsufficientDataException(String message) { super(message); } }
9,375
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/PublishedWorkflowAlreadyExistsException.java
/* * * 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.airavata.registry.api.exception.gateway; import org.apache.airavata.registry.api.exception.RegistryException; public class PublishedWorkflowAlreadyExistsException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public PublishedWorkflowAlreadyExistsException(String workflowTemplateName) { super("The workflow "+workflowTemplateName+" is already published!!!"); } }
9,376
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/PublishedWorkflowDoesNotExistsException.java
/* * * 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.airavata.registry.api.exception.gateway; import org.apache.airavata.registry.api.exception.RegistryException; public class PublishedWorkflowDoesNotExistsException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public PublishedWorkflowDoesNotExistsException(String workflowTemplateName) { super("There is no workflow named "+workflowTemplateName+" published!!!"); } }
9,377
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/DescriptorAlreadyExistsException.java
/* * * 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.airavata.registry.api.exception.gateway; import org.apache.airavata.registry.api.exception.RegistryException; public class DescriptorAlreadyExistsException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public DescriptorAlreadyExistsException(String descriptorName) { super("The Descriptor "+descriptorName+" already exists!!!"); } }
9,378
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/MalformedDescriptorException.java
/* * * 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.airavata.registry.api.exception.gateway; import org.apache.airavata.registry.api.exception.RegistryException; public class MalformedDescriptorException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public MalformedDescriptorException(String descriptorName, Throwable e) { super("Error in generating the descriptor for "+descriptorName+"!!!", e); } }
9,379
0
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception
Create_ds/airavata-sandbox/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/DescriptorDoesNotExistsException.java
/* * * 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.airavata.registry.api.exception.gateway; import org.apache.airavata.registry.api.exception.RegistryException; public class DescriptorDoesNotExistsException extends RegistryException { private static final long serialVersionUID = -8006347245307495767L; public DescriptorDoesNotExistsException(String descriptorName) { super("The Descriptor "+descriptorName+" does not exists!!!"); } }
9,380
0
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/UserWorkflowRegistryService.java
/* * * 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.airavata.registry.services; import org.apache.airavata.registry.api.exception.RegistryException; import org.apache.airavata.registry.api.exception.worker.UserWorkflowAlreadyExistsException; import org.apache.airavata.registry.api.exception.worker.UserWorkflowDoesNotExistsException; import javax.ws.rs.core.Response; public interface UserWorkflowRegistryService { public Response isWorkflowExists(String workflowName) throws RegistryException; public Response addWorkflow(String workflowName, String workflowGraphXml) throws UserWorkflowAlreadyExistsException, RegistryException; public Response updateWorkflow(String workflowName, String workflowGraphXml) throws UserWorkflowDoesNotExistsException, RegistryException; public Response getWorkflowGraphXML(String workflowName) throws UserWorkflowDoesNotExistsException, RegistryException; public Response getWorkflows() throws RegistryException; public Response getWorkflowMetadata(String workflowName) throws RegistryException; public Response removeWorkflow(String workflowName) throws UserWorkflowDoesNotExistsException, RegistryException; }
9,381
0
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/ProjectsRegistryService.java
/* * * 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.airavata.registry.services; import org.apache.airavata.registry.api.exception.RegistryException; import org.apache.airavata.registry.api.AiravataExperiment; import org.apache.airavata.registry.api.exception.worker.ExperimentDoesNotExistsException; import org.apache.airavata.registry.api.exception.worker.WorkspaceProjectAlreadyExistsException; import org.apache.airavata.registry.api.exception.worker.WorkspaceProjectDoesNotExistsException; import javax.ws.rs.core.Response; import java.util.Date; public interface ProjectsRegistryService { // ------------Project management public Response isWorkspaceProjectExists(String projectName) throws RegistryException; public Response isWorkspaceProjectExists(String projectName, String createIfNotExists) throws RegistryException; public Response addWorkspaceProject(String projectName) throws WorkspaceProjectAlreadyExistsException, RegistryException; public Response updateWorkspaceProject(String projectName) throws WorkspaceProjectDoesNotExistsException, RegistryException; public Response deleteWorkspaceProject(String projectName) throws WorkspaceProjectDoesNotExistsException, RegistryException; public Response getWorkspaceProject(String projectName) throws WorkspaceProjectDoesNotExistsException, RegistryException; public Response getWorkspaceProjects() throws RegistryException; // ------------Experiment management public Response addExperiment(String projectName, AiravataExperiment experiment) throws WorkspaceProjectDoesNotExistsException, ExperimentDoesNotExistsException, RegistryException; public Response removeExperiment(String experimentId) throws ExperimentDoesNotExistsException; public Response getExperiments() throws RegistryException; public Response getExperimentsByProject(String projectName) throws RegistryException; public Response getExperimentsByDate(Date from, Date to) throws RegistryException; public Response getExperimentsByProjectDate(String projectName, Date from, Date to) throws RegistryException; }
9,382
0
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/RegistryService.java
/* * * 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.airavata.registry.services; import java.io.IOException; import java.net.InetAddress; import java.sql.Connection; import java.sql.SQLException; import org.apache.airavata.persistance.registry.jpa.ResourceType; import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource; import org.apache.airavata.persistance.registry.jpa.resources.UserResource; import org.apache.airavata.persistance.registry.jpa.resources.Utils; import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource; import org.apache.airavata.registry.api.exception.RegistrySettingsException; import org.apache.airavata.registry.api.util.RegistrySettings; import org.apache.airavata.registry.services.utils.DatabaseCreator; import org.apache.airavata.registry.services.utils.JdbcStorage; import org.apache.axis2.context.ConfigurationContext; import org.apache.axis2.description.AxisService; import org.apache.axis2.engine.ServiceLifeCycle; import org.apache.derby.drda.NetworkServerControl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class RegistryService implements ServiceLifeCycle { private static final Logger logger = LoggerFactory.getLogger(RegistryService.class); public static final String PERSISTANT_DATA = "Configuration"; public static final String REGISTRY_DEFAULT_GATEWAY_ID = "default.registry.gateway"; public static final String REGISTRY_DEFAULT_USER = "default.registry.user"; public static final String REGISTRY_DEFAULT_USER_PASSWORD = "default.registry.password"; public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer"; public static final String REGISTRY_JDBC_DRIVER = "registry.jdbc.driver"; public static final String REGISTRY_JDBC_URL = "registry.jdbc.url"; public static final String REGISTRY_JDBC_USER = "registry.jdbc.user"; public static final String REGISTRY_JDBC_PASSWORD = "registry.jdbc.password"; private JdbcStorage db; private NetworkServerControl server; private static volatile boolean serverStarted = false; @Override public void startUp(ConfigurationContext configurationContext, AxisService axisService) { //todo have to read these properties from some configuration initializeDB(); serverStarted = true; } private void startDerbyInServerMode() { try { System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true"); server = new NetworkServerControl(InetAddress.getByName("0.0.0.0"), Utils.getPort(), Utils.getJDBCUser(), Utils.getJDBCPassword()); java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true); server.start(consoleWriter); } catch (IOException e) { logger.error("Unable to start Apache derby in the server mode! Check whether " + "specified port is available"); } catch (Exception e) { logger.error("Unable to start Apache derby in the server mode! Check whether " + "specified port is available"); } } private void stopDerbyServer() { try { server.shutdown(); serverStarted = false; } catch (Exception e) { e.printStackTrace(); } } private void initializeDB() { System.setProperty("registry.initialize.state", "0"); String jdbcUrl = null; String jdbcDriver = null; try{ jdbcDriver = RegistrySettings.getSetting(REGISTRY_JDBC_DRIVER); jdbcUrl = RegistrySettings.getSetting(REGISTRY_JDBC_URL); String jdbcUser = RegistrySettings.getSetting(REGISTRY_JDBC_USER); String jdbcPassword = RegistrySettings.getSetting(REGISTRY_JDBC_PASSWORD); jdbcUrl = jdbcUrl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword; } catch (RegistrySettingsException e) { logger.error("Unable to read properties" , e); } if (Utils.getDBType().equals("derby") && Utils.isDerbyStartEnabled()) { startDerbyInServerMode(); } db = new JdbcStorage(10, 50, jdbcUrl, jdbcDriver, true); Connection conn = null; try { conn = db.connect(); if (!DatabaseCreator.isDatabaseStructureCreated(PERSISTANT_DATA, conn)) { DatabaseCreator.createRegistryDatabase(conn); logger.info("New Database created for Registry"); } else { logger.info("Database already created for Registry!"); } try{ GatewayResource gatewayResource = new GatewayResource(); gatewayResource.setGatewayName(RegistrySettings.getSetting(REGISTRY_DEFAULT_GATEWAY_ID)); gatewayResource.setOwner(RegistrySettings.getSetting(REGISTRY_DEFAULT_GATEWAY_ID)); gatewayResource.save(); UserResource userResource = (UserResource) gatewayResource.create(ResourceType.USER); userResource.setUserName(RegistrySettings.getSetting(REGISTRY_DEFAULT_USER)); userResource.setPassword(RegistrySettings.getSetting(REGISTRY_DEFAULT_USER_PASSWORD)); userResource.save(); WorkerResource workerResource = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER); workerResource.setUser(userResource.getUserName()); workerResource.save(); } catch (RegistrySettingsException e) { logger.error("Unable to read properties", e); } } catch (Exception e) { logger.error(e.getMessage(), e); throw new RuntimeException("Database failure"); } finally { db.closeConnection(conn); try { if (!conn.getAutoCommit()) { conn.commit(); } conn.close(); } catch (SQLException e) { logger.error(e.getMessage(), e); e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } } System.setProperty("registry.initialize.state", "1"); } public boolean isRegistryServiceStarted() { return serverStarted; } @Override public void shutDown(ConfigurationContext configurationContext, AxisService axisService) { } }
9,383
0
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/ProvenanceRegistryService.java
/* * * 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.airavata.registry.services; import org.apache.airavata.registry.api.exception.RegistryException; import org.apache.airavata.registry.api.workflow.NodeExecutionStatus; import org.apache.airavata.registry.api.workflow.WorkflowNodeGramData; import javax.ws.rs.core.Response; import java.util.Date; public interface ProvenanceRegistryService { /*------------------------------------------- Experiment data ---------------------------------------------*/ /** * Returns true if the experiment exists * * @param experimentId * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response isExperimentExists(String experimentId) throws RegistryException; public Response isExperimentExistsThenCreate(String experimentId, boolean createIfNotPresent) throws RegistryException; /** * Save the username of the user who runs this experiment * * @param experimentId * @param user * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response updateExperimentExecutionUser(String experimentId, String user) throws RegistryException; /** * Retrieve the user who is runing the experiment * * @param experimentId * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response getExperimentExecutionUser(String experimentId) throws RegistryException; /** * Get the name of the workflow intance * * @param experimentId * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response getExperimentName(String experimentId) throws RegistryException; /** * Save a name for this workflow execution * * @param experimentId * @param experimentName * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response updateExperimentName(String experimentId, String experimentName) throws RegistryException; /** * Return the metadata information saved for the experiment * * @param experimentId * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response getExperimentMetadata(String experimentId) throws RegistryException; /** * Save the metadata for the experiment * * @param experimentId * @param metadata * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response updateExperimentMetadata(String experimentId, String metadata) throws RegistryException; /** * Return the template name of the workflow that this intance was created from * * @param workflowInstanceId * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response getWorkflowExecutionTemplateName(String workflowInstanceId) throws RegistryException; /** * Save the template name of the workflow that this intance was created from * * @param workflowInstanceId * @param templateName * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response setWorkflowInstanceTemplateName(String workflowInstanceId, String templateName) throws RegistryException; public Response getExperimentWorkflowInstances(String experimentId) throws RegistryException; /*-------------------------------------- Experiment Workflow instance node data ----------------------------------------*/ public Response isWorkflowInstanceExists(String instanceId) throws RegistryException; public Response isWorkflowInstanceExistsThenCreate(String instanceId, boolean createIfNotPresent) throws RegistryException; /** * Save a status for this workflow execution with the current time at the moment * * @param instanceId * @param executionStatus * - contains the status * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response updateWorkflowInstanceStatusByInstance(String instanceId, String executionStatus) throws RegistryException; /** * Save a status for this workflow execution * * @param experimentID * @param workflowInstanceID * @param executionStatus * @param statusUpdateTime * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response updateWorkflowInstanceStatusByExperiment(String experimentID, String workflowInstanceID, String executionStatus, Date statusUpdateTime) throws RegistryException; /** * Return the status of the execution * * @param instanceId * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response getWorkflowInstanceStatus(String instanceId) throws RegistryException; /** * Save the input data of a node in the workflow instance of an experiment * * @param experimentID * @param nodeID * @param workflowInstanceID * @param data * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response updateWorkflowNodeInput(String experimentID, String nodeID, String workflowInstanceID, String data) throws RegistryException; /** * Save the output data of a node in the workflow instance of an experiment * * @param experimentID * @param nodeID * @param workflowInstanceID * @param data * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response updateWorkflowNodeOutput(String experimentID, String nodeID, String workflowInstanceID, String data) throws RegistryException; /** * Return a list of data passed as input for service node which regex matched nodeId, workflow template id & * experiment id * * @param experimentIdRegEx * @param workflowNameRegEx * - this is the workflowName or workflow template Id of an experiment * @param nodeNameRegEx * - nodeId * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response searchWorkflowInstanceNodeInput(String experimentIdRegEx, String workflowNameRegEx, String nodeNameRegEx) throws RegistryException; /** * Return a list of data returned as output from service node which regex matched nodeId, workflow template id & * experiment id * * @param experimentIdRegEx * @param workflowNameRegEx * - this is the workflowName or workflow template Id of an experiment * @param nodeNameRegEx * - nodeId * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response searchWorkflowInstanceNodeOutput(String experimentIdRegEx, String workflowNameRegEx, String nodeNameRegEx) throws RegistryException; public Response getWorkflowInstanceNodeInput(String workflowInstanceId, String nodeType) throws RegistryException; public Response getWorkflowInstanceNodeOutput(String workflowInstanceId, String nodeType) throws RegistryException; /*--------------------------------------- Retrieving Experiment ------------------------------------------*/ /** * Return workflow execution object fully populated with data currently avaialble for that experiment * * @param experimentId * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response getExperiment(String experimentId) throws RegistryException; /** * Return experiment ids of experiments launched by the given user * * @param user * - a regex user id * @return - experiment id list * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response getExperimentIdByUser(String user) throws RegistryException; /** * Return experiments launched by the given user * * @param user * @return experiment object list each populated by current data of that experiment * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response getExperimentByUser(String user) throws RegistryException; /** * Return the pageNo set of experiments launched by the given user if grouped in to pages of size pageSize * * @param user * @param pageSize * @param pageNo * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response getExperimentByUser(String user, int pageSize, int pageNo) throws RegistryException; /** * This will update the workflowStatus for given experimentID,workflowInstanceID combination. * * @param workflowStatusNode * @return * @throws org.apache.airavata.registry.api.exception.RegistryException */ public Response updateWorkflowNodeStatus(NodeExecutionStatus workflowStatusNode) throws RegistryException; public Response updateWorkflowNodeStatus(String workflowInstanceId, String nodeId, String executionStatus) throws RegistryException; public Response updateWorkflowNodeStatus(String workflowInstanceId, String executionStatus) throws RegistryException; public Response getWorkflowNodeStatus(String workflowInstanceId, String nodeId) throws RegistryException; public Response getWorkflowNodeStartTime(String workflowInstanceId, String nodeId) throws RegistryException; public Response getWorkflowStartTime(String workflowInstanceId) throws RegistryException; /** * This will store the gram specific data in to repository, this can be called before submitting the workflow in to * Grid * * @param workflowNodeGramData * @return */ public Response updateWorkflowNodeGramData(WorkflowNodeGramData workflowNodeGramData) throws RegistryException; public Response getWorkflowInstanceData(String workflowInstanceId) throws RegistryException; public Response isWorkflowInstanceNodePresent(String workflowInstanceId, String nodeId) throws RegistryException; public Response isWorkflowInstanceNodePresent(String workflowInstanceId, String nodeId, boolean createIfNotPresent) throws RegistryException; public Response getWorkflowInstanceNodeData(String workflowInstanceId, String nodeId) throws RegistryException; public Response addWorkflowInstance(String experimentId, String workflowInstanceId, String templateName) throws RegistryException; public Response updateWorkflowNodeType(String workflowInstanceId, String nodeId, String nodeType) throws RegistryException; public Response addWorkflowInstanceNode(String workflowInstance, String nodeId) throws RegistryException; }
9,384
0
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/DescriptorRegistryService.java
/* * * 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.airavata.registry.services; import org.apache.airavata.registry.api.exception.RegistryException; import org.apache.airavata.registry.api.exception.gateway.DescriptorAlreadyExistsException; import org.apache.airavata.registry.api.exception.gateway.DescriptorDoesNotExistsException; import org.apache.airavata.registry.api.exception.gateway.MalformedDescriptorException; import javax.ws.rs.core.Response; public interface DescriptorRegistryService { /* * Note Name changes of the descriptors should not be allowed */ // ---------Host Descriptor data------------ public Response isHostDescriptorExists(String descriptorName) throws RegistryException; public Response addHostDescriptor(String descriptor) throws DescriptorAlreadyExistsException, RegistryException; public Response updateHostDescriptor(String descriptor) throws DescriptorDoesNotExistsException, RegistryException; public Response getHostDescriptor(String hostName) throws DescriptorDoesNotExistsException, MalformedDescriptorException, RegistryException; public Response removeHostDescriptor(String hostName) throws DescriptorDoesNotExistsException, RegistryException; public Response getHostDescriptors() throws MalformedDescriptorException, RegistryException; public Response getHostDescriptorMetadata(String hostName) throws DescriptorDoesNotExistsException, RegistryException; // ---------Service Descriptor data------------ public Response isServiceDescriptorExists(String descriptorName) throws RegistryException; public Response addServiceDescriptor(String descriptor) throws DescriptorAlreadyExistsException, RegistryException; public Response updateServiceDescriptor(String descriptor) throws DescriptorDoesNotExistsException, RegistryException; public Response getServiceDescriptor(String serviceName) throws DescriptorDoesNotExistsException, MalformedDescriptorException, RegistryException; public Response removeServiceDescriptor(String serviceName) throws DescriptorDoesNotExistsException, RegistryException; public Response getServiceDescriptors() throws MalformedDescriptorException, RegistryException; public Response getServiceDescriptorMetadata(String serviceName) throws DescriptorDoesNotExistsException, RegistryException; // ---------Application Descriptor data------------ public Response isApplicationDescriptorExists(String serviceName, String hostName, String descriptorName) throws RegistryException; public Response addApplicationDescriptor(String serviceDescription, String hostDescriptor, String descriptor) throws DescriptorAlreadyExistsException, RegistryException; public Response addApplicationDesc(String serviceName, String hostName, String descriptor) throws DescriptorAlreadyExistsException, RegistryException; public Response udpateApplicationDescriptorByDescriptors(String serviceDescription, String hostDescriptor, String descriptor) throws DescriptorDoesNotExistsException, RegistryException; public Response updateApplicationDescriptor(String serviceName, String hostName, String descriptor) throws DescriptorDoesNotExistsException, RegistryException; public Response getApplicationDescriptor(String serviceName, String hostname, String applicationName) throws DescriptorDoesNotExistsException, MalformedDescriptorException, RegistryException; public Response getApplicationDescriptors(String serviceName, String hostname) throws MalformedDescriptorException, RegistryException; public Response getApplicationDescriptors(String serviceName) throws MalformedDescriptorException, RegistryException; public Response getApplicationDescriptors() throws MalformedDescriptorException, RegistryException; public Response removeApplicationDescriptor(String serviceName, String hostName, String applicationName) throws DescriptorDoesNotExistsException, RegistryException; public Response getApplicationDescriptorMetadata(String serviceName, String hostName, String applicationName) throws DescriptorDoesNotExistsException, RegistryException; }
9,385
0
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/PublishedWorkflowRegistryService.java
/* * * 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.airavata.registry.services; import org.apache.airavata.registry.api.exception.RegistryException; import org.apache.airavata.registry.api.exception.gateway.PublishedWorkflowAlreadyExistsException; import org.apache.airavata.registry.api.exception.gateway.PublishedWorkflowDoesNotExistsException; import org.apache.airavata.registry.api.exception.worker.UserWorkflowDoesNotExistsException; import javax.ws.rs.core.Response; public interface PublishedWorkflowRegistryService { public Response isPublishedWorkflowExists(String workflowName) throws RegistryException; public Response publishWorkflow(String workflowName, String publishWorkflowName) throws PublishedWorkflowAlreadyExistsException, UserWorkflowDoesNotExistsException, RegistryException; public Response publishWorkflow(String workflowName) throws PublishedWorkflowAlreadyExistsException, UserWorkflowDoesNotExistsException, RegistryException; public Response getPublishedWorkflowGraphXML(String workflowName) throws PublishedWorkflowDoesNotExistsException, RegistryException; public Response getPublishedWorkflowNames() throws RegistryException; public Response getPublishedWorkflows() throws RegistryException; public Response getPublishedWorkflowMetadata(String workflowName) throws RegistryException; public Response removePublishedWorkflow(String workflowName) throws PublishedWorkflowDoesNotExistsException, RegistryException; }
9,386
0
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/ConfigurationRegistryService.java
/* * * 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.airavata.registry.services; import javax.ws.rs.core.Response; import java.net.URI; import java.util.Date; public interface ConfigurationRegistryService { public Response getConfiguration(String key); public Response getConfigurationList(String key); public Response setConfiguration(String key, String value, Date expire); public Response addConfiguration(String key, String value, Date expire); public Response removeAllConfiguration(String key); public Response removeConfiguration(String key, String value); public Response getGFacURIs(); public Response getWorkflowInterpreterURIs(); public Response getEventingServiceURI(); public Response getMessageBoxURI(); public Response addGFacURI(URI uri); public Response addWorkflowInterpreterURI(URI uri); public Response setEventingURI(URI uri); public Response setMessageBoxURI(URI uri); public Response addGFacURIByDate(URI uri, Date expire); public Response addWorkflowInterpreterURI(URI uri, Date expire); public Response setEventingURIByDate(URI uri, Date expire); public Response setMessageBoxURIByDate(URI uri, Date expire); public Response removeGFacURI(URI uri); public Response removeAllGFacURI(); public Response removeWorkflowInterpreterURI(URI uri); public Response removeAllWorkflowInterpreterURI(); public Response unsetEventingURI(); public Response unsetMessageBoxURI(); }
9,387
0
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/utils/JdbcStorage.java
/* * * 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.airavata.registry.services.utils; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class JdbcStorage { private static Logger log = LoggerFactory.getLogger(JdbcStorage.class); private ConnectionPool connectionPool; public JdbcStorage(String jdbcUrl, String jdbcDriver) { // default init connection and max connection this(3, 50, jdbcUrl, jdbcDriver, true); } public JdbcStorage(int initCon, int maxCon, String url, String driver, boolean enableTransactions) { try { if (enableTransactions) { connectionPool = new ConnectionPool(driver, url, initCon, maxCon, true, false, Connection.TRANSACTION_SERIALIZABLE); } else { connectionPool = new ConnectionPool(driver, url, initCon, maxCon, true); } } catch (Exception e) { throw new RuntimeException("Failed to create database connection pool.", e); } } /** * Check if this connection pool is auto commit or not * * @return */ public boolean isAutoCommit() { return connectionPool.isAutoCommit(); } public void commit(Connection conn) { try { if (conn != null && !conn.getAutoCommit()) { conn.commit(); } } catch (SQLException sqle) { log.error("Cannot commit data", sqle); } } public void commitAndFree(Connection conn) { commit(conn); closeConnection(conn); } public void rollback(Connection conn) { try { if (conn != null && !conn.getAutoCommit()) { conn.rollback(); } } catch (SQLException sqle) { log.error("Cannot Rollback data", sqle); } } public void rollbackAndFree(Connection conn) { rollback(conn); closeConnection(conn); } public Connection connect() { Connection conn = null; try { conn = connectionPool.getConnection(); } catch (SQLException e) { e.printStackTrace(); log.error(e.getMessage(), e); } return conn; } /** * This method is provided so that you can have better control over the statement. For example: You can use * stmt.setString to convert quotation mark automatically in an UPDATE statement * * NOTE: Statement is closed after execution */ public int executeUpdateAndClose(PreparedStatement stmt) throws SQLException { int rows = 0; try { rows = stmt.executeUpdate(); if (rows == 0) { log.info("Problem: 0 rows affected by insert/update/delete statement."); } } finally { stmt.close(); } return rows; } public int countRow(String tableName, String columnName) throws SQLException { String query = new String("SELECT COUNT(" + columnName + ") FROM " + tableName); int count = -1; Connection conn = null; PreparedStatement stmt = null; try { conn = connectionPool.getConnection(); stmt = conn.prepareStatement(query); ResultSet rs = stmt.executeQuery(); rs.next(); count = rs.getInt(1); commit(conn); } catch (SQLException sql) { rollback(conn); throw sql; } finally { try { if (stmt != null && !stmt.isClosed()) { stmt.close(); } } finally { closeConnection(conn); } } return count; } public void quietlyClose(Connection conn, Statement... stmts) { if (stmts != null) { for (Statement stmt : stmts) { try { if (stmt != null && !stmt.isClosed()) { stmt.close(); } } catch (SQLException sql) { log.error(sql.getMessage(), sql); } } } closeConnection(conn); } public void closeConnection(Connection conn) { if (conn != null) { connectionPool.free(conn); } } public void closeAllConnections() { if (connectionPool != null) connectionPool.dispose(); } public void shutdown() { connectionPool.shutdown(); } }
9,388
0
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/utils/ConnectionPool.java
/* * * 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.airavata.registry.services.utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.sql.DataSource; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.HashMap; import java.util.Iterator; import java.util.Stack; import java.util.concurrent.Semaphore; /** * A class for preallocating, recycling, and managing JDBC connections. */ public class ConnectionPool { private static final Logger logger = LoggerFactory.getLogger(ConnectionPool.class); private long MAX_IDLE_TIME = 5 * 60 * 1000; // 5 minutes private String driver; private String url; private String username; private String password; private String jdbcUrl; private int maxConnections; private boolean autoCommit = true; private boolean waitIfBusy; private Semaphore needConnection = new Semaphore(0); private boolean stop; private Stack<Connection> availableConnections; private Stack<Connection> busyConnections; private HashMap<Connection, Long> lastAccessTimeRecord = new HashMap<Connection, Long>(); private String urlType = ""; private DataSource datasource; private int transactionIsolation = Connection.TRANSACTION_NONE; private Thread clenupThread; private Thread producerThread; public ConnectionPool(String driver, String url, String username, String password, int initialConnections, int maxConnections, boolean waitIfBusy) throws SQLException { this.driver = driver; this.url = url; this.username = username; this.password = password; this.urlType = "speratedURL"; initialize(initialConnections, maxConnections, waitIfBusy); } public ConnectionPool(String driver, String jdbcUrl, int initialConnections, int maxConnections, boolean waitIfBusy, boolean autoCommit, int transactionIsolation) throws SQLException { this.driver = driver; this.jdbcUrl = jdbcUrl; this.urlType = "simpleURL"; this.autoCommit = autoCommit; this.transactionIsolation = transactionIsolation; initialize(initialConnections, maxConnections, waitIfBusy); } public ConnectionPool(String driver, String jdbcUrl, int initialConnections, int maxConnections, boolean waitIfBusy) throws SQLException { this.driver = driver; this.jdbcUrl = jdbcUrl; this.urlType = "simpleURL"; initialize(initialConnections, maxConnections, waitIfBusy); } public ConnectionPool(DataSource dataSource, int initialConnections, int maxConnections, boolean waitIfBusy) throws SQLException { this.urlType = "dataSource"; this.datasource = dataSource; initialize(initialConnections, maxConnections, waitIfBusy); } /** * Check if this connection pool is auto commit or not * * @return */ public boolean isAutoCommit() { return this.autoCommit; } private void initialize(int initialConnections, int maxConnections, boolean waitIfBusy) throws SQLException { this.maxConnections = maxConnections; this.waitIfBusy = waitIfBusy; int sizeOfConnections = (initialConnections > maxConnections) ? maxConnections : initialConnections; availableConnections = new Stack<Connection>(); busyConnections = new Stack<Connection>(); for (int i = 0; i < sizeOfConnections; i++) { Connection con = makeNewConnection(); setTimeStamp(con); availableConnections.push(con); } producerThread = new Thread(new FillUpThread()); producerThread.start(); clenupThread = new Thread(new CleanUpThread()); clenupThread.start(); } public synchronized Connection getConnection() throws SQLException { if (!availableConnections.isEmpty()) { Connection existingConnection = availableConnections.pop(); // If connection on available list is closed (e.g., // it timed out), then remove it from available list // and race for a connection again. if (existingConnection.isClosed()) { lastAccessTimeRecord.remove(existingConnection); // notifyAll for fairness notifyAll(); } else { busyConnections.push(existingConnection); setTimeStamp(existingConnection); return existingConnection; } } else if (!waitIfBusy && busyConnections.size() >= maxConnections) { // You reached maxConnections limit and waitIfBusy flag is false. // Throw SQLException in such a case. throw new SQLException("Connection limit reached"); } else { if (busyConnections.size() < maxConnections) { // available connection is empty, but total number of connection // doesn't reach maxConnection. Request for more connection needConnection.release(); } try { // wait for free connection wait(); } catch (InterruptedException ie) { } } // always race for connection forever return getConnection(); } // This explicitly makes a new connection. Called in // the foreground when initializing the ConnectionPool, // and called in the background when running. private Connection makeNewConnection() throws SQLException { try { // Load database driver if not already loaded Class.forName(driver); Connection connection; // Establish network connection to database if (urlType.equals("speratedURL")) { connection = DriverManager.getConnection(url, username, password); } else if (urlType.equals("simpleURL")) { connection = DriverManager.getConnection(jdbcUrl); } else { // if(urlType.equals("dataSource")){ connection = datasource.getConnection(); } connection.setTransactionIsolation(this.transactionIsolation); connection.setAutoCommit(this.autoCommit); return connection; } catch (ClassNotFoundException cnfe) { // Simplify try/catch blocks of people using this by // throwing only one exception type. throw new SQLException("Can't find class for driver: " + driver); } } private synchronized void fillUpConnection(Connection conn) { setTimeStamp(conn); availableConnections.push(conn); // notify all since new connection is created notifyAll(); } private void setTimeStamp(Connection connection) { lastAccessTimeRecord.put(connection, System.currentTimeMillis()); } // The database connection cannot be left idle for too long, otherwise TCP // connection will be broken. /** * From http://forums.mysql.com/read.php?39,28450,57460#msg-57460 Okay, then it looks like wait_timeout on the * server is killing your connection (it is set to 8 hours of idle time by default). Either set that value higher on * your server, or configure your connection pool to not hold connections idle that long (I prefer the latter). Most * folks I know that run MySQL with a connection pool in high-load production environments only let connections sit * idle for a matter of minutes, since it only takes a few milliseconds to open a connection, and the longer one * sits idle the more chance it will go "bad" because of a network hiccup or the MySQL server being restarted. * * @throws SQLException */ private boolean isConnectionStale(Connection connection) { long currentTime = System.currentTimeMillis(); long lastAccess = lastAccessTimeRecord.get(connection); if (currentTime - lastAccess > MAX_IDLE_TIME) { return true; } else return false; } private synchronized void closeStaleConnections() { // close idle connections Iterator<Connection> iter = availableConnections.iterator(); while (iter.hasNext()) { Connection existingConnection = iter.next(); if (isConnectionStale(existingConnection)) { try { existingConnection.close(); iter.remove(); } catch (SQLException sql) { logger.error(sql.getMessage(), sql); } } } // close busy connections that have been checked out for too long. // This should not happen since this means program has bug for not // releasing connections . iter = busyConnections.iterator(); while (iter.hasNext()) { Connection busyConnection = iter.next(); if (isConnectionStale(busyConnection)) { try { busyConnection.close(); iter.remove(); logger.warn("****Connection has checked out too long. Forced release. Check the program for calling release connection [free(Connection) method]"); } catch (SQLException sql) { logger.error(sql.getMessage(), sql); } } } } public synchronized void free(Connection connection) { busyConnections.removeElement(connection); availableConnections.addElement(connection); // Wake up threads that are waiting for a connection notifyAll(); } /** * Close all the connections. Use with caution: be sure no connections are in use before calling. Note that you are * not <I>required</I> to call this when done with a ConnectionPool, since connections are guaranteed to be closed * when garbage collected. But this method gives more control regarding when the connections are closed. */ public synchronized void dispose() { logger.info("Connection Pool Shutting down"); // stop clean up thread this.stop = true; this.clenupThread.interrupt(); // stop producer up thread this.producerThread.interrupt(); // close all connection closeConnections(availableConnections); availableConnections = new Stack<Connection>(); closeConnections(busyConnections); busyConnections = new Stack<Connection>(); lastAccessTimeRecord.clear(); logger.info("All connection is closed"); try { this.clenupThread.join(); this.producerThread.join(); } catch (Exception e) { logger.error("Cannot shutdown cleanup thread", e); } logger.info("Connection Pool Shutdown"); } private void closeConnections(Stack<Connection> connections) { while (!connections.isEmpty()) { Connection connection = connections.pop(); try { if (!connection.isClosed()) { connection.close(); } } catch (SQLException sqle) { // Ignore errors; garbage collect anyhow logger.warn(sqle.getMessage()); } } } public synchronized String toString() { String info = "ConnectionPool(" + url + "," + username + ")" + ", available=" + availableConnections.size() + ", busy=" + busyConnections.size() + ", max=" + maxConnections; return (info); } class CleanUpThread implements Runnable { public void run() { while (!stop) { try { Thread.sleep(MAX_IDLE_TIME); closeStaleConnections(); } catch (InterruptedException e) { logger.info("Clean up thread is interrupted to close"); } } } } class FillUpThread implements Runnable { public void run() { while (!stop) { try { // block until get needConnection.acquire(); Connection conn = makeNewConnection(); fillUpConnection(conn); } catch (SQLException e) { // cannot create connection (increase semaphore value back) needConnection.release(); logger.error(e.getMessage(), e); } catch (InterruptedException e) { logger.info("Fill up thread is interrupted to close"); break; } } } } public void shutdown(){ for (Connection c : availableConnections) { try { c.close(); } catch (SQLException e) { } } for (Connection c : busyConnections) { try { c.close(); } catch (SQLException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } } } }
9,389
0
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services
Create_ds/airavata-sandbox/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/utils/DatabaseCreator.java
/* * * 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.airavata.registry.services.utils; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.SQLWarning; import java.sql.Statement; import java.util.StringTokenizer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * This class creates the database tables required for messagebox and messagebroker with default configuration this * class creates embedded derby database in local file system. User can specify required database in appropriate * properties files. */ public class DatabaseCreator { public enum DatabaseType { derby("(?i).*derby.*"), mysql("(?i).*mysql.*"), other(""); private String pattern; private DatabaseType(String matchingPattern) { this.pattern = matchingPattern; } public String getMatchingPattern() { return this.pattern; } } private static DatabaseType[] supportedDatabase = new DatabaseType[] { DatabaseType.derby, DatabaseType.mysql }; private static Logger log = LoggerFactory.getLogger(DatabaseCreator.class); private static final String delimiter = ";"; /** * Creates database * * @throws Exception */ public static void createRegistryDatabase(Connection conn) throws Exception { createDatabase("data", conn); } /** * Checks whether database tables are created by using select * on given table name * * @param tableName * Table which should be existed * @return <code>true</core> if checkSQL is success, else <code>false</code> . */ public static boolean isDatabaseStructureCreated(String tableName, Connection conn) { try { log.debug("Running a query to test the database tables existence."); // check whether the tables are already created with a query Statement statement = null; try { statement = conn.createStatement(); ResultSet rs = statement.executeQuery("select * from " + tableName); if (rs != null) { rs.close(); } } finally { try { if (statement != null) { statement.close(); } } catch (SQLException e) { return false; } } } catch (SQLException e) { return false; } return true; } /** * executes given sql * * @param sql * @throws Exception */ private static void executeSQL(String sql, Connection conn) throws Exception { // Check and ignore empty statements if ("".equals(sql.trim())) { return; } Statement statement = null; try { log.debug("SQL : " + sql); boolean ret; int updateCount = 0, updateCountTotal = 0; statement = conn.createStatement(); ret = statement.execute(sql); updateCount = statement.getUpdateCount(); do { if (!ret) { if (updateCount != -1) { updateCountTotal += updateCount; } } ret = statement.getMoreResults(); if (ret) { updateCount = statement.getUpdateCount(); } } while (ret); log.debug(sql + " : " + updateCountTotal + " rows affected"); SQLWarning warning = conn.getWarnings(); while (warning != null) { log.info(warning + " sql warning"); warning = warning.getNextWarning(); } conn.clearWarnings(); } catch (SQLException e) { if (e.getSQLState().equals("X0Y32")) { // eliminating the table already exception for the derby // database log.info("Table Already Exists", e); } else { throw new Exception("Error occurred while executing : " + sql, e); } } finally { if (statement != null) { try { statement.close(); } catch (SQLException e) { log.error("Error occurred while closing result set.", e); } } } } /** * computes relatational database type using database name * * @return DatabaseType * @throws Exception * */ public static DatabaseType getDatabaseType(Connection conn) throws Exception { try { if (conn != null && (!conn.isClosed())) { DatabaseMetaData metaData = conn.getMetaData(); String databaseProductName = metaData.getDatabaseProductName(); return checkType(databaseProductName); } } catch (SQLException e) { String msg = "Failed to create Airavatadatabase." + e.getMessage(); log.error(msg, e); throw new Exception(msg, e); } return DatabaseType.other; } /** * Overloaded method with String input * * @return DatabaseType * @throws Exception * */ public static DatabaseType getDatabaseType(String dbUrl) throws Exception { return checkType(dbUrl); } private static DatabaseType checkType(String text) throws Exception { try { if (text != null) { for (DatabaseType type : supportedDatabase) { if (text.matches(type.getMatchingPattern())) return type; } } String msg = "Unsupported database: " + text + ". Database will not be created automatically by the Airavata. " + "Please create the database using appropriate database scripts for " + "the database."; throw new Exception(msg); } catch (SQLException e) { String msg = "Failed to create Airavatadatabase." + e.getMessage(); log.error(msg, e); throw new Exception(msg, e); } } /** * Get scripts location which is prefix + "-" + databaseType + ".sql" * * @param prefix * @param databaseType * @return script location */ private static String getScriptLocation(String prefix, DatabaseType databaseType) { String scriptName = prefix + "-" + databaseType + ".sql"; log.debug("Loading database script from :" + scriptName); return "database_scripts" + File.separator + scriptName; } private static void createDatabase(String prefix, Connection conn) throws Exception { Statement statement = null; try { conn.setAutoCommit(false); statement = conn.createStatement(); executeSQLScript(getScriptLocation(prefix, DatabaseCreator.getDatabaseType(conn)), conn); conn.commit(); log.debug("Tables are created successfully."); } catch (SQLException e) { String msg = "Failed to create database tables for Airavata resource store. " + e.getMessage(); log.error(msg, e); conn.rollback(); throw new Exception(msg, e); } finally { conn.setAutoCommit(true); try { if (statement != null) { statement.close(); } } catch (SQLException e) { log.error("Failed to close statement.", e); } } } private static void executeSQLScript(String dbscriptName, Connection conn) throws Exception { StringBuffer sql = new StringBuffer(); BufferedReader reader = null; try { InputStream is = DatabaseCreator.class.getClassLoader().getResourceAsStream(dbscriptName); reader = new BufferedReader(new InputStreamReader(is)); String line; while ((line = reader.readLine()) != null) { line = line.trim(); if (line.startsWith("//")) { continue; } if (line.startsWith("--")) { continue; } StringTokenizer st = new StringTokenizer(line); if (st.hasMoreTokens()) { String token = st.nextToken(); if ("REM".equalsIgnoreCase(token)) { continue; } } sql.append(" ").append(line); // SQL defines "--" as a comment to EOL // and in Oracle it may contain a hint // so we cannot just remove it, instead we must end it if (line.indexOf("--") >= 0) { sql.append("\n"); } if ((checkStringBufferEndsWith(sql, delimiter))) { executeSQL(sql.substring(0, sql.length() - delimiter.length()), conn); sql.replace(0, sql.length(), ""); } } // Catch any statements not followed by ; if (sql.length() > 0) { executeSQL(sql.toString(), conn); } } catch (IOException e) { log.error("Error occurred while executing SQL script for creating Airavata database", e); throw new Exception("Error occurred while executing SQL script for creating Airavata database", e); } finally { if (reader != null) { reader.close(); } } } /** * Checks that a string buffer ends up with a given string. It may sound trivial with the existing JDK API but the * various implementation among JDKs can make those methods extremely resource intensive and perform poorly due to * massive memory allocation and copying. See * * @param buffer * the buffer to perform the check on * @param suffix * the suffix * @return <code>true</code> if the character sequence represented by the argument is a suffix of the character * sequence represented by the StringBuffer object; <code>false</code> otherwise. Note that the result will * be <code>true</code> if the argument is the empty string. */ public static boolean checkStringBufferEndsWith(StringBuffer buffer, String suffix) { if (suffix.length() > buffer.length()) { return false; } // this loop is done on purpose to avoid memory allocation performance // problems on various JDKs // StringBuffer.lastIndexOf() was introduced in jdk 1.4 and // implementation is ok though does allocation/copying // StringBuffer.toString().endsWith() does massive memory // allocation/copying on JDK 1.5 // See http://issues.apache.org/bugzilla/show_bug.cgi?id=37169 int endIndex = suffix.length() - 1; int bufferIndex = buffer.length() - 1; while (endIndex >= 0) { if (buffer.charAt(bufferIndex) != suffix.charAt(endIndex)) { return false; } bufferIndex--; endIndex--; } return true; } }
9,390
0
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/provenance
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/provenance/test/JpaTest.java
/* * * 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.airavata.provenance.test; import static org.junit.Assert.assertTrue; public class JpaTest { // private static final String PERSISTENCE_UNIT_NAME = "airavata_provenance"; // private EntityManagerFactory factory; // // @Before // public void setUp() throws Exception { // factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME); // EntityManager em = factory.createEntityManager(); // // // Begin a new local transaction so that we can persist a new entity // em.getTransaction().begin(); // // // Read the existing entries // Query q = em.createQuery("select m from Experiment_Data m"); // // Persons should be empty // // // Do we have entries? // boolean createNewEntries = (q.getResultList().size() == 0); // // // No, so lets create new entries // if (createNewEntries) { // assertTrue(q.getResultList().size() == 0); // Experiment_Data data = new Experiment_Data(); // data.setExperiment_ID("Experiement_ID1"); // data.setName("Name1"); // em.persist(data); // for (int i = 0; i < 5; i++) { // Workflow_Data wData = new Workflow_Data(); // wData.setWorkflow_instanceID("instance_ID" + i); // wData.setExperiment_Data(data); // em.persist(wData); // for (int j = 0; j < 5; j++) { // Node_Data nData = new Node_Data(); // nData.setNode_id("node_ID" + j); // nData.setWorkflow_Data(wData); // em.persist(nData); // // Gram_Data gData = new Gram_Data(); // gData.setNode_id("node_ID" + j); // gData.setWorkflow_Data(wData); // em.persist(gData); // } // // Now persists the family person relationship // // data.getWorkflows().add(wData); // // em.persist(wData); // // em.persist(data); // } // } // // // Commit the transaction, which will cause the entity to // // be stored in the database // em.getTransaction().commit(); // // // It is always good practice to close the EntityManager so that // // resources are conserved. // em.close(); // // } // // @Test // public void checkInsertedWorkflow() { // // // Now lets check the database and see if the created entries are there // // Create a fresh, new EntityManager // EntityManager em = factory.createEntityManager(); // // // Perform a simple query for all the Message entities // Query q = em.createQuery("select m from Workflow_Data m"); // // // We should have 5 Persons in the database // assertTrue(q.getResultList().size() == 5); // // em.close(); // } // // @Test // public void checkInsertedNode() { // EntityManager em = factory.createEntityManager(); // // Query q = em.createQuery("select m from Node_Data m"); // // assertTrue(q.getResultList().size() == 25); // // em.close(); // } // // @Test (expected = javax.persistence.NoResultException.class) // public void deleteNode_Data() throws InterruptedException { // Thread.sleep(1000); // EntityManager em = factory.createEntityManager(); // // Begin a new local transaction so that we can persist a new entity // em.getTransaction().begin(); // Query q = em.createQuery("SELECT p FROM Experiment_Data p WHERE p.experiment_ID = :firstName"); // q.setParameter("firstName", "Experiement_ID1"); // Experiment_Data eData = (Experiment_Data) q.getSingleResult(); // // q = em.createQuery("SELECT p FROM Workflow_Data p WHERE p.experiment_Data = :firstName AND p.workflow_instanceID = :lastName"); // q.setParameter("firstName", eData); // q.setParameter("lastName", "instance_ID4"); // Workflow_Data wData = (Workflow_Data) q.getSingleResult(); // // q = em.createQuery("SELECT p FROM Node_Data p WHERE p.workflow_Data = :firstName AND p.node_id = :lastName"); // q.setParameter("firstName", wData); // q.setParameter("lastName", "node_ID4"); // Node_Data nData = (Node_Data) q.getSingleResult(); // // //System.out.println(nData.getStart_time()); // em.remove(nData); // // q = em.createQuery("SELECT p FROM Node_Data p WHERE p.workflow_Data = :firstName AND p.node_id = :lastName"); // q.setParameter("firstName", wData); // q.setParameter("lastName", "node_ID3"); // nData = (Node_Data) q.getSingleResult(); // nData.setStatus("finished"); // Thread.sleep(5000); // em.getTransaction().commit(); // // q = em.createQuery("SELECT p FROM Node_Data p WHERE p.workflow_Data = :firstName AND p.node_id = :lastName"); // q.setParameter("firstName", wData); // q.setParameter("lastName", "node_ID4"); // Node_Data person = (Node_Data) q.getSingleResult(); // person.getInputs(); // // Begin a new local transaction so that we can persist a new entity // // em.close(); // } }
9,391
0
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/UserWorkflowResourceTest.java
/* * * 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.airavata.persistance.registry.jpa; import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource; import org.apache.airavata.persistance.registry.jpa.resources.UserWorkflowResource; import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource; import java.sql.Date; import java.sql.Timestamp; import java.util.Calendar; public class UserWorkflowResourceTest extends AbstractResourceTest { private WorkerResource workerResource; private UserWorkflowResource userWorkflowResource; @Override public void setUp() throws Exception { super.setUp(); GatewayResource gatewayResource = super.getGatewayResource(); workerResource = super.getWorkerResource(); userWorkflowResource = workerResource.createWorkflowTemplate("workflow1"); userWorkflowResource.setGateway(gatewayResource); userWorkflowResource.setContent("testContent"); Calendar calender = Calendar.getInstance(); java.util.Date d = calender.getTime(); Timestamp currentTime = new Timestamp(d.getTime()); userWorkflowResource.setLastUpdateDate(currentTime); } public void testSave() throws Exception { userWorkflowResource.save(); assertTrue("user workflow saved successfully", workerResource.isWorkflowTemplateExists("workflow1")); //remove user workflow workerResource.removeWorkflowTemplate("workflow1"); } @Override public void tearDown() throws Exception { super.tearDown(); } }
9,392
0
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExecutionErrorResourceTest.java
/* * * 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.airavata.persistance.registry.jpa; import org.apache.airavata.persistance.registry.jpa.resources.*; import java.sql.Timestamp; import java.util.Calendar; public class ExecutionErrorResourceTest extends AbstractResourceTest { private ExperimentDataResource experimentDataResource; private WorkflowDataResource workflowDataResource; private NodeDataResource nodeDataResource; @Override public void setUp() throws Exception { super.setUp(); GatewayResource gatewayResource = super.getGatewayResource(); WorkerResource workerResource = super.getWorkerResource(); ExperimentResource experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT); experimentResource.setExpID("testExpID"); experimentResource.setWorker(workerResource); experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject")); experimentResource.save(); experimentDataResource = (ExperimentDataResource) experimentResource.create(ResourceType.EXPERIMENT_DATA); experimentDataResource.setExpName("testExpID"); experimentDataResource.setUserName(workerResource.getUser()); experimentDataResource.save(); workflowDataResource = (WorkflowDataResource) experimentDataResource.create(ResourceType.WORKFLOW_DATA); workflowDataResource.setWorkflowInstanceID("testWFInstance"); workflowDataResource.setTemplateName("testTemplate"); workflowDataResource.setExperimentID("testExpID"); Calendar calender = Calendar.getInstance(); java.util.Date d = calender.getTime(); Timestamp timestamp = new Timestamp(d.getTime()); workflowDataResource.setLastUpdatedTime(timestamp); workflowDataResource.save(); nodeDataResource = workflowDataResource.createNodeData("testNodeID"); nodeDataResource.setWorkflowDataResource(workflowDataResource); nodeDataResource.setInputs("testInput"); nodeDataResource.setOutputs("testOutput"); nodeDataResource.setStatus("testStatus"); nodeDataResource.save(); } public void testSave() throws Exception { ExecutionErrorResource executionErrorResource = (ExecutionErrorResource) workflowDataResource.create(ResourceType.EXECUTION_ERROR); executionErrorResource.setErrorCode("testErrorCode"); executionErrorResource.setActionTaken("testAction"); executionErrorResource.setErrorLocation("testErrorLocation"); executionErrorResource.setErrorReference(0); executionErrorResource.setWorkflowDataResource(workflowDataResource); executionErrorResource.setExperimentDataResource(experimentDataResource); executionErrorResource.setNodeID(nodeDataResource.getNodeID()); executionErrorResource.setGfacJobID("testGfacJobID"); executionErrorResource.setErrorDes("testDes"); executionErrorResource.setErrorMsg("errorMsg"); executionErrorResource.save(); System.out.println(executionErrorResource.getErrorID()); assertTrue("application descriptor saved successfully", workflowDataResource.isExists(ResourceType.EXECUTION_ERROR, executionErrorResource.getErrorID())); } @Override public void tearDown() throws Exception { super.tearDown(); } }
9,393
0
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/PersistentDataTestSuite.java
/* * * 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.airavata.persistance.registry.jpa; import junit.framework.*; import junit.framework.Test; import org.junit.Before; import java.util.Enumeration; public class PersistentDataTestSuite extends TestSuite{ @Before public void setUp() throws Exception { Class[] testClasses = { ConfigurationResourceTest.class, GatewayResourceTest.class, UserResourceTest.class, WorkerResourceTest.class, ProjectResourceTest.class, HostDescriptorResourceTest.class, ServiceDescriptorResourceTest.class, ApplicationDescriptorResourceTest.class, UserWorkflowResourceTest.class, PublishWorkflowResourceTest.class, ExperimentResourceTest.class, ExperimentMetadataResourceTest.class, ExperimentDataResourceTest.class, WorkflowDataResourceTest.class, NodeDataResourceTest.class, GramDataResourceTest.class}; TestSuite testSuite = new TestSuite(testClasses); } @Override public Enumeration<Test> tests() { return super.tests(); } }
9,394
0
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/WorkflowDataResourceTest.java
/* * * 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.airavata.persistance.registry.jpa; import org.apache.airavata.persistance.registry.jpa.resources.*; import java.sql.Timestamp; import java.util.Calendar; public class WorkflowDataResourceTest extends AbstractResourceTest { private ExperimentDataResource experimentDataResource; private WorkflowDataResource workflowDataResource; private NodeDataResource nodeDataResource; private GramDataResource gramDataResource; @Override public void setUp() throws Exception { super.setUp(); GatewayResource gatewayResource = super.getGatewayResource(); WorkerResource workerResource = super.getWorkerResource(); ExperimentResource experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT); experimentResource.setExpID("testExpID"); experimentResource.setWorker(workerResource); experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject")); experimentResource.save(); experimentDataResource = (ExperimentDataResource) experimentResource.create(ResourceType.EXPERIMENT_DATA); experimentDataResource.setExpName("testExpID"); experimentDataResource.setUserName(workerResource.getUser()); experimentDataResource.save(); workflowDataResource = (WorkflowDataResource) experimentDataResource.create(ResourceType.WORKFLOW_DATA); workflowDataResource.setWorkflowInstanceID("testWFInstance"); workflowDataResource.setTemplateName("testTemplate"); workflowDataResource.setExperimentID("testExpID"); Calendar calender = Calendar.getInstance(); java.util.Date d = calender.getTime(); Timestamp timestamp = new Timestamp(d.getTime()); workflowDataResource.setLastUpdatedTime(timestamp); workflowDataResource.save(); nodeDataResource = workflowDataResource.createNodeData("testNodeID"); gramDataResource = workflowDataResource.createGramData("testNodeID"); nodeDataResource.setWorkflowDataResource(workflowDataResource); nodeDataResource.setInputs("testInput"); nodeDataResource.setOutputs("testOutput"); nodeDataResource.setStatus("testStatus"); nodeDataResource.save(); gramDataResource.setRsl("testRSL"); gramDataResource.setWorkflowDataResource(workflowDataResource); gramDataResource.save(); } public void testCreate() throws Exception { assertNotNull("node data resource created successfully", nodeDataResource); assertNotNull("gram data resource created successfully", gramDataResource); } public void testGet() throws Exception { assertNotNull("Node data retrieved successfully", workflowDataResource.getNodeData("testNodeID")); assertNotNull("Gram data retrieved successfully", workflowDataResource.getGramData("testNodeID")); } public void testGetList() throws Exception { assertNotNull("Node data retrieved successfully", workflowDataResource.getNodeData()); assertNotNull("Gram data retrieved successfully", workflowDataResource.getGramData()); } public void testRemove() throws Exception { workflowDataResource.removeNodeData("testNodeID"); workflowDataResource.removeGramData("testNodeID"); assertTrue("node date removed successfully", !workflowDataResource.isNodeExists("testNodeID")); assertTrue("gram date removed successfully", !workflowDataResource.isGramDataExists("testNodeID")); } public void testSave() throws Exception { assertTrue("workflow data saved successfully", experimentDataResource.isWorkflowInstancePresent("testWFInstance")); } @Override public void tearDown() throws Exception { super.tearDown(); } }
9,395
0
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentResourceTest.java
/* * * 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.airavata.persistance.registry.jpa; import org.apache.airavata.persistance.registry.jpa.resources.*; import java.sql.Timestamp; import java.util.Calendar; public class ExperimentResourceTest extends AbstractResourceTest { private GatewayResource gatewayResource; private ExperimentResource experimentResource; private WorkerResource workerResource; private ExperimentDataResource experimentDataResource; @Override public void setUp() throws Exception { super.setUp(); gatewayResource = super.getGatewayResource(); workerResource = super.getWorkerResource(); experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT); experimentResource.setExpID("testExpID"); experimentResource.setWorker(workerResource); experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject")); Calendar calender = Calendar.getInstance(); java.util.Date d = calender.getTime(); Timestamp currentDate = new Timestamp(d.getTime()); experimentResource.setSubmittedDate(currentDate); experimentResource.save(); experimentDataResource = (ExperimentDataResource) experimentResource.create(ResourceType.EXPERIMENT_DATA); experimentDataResource.setExpName("testExpID"); experimentDataResource.setUserName(workerResource.getUser()); experimentDataResource.save(); } public void testCreate() throws Exception { assertNotNull("experiment data resource has being created ", experimentDataResource); } public void testGet() throws Exception { assertNotNull("experiment data retrieved successfully", experimentResource.get(ResourceType.EXPERIMENT_DATA, "testExpID")); } public void testSave() throws Exception { experimentResource.save(); assertTrue("experiment save successfully", gatewayResource.isExists(ResourceType.EXPERIMENT, "testExpID")); } public void testRemove() throws Exception { if (!experimentDataResource.isWorkflowInstancePresent("testWFInstance")){ experimentResource.remove(ResourceType.EXPERIMENT_DATA, "testExpID"); assertTrue("experiment data removed successfully", !experimentResource.isExists(ResourceType.EXPERIMENT_DATA, "testExpID")); } } @Override public void tearDown() throws Exception { super.tearDown(); } }
9,396
0
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/UserResourceTest.java
/* * * 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.airavata.persistance.registry.jpa; import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource; import org.apache.airavata.persistance.registry.jpa.resources.UserResource; public class UserResourceTest extends AbstractResourceTest { private UserResource userResource; private GatewayResource gatewayResource; @Override public void setUp() throws Exception { super.setUp(); gatewayResource = super.getGatewayResource(); userResource = super.getUserResource(); } public void testSave() throws Exception { userResource.save(); assertTrue("user resource saved successfully", gatewayResource.isExists(ResourceType.USER, "admin")); //remove user // gatewayResource.remove(ResourceType.USER, "testUser"); } @Override public void tearDown() throws Exception { super.tearDown(); } }
9,397
0
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExperimentMetadataResourceTest.java
/* * * 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.airavata.persistance.registry.jpa; import org.apache.airavata.persistance.registry.jpa.resources.*; import java.sql.Date; import java.sql.Timestamp; import java.util.Calendar; public class ExperimentMetadataResourceTest extends AbstractResourceTest { private ExperimentDataResource experimentDataResource; @Override public void setUp() throws Exception { super.setUp(); GatewayResource gatewayResource = super.getGatewayResource(); WorkerResource workerResource = super.getWorkerResource(); ExperimentResource experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT); experimentResource.setExpID("testExpID"); experimentResource.setWorker(workerResource); experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject")); Calendar calender = Calendar.getInstance(); java.util.Date d = calender.getTime(); Timestamp currentDate = new Timestamp(d.getTime()); experimentResource.setSubmittedDate(currentDate); experimentResource.save(); experimentDataResource = (ExperimentDataResource) experimentResource.create(ResourceType.EXPERIMENT_DATA); experimentDataResource.setExpName("testExpID"); experimentDataResource.setUserName(workerResource.getUser()); experimentDataResource.save(); } public void testSave() throws Exception { ExperimentMetadataResource experimentMetadataResource = new ExperimentMetadataResource(); experimentMetadataResource.setExpID("testExpID"); experimentMetadataResource.setMetadata("testMetadata"); experimentMetadataResource.save(); assertTrue("experiment meta data saved successfully", experimentDataResource.isExists(ResourceType.EXPERIMENT_METADATA, "testExpID")); } @Override public void tearDown() throws Exception { super.tearDown(); } }
9,398
0
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry
Create_ds/airavata-sandbox/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/GFacJobDataResourceTest.java
/* * * 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.airavata.persistance.registry.jpa; import org.apache.airavata.persistance.registry.jpa.resources.*; import java.sql.Timestamp; import java.util.Calendar; public class GFacJobDataResourceTest extends AbstractResourceTest { private WorkerResource workerResource; private ExperimentDataResource experimentDataResource; private WorkflowDataResource workflowDataResource; @Override public void setUp() throws Exception { super.setUp(); GatewayResource gatewayResource = super.getGatewayResource(); workerResource = super.getWorkerResource(); ExperimentResource experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT); experimentResource.setExpID("testExpID"); experimentResource.setWorker(workerResource); experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject")); experimentResource.save(); experimentDataResource = (ExperimentDataResource) experimentResource.create(ResourceType.EXPERIMENT_DATA); experimentDataResource.setExpName("testExpID"); experimentDataResource.setUserName(workerResource.getUser()); experimentDataResource.save(); workflowDataResource = (WorkflowDataResource) experimentDataResource.create(ResourceType.WORKFLOW_DATA); workflowDataResource.setWorkflowInstanceID("testWFInstance"); workflowDataResource.setTemplateName("testTemplate"); workflowDataResource.setExperimentID("testExpID"); Calendar calender = Calendar.getInstance(); java.util.Date d = calender.getTime(); Timestamp timestamp = new Timestamp(d.getTime()); workflowDataResource.setLastUpdatedTime(timestamp); workflowDataResource.save(); } @Override public void tearDown() throws Exception { super.tearDown(); } public void testSave() throws Exception { GFacJobDataResource resource = (GFacJobDataResource)workflowDataResource.create(ResourceType.GFAC_JOB_DATA); resource.setLocalJobID("testJobID"); resource.setApplicationDescID("testApplication"); resource.setExperimentDataResource(experimentDataResource); resource.setNodeID("testNode"); resource.setHostDescID("testHost"); resource.setServiceDescID("testService"); resource.setStatus("testStatus"); resource.setJobData("testJobData"); resource.save(); assertTrue("GFac job data saved successfully", workerResource.isGFacJobExists("testJobID")); // workflowDataResource.remove(ResourceType.GFAC_JOB_DATA, "testJobID"); } }
9,399