http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/LoggingRegistryImpl.java ---------------------------------------------------------------------- diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/LoggingRegistryImpl.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/LoggingRegistryImpl.java deleted file mode 100644 index 0274518..0000000 --- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/LoggingRegistryImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * - * 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.impl; - -import org.apache.airavata.registry.cpi.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; -import java.util.Map; - -public class LoggingRegistryImpl implements Registry { - private final static Logger logger = LoggerFactory.getLogger(LoggingRegistryImpl.class); - - @Override - public Object add(ParentDataType dataType, Object newObjectToAdd, String gatewayId) throws RegistryException { - return null; - } - - @Override - public Object add(ChildDataType dataType, Object newObjectToAdd, Object dependentIdentifiers) throws RegistryException { - return null; - } - - @Override - public void update(RegistryModelType dataType, Object newObjectToUpdate, Object identifier) throws RegistryException { - - } - - @Override - public void update(RegistryModelType dataType, Object identifier, String fieldName, Object value) throws RegistryException { - - } - - @Override - public Object get(RegistryModelType dataType, Object identifier) throws RegistryException { - return null; - } - - @Override - public List<Object> get(RegistryModelType dataType, String fieldName, Object value) throws RegistryException { - return null; - } - - @Override - public List<Object> get(RegistryModelType dataType, String fieldName, Object value, int limit, int offset, Object orderByIdentifier, ResultOrderType resultOrderType) throws RegistryException { - return null; - } - - @Override - public List<Object> search(RegistryModelType dataType, Map<String, String> filters) throws RegistryException { - return null; - } - - @Override - public List<Object> search(RegistryModelType dataType, Map<String, String> filters, int limit, int offset, Object orderByIdentifier, ResultOrderType resultOrderType) throws RegistryException { - return null; - } - - @Override - public Object getValue(RegistryModelType dataType, Object identifier, String field) throws RegistryException { - return null; - } - - @Override - public List<String> getIds(RegistryModelType dataType, String fieldName, Object value) throws RegistryException { - return null; - } - - @Override - public void remove(RegistryModelType dataType, Object identifier) throws RegistryException { - - } - - @Override - public boolean isExist(RegistryModelType dataType, Object identifier) throws RegistryException { - return false; - } -}
http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ProjectRegistry.java ---------------------------------------------------------------------- diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ProjectRegistry.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ProjectRegistry.java deleted file mode 100644 index 620c535..0000000 --- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ProjectRegistry.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * - * 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.impl; - -import org.apache.airavata.model.workspace.Project; -import org.apache.airavata.persistance.registry.jpa.ResourceType; -import org.apache.airavata.persistance.registry.jpa.ResourceUtils; -import org.apache.airavata.persistance.registry.jpa.mongo.dao.ProjectDao; -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.WorkerResource; -import org.apache.airavata.registry.cpi.RegistryException; -import org.apache.airavata.registry.cpi.ResultOrderType; -import org.apache.airavata.registry.cpi.utils.Constants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.*; - -public class ProjectRegistry { - private GatewayResource gatewayResource; - private WorkerResource workerResource; - private final static Logger logger = LoggerFactory.getLogger(ProjectRegistry.class); - - private ProjectDao projectDao; - - public ProjectRegistry(GatewayResource gatewayResource, UserResource user) throws RegistryException { - this.projectDao = new ProjectDao(); - - if (!ResourceUtils.isGatewayExist(gatewayResource.getGatewayId())){ - this.gatewayResource = gatewayResource; - }else { - this.gatewayResource = (GatewayResource)ResourceUtils.getGateway(gatewayResource.getGatewayId()); - } - if (!gatewayResource.isExists(ResourceType.GATEWAY_WORKER, user.getUserName())){ - workerResource = ResourceUtils.addGatewayWorker(gatewayResource, user); - }else { - workerResource = (WorkerResource)ResourceUtils.getWorker(gatewayResource.getGatewayId(), - user.getUserName()); - } - } - - public String addProject (Project project, String gatewayId) throws RegistryException{ - try { - if (!ResourceUtils.isUserExist(project.getOwner())){ - ResourceUtils.addUser(project.getOwner(), null); - } - project.setProjectId(getProjectId(project.getName())); - projectDao.createProject(project); - return project.getProjectId(); - }catch (Exception e){ - logger.error("Error while saving project to registry", e); - throw new RegistryException(e); - } - } - - private String getProjectId (String projectName){ - String pro = projectName.replaceAll("\\s", ""); - return pro + "_" + UUID.randomUUID(); - } - - public void updateProject (Project project, String projectId) throws RegistryException{ - try { - UserResource user = (UserResource)ResourceUtils.getUser(project.getOwner()); - if (!gatewayResource.isExists(ResourceType.GATEWAY_WORKER, user.getUserName())){ - workerResource = ResourceUtils.addGatewayWorker(gatewayResource, user); - }else { - workerResource = (WorkerResource)ResourceUtils.getWorker( - gatewayResource.getGatewayName(), user.getUserName()); - } - projectDao.updateProject(project); - }catch (Exception e){ - logger.error("Error while saving project to registry", e); - throw new RegistryException(e); - } - } - - public Project getProject (String projectId) throws RegistryException{ - try { - return projectDao.getProject(projectId); - }catch (Exception e){ - logger.error("Error while retrieving project from registry", e); - throw new RegistryException(e); - } - } - - /** - * Get list of projects of the user - * @param fieldName - * @param value - * @return - * @throws RegistryException - */ - public List<Project> getProjectList (String fieldName, Object value) throws RegistryException{ - return getProjectList(fieldName, value, -1, -1, null, null); - } - - /** - * Get projects list with pagination and result ordering - * @param fieldName - * @param value - * @param limit - * @param offset - * @param orderByIdentifier - * @param resultOrderType - * @return - * @throws RegistryException - */ - public List<Project> getProjectList (String fieldName, Object value, int limit, int offset, - Object orderByIdentifier, ResultOrderType resultOrderType) throws RegistryException{ - try { - Map<String, String> filters = new HashMap(); - filters.put(fieldName, (String)value); - return projectDao.searchProjects(filters, limit, offset, orderByIdentifier, resultOrderType); - }catch (Exception e){ - logger.error("Error while retrieving project from registry", e); - throw new RegistryException(e); - } - } - - /** - * To search projects of user with the given filter criteria. All the matching results will be sent. - * Results are not ordered in any order - * @param filters - * @return - * @throws RegistryException - */ - public List<Project> searchProjects (Map<String, String> filters) throws RegistryException{ - return searchProjects(filters, -1, -1, null, null); - } - - /** - * To search the projects of user with the given filter criteria and retrieve the results with - * pagination support. Results can be ordered based on an identifier (i.e column) either ASC or - * DESC. - * - * @param filters - * @param limit - * @param offset - * @param orderByIdentifier - * @param resultOrderType - * @return - * @throws RegistryException - */ - public List<Project> searchProjects(Map<String, String> filters, int limit, - int offset, Object orderByIdentifier, ResultOrderType resultOrderType) throws RegistryException { - try { - return projectDao.searchProjects(filters, limit, offset, orderByIdentifier, resultOrderType); - }catch (Exception e){ - logger.error("Error while retrieving project from registry", e); - throw new RegistryException(e); - } - - } - - public List<String> getProjectIds (String fieldName, Object value) throws RegistryException{ - List<String> projectIds = new ArrayList<String>(); - try { - if (fieldName.equals(Constants.FieldConstants.ProjectConstants.OWNER)){ - Map<String, String> filters = new HashMap(); - filters.put(fieldName, (String)value); - projectDao.searchProjects(filters, -1, -1, null, null).stream() - .forEach(pr->projectIds.add(pr.getProjectId())); - return projectIds; - } - }catch (Exception e){ - logger.error("Error while retrieving projects from registry", e); - throw new RegistryException(e); - } - return projectIds; - } - - public void removeProject (String projectId) throws RegistryException { - try { - Project project = new Project(); - project.setProjectId(projectId); - projectDao.deleteProject(project); - } catch (Exception e) { - logger.error("Error while removing the project..", e); - throw new RegistryException(e); - } - } - - public boolean isProjectExist(String projectId) throws RegistryException { - try { - return projectDao.getProject(projectId) != null; - } catch (Exception e) { - logger.error("Error while retrieving project...", e); - throw new RegistryException(e); - } - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryFactory.java ---------------------------------------------------------------------- diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryFactory.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryFactory.java deleted file mode 100644 index 8af4f19..0000000 --- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryFactory.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * - * 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.impl; - -import org.apache.airavata.common.exception.ApplicationSettingsException; -import org.apache.airavata.common.utils.ServerSettings; -import org.apache.airavata.registry.cpi.Registry; -import org.apache.airavata.registry.cpi.RegistryException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class RegistryFactory { - private static Registry registry; - private static Logger logger = LoggerFactory.getLogger(RegistryFactory.class); - - public static Registry getRegistry(String gateway, String username, String password) throws RegistryException { - try { - if (registry == null) { - registry = new RegistryImpl(gateway, username, password); - } - } catch (RegistryException e) { - logger.error("Unable to create registry instance", e); - throw new RegistryException(e); - } - return registry; - } - - public static Registry getRegistry(String gateway) throws RegistryException { - try { - if (registry == null) { - registry = new RegistryImpl(gateway, ServerSettings.getDefaultUser(), ServerSettings.getDefaultUserPassword()); - } - } catch (RegistryException e) { - logger.error("Unable to create registry instance", e); - throw new RegistryException(e); - } catch (ApplicationSettingsException e) { - logger.error("Unable to create registry instance", e); - throw new RegistryException(e); - } - return registry; - } - - public static Registry getDefaultRegistry () throws RegistryException { - try { - if (registry == null) { - registry = new RegistryImpl(); - } - } catch (RegistryException e) { - logger.error("Unable to create registry instance", e); - throw new RegistryException(e); - } - return registry; - } - - public static Registry getLoggingRegistry() { - if(registry == null) { - registry = new LoggingRegistryImpl(); - } - return registry; - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java ---------------------------------------------------------------------- diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java deleted file mode 100644 index b8d7132..0000000 --- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java +++ /dev/null @@ -1,735 +0,0 @@ -/* - * - * 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.impl; - -import org.apache.airavata.common.exception.ApplicationSettingsException; -import org.apache.airavata.common.utils.ServerSettings; -import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType; -import org.apache.airavata.model.workspace.Gateway; -import org.apache.airavata.model.workspace.Project; -import org.apache.airavata.model.workspace.experiment.*; -import org.apache.airavata.persistance.registry.jpa.ResourceUtils; -import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource; -import org.apache.airavata.persistance.registry.jpa.resources.UserResource; -import org.apache.airavata.registry.cpi.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public class RegistryImpl implements Registry { - private GatewayResource gatewayResource; - private UserResource user; - private final static Logger logger = LoggerFactory.getLogger(RegistryImpl.class); - private ExperimentRegistry experimentRegistry = null; - private ProjectRegistry projectRegistry = null; - private GatewayRegistry gatewayRegistry = null; - - public RegistryImpl() throws RegistryException{ - try { - if (!ResourceUtils.isGatewayExist(ServerSettings.getDefaultUserGateway())){ - gatewayResource = (GatewayResource) ResourceUtils.createGateway(ServerSettings.getDefaultUserGateway()); - gatewayResource.setGatewayName(ServerSettings.getDefaultUserGateway()); - gatewayResource.save(); - }else { - gatewayResource = (GatewayResource)ResourceUtils.getGateway(ServerSettings.getDefaultUserGateway()); - } - - if (!ResourceUtils.isUserExist(ServerSettings.getDefaultUser())){ - user = ResourceUtils.createUser(ServerSettings.getDefaultUser(), ServerSettings.getDefaultUserPassword()); - user.save(); - }else { - user = (UserResource)ResourceUtils.getUser(ServerSettings.getDefaultUser()); - } - experimentRegistry = new ExperimentRegistry(gatewayResource, user); - projectRegistry = new ProjectRegistry(gatewayResource, user); - gatewayRegistry = new GatewayRegistry(); - } catch (ApplicationSettingsException e) { - logger.error("Unable to read airavata server properties..", e); - throw new RegistryException("Unable to read airavata server properties..", e); - } - } - - public RegistryImpl(String gateway, String username, String password) throws RegistryException{ - if (!ResourceUtils.isGatewayExist(gateway)){ - gatewayResource = (GatewayResource) ResourceUtils.createGateway(gateway); - gatewayResource.save(); - }else { - gatewayResource = (GatewayResource)ResourceUtils.getGateway(gateway); - } - - if (!ResourceUtils.isUserExist(username)){ - user = ResourceUtils.createUser(username, password); - user.save(); - }else { - user = (UserResource)ResourceUtils.getUser(username); - } - experimentRegistry = new ExperimentRegistry(gatewayResource, user); - projectRegistry = new ProjectRegistry(gatewayResource, user); - } - - /** - * This method is to add an object in to the registry - * - * @param dataType Data type is a predefined type which the programmer should choose according to the object he - * is going to save in to registry - * @param newObjectToAdd Object which contains the fields that need to be saved in to registry. This object is a - * thrift model object. In experiment case this object can be BasicMetadata, ConfigurationData - * etc - * @return return the identifier to identify the object - */ - @Override - public Object add(ParentDataType dataType, Object newObjectToAdd, String gatewayId) throws RegistryException { - try { - switch (dataType) { - case PROJECT: - return projectRegistry.addProject((Project)newObjectToAdd, gatewayId); - case EXPERIMENT: - return experimentRegistry.addExperiment((Experiment) newObjectToAdd, gatewayId); - case GATEWAY: - return gatewayRegistry.addGateway((Gateway)newObjectToAdd); - default: - logger.error("Unsupported top level type..", new UnsupportedOperationException()); - throw new UnsupportedOperationException(); - } - } catch (Exception e) { - logger.error("Error while adding the resource " + dataType.toString(), new RegistryException(e)); - throw new RegistryException("Error while adding the resource " + dataType.toString(), e); - } - } - - /** - * This method is to add an object in to the registry - * - * @param dataType Data type is a predefined type which the programmer should choose according to the object he - * is going to save in to registry - * @param newObjectToAdd Object which contains the fields that need to be saved in to registry. This object is a - * thrift model object. In experiment case this object can be BasicMetadata, ConfigurationData - * etc - * @param dependentIdentifier Object which contains the identifier if the object that is going to add is not a top - * level object in the data model. If it is a top level object, programmer can pass it as - * null - */ - @Override - public Object add(ChildDataType dataType, Object newObjectToAdd, Object dependentIdentifier) throws RegistryException { - try { - switch (dataType) { - case EXPERIMENT_CONFIGURATION_DATA: - return experimentRegistry.addUserConfigData((UserConfigurationData) newObjectToAdd, (String) dependentIdentifier); - case EXPERIMENT_OUTPUT: - return experimentRegistry.addExpOutputs((List<OutputDataObjectType>) newObjectToAdd, (String) dependentIdentifier); - case EXPERIMENT_STATUS: - return experimentRegistry.updateExperimentStatus((ExperimentStatus) newObjectToAdd, (String) dependentIdentifier); - case WORKFLOW_NODE_DETAIL: - return experimentRegistry.addWorkflowNodeDetails((WorkflowNodeDetails) newObjectToAdd, (String) dependentIdentifier); - case WORKFLOW_NODE_STATUS: - return experimentRegistry.addWorkflowNodeStatus((WorkflowNodeStatus) newObjectToAdd, (CompositeIdentifier) dependentIdentifier); - case NODE_OUTPUT: - return experimentRegistry.addNodeOutputs((List<OutputDataObjectType>) newObjectToAdd, (CompositeIdentifier) dependentIdentifier); - case TASK_DETAIL: - return experimentRegistry.addTaskDetails((TaskDetails) newObjectToAdd, (String) dependentIdentifier); - case APPLICATION_OUTPUT: - return experimentRegistry.addApplicationOutputs((List<OutputDataObjectType>) newObjectToAdd, (CompositeIdentifier) dependentIdentifier); - case TASK_STATUS: - return experimentRegistry.addTaskStatus((TaskStatus) newObjectToAdd, (CompositeIdentifier) dependentIdentifier); - case JOB_DETAIL: - return experimentRegistry.addJobDetails((JobDetails) newObjectToAdd, (CompositeIdentifier) dependentIdentifier); - case JOB_STATUS: - return experimentRegistry.addJobStatus((JobStatus) newObjectToAdd, (CompositeIdentifier) dependentIdentifier); - case APPLICATION_STATUS: - return experimentRegistry.addApplicationStatus((ApplicationStatus) newObjectToAdd, (CompositeIdentifier) dependentIdentifier); - case DATA_TRANSFER_DETAIL: - return experimentRegistry.addDataTransferDetails((DataTransferDetails) newObjectToAdd, (String) dependentIdentifier); - case TRANSFER_STATUS: - return experimentRegistry.addTransferStatus((TransferStatus) newObjectToAdd, (CompositeIdentifier) dependentIdentifier); - case COMPUTATIONAL_RESOURCE_SCHEDULING: - return experimentRegistry.addComputationalResourceScheduling((ComputationalResourceScheduling) newObjectToAdd, (CompositeIdentifier) dependentIdentifier); - case ADVANCE_OUTPUT_DATA_HANDLING: - return experimentRegistry.addOutputDataHandling((AdvancedOutputDataHandling) newObjectToAdd, (CompositeIdentifier) dependentIdentifier); - case ADVANCE_INPUT_DATA_HANDLING: - return experimentRegistry.addInputDataHandling((AdvancedInputDataHandling) newObjectToAdd, (CompositeIdentifier) dependentIdentifier); - case QOS_PARAM: - return experimentRegistry.addQosParams((QualityOfServiceParams) newObjectToAdd, (String) dependentIdentifier); - case ERROR_DETAIL: - return experimentRegistry.addErrorDetails((ErrorDetails) newObjectToAdd, dependentIdentifier); - default: - logger.error("Unsupported dependent data type...", new UnsupportedOperationException()); - throw new UnsupportedOperationException(); - } - } catch (Exception e) { - logger.error("Error while adding " + dataType.toString() , new RegistryException(e)); - throw new RegistryException("Error while adding " + dataType.toString(), e); - } - - } - - /** - * This method is to update the whole object in registry - * - * @param dataType Data type is a predefined type which the programmer should choose according to the object he - * is going to save in to registry - * @param newObjectToUpdate Object which contains the fields that need to be updated in to registry. This object is a - * thrift model object. In experiment case this object can be BasicMetadata, ConfigurationData - * etc. CPI programmer can only fill necessary fields that need to be updated. He does not - * have to fill the whole object. He needs to only fill the mandatory fields and whatever the - * other fields that need to be updated. - */ - @Override - public void update(RegistryModelType dataType, Object newObjectToUpdate, Object identifier) throws RegistryException { - try { - switch (dataType) { - case PROJECT: - projectRegistry.updateProject((Project)newObjectToUpdate, (String)identifier); - break; - case GATEWAY: - gatewayRegistry.updateGateway((String)identifier, (Gateway)newObjectToUpdate); - break; - case EXPERIMENT: - experimentRegistry.updateExperiment((Experiment) newObjectToUpdate, (String) identifier); - break; - case EXPERIMENT_CONFIGURATION_DATA: - experimentRegistry.updateUserConfigData((UserConfigurationData) newObjectToUpdate, (String) identifier); - break; - case EXPERIMENT_OUTPUT: - experimentRegistry.updateExpOutputs((List<OutputDataObjectType>) newObjectToUpdate, (String) identifier); - break; - case EXPERIMENT_STATUS: - experimentRegistry.updateExperimentStatus((ExperimentStatus) newObjectToUpdate, (String) identifier); - break; - case WORKFLOW_NODE_DETAIL: - experimentRegistry.updateWorkflowNodeDetails((WorkflowNodeDetails) newObjectToUpdate, (String) identifier); - break; - case WORKFLOW_NODE_STATUS: - experimentRegistry.updateWorkflowNodeStatus((WorkflowNodeStatus) newObjectToUpdate, (String) identifier); - break; - case NODE_OUTPUT: - experimentRegistry.updateNodeOutputs((List<OutputDataObjectType>) newObjectToUpdate, (String) identifier); - break; - case TASK_DETAIL: - experimentRegistry.updateTaskDetails((TaskDetails) newObjectToUpdate, (String) identifier); - break; - case APPLICATION_OUTPUT: - experimentRegistry.updateAppOutputs((List<OutputDataObjectType>) newObjectToUpdate, (String) identifier); - break; - case TASK_STATUS: - experimentRegistry.updateTaskStatus((TaskStatus) newObjectToUpdate, (String) identifier); - break; - case JOB_DETAIL: - experimentRegistry.updateJobDetails((JobDetails) newObjectToUpdate, (CompositeIdentifier) identifier); - break; - case JOB_STATUS: - experimentRegistry.updateJobStatus((JobStatus) newObjectToUpdate, (CompositeIdentifier) identifier); - break; - case APPLICATION_STATUS: - experimentRegistry.updateApplicationStatus((ApplicationStatus) newObjectToUpdate, (CompositeIdentifier) identifier); - break; - case DATA_TRANSFER_DETAIL: - experimentRegistry.updateDataTransferDetails((DataTransferDetails) newObjectToUpdate, (CompositeIdentifier) identifier); - break; - case TRANSFER_STATUS: - experimentRegistry.updateTransferStatus((TransferStatus) newObjectToUpdate, (CompositeIdentifier) identifier); - break; - case COMPUTATIONAL_RESOURCE_SCHEDULING: - experimentRegistry.updateScheduling((ComputationalResourceScheduling) newObjectToUpdate, (String) identifier, dataType.toString()); - break; - case ADVANCE_INPUT_DATA_HANDLING: - experimentRegistry.updateInputDataHandling((AdvancedInputDataHandling) newObjectToUpdate, (String) identifier, dataType.toString()); - break; - case ADVANCE_OUTPUT_DATA_HANDLING: - experimentRegistry.updateOutputDataHandling((AdvancedOutputDataHandling) newObjectToUpdate, (String) identifier, dataType.toString()); - break; - case QOS_PARAM: - experimentRegistry.updateQOSParams((QualityOfServiceParams) newObjectToUpdate, (String) identifier, dataType.toString()); - break; - default: - logger.error("Unsupported data type...", new UnsupportedOperationException()); - throw new UnsupportedOperationException(); - } - } catch (Exception e) { - logger.error("Error while updating the resource " + dataType.toString(), new RegistryException(e)); - throw new RegistryException("Error while updating the resource.." + dataType.toString(), e); - } - - } - - /** - * This method is to update a specific field of the data model - * - * @param dataType Data type is a predefined type which the programmer should choose according to the object he - * is going to save in to registry - * @param identifier Identifier which will uniquely identify the data model. For example, in Experiment_Basic_Type, - * identifier will be generated experimentID - * @param fieldName Field which need to be updated in the registry. In Experiment_Basic_Type, if you want to update the - * description, field will be "description". Field names are defined in - * org.apache.airavata.registry.cpi.utils.Constants - * @param value Value by which the given field need to be updated. If the field is "description", that field will be - * updated by given value - */ - @Override - public void update(RegistryModelType dataType, Object identifier, String fieldName, Object value) throws RegistryException { - try { - switch (dataType) { - case EXPERIMENT: - experimentRegistry.updateExperimentField((String) identifier, fieldName, value); - break; - case EXPERIMENT_CONFIGURATION_DATA: - experimentRegistry.updateExpConfigDataField((String) identifier, fieldName, value); - break; - default: - logger.error("Unsupported data type...", new UnsupportedOperationException()); - throw new UnsupportedOperationException(); - } - } catch (Exception e) { - logger.error("Error while updating the resource " + dataType.toString(), new RegistryException(e)); - throw new RegistryException("Error while updating the resource " + dataType.toString(), e); - } - - } - - /** - * This method is to retrieve object according to the identifier. In the experiment basic data type, if you give the - * experiment id, this method will return the BasicMetadata object - * - * @param dataType Data type is a predefined type which the programmer should choose according to the object he - * is going to save in to registry - * @param identifier Identifier which will uniquely identify the data model. For example, in Experiment_Basic_Type, - * identifier will be generated experimentID - * @return object according to the given identifier. - */ - @Override - public Object get(RegistryModelType dataType, Object identifier) throws RegistryException { - try { - switch (dataType) { - case PROJECT: - return projectRegistry.getProject((String)identifier); - case GATEWAY: - return gatewayRegistry.getGateway((String)identifier); - case EXPERIMENT: - return experimentRegistry.getExperiment((String) identifier, null); - case EXPERIMENT_CONFIGURATION_DATA: - return experimentRegistry.getConfigData((String) identifier, null); - case EXPERIMENT_OUTPUT: - return experimentRegistry.getExperimentOutputs((String) identifier); - case EXPERIMENT_STATUS: - return experimentRegistry.getExperimentStatus((String) identifier); - case WORKFLOW_NODE_DETAIL: - return experimentRegistry.getWorkflowNodeDetails((String) identifier); - case WORKFLOW_NODE_STATUS: - return experimentRegistry.getWorkflowNodeStatus((String) identifier); - case NODE_OUTPUT: - return experimentRegistry.getNodeOutputs((String) identifier); - case TASK_DETAIL: - return experimentRegistry.getTaskDetails((String) identifier); - case APPLICATION_OUTPUT: - return experimentRegistry.getApplicationOutputs((String) identifier); - case TASK_STATUS: - return experimentRegistry.getTaskStatus((String) identifier); - case JOB_DETAIL: - return experimentRegistry.getJobDetails((CompositeIdentifier) identifier); - case JOB_STATUS: - return experimentRegistry.getJobStatus((CompositeIdentifier) identifier); - case APPLICATION_STATUS: - return experimentRegistry.getApplicationStatus((CompositeIdentifier) identifier); - case DATA_TRANSFER_DETAIL: - return experimentRegistry.getDataTransferDetails((CompositeIdentifier) identifier); - case TRANSFER_STATUS: - return experimentRegistry.getDataTransferStatus((CompositeIdentifier) identifier); - case COMPUTATIONAL_RESOURCE_SCHEDULING: - return experimentRegistry.getComputationalScheduling(dataType, (String) identifier); - case ADVANCE_INPUT_DATA_HANDLING: - return experimentRegistry.getInputDataHandling(dataType, (String) identifier); - case ADVANCE_OUTPUT_DATA_HANDLING: - return experimentRegistry.getOutputDataHandling(dataType, (String) identifier); - case QOS_PARAM: - return experimentRegistry.getQosParams(dataType, (String) identifier); - default: - logger.error("Unsupported data type...", new UnsupportedOperationException()); - throw new UnsupportedOperationException(); - } - } catch (Exception e) { - logger.error("Error while retrieving the resource " + dataType.toString(), new RegistryException(e)); - throw new RegistryException("Error while retrieving the resource " + dataType.toString() , e); - } - } - - /** - * This method is to retrieve list of objects according to a given criteria - * - * @param dataType Data type is a predefined type which the programmer should choose according to the object he - * is going to save in to registry - * @param fieldName FieldName is the field that filtering should be done. For example, if we want to retrieve all - * the experiments for a given user, filterBy will be "userName" - * @param value value for the filtering field. In the experiment case, value for "userName" can be "admin" - * @return List of objects according to the given criteria - */ - @Override - public List<Object> get(RegistryModelType dataType, String fieldName, Object value) throws RegistryException { - try { - List<Object> result = new ArrayList<Object>(); - switch (dataType) { - case PROJECT: - List<Project> projectList = projectRegistry.getProjectList(fieldName, value); - for (Project project : projectList ){ - result.add(project); - } - return result; - case GATEWAY: - List<Gateway> allGateways = gatewayRegistry.getAllGateways(); - for (Gateway gateway : allGateways){ - result.add(gateway); - } - return result; - case EXPERIMENT: - List<Experiment> experimentList = experimentRegistry.getExperimentList(fieldName, value); - for (Experiment experiment : experimentList) { - result.add(experiment); - } - return result; - case WORKFLOW_NODE_DETAIL: - List<WorkflowNodeDetails> wfNodeDetails = experimentRegistry.getWFNodeDetails(fieldName, value); - for (WorkflowNodeDetails wf : wfNodeDetails) { - result.add(wf); - } - return result; - case WORKFLOW_NODE_STATUS: - List<WorkflowNodeStatus> wfNodeStatusList = experimentRegistry.getWFNodeStatusList(fieldName, value); - for (WorkflowNodeStatus wfs : wfNodeStatusList) { - result.add(wfs); - } - return result; - case TASK_DETAIL: - List<TaskDetails> taskDetails = experimentRegistry.getTaskDetails(fieldName, value); - for (TaskDetails task : taskDetails) { - result.add(task); - } - return result; - case JOB_DETAIL: - List<JobDetails> jobDetails = experimentRegistry.getJobDetails(fieldName, value); - for (JobDetails job : jobDetails) { - result.add(job); - } - return result; - case DATA_TRANSFER_DETAIL: - List<DataTransferDetails> dataTransferDetails = experimentRegistry.getDataTransferDetails(fieldName, value); - for (DataTransferDetails transferDetails : dataTransferDetails) { - result.add(transferDetails); - } - return result; - case ERROR_DETAIL: - List<ErrorDetails> errorDetails = experimentRegistry.getErrorDetails(fieldName, value); - for (ErrorDetails error : errorDetails) { - result.add(error); - } - return result; - default: - logger.error("Unsupported data type...", new UnsupportedOperationException()); - throw new UnsupportedOperationException(); - } - } catch (Exception e) { - logger.error("Error while retrieving the resource " + dataType.toString(), new RegistryException(e)); - throw new RegistryException("Error while retrieving the resource " + dataType.toString(), e); - } - - } - - /** - * This method is to retrieve list of objects according to a given criteria with pagination and ordering - * - * @param dataType Data type is a predefined type which the programmer should choose according to the object he - * is going to save in to registry - * @param fieldName FieldName is the field that filtering should be done. For example, if we want to retrieve all - * the experiments for a given user, filterBy will be "userName" - * @param value value for the filtering field. In the experiment case, value for "userName" can be "admin" - * @param limit Size of the results to be returned - * @param offset Start position of the results to be retrieved - * @param orderByIdentifier Named of the column in which the ordering is based - * @param resultOrderType Type of ordering i.e ASC or DESC - * @return - * @throws RegistryException - */ - @Override - public List<Object> get(RegistryModelType dataType, String fieldName, Object value, int limit, - int offset, Object orderByIdentifier, ResultOrderType resultOrderType) throws RegistryException { - try { - List<Object> result = new ArrayList<Object>(); - switch (dataType) { - case PROJECT: - List<Project> projectList = projectRegistry - .getProjectList(fieldName, value, limit, offset, orderByIdentifier, resultOrderType); - for (Project project : projectList ){ - result.add(project); - } - return result; - case EXPERIMENT: - List<Experiment> experimentList = experimentRegistry.getExperimentList(fieldName, value, - limit, offset, orderByIdentifier, resultOrderType); - for (Experiment experiment : experimentList) { - result.add(experiment); - } - return result; - default: - logger.error("Unsupported data type...", new UnsupportedOperationException()); - throw new UnsupportedOperationException(); - } - } catch (Exception e) { - logger.error("Error while retrieving the resource " + dataType.toString(), new RegistryException(e)); - throw new RegistryException("Error while retrieving the resource " + dataType.toString(), e); - } - } - - /** - * This method is to retrieve list of objects according to a given criteria - * @param dataType Data type is a predefined type which the programmer should choose according to the object he - * is going to save in to registry - * @param filters filters is a map of field name and value that you need to use for search filtration - * @return List of objects according to the given criteria - */ - @Override - public List<Object> search(RegistryModelType dataType, Map<String, String> filters) throws RegistryException { - return search(dataType, filters, -1, -1, null, null); - } - - /** - * This method is to retrieve list of objects with pagination according to a given criteria sorted - * according by the specified identified and specified ordering (i.e either ASC or DESC) - * @param dataType Data type is a predefined type which the programmer should choose according to the object he - * is going to save in to registry - * @param filters filters is a map of field name and value that you need to use for search filtration - * @param limit amount of the results to be returned - * @param offset offset of the results from the sorted list to be fetched from - * @param orderByIdentifier identifier (i.e the column) which will be used as the basis to sort the results - * @param resultOrderType The type of ordering (i.e ASC or DESC) that has to be used when retrieving the results - * @return List of objects according to the given criteria - */ - @Override - public List<Object> search(RegistryModelType dataType, Map<String, String> filters, int limit, - int offset, Object orderByIdentifier, ResultOrderType resultOrderType) throws RegistryException { - try { - List<Object> result = new ArrayList<Object>(); - switch (dataType) { - case PROJECT: - List<Project> projectList - = projectRegistry.searchProjects(filters, limit, offset, - orderByIdentifier, resultOrderType); - for (Project project : projectList ){ - result.add(project); - } - return result; - case EXPERIMENT: - List<ExperimentSummary> experimentSummaries = experimentRegistry - .searchExperiments(filters, limit, offset, orderByIdentifier, - resultOrderType); - for (ExperimentSummary ex : experimentSummaries){ - result.add(ex); - } - return result; - default: - logger.error("Unsupported data type...", new UnsupportedOperationException()); - throw new UnsupportedOperationException(); - } - } catch (Exception e) { - logger.error("Error while retrieving the resource " + dataType.toString(), new RegistryException(e)); - throw new RegistryException("Error while retrieving the resource " + dataType.toString(), e); - } - } - - /** - * This method is to retrieve a specific value for a given field. - * - * @param dataType Data type is a predefined type which the programmer should choose according to the object he - * is going to save in to registry - * @param identifier Identifier which will uniquely identify the data model. For example, in Experiment_Basic_Type, - * identifier will be generated experimentID - * @param field field that filtering should be done. For example, if we want to execution user for a given - * experiment, field will be "userName" - * @return return the value for the specific field where data model is identified by the unique identifier that has - * given - */ - @Override - public Object getValue(RegistryModelType dataType, Object identifier, String field) throws RegistryException { - try { - switch (dataType) { - case EXPERIMENT: - return experimentRegistry.getExperiment((String) identifier, field); - case EXPERIMENT_CONFIGURATION_DATA: - return experimentRegistry.getConfigData((String) identifier, field); - default: - logger.error("Unsupported data type...", new UnsupportedOperationException()); - throw new UnsupportedOperationException(); - } - } catch (Exception e) { - logger.error("Error while retrieving the resource " + dataType.toString(), new RegistryException(e)); - throw new RegistryException("Error while retrieving the resource " + dataType.toString(), e); - } - - } - - /** - * This method is to retrieve all the identifiers according to given filtering criteria. For an example, if you want - * to get all the experiment ids for a given gateway, your field name will be "gateway" and the value will be the - * name of the gateway ("default"). Similar manner you can retrieve all the experiment ids for a given user. - * - * @param dataType Data type is a predefined type which the programmer should choose according to the object he - * is going to save in to registry - * @param fieldName FieldName is the field that filtering should be done. For example, if we want to retrieve all - * the experiments for a given user, filterBy will be "userName" - * @param value value for the filtering field. In the experiment case, value for "userName" can be "admin" - * @return id list according to the filtering criteria - */ - @Override - public List<String> getIds(RegistryModelType dataType, String fieldName, Object value) throws RegistryException { - try { - switch (dataType) { - case PROJECT: - return projectRegistry.getProjectIds(fieldName, value); - case EXPERIMENT: - return experimentRegistry.getExperimentIds(fieldName, value); - case EXPERIMENT_CONFIGURATION_DATA: - return experimentRegistry.getExperimentIds(fieldName, value); - case WORKFLOW_NODE_DETAIL: - return experimentRegistry.getWorkflowNodeIds(fieldName, value); - case TASK_DETAIL: - return experimentRegistry.getTaskDetailIds(fieldName, value); - case JOB_DETAIL: - return experimentRegistry.getJobDetailIds(fieldName, value); - case DATA_TRANSFER_DETAIL: - return experimentRegistry.getTransferDetailIds(fieldName, value); - default: - logger.error("Unsupported data type...", new UnsupportedOperationException()); - throw new UnsupportedOperationException(); - } - } catch (Exception e) { - logger.error("Error while retrieving the ids for" + dataType.toString(), new RegistryException(e)); - throw new RegistryException("Error while retrieving the ids for " + dataType.toString(), e); - } - - } - - /** - * This method is to remove a item from the registry - * - * @param dataType Data type is a predefined type which the programmer should choose according to the object he - * is going to save in to registry - * @param identifier Identifier which will uniquely identify the data model. For example, in Experiment_Basic_Type, - * identifier will be generated experimentID - */ - @Override - public void remove(RegistryModelType dataType, Object identifier) throws RegistryException { - try { - switch (dataType) { - case PROJECT: - projectRegistry.removeProject((String)identifier); - break; - case GATEWAY: - gatewayRegistry.removeGateway((String)identifier); - break; - case EXPERIMENT: - experimentRegistry.removeExperiment((String) identifier); - break; - case EXPERIMENT_CONFIGURATION_DATA: - experimentRegistry.removeExperimentConfigData((String) identifier); - break; - case WORKFLOW_NODE_DETAIL: - experimentRegistry.removeWorkflowNode((String) identifier); - break; - case TASK_DETAIL: - experimentRegistry.removeTaskDetails((String) identifier); - break; - case JOB_DETAIL: - experimentRegistry.removeJobDetails((CompositeIdentifier) identifier); - break; - case DATA_TRANSFER_DETAIL: - experimentRegistry.removeDataTransferDetails((CompositeIdentifier) identifier); - break; - case COMPUTATIONAL_RESOURCE_SCHEDULING: - experimentRegistry.removeComputationalScheduling(dataType, (String) identifier); - break; - case ADVANCE_OUTPUT_DATA_HANDLING: - experimentRegistry.removeOutputDataHandling(dataType, (String) identifier); - break; - case ADVANCE_INPUT_DATA_HANDLING: - experimentRegistry.removeInputDataHandling(dataType, (String) identifier); - break; - case QOS_PARAM: - experimentRegistry.removeQOSParams(dataType, (String) identifier); - break; - default: - logger.error("Unsupported data type...", new UnsupportedOperationException()); - throw new UnsupportedOperationException(); - } - } catch (Exception e) { - logger.error("Error while removing the resource " + dataType.toString(), new RegistryException(e)); - throw new RegistryException("Error while removing the resource " + dataType.toString(), e); - } - - } - - /** - * This method will check whether a given data type which can be identified with the identifier exists or not - * - * @param dataType Data type is a predefined type which the programmer should choose according to the object he - * is going to save in to registry - * @param identifier Identifier which will uniquely identify the data model. For example, in Experiment_Basic_Type, - * identifier will be generated experimentID - * @return whether the given data type exists or not - */ - @Override - public boolean isExist(RegistryModelType dataType, Object identifier) throws RegistryException { - try { - switch (dataType) { - case PROJECT: - return projectRegistry.isProjectExist((String)identifier); - case GATEWAY: - return gatewayRegistry.isGatewayExist((String)identifier); - case EXPERIMENT: - return experimentRegistry.isExperimentExist((String) identifier); - case EXPERIMENT_CONFIGURATION_DATA: - return experimentRegistry.isExperimentConfigDataExist((String) identifier); - case WORKFLOW_NODE_DETAIL: - return experimentRegistry.isWFNodeExist((String) identifier); - case TASK_DETAIL: - return experimentRegistry.isTaskDetailExist((String) identifier); - case JOB_DETAIL: - return experimentRegistry.isJobDetailExist((CompositeIdentifier) identifier); - case DATA_TRANSFER_DETAIL: - return experimentRegistry.isTransferDetailExist((CompositeIdentifier) identifier); - case COMPUTATIONAL_RESOURCE_SCHEDULING: - return experimentRegistry.isComputationalSchedulingExist(dataType, (String) identifier); - case ADVANCE_INPUT_DATA_HANDLING: - return experimentRegistry.isInputDataHandlingExist(dataType, (String) identifier); - case ADVANCE_OUTPUT_DATA_HANDLING: - return experimentRegistry.isOutputDataHandlingExist(dataType, (String) identifier); - case QOS_PARAM: - return experimentRegistry.isQOSParamsExist(dataType, (String) identifier); - default: - logger.error("Unsupported data type...", new UnsupportedOperationException()); - throw new UnsupportedOperationException(); - } - } catch (Exception e) { - logger.error("Error while checking existence of the resource " + dataType.toString(), new RegistryException(e)); - throw new RegistryException("Error while checking existence of the resource " + dataType.toString(), e); - } - } - -} http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java ---------------------------------------------------------------------- diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java deleted file mode 100644 index 7920200..0000000 --- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/UserReg.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * 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.impl; - -import org.apache.airavata.common.exception.ApplicationSettingsException; -import org.apache.airavata.common.utils.ServerSettings; -import org.apache.airavata.persistance.registry.jpa.ResourceUtils; -import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource; -import org.apache.airavata.registry.cpi.RegistryException; - -public class UserReg { - public WorkerResource getSystemUser() throws ApplicationSettingsException, RegistryException { - return (WorkerResource)ResourceUtils.getWorker(ServerSettings.getDefaultUserGateway(), ServerSettings.getDefaultUser()); - } - - public WorkerResource getExistingUser (String gatewayName, String userName) throws RegistryException { - return (WorkerResource)ResourceUtils.getWorker(gatewayName, userName); - } - - - -} http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedInputDataHandling.java ---------------------------------------------------------------------- diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedInputDataHandling.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedInputDataHandling.java deleted file mode 100644 index 8f40f2d..0000000 --- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedInputDataHandling.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * - * 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.model; - -import org.apache.openjpa.persistence.DataCache; - -import javax.persistence.*; -import java.io.Serializable; - -@DataCache -@Entity -@Table(name = "ADVANCE_INPUT_DATA_HANDLING") -public class AdvancedInputDataHandling implements Serializable { - @Id - @GeneratedValue - @Column(name = "INPUT_DATA_HANDLING_ID") - private int dataHandlingId; - @Column(name = "EXPERIMENT_ID") - private String expId; - @Column(name = "TASK_ID") - private String taskId; - @Column(name = "WORKING_DIR_PARENT") - private String parentWorkingDir; - @Column(name = "UNIQUE_WORKING_DIR") - private String workingDir; - @Column(name = "STAGE_INPUT_FILES_TO_WORKING_DIR") - private boolean stageInputsToWorkingDir; - @Column(name = "CLEAN_AFTER_JOB") - private boolean cleanAfterJob; - - @ManyToOne(cascade= CascadeType.MERGE) - @JoinColumn(name = "EXPERIMENT_ID") - private Experiment experiment; - - @ManyToOne(cascade= CascadeType.MERGE) - @JoinColumn(name = "TASK_ID") - private TaskDetail task; - - public int getDataHandlingId() { - return dataHandlingId; - } - - public void setDataHandlingId(int dataHandlingId) { - this.dataHandlingId = dataHandlingId; - } - - public String getExpId() { - return expId; - } - - public void setExpId(String expId) { - this.expId = expId; - } - - public String getTaskId() { - return taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - - public String getParentWorkingDir() { - return parentWorkingDir; - } - - public void setParentWorkingDir(String parentWorkingDir) { - this.parentWorkingDir = parentWorkingDir; - } - - public String getWorkingDir() { - return workingDir; - } - - public void setWorkingDir(String workingDir) { - this.workingDir = workingDir; - } - - public boolean isStageInputsToWorkingDir() { - return stageInputsToWorkingDir; - } - - public void setStageInputsToWorkingDir(boolean stageInputsToWorkingDir) { - this.stageInputsToWorkingDir = stageInputsToWorkingDir; - } - - public boolean isCleanAfterJob() { - return cleanAfterJob; - } - - public void setCleanAfterJob(boolean cleanAfterJob) { - this.cleanAfterJob = cleanAfterJob; - } - - public Experiment getExperiment() { - return experiment; - } - - public void setExperiment(Experiment experiment) { - this.experiment = experiment; - } - - public TaskDetail getTask() { - return task; - } - - public void setTask(TaskDetail task) { - this.task = task; - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedOutputDataHandling.java ---------------------------------------------------------------------- diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedOutputDataHandling.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedOutputDataHandling.java deleted file mode 100644 index d305f22..0000000 --- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/AdvancedOutputDataHandling.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * - * 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.model; - -import org.apache.openjpa.persistence.DataCache; - -import javax.persistence.*; -import java.io.Serializable; - -@DataCache -@Entity -@Table(name = "ADVANCE_OUTPUT_DATA_HANDLING") -public class AdvancedOutputDataHandling implements Serializable { - @Id - @GeneratedValue - @Column(name = "OUTPUT_DATA_HANDLING_ID") - private int outputDataHandlingId; - @Column(name = "EXPERIMENT_ID") - private String expId; - @Column(name = "TASK_ID") - private String taskId; - @Column(name = "OUTPUT_DATA_DIR") - private String outputDataDir; - @Column(name = "DATA_REG_URL") - private String dataRegUrl; - @Column(name = "PERSIST_OUTPUT_DATA") - private boolean persistOutputData; - - @ManyToOne(cascade= CascadeType.MERGE) - @JoinColumn(name = "EXPERIMENT_ID") - private Experiment experiment; - - @ManyToOne(cascade= CascadeType.MERGE) - @JoinColumn(name = "TASK_ID") - private TaskDetail task; - - public int getOutputDataHandlingId() { - return outputDataHandlingId; - } - - public void setOutputDataHandlingId(int outputDataHandlingId) { - this.outputDataHandlingId = outputDataHandlingId; - } - - public String getExpId() { - return expId; - } - - public void setExpId(String expId) { - this.expId = expId; - } - - public String getTaskId() { - return taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - - public String getOutputDataDir() { - return outputDataDir; - } - - public void setOutputDataDir(String outputDataDir) { - this.outputDataDir = outputDataDir; - } - - public String getDataRegUrl() { - return dataRegUrl; - } - - public void setDataRegUrl(String dataRegUrl) { - this.dataRegUrl = dataRegUrl; - } - - public boolean isPersistOutputData() { - return persistOutputData; - } - - public void setPersistOutputData(boolean persistOutputData) { - this.persistOutputData = persistOutputData; - } - - public Experiment getExperiment() { - return experiment; - } - - public void setExperiment(Experiment experiment) { - this.experiment = experiment; - } - - public TaskDetail getTask() { - return task; - } - - public void setTask(TaskDetail task) { - this.task = task; - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationInput.java ---------------------------------------------------------------------- diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationInput.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationInput.java deleted file mode 100644 index 66a9796..0000000 --- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationInput.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * - * 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.model; - -import org.apache.openjpa.persistence.DataCache; - -import javax.persistence.*; -import java.io.Serializable; - -@DataCache -@Entity -@Table(name = "APPLICATION_INPUT") -@IdClass(ApplicationInput_PK.class) -public class ApplicationInput implements Serializable { - @Id - @Column(name = "TASK_ID") - private String taskId; - @Id - @Column(name = "INPUT_KEY") - private String inputKey; - @Column(name = "DATA_TYPE") - private String dataType; - @Column(name = "METADATA") - private String metadata; - @Lob - @Column(name = "VALUE") - private char[] value; - @Column(name = "APP_ARGUMENT") - private String appArgument; - - @Column(name = "INPUT_ORDER") - private int inputOrder; - - @Column(name = "STANDARD_INPUT") - private boolean standardInput; - - @Column(name = "USER_FRIENDLY_DESC") - private String userFriendlyDesc; - - @Column(name="IS_REQUIRED") - private boolean isRequired; - @Column(name="REQUIRED_TO_COMMANDLINE") - private boolean requiredToCMD; - @Column(name = "DATA_STAGED") - private boolean dataStaged; - - @ManyToOne(cascade= CascadeType.MERGE) - @JoinColumn(name = "TASK_ID") - private TaskDetail task; - - public int getInputOrder() { - return inputOrder; - } - - public void setInputOrder(int inputOrder) { - this.inputOrder = inputOrder; - } - - public String getTaskId() { - return taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - - public String getInputKey() { - return inputKey; - } - - public void setInputKey(String inputKey) { - this.inputKey = inputKey; - } - - public String getDataType() { - return dataType; - } - - public void setDataType(String dataType) { - this.dataType = dataType; - } - - public String getMetadata() { - return metadata; - } - - public void setMetadata(String metadata) { - this.metadata = metadata; - } - - public char[] getValue() { - return value; - } - - public void setValue(char[] value) { - this.value = value; - } - - public TaskDetail getTask() { - return task; - } - - public void setTask(TaskDetail task) { - this.task = task; - } - - public String getAppArgument() { - return appArgument; - } - - public void setAppArgument(String appArgument) { - this.appArgument = appArgument; - } - - public boolean isStandardInput() { - return standardInput; - } - - public void setStandardInput(boolean standardInput) { - this.standardInput = standardInput; - } - - public String getUserFriendlyDesc() { - return userFriendlyDesc; - } - - public void setUserFriendlyDesc(String userFriendlyDesc) { - this.userFriendlyDesc = userFriendlyDesc; - } - - public boolean isRequired() { - return isRequired; - } - - public void setRequired(boolean isRequired) { - this.isRequired = isRequired; - } - - public boolean isRequiredToCMD() { - return requiredToCMD; - } - - public void setRequiredToCMD(boolean requiredToCMD) { - this.requiredToCMD = requiredToCMD; - } - - public boolean isDataStaged() { - return dataStaged; - } - - public void setDataStaged(boolean dataStaged) { - this.dataStaged = dataStaged; - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationInput_PK.java ---------------------------------------------------------------------- diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationInput_PK.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationInput_PK.java deleted file mode 100644 index e99cbd2..0000000 --- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationInput_PK.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * 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.model; - -import java.io.Serializable; - -public class ApplicationInput_PK implements Serializable { - private String taskId; - private String inputKey; - - public ApplicationInput_PK(String inputKey, String taskId) { - this.inputKey = inputKey; - this.taskId = taskId; - } - - public ApplicationInput_PK() { - ; - } - - @Override - public boolean equals(Object o) { - return false; - } - - @Override - public int hashCode() { - return 1; - } - - - public String getTaskId() { - return taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - - public String getInputKey() { - return inputKey; - } - - public void setInputKey(String inputKey) { - this.inputKey = inputKey; - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationOutput.java ---------------------------------------------------------------------- diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationOutput.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationOutput.java deleted file mode 100644 index c95f934..0000000 --- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationOutput.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * - * 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.model; - -import org.apache.openjpa.persistence.DataCache; - -import javax.persistence.*; -import java.io.Serializable; - -@DataCache -@Entity -@Table(name = "APPLICATION_OUTPUT") -@IdClass(ApplicationOutput_PK.class) -public class ApplicationOutput implements Serializable { - @Id - @Column(name = "TASK_ID") - private String taskId; - @Id - @Column(name = "OUTPUT_KEY") - private String outputKey; - @Column(name = "DATA_TYPE") - private String dataType; - @Lob - @Column(name = "VALUE") - private char[] value; - - @Column(name = "IS_REQUIRED") - private boolean isRequired; - @Column(name="REQUIRED_TO_COMMANDLINE") - private boolean addedToCmd; - @Column(name = "DATA_MOVEMENT") - private boolean dataMovement; - @Column(name = "DATA_NAME_LOCATION") - private String dataNameLocation; - @Column(name = "SEARCH_QUERY") - private String searchQuery; - @Column(name = "APP_ARGUMENT") - private String applicationArgument; - - @ManyToOne(cascade= CascadeType.MERGE) - @JoinColumn(name = "TASK_ID") - private TaskDetail task; - - public String getTaskId() { - return taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - - public char[] getValue() { - return value; - } - - public void setValue(char[] value) { - this.value = value; - } - - public TaskDetail getTask() { - return task; - } - - public void setTask(TaskDetail task) { - this.task = task; - } - - public String getOutputKey() { - return outputKey; - } - - public void setOutputKey(String outputKey) { - this.outputKey = outputKey; - } - - public String getDataType() { - return dataType; - } - - public void setDataType(String dataType) { - this.dataType = dataType; - } - - public boolean isRequired() { - return isRequired; - } - - public void setRequired(boolean isRequired) { - this.isRequired = isRequired; - } - - public boolean isAddedToCmd() { - return addedToCmd; - } - - public void setAddedToCmd(boolean addedToCmd) { - this.addedToCmd = addedToCmd; - } - - public boolean isDataMovement() { - return dataMovement; - } - - public void setDataMovement(boolean dataMovement) { - this.dataMovement = dataMovement; - } - - public String getDataNameLocation() { - return dataNameLocation; - } - - public void setDataNameLocation(String dataNameLocation) { - this.dataNameLocation = dataNameLocation; - } - - public String getSearchQuery() { - return searchQuery; - } - - public void setSearchQuery(String searchQuery) { - this.searchQuery = searchQuery; - } - - public String getApplicationArgument() { - return applicationArgument; - } - - public void setApplicationArgument(String applicationArgument) { - this.applicationArgument = applicationArgument; - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/801489bf/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationOutput_PK.java ---------------------------------------------------------------------- diff --git a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationOutput_PK.java b/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationOutput_PK.java deleted file mode 100644 index 17a5021..0000000 --- a/modules/registry/airavata-mongo-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/ApplicationOutput_PK.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * 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.model; - -import java.io.Serializable; - -public class ApplicationOutput_PK implements Serializable { - private String taskId; - private String outputKey; - - public ApplicationOutput_PK(String outputKey, String taskId) { - this.outputKey = outputKey; - this.taskId = taskId; - } - - public ApplicationOutput_PK() { - ; - } - - @Override - public boolean equals(Object o) { - return false; - } - - @Override - public int hashCode() { - return 1; - } - - public String getTaskId() { - return taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - - public String getOutputKey() { - return outputKey; - } - - public void setOutputKey(String outputKey) { - this.outputKey = outputKey; - } -}
