adding registry refactoring effort module
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/ad06b474 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/ad06b474 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/ad06b474 Branch: refs/heads/lahiru/AIRAVATA-2065 Commit: ad06b474c15bf5ab1738e6e259dc04b9720856a2 Parents: bfff64c Author: scnakandala <supun.nakand...@gmail.com> Authored: Fri Aug 26 12:11:21 2016 -0400 Committer: scnakandala <supun.nakand...@gmail.com> Committed: Fri Aug 26 12:11:21 2016 -0400 ---------------------------------------------------------------------- modules/registry-refactoring/pom.xml | 127 ++++++++++ .../org/apache/airavata/registry/core/Main.java | 75 ++++++ .../registry/core/RegistryException.java | 28 +++ .../ComputeResourceSchedulingEntity.java | 170 +++++++++++++ .../entities/expcatalog/ExperimentEntity.java | 203 +++++++++++++++ .../expcatalog/ExperimentErrorEntity.java | 116 +++++++++ .../expcatalog/ExperimentInputEntity.java | 171 +++++++++++++ .../expcatalog/ExperimentOutputEntity.java | 153 ++++++++++++ .../expcatalog/UserConfigurationEntity.java | 131 ++++++++++ .../workspacecatalog/GatewayEntity.java | 221 +++++++++++++++++ .../workspacecatalog/NSFDemographicsEntity.java | 94 +++++++ .../workspacecatalog/NotificationEntity.java | 110 +++++++++ .../workspacecatalog/ProjectEntity.java | 92 +++++++ .../workspacecatalog/UserProfileEntity.java | 247 +++++++++++++++++++ .../core/repositories/AbstractRepository.java | 78 ++++++ .../expcatalog/ExperimentRespository.java | 43 ++++ .../workspacecatalog/GatewayRepository.java | 35 +++ .../NotificationRepository.java | 35 +++ .../workspacecatalog/ProjectRepository.java | 35 +++ .../workspacecatalog/UserProfileRepository.java | 43 ++++ .../airavata/registry/core/utils/Committer.java | 27 ++ .../airavata/registry/core/utils/JPAUtils.java | 82 ++++++ .../core/utils/ObjectMapperSingleton.java | 39 +++ .../src/main/resources/META-INF/persistence.xml | 33 +++ .../src/main/resources/experiment_catalog.sql | 110 +++++++++ .../src/main/resources/workspace_catalog.sql | 125 ++++++++++ .../core/repositories/RepositoryTest.java | 60 +++++ 27 files changed, 2683 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/pom.xml ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/pom.xml b/modules/registry-refactoring/pom.xml new file mode 100644 index 0000000..b794349 --- /dev/null +++ b/modules/registry-refactoring/pom.xml @@ -0,0 +1,127 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.airavata</groupId> + <artifactId>airavata</artifactId> + <version>0.17-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent> + + <groupId>org.apache.airavata</groupId> + <artifactId>registry-refactoring</artifactId> + + <properties> + <derby.version>10.11.1.1</derby.version> + <surefire.version>2.18.1</surefire.version> + <skipTests>false</skipTests> + <mysql.connector.version>5.1.34</mysql.connector.version> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.airavata</groupId> + <artifactId>airavata-data-models</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>net.sf.dozer</groupId> + <artifactId>dozer</artifactId> + <version>5.4.0</version> + </dependency> + <dependency> + <groupId>org.apache.openjpa</groupId> + <artifactId>openjpa-all</artifactId> + <version>2.3.0</version> + </dependency> + + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + <version>${mysql.connector.version}</version> + </dependency> + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derby</artifactId> + <version>${derby.version}</version> + </dependency> + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derbyclient</artifactId> + <version>${derby.version}</version> + </dependency> + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derbynet</artifactId> + <version>${derby.version}</version> + </dependency> + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derbytools</artifactId> + <version>${derby.version}</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.1</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.openjpa</groupId> + <artifactId>openjpa-maven-plugin</artifactId> + <version>2.2.0</version> + <configuration> + <includes>**/entities/*.class</includes> + <excludes>**/entities/XML*.class</excludes> + <addDefaultConstructor>true</addDefaultConstructor> + <enforcePropertyRestrictions>true</enforcePropertyRestrictions> + </configuration> + <executions> + <execution> + <id>enhancer</id> + <phase>process-classes</phase> + <goals> + <goal>enhance</goal> + </goals> + </execution> + </executions> + <dependencies> + <dependency> + <groupId>org.apache.openjpa</groupId> + <artifactId>openjpa</artifactId> + <version>2.2.0</version> + </dependency> + </dependencies> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>${surefire.version}</version> + <inherited>true</inherited> + <configuration> + <failIfNoTests>false</failIfNoTests> + <!--<skipTests>${skipTests}</skipTests>--> + <skipTests>true</skipTests> + <workingDirectory>${project.build.testOutputDirectory}</workingDirectory> + </configuration> + </plugin> + </plugins> + </build> + +</project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/Main.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/Main.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/Main.java new file mode 100644 index 0000000..e509b47 --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/Main.java @@ -0,0 +1,75 @@ +/* + * + * 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.core; + +import org.apache.airavata.model.user.NSFDemographics; +import org.apache.airavata.model.workspace.Gateway; +import org.apache.airavata.model.workspace.GatewayApprovalStatus; +import org.apache.airavata.model.workspace.Notification; +import org.apache.airavata.registry.core.entities.workspacecatalog.GatewayEntity; +import org.apache.airavata.registry.core.entities.workspacecatalog.NotificationEntity; +import org.apache.airavata.registry.core.entities.workspacecatalog.UserProfileEntity; +import org.apache.airavata.registry.core.repositories.workspacecatalog.GatewayRepository; +import org.apache.airavata.registry.core.repositories.workspacecatalog.NotificationRepository; +import org.apache.airavata.registry.core.utils.JPAUtils; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.dozer.Mapper; + +import java.io.IOException; +import java.util.UUID; + +public class Main { + + public static void main(String[] args) throws IOException { + org.apache.airavata.model.user.UserProfile userProfile = new org.apache.airavata.model.user.UserProfile(); + userProfile.setAiravataInternalUserId("I don't know"); + NSFDemographics nsfDemographics = new NSFDemographics(); + nsfDemographics.setGender("sdfsf"); + userProfile.setNsfDemographics(nsfDemographics); + + Mapper mapper = ObjectMapperSingleton.getInstance(); + UserProfileEntity destObject = + mapper.map(userProfile, UserProfileEntity.class); + + System.out.println(destObject.getNsfDemographics().getGender()); + + userProfile = mapper.map(destObject, org.apache.airavata.model.user.UserProfile.class); + System.out.println(userProfile.getNsfDemographics().getGender()); + + JPAUtils.getEntityManager(); + + Gateway gateway = new Gateway(); + gateway.setGatewayApprovalStatus(GatewayApprovalStatus.ACTIVE); + gateway.setGatewayId("test.com" + System.currentTimeMillis()); + gateway.setDomain("test.com"); + + GatewayRepository gatewayRepository = new GatewayRepository(Gateway.class, GatewayEntity.class); + gateway = gatewayRepository.create(gateway); + System.out.println(gateway.getGatewayId()); + + Notification notification = new Notification(); + notification.setNotificationId(UUID.randomUUID().toString()); + notification.setGatewayId(gateway.getGatewayId()); + + NotificationRepository notificationRepository = new NotificationRepository(Notification.class, NotificationEntity.class); + notificationRepository.create(notification); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/RegistryException.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/RegistryException.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/RegistryException.java new file mode 100644 index 0000000..8893b34 --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/RegistryException.java @@ -0,0 +1,28 @@ +/* + * + * 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.core; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class RegistryException extends Exception { + private final static Logger logger = LoggerFactory.getLogger(RegistryException.class); +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ComputeResourceSchedulingEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ComputeResourceSchedulingEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ComputeResourceSchedulingEntity.java new file mode 100644 index 0000000..76eb5ea --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ComputeResourceSchedulingEntity.java @@ -0,0 +1,170 @@ +/* + * + * 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.core.entities.expcatalog; + +import javax.persistence.*; + +@Entity +@Table(name = "COMPUTE_RESOURCE_SCHEDULING") +public class ComputeResourceSchedulingEntity { + private String experimentId; + private String resourceHostId; + private int totalCPUCount; + private int nodeCount; + private int numberOfThreads; + private String queueName; + private int wallTimeLimit; + private int totalPhysicalMemory; + private String chessisNumber; + private String staticWorkingDir; + private String overrideLoginUserName; + private String overrideScratchLocation; + private String overrideAllocationProjectNumber; + private UserConfigurationEntity userConfiguration; + + @Id + @Column(name = "EXPERIMENT_ID") + public String getExperimentId() { + return experimentId; + } + + public void setExperimentId(String experimentId) { + this.experimentId = experimentId; + } + + @Column(name = "RESOURCE_HOST_ID") + public String getResourceHostId() { + return resourceHostId; + } + + public void setResourceHostId(String resourceHostId) { + this.resourceHostId = resourceHostId; + } + + @Column(name = "CPU_COUNT") + public int getTotalCPUCount() { + return totalCPUCount; + } + + public void setTotalCPUCount(int totalCPUCount) { + this.totalCPUCount = totalCPUCount; + } + + @Column(name = "NODE_COUNT") + public int getNodeCount() { + return nodeCount; + } + + public void setNodeCount(int nodeCount) { + this.nodeCount = nodeCount; + } + + @Column(name = "NUMBER_OF_THREADS") + public int getNumberOfThreads() { + return numberOfThreads; + } + + public void setNumberOfThreads(int numberOfThreads) { + this.numberOfThreads = numberOfThreads; + } + + @Column(name = "QUEUE_NAME") + public String getQueueName() { + return queueName; + } + + public void setQueueName(String queueName) { + this.queueName = queueName; + } + + @Column(name = "WALL_TIME_LIMIT") + public int getWallTimeLimit() { + return wallTimeLimit; + } + + public void setWallTimeLimit(int wallTimeLimit) { + this.wallTimeLimit = wallTimeLimit; + } + + @Column(name = "TOTAL_PHYSICAL_MEMORY") + public int getTotalPhysicalMemory() { + return totalPhysicalMemory; + } + + public void setTotalPhysicalMemory(int totalPhysicalMemory) { + this.totalPhysicalMemory = totalPhysicalMemory; + } + + @Column(name = "CHESSIS_NUMBER") + public String getChessisNumber() { + return chessisNumber; + } + + public void setChessisNumber(String chessisNumber) { + this.chessisNumber = chessisNumber; + } + + @Column(name = "STATIC_WORKING_DIRECTORY") + public String getStaticWorkingDir() { + return staticWorkingDir; + } + + public void setStaticWorkingDir(String staticWorkingDir) { + this.staticWorkingDir = staticWorkingDir; + } + + @Column(name = "OVERRIDE_LOGIN_USERNAME") + public String getOverrideLoginUserName() { + return overrideLoginUserName; + } + + public void setOverrideLoginUserName(String overrideLoginUserName) { + this.overrideLoginUserName = overrideLoginUserName; + } + + @Column(name = "OVERRIDE_SCRATCH_LOCATION") + public String getOverrideScratchLocation() { + return overrideScratchLocation; + } + + public void setOverrideScratchLocation(String overrideScratchLocation) { + this.overrideScratchLocation = overrideScratchLocation; + } + + @Column(name = "OVERRIDE_ALLOCATION_PROJECT_NUMBER") + public String getOverrideAllocationProjectNumber() { + return overrideAllocationProjectNumber; + } + + public void setOverrideAllocationProjectNumber(String overrideAllocationProjectNumber) { + this.overrideAllocationProjectNumber = overrideAllocationProjectNumber; + } + + @OneToOne(targetEntity = UserConfigurationEntity.class, cascade = CascadeType.ALL) + @PrimaryKeyJoinColumn(name = "EXPERIMENT_ID", referencedColumnName = "EXPERIMENT_ID") + public UserConfigurationEntity getUserConfiguration() { + return userConfiguration; + } + + public void setUserConfiguration(UserConfigurationEntity userConfiguration) { + this.userConfiguration = userConfiguration; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentEntity.java new file mode 100644 index 0000000..5b9d15a --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentEntity.java @@ -0,0 +1,203 @@ +/* + * + * 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.core.entities.expcatalog; + +import javax.persistence.*; +import java.util.List; + +@Entity +@Table(name = "EXPERIMENT") +public class ExperimentEntity { + public String experimentId; + public String projectId; + public String gatewayId; + public String experimentType; + public String userName; + public String experimentName; + public long creationTime; + public String description; + public String executionId; + public String gatewayExecutionId; + public String gatewayInstanceId; + public boolean enableEmailNotification; + public List<String> emailAddresses; + + private List<ExperimentInputEntity> experimentInputs; + private List<ExperimentOutputEntity> experimentOutputs; + private List<ExperimentErrorEntity> experimentErrors; + + private UserConfigurationEntity userConfiguration; + + @Id + @Column(name = "EXPERIMENT_ID") + public String getExperimentId() { + return experimentId; + } + + public void setExperimentId(String experimentId) { + this.experimentId = experimentId; + } + + @Column(name = "PROJECT_ID") + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + @Column(name = "GATEWAY_ID") + public String getGatewayId() { + return gatewayId; + } + + public void setGatewayId(String gatewayId) { + this.gatewayId = gatewayId; + } + + @Column(name = "EXPERIMENT_TYPE") + public String getExperimentType() { + return experimentType; + } + + public void setExperimentType(String experimentType) { + this.experimentType = experimentType; + } + + @Column(name = "USER_NAME") + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + @Column(name = "EXPERIMENT_NAME") + public String getExperimentName() { + return experimentName; + } + + public void setExperimentName(String experimentName) { + this.experimentName = experimentName; + } + + @Column(name = "CREATION_TIME") + public long getCreationTime() { + return creationTime; + } + + public void setCreationTime(long creationTime) { + this.creationTime = creationTime; + } + + @Column(name = "DESCRIPTION") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + @Column(name = "EXECUTION_ID") + public String getExecutionId() { + return executionId; + } + + public void setExecutionId(String executionId) { + this.executionId = executionId; + } + + @Column(name = "GATEWAY_EXECUTION_ID") + public String getGatewayExecutionId() { + return gatewayExecutionId; + } + + public void setGatewayExecutionId(String gatewayExecutionId) { + this.gatewayExecutionId = gatewayExecutionId; + } + + @Column(name = "GATEWAY_INSTANCE_ID") + public String getGatewayInstanceId() { + return gatewayInstanceId; + } + + public void setGatewayInstanceId(String gatewayInstanceId) { + this.gatewayInstanceId = gatewayInstanceId; + } + + @Column(name = "ENABLE_EMAIL_NOTIFICATION") + public boolean isEnableEmailNotification() { + return enableEmailNotification; + } + + public void setEnableEmailNotification(boolean enableEmailNotification) { + this.enableEmailNotification = enableEmailNotification; + } + + @ElementCollection + @CollectionTable(name="EXPERIMENT_EMAIL", joinColumns = @JoinColumn(name="EXPERIMENT_ID")) + public List<String> getEmailAddresses() { + return emailAddresses; + } + + public void setEmailAddresses(List<String> emailAddresses) { + this.emailAddresses = emailAddresses; + } + + @OneToOne(targetEntity = UserConfigurationEntity.class, cascade = CascadeType.ALL, mappedBy = "experiment") + public UserConfigurationEntity getUserConfiguration() { + return userConfiguration; + } + + public void setUserConfiguration(UserConfigurationEntity userConfiguration) { + this.userConfiguration = userConfiguration; + } + + @OneToMany(targetEntity = ExperimentInputEntity.class, cascade = CascadeType.ALL, mappedBy = "experiment") + public List<ExperimentInputEntity> getExperimentInputs() { + return experimentInputs; + } + + public void setExperimentInputs(List<ExperimentInputEntity> experimentInputs) { + this.experimentInputs = experimentInputs; + } + + @OneToMany(targetEntity = ExperimentOutputEntity.class, cascade = CascadeType.ALL, mappedBy = "experiment") + public List<ExperimentOutputEntity> getExperimentOutputs() { + return experimentOutputs; + } + + public void setExperimentOutputs(List<ExperimentOutputEntity> experimentOutputs) { + this.experimentOutputs = experimentOutputs; + } + + @OneToMany(targetEntity = ExperimentErrorEntity.class, cascade = CascadeType.ALL, mappedBy = "experiment") + public List<ExperimentErrorEntity> getExperimentErrors() { + return experimentErrors; + } + + public void setExperimentErrors(List<ExperimentErrorEntity> experimentErrors) { + this.experimentErrors = experimentErrors; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentErrorEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentErrorEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentErrorEntity.java new file mode 100644 index 0000000..45c47ad --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentErrorEntity.java @@ -0,0 +1,116 @@ +/* + * + * 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.core.entities.expcatalog; + +import javax.persistence.*; +import java.util.List; + +@Entity +@Table(name = "EXPERIMENT_ERROR") +public class ExperimentErrorEntity { + private String errorId; + private String experimentId; + private long creationTime; + private String actualErrorMessage; + private String userFriendlyMessage; + private boolean transientOrPersistent; + private List<String> rootCauseErrorIdList; + + private ExperimentEntity experiment; + + @Id + @Column(name = "ERROR_ID") + public String getErrorId() { + return errorId; + } + + public void setErrorId(String errorId) { + this.errorId = errorId; + } + + @Column(name = "EXPERIMENT_ID") + public String getExperimentId() { + return experimentId; + } + + public void setExperimentId(String experimentId) { + this.experimentId = experimentId; + } + + @Column(name = "CREATION_TIME") + public long getCreationTime() { + return creationTime; + } + + public void setCreationTime(long creationTime) { + this.creationTime = creationTime; + } + + @Column(name = "ACTUAL_ERROR_MESSAGE") + public String getActualErrorMessage() { + return actualErrorMessage; + } + + public void setActualErrorMessage(String actualErrorMessage) { + this.actualErrorMessage = actualErrorMessage; + } + + @Column(name = "USER_FRIENDLY_MESSAGE") + public String getUserFriendlyMessage() { + return userFriendlyMessage; + } + + public void setUserFriendlyMessage(String userFriendlyMessage) { + this.userFriendlyMessage = userFriendlyMessage; + } + + + @Column(name = "TRANSIENT_OR_PERSISTENT") + public boolean isTransientOrPersistent() { + return transientOrPersistent; + } + + public void setTransientOrPersistent(boolean transientOrPersistent) { + this.transientOrPersistent = transientOrPersistent; + } + + + @ElementCollection + @CollectionTable(name="EXPERIMENT_ERROR_ROOT_CAUSE_ERROR_ID", joinColumns = @JoinColumn(name="ERROR_ID")) + public List<String> getRootCauseErrorIdList() { + return rootCauseErrorIdList; + } + + public void setRootCauseErrorIdList(List<String> rootCauseErrorIdList) { + this.rootCauseErrorIdList = rootCauseErrorIdList; + } + + + @ManyToOne(targetEntity = ExperimentEntity.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "EXPERIMENT_ID", referencedColumnName = "EXPERIMENT_ID") + public ExperimentEntity getExperiment() { + return experiment; + } + + public void setExperiment(ExperimentEntity experiment) { + this.experiment = experiment; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentInputEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentInputEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentInputEntity.java new file mode 100644 index 0000000..eeca021 --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentInputEntity.java @@ -0,0 +1,171 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.entities.expcatalog; + +import javax.persistence.*; + +@Entity +@Table(name = "EXPERIMENT_INPUT") +public class ExperimentInputEntity { + private String experimentId; + public String name; + public String value; + public String type; + public String applicationArgument; + public boolean standardInput; + public String userFriendlyDescription; + public String metaData; + public int inputOrder; + public boolean isRequired; + public boolean requiredToAddedToCommandLine; + public boolean dataStaged; + public String storageResourceId; + + private ExperimentEntity experiment; + + @Id + @Column(name = "EXPERIMENT_ID") + public String getExperimentId() { + return experimentId; + } + + public void setExperimentId(String experimentId) { + this.experimentId = experimentId; + } + + @Column(name = "INPUT_NAME") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Column(name = "INPUT_VALUE") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Column(name = "INPUT_TYPE") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + @Column(name = "APPLICATION_ARGUMENT") + public String getApplicationArgument() { + return applicationArgument; + } + + public void setApplicationArgument(String applicationArgument) { + this.applicationArgument = applicationArgument; + } + + @Column(name = "STANDARD_INPUT") + public boolean isStandardInput() { + return standardInput; + } + + public void setStandardInput(boolean standardInput) { + this.standardInput = standardInput; + } + + @Column(name = "USER_FRIENDLY_DESCRIPTION") + public String getUserFriendlyDescription() { + return userFriendlyDescription; + } + + public void setUserFriendlyDescription(String userFriendlyDescription) { + this.userFriendlyDescription = userFriendlyDescription; + } + + @Column(name = "METADATA") + public String getMetaData() { + return metaData; + } + + public void setMetaData(String metaData) { + this.metaData = metaData; + } + + @Column(name = "INPUT_ORDER") + public int getInputOrder() { + return inputOrder; + } + + public void setInputOrder(int inputOrder) { + this.inputOrder = inputOrder; + } + + @Column(name = "REQUIRED") + public boolean isRequired() { + return isRequired; + } + + public void setIsRequired(boolean isRequired) { + this.isRequired = isRequired; + } + + @Column(name = "REQUIRED_TO_ADDED_TO_COMMANDLINE") + public boolean isRequiredToAddedToCommandLine() { + return requiredToAddedToCommandLine; + } + + public void setRequiredToAddedToCommandLine(boolean requiredToAddedToCommandLine) { + this.requiredToAddedToCommandLine = requiredToAddedToCommandLine; + } + + @Column(name = "DATA_STAGED") + public boolean isDataStaged() { + return dataStaged; + } + + public void setDataStaged(boolean dataStaged) { + this.dataStaged = dataStaged; + } + + @Column(name = "STORAGE_RESOURCE_ID") + public String getStorageResourceId() { + return storageResourceId; + } + + public void setStorageResourceId(String storageResourceId) { + this.storageResourceId = storageResourceId; + } + + @ManyToOne(targetEntity = ExperimentEntity.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "EXPERIMENT_ID", referencedColumnName = "EXPERIMENT_ID") + public ExperimentEntity getExperiment() { + return experiment; + } + + public void setExperiment(ExperimentEntity experiment) { + this.experiment = experiment; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentOutputEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentOutputEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentOutputEntity.java new file mode 100644 index 0000000..9cb2702 --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentOutputEntity.java @@ -0,0 +1,153 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.entities.expcatalog; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name = "EXPERIMENT_OUTPUT") +public class ExperimentOutputEntity { + private String experimentId; + public String name; + public String value; + public String type; + public String applicationArgument; + public boolean isRequired; + public boolean requiredToAddedToCommandLine; + public boolean dataMovement; + public String location; + public String searchQuery; + public boolean outputStreaming; + public String storageResourceId; + + @Id + @Column(name = "EXPERIMENT_ID") + public String getExperimentId() { + return experimentId; + } + + public void setExperimentId(String experimentId) { + this.experimentId = experimentId; + } + + @Column(name = "OUTPUT_NAME") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Column(name = "OUTPUT_VALUE") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Column(name = "OUTPUT_TYPE") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + @Column(name = "APPLICATION_ARGUMENT") + public String getApplicationArgument() { + return applicationArgument; + } + + public void setApplicationArgument(String applicationArgument) { + this.applicationArgument = applicationArgument; + } + + @Column(name = "REQUIRED") + public boolean isRequired() { + return isRequired; + } + + public void setIsRequired(boolean isRequired) { + this.isRequired = isRequired; + } + + + @Column(name = "REQUIRED_TO_ADDED_TO_COMMANDLINE") + public boolean isRequiredToAddedToCommandLine() { + return requiredToAddedToCommandLine; + } + + public void setRequiredToAddedToCommandLine(boolean requiredToAddedToCommandLine) { + this.requiredToAddedToCommandLine = requiredToAddedToCommandLine; + } + + @Column(name = "DATA_MOVEMENT") + public boolean isDataMovement() { + return dataMovement; + } + + public void setDataMovement(boolean dataMovement) { + this.dataMovement = dataMovement; + } + + @Column(name = "LOCATION") + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + @Column(name = "SEARCH_QUERY") + public String getSearchQuery() { + return searchQuery; + } + + public void setSearchQuery(String searchQuery) { + this.searchQuery = searchQuery; + } + + @Column(name = "OUTPUT_STREAMING") + public boolean isOutputStreaming() { + return outputStreaming; + } + + public void setOutputStreaming(boolean outputStreaming) { + this.outputStreaming = outputStreaming; + } + + @Column(name = "STORAGE_RESOURCE_ID") + public String getStorageResourceId() { + return storageResourceId; + } + + public void setStorageResourceId(String storageResourceId) { + this.storageResourceId = storageResourceId; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/UserConfigurationEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/UserConfigurationEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/UserConfigurationEntity.java new file mode 100644 index 0000000..06e3b37 --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/UserConfigurationEntity.java @@ -0,0 +1,131 @@ +/* + * + * 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.core.entities.expcatalog; + +import javax.persistence.*; + +@Entity +@Table(name = "USER_CONFIGURATION_ENTITY") +public class UserConfigurationEntity { + private String experimentId; + private boolean airavataAutoSchedule; + private boolean overrideManualScheduledParams; + private boolean throttleResources; + private String userDN; + private boolean generateCert; + private String storageId; + private String experimentDataDir; + + private ComputeResourceSchedulingEntity computeResourceSchedulingEntity; + private ExperimentEntity experiment; + + @Id + @Column(name = "EXPERIMENT_ID") + public String getExperimentId() { + return experimentId; + } + + public void setExperimentId(String experimentId) { + this.experimentId = experimentId; + } + + @Column(name = "AIRAVATA_AUTO_SCHEDULE") + public boolean isAiravataAutoSchedule() { + return airavataAutoSchedule; + } + + public void setAiravataAutoSchedule(boolean airavataAutoSchedule) { + this.airavataAutoSchedule = airavataAutoSchedule; + } + + @Column(name = "OVERRIDE_MANUAL_SCHEDULED_PARAMS") + public boolean isOverrideManualScheduledParams() { + return overrideManualScheduledParams; + } + + public void setOverrideManualScheduledParams(boolean overrideManualScheduledParams) { + this.overrideManualScheduledParams = overrideManualScheduledParams; + } + + @Column(name = "THROTTLE_RESOURCE") + public boolean isThrottleResources() { + return throttleResources; + } + + public void setThrottleResources(boolean throttleResources) { + this.throttleResources = throttleResources; + } + + @Column(name = "USER_DN") + public String getUserDN() { + return userDN; + } + + public void setUserDN(String userDN) { + this.userDN = userDN; + } + + @Column(name = "GENERATE_CERT") + public boolean isGenerateCert() { + return generateCert; + } + + public void setGenerateCert(boolean generateCert) { + this.generateCert = generateCert; + } + + @Column(name = "STORAGE_ID") + public String getStorageId() { + return storageId; + } + + public void setStorageId(String storageId) { + this.storageId = storageId; + } + + @Column(name = "EXPERIMENT_DATA_DIR") + public String getExperimentDataDir() { + return experimentDataDir; + } + + public void setExperimentDataDir(String experimentDataDir) { + this.experimentDataDir = experimentDataDir; + } + + @OneToOne(targetEntity = ComputeResourceSchedulingEntity.class, cascade = CascadeType.ALL, mappedBy = "userConfiguration") + public ComputeResourceSchedulingEntity getComputeResourceSchedulingEntity() { + return computeResourceSchedulingEntity; + } + + public void setComputeResourceSchedulingEntity(ComputeResourceSchedulingEntity computeResourceSchedulingEntity) { + this.computeResourceSchedulingEntity = computeResourceSchedulingEntity; + } + + @OneToOne(targetEntity = ExperimentEntity.class, cascade = CascadeType.ALL) + @PrimaryKeyJoinColumn(name = "EXPERIMENT_ID", referencedColumnName = "EXPERIMENT_ID") + public ExperimentEntity getExperiment() { + return experiment; + } + + public void setExperiment(ExperimentEntity experiment) { + this.experiment = experiment; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/GatewayEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/GatewayEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/GatewayEntity.java new file mode 100644 index 0000000..6ba10fe --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/GatewayEntity.java @@ -0,0 +1,221 @@ +/* + * + * 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.core.entities.workspacecatalog; + +import javax.persistence.*; + +@Entity +@Table(name="GATEWAY") +public class GatewayEntity { + private String gatewayId; + private String gatewayName; + private String domain; + private String emailAddress; + private String gatewayApprovalStatus; + private String gatewayAcronym; + private String gatewayUrl; + private String gatewayPublicAbstract; + private String reviewProposalDescription; + private String gatewayAdminFirstName; + private String getGatewayAdminLastName; + private String gatewayAdminEmail; + private String identityServerUserName; + private String identityServerPasswordToken; + private String declinedReason; + private String oauthClientId; + private String getOauthClientSecret; + private long requestCreationTime; + private String requesterUsername; + + @Id + @Column(name = "GATEWAY_ID") + public String getGatewayId() { + return gatewayId; + } + + public void setGatewayId(String id) { + this.gatewayId = id; + } + + @Column(name = "GATEWAY_NAME") + public String getGatewayName() { + return gatewayName; + } + + public void setGatewayName(String gatewayName) { + this.gatewayName = gatewayName; + } + + @Column(name = "GATEWAY_DOMAIN") + public String getDomain() { + return domain; + } + + public void setDomain(String domain) { + this.domain = domain; + } + + @Column(name = "EMAIL_ADDRESS") + public String getEmailAddress() { + return emailAddress; + } + + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + @Column(name = "GATEWAY_APPROVAL_STATUS") + public String getGatewayApprovalStatus() { + return gatewayApprovalStatus; + } + + public void setGatewayApprovalStatus(String gatewayApprovalStatus) { + this.gatewayApprovalStatus = gatewayApprovalStatus; + } + + @Column(name = "GATEWAY_ACRONYM") + public String getGatewayAcronym() { + return gatewayAcronym; + } + + public void setGatewayAcronym(String gatewayAcronym) { + this.gatewayAcronym = gatewayAcronym; + } + + @Column(name = "GATEWAY_URL") + public String getGatewayUrl() { + return gatewayUrl; + } + + public void setGatewayUrl(String gatewayUrl) { + this.gatewayUrl = gatewayUrl; + } + + @Lob + @Column(name = "GATEWAY_PUBLIC_ABSTRACT") + public String getGatewayPublicAbstract() { + return gatewayPublicAbstract; + } + + public void setGatewayPublicAbstract(String gatewayPublicAbstract) { + this.gatewayPublicAbstract = gatewayPublicAbstract; + } + + @Lob + @Column(name = "REVIEW_PROPOSAL_DESCRIPTION") + public String getReviewProposalDescription() { + return reviewProposalDescription; + } + + public void setReviewProposalDescription(String reviewProposalDescription) { + this.reviewProposalDescription = reviewProposalDescription; + } + + @Column(name = "GATEWAY_ADMIN_FIRST_NAME") + public String getGatewayAdminFirstName() { + return gatewayAdminFirstName; + } + + public void setGatewayAdminFirstName(String gatewayAdminFirstName) { + this.gatewayAdminFirstName = gatewayAdminFirstName; + } + + @Column(name = "GATEWAY_ADMIN_LAST_NAME") + public String getGetGatewayAdminLastName() { + return getGatewayAdminLastName; + } + + public void setGetGatewayAdminLastName(String getGatewayAdminLastName) { + this.getGatewayAdminLastName = getGatewayAdminLastName; + } + + @Column(name = "GATEWAY_ADMIN_EMAIL") + public String getGatewayAdminEmail() { + return gatewayAdminEmail; + } + + public void setGatewayAdminEmail(String gatewayAdminEmail) { + this.gatewayAdminEmail = gatewayAdminEmail; + } + + @Column(name = "IDENTITY_SERVER_USERNAME") + public String getIdentityServerUserName() { + return identityServerUserName; + } + + public void setIdentityServerUserName(String identityServerUserName) { + this.identityServerUserName = identityServerUserName; + } + + @Column(name = "IDENTITY_SERVER_PASSWORD_TOKEN") + public String getIdentityServerPasswordToken() { + return identityServerPasswordToken; + } + + public void setIdentityServerPasswordToken(String identityServerPasswordToken) { + this.identityServerPasswordToken = identityServerPasswordToken; + } + + @Column(name = "REQUESTER_USERNAME") + public String getRequesterUsername() { + return requesterUsername; + } + + public void setRequesterUsername(String requesterUsername) { + this.requesterUsername = requesterUsername; + } + + @Column(name = "DECLINED_REASON") + public String getDeclinedReason() { + return declinedReason; + } + + public void setDeclinedReason(String declinedReason) { + this.declinedReason = declinedReason; + } + + @Column(name = "OAUTH_CLIENT_ID") + public String getOauthClientId() { + return oauthClientId; + } + + public void setOauthClientId(String oauthClientId) { + this.oauthClientId = oauthClientId; + } + + @Column(name = "REQUEST_CREATION_TIME") + public long getRequestCreationTime() { + return requestCreationTime; + } + + public void setRequestCreationTime(long requestCreationTime) { + this.requestCreationTime = requestCreationTime; + } + + @Column(name = "OAUTH_CLIENT_SECRET") + public String getGetOauthClientSecret() { + return getOauthClientSecret; + } + + public void setGetOauthClientSecret(String oauthClientSecret) { + this.getOauthClientSecret = oauthClientSecret; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/NSFDemographicsEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/NSFDemographicsEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/NSFDemographicsEntity.java new file mode 100644 index 0000000..4f7aa7a --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/NSFDemographicsEntity.java @@ -0,0 +1,94 @@ +/* + * + * 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.core.entities.workspacecatalog; + +import javax.persistence.*; +import java.util.List; + +@Entity +@Table(name = "NSF_DEMOGRAPHIC") +public class NSFDemographicsEntity { + private String airavataInternalUserId; + private String gender; + private List<String> ethnicities; + private List<String> races; + private List<String> disabilities; + private UserProfileEntity userProfile; + + @Id + @Column(name = "AIRAVATA_INTERNAL_USER_ID") + public String getAiravataInternalUserId() { + return airavataInternalUserId; + } + + public void setAiravataInternalUserId(String userId) { + this.airavataInternalUserId = userId; + } + + @Column(name = "GENDER") + public String getGender() { + return gender; + } + + public void setGender(String gender) { + this.gender = gender; + } + + @ElementCollection + @CollectionTable(name="NSF_DEMOGRAPHIC_ETHNICITY", joinColumns = @JoinColumn(name="AIRAVATA_INTERNAL_USER_ID")) + public List<String> getEthnicities() { + return ethnicities; + } + + public void setEthnicities(List<String> ethnicities) { + this.ethnicities = ethnicities; + } + + @ElementCollection + @CollectionTable(name="NSF_DEMOGRAPHIC_RACE", joinColumns = @JoinColumn(name="AIRAVATA_INTERNAL_USER_ID")) + public List<String> getRaces() { + return races; + } + + public void setRaces(List<String> races) { + this.races = races; + } + + @ElementCollection + @CollectionTable(name="NSF_DEMOGRAPHIC_DISABILITY", joinColumns = @JoinColumn(name="AIRAVATA_INTERNAL_USER_ID")) + public List<String> getDisabilities() { + return disabilities; + } + + public void setDisabilities(List<String> disabilities) { + this.disabilities = disabilities; + } + + @OneToOne(targetEntity = UserProfileEntity.class, cascade = CascadeType.ALL) + @PrimaryKeyJoinColumn(name = "AIRAVATA_INTERNAL_USER_ID", referencedColumnName = "AIRAVATA_INTERNAL_USER_ID") + public UserProfileEntity getUserProfile() { + return userProfile; + } + + public void setUserProfile(UserProfileEntity userProfile) { + this.userProfile = userProfile; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/NotificationEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/NotificationEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/NotificationEntity.java new file mode 100644 index 0000000..5a0805c --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/NotificationEntity.java @@ -0,0 +1,110 @@ +/* + * + * 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.core.entities.workspacecatalog; + +import javax.persistence.*; + +@Entity +@Table(name = "NOTIFICATION") +public class NotificationEntity { + private String notificationId; + private String gatewayId; + private String title; + private String notificationMessage; + private long creationTime; + private long publishedTime; + private long expirationTime; + private String priority; + + @Id + @Column(name = "NOTIFICATION_ID") + public String getNotificationId() { + return notificationId; + } + + public void setNotificationId(String notificationId) { + this.notificationId = notificationId; + } + + @Column(name = "GATEWAY_ID") + public String getGatewayId() { + return gatewayId; + } + + public void setGatewayId(String gatewayId) { + this.gatewayId = gatewayId; + } + + @Column(name = "TITLE") + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + @Lob + @Column(name = "NOTIFICATION_MESSAGE") + public String getNotificationMessage() { + return notificationMessage; + } + + public void setNotificationMessage(String notificationMessage) { + this.notificationMessage = notificationMessage; + } + + @Column(name = "CREATION_TIME") + public long getCreationTime() { + return creationTime; + } + + public void setCreationTime(long creationTime) { + this.creationTime = creationTime; + } + + @Column(name = "PUBLISHED_TIME") + public long getPublishedTime() { + return publishedTime; + } + + public void setPublishedTime(long publishedTime) { + this.publishedTime = publishedTime; + } + + @Column(name = "EXPIRATION_TIME") + public long getExpirationTime() { + return expirationTime; + } + + public void setExpirationTime(long expirationTime) { + this.expirationTime = expirationTime; + } + + @Column(name = "PRIORITY") + public String getPriority() { + return priority; + } + + public void setPriority(String priority) { + this.priority = priority; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/ProjectEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/ProjectEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/ProjectEntity.java new file mode 100644 index 0000000..2cfdd04 --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/ProjectEntity.java @@ -0,0 +1,92 @@ +/* + * + * 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.core.entities.workspacecatalog; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name = "PROJECT") +public class ProjectEntity { + private String projectID; + private String owner; + private String gatewayId; + private String name; + private String description; + private long creationTime; + + @Id + @Column(name = "PROJECT_ID") + public String getProjectID() { + return projectID; + } + + public void setProjectID(String projectID) { + this.projectID = projectID; + } + + @Column(name = "OWNER") + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + @Column(name = "GATEWAY_ID") + public String getGatewayId() { + return gatewayId; + } + + public void setGatewayId(String gatewayId) { + this.gatewayId = gatewayId; + } + + @Column(name = "PROJECT_NAME") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Column(name = "DESCRIPTION") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + @Column(name = "CREATION_TIME") + public long getCreationTime() { + return creationTime; + } + + public void setCreationTime(long creationTime) { + this.creationTime = creationTime; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/UserProfileEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/UserProfileEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/UserProfileEntity.java new file mode 100644 index 0000000..11f6e33 --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workspacecatalog/UserProfileEntity.java @@ -0,0 +1,247 @@ +/* + * + * 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.core.entities.workspacecatalog; + +import javax.persistence.*; +import java.util.List; + +@Entity +@Table(name="USER_PROFILE") +public class UserProfileEntity { + private String airavataInternalUserId; + private String userId; + private String gatewayId; + private String userModelVersion; + private String userName; + private String orcidId; + private String country; + private String homeOrganization; + private String orginationAffiliation; + private long creationTime; + private long lastAccessTime; + private long validUntil; + private String state; + private String comments; + private List<String> labeledURI; + private String gpgKey; + private String timeZone; + + private List<String> nationality; + private List<String> emails; + private List<String> phones; + private NSFDemographicsEntity nsfDemographics; + + @Id + @Column(name = "AIRAVATA_INTERNAL_USER_ID") + public String getAiravataInternalUserId() { + return airavataInternalUserId; + } + + public void setAiravataInternalUserId(String id) { + this.airavataInternalUserId = id; + } + + @Column(name = "USER_ID") + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + @Column(name = "GATEWAY_ID") + public String getGatewayId() { + return gatewayId; + } + + public void setGatewayId(String gatewayId) { + this.gatewayId = gatewayId; + } + + @Column(name = "USER_MODEL_VERSION") + public String getUserModelVersion() { + return userModelVersion; + } + + public void setUserModelVersion(String userModelVersion) { + this.userModelVersion = userModelVersion; + } + + @ElementCollection + @CollectionTable(name="USER_PROFILE_EMAIL", joinColumns = @JoinColumn(name="AIRAVATA_INTERNAL_USER_ID")) + public List<String> getEmails() { + return emails; + } + + public void setEmails(List<String> emails) { + this.emails = emails; + } + + @Column(name = "USER_NAME") + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + @Column(name = "ORCID_ID") + public String getOrcidId() { + return orcidId; + } + + public void setOrcidId(String orcidId) { + this.orcidId = orcidId; + } + + @ElementCollection + @CollectionTable(name="USER_PROFILE_PHONE", joinColumns = @JoinColumn(name="AIRAVATA_INTERNAL_USER_ID")) + public List<String> getPhones() { + return phones; + } + + public void setPhones(List<String> phones) { + this.phones = phones; + } + + @Column(name = "COUNTRY") + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + @ElementCollection + @CollectionTable(name="USER_PROFILE_NATIONALITY", joinColumns = @JoinColumn(name="AIRAVATA_INTERNAL_USER_ID")) + public List<String> getNationality() { + return nationality; + } + + public void setNationality(List<String> nationality) { + this.nationality = nationality; + } + + @Column(name = "HOME_ORGANIZATION") + public String getHomeOrganization() { + return homeOrganization; + } + + public void setHomeOrganization(String homeOrganization) { + this.homeOrganization = homeOrganization; + } + + @Column(name = "ORIGINATION_AFFILIATION") + public String getOrginationAffiliation() { + return orginationAffiliation; + } + + public void setOrginationAffiliation(String orginationAffiliation) { + this.orginationAffiliation = orginationAffiliation; + } + + @Column(name="CREATION_TIME") + public long getCreationTime() { + return creationTime; + } + + public void setCreationTime(long creationTime) { + this.creationTime = creationTime; + } + + @Column(name = "LAST_ACCESS_TIME") + public long getLastAccessTime() { + return lastAccessTime; + } + + public void setLastAccessTime(long lastAccessTime) { + this.lastAccessTime = lastAccessTime; + } + + @Column(name = "VALID_UNTIL") + public long getValidUntil() { + return validUntil; + } + + public void setValidUntil(long validUntil) { + this.validUntil = validUntil; + } + + @Column(name = "STATE") + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + @Lob + @Column(name = "COMMENTS") + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + @ElementCollection + @CollectionTable(name="USER_PROFILE_LABELED_URI", joinColumns = @JoinColumn(name="AIRAVATA_INTERNAL_USER_ID")) + public List<String> getLabeledURI() { + return labeledURI; + } + + public void setLabeledURI(List<String> labeledURI) { + this.labeledURI = labeledURI; + } + + @Lob + @Column(name = "GPG_KEY") + public String getGpgKey() { + return gpgKey; + } + + public void setGpgKey(String gpgKey) { + this.gpgKey = gpgKey; + } + + @Column(name = "TIME_ZONE") + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(String timeZone) { + this.timeZone = timeZone; + } + + @OneToOne(targetEntity = NSFDemographicsEntity.class, cascade = CascadeType.ALL, mappedBy = "userProfile") + public NSFDemographicsEntity getNsfDemographics() { + return nsfDemographics; + } + + public void setNsfDemographics(NSFDemographicsEntity nsfDemographics) { + this.nsfDemographics = nsfDemographics; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/AbstractRepository.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/AbstractRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/AbstractRepository.java new file mode 100644 index 0000000..1e906ba --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/AbstractRepository.java @@ -0,0 +1,78 @@ +/* + * + * 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.core.repositories; + +import org.apache.airavata.registry.core.utils.JPAUtils; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; + +public abstract class AbstractRepository<T, E, Id> { + private final static Logger logger = LoggerFactory.getLogger(AbstractRepository.class); + + private Class<T> thriftGenericClass; + private Class<E> dbEntityGenericClass; + + public AbstractRepository(Class<T> thriftGenericClass, Class<E> dbEntityGenericClass){ + this.thriftGenericClass = thriftGenericClass; + this.dbEntityGenericClass = dbEntityGenericClass; + } + + public T create(T t){ + return update(t); + } + + public T update(T t){ + Mapper mapper = ObjectMapperSingleton.getInstance(); + E entity = mapper.map(t, dbEntityGenericClass); + E persistedCopy = JPAUtils.execute(entityManager -> entityManager.merge(entity)); + return mapper.map(persistedCopy, thriftGenericClass); + } + + public boolean delete(Id id){ + JPAUtils.execute(entityManager -> { + E entity = entityManager.find(dbEntityGenericClass, id); + entityManager.remove(entity); + return entity; + }); + return true; + } + + public T get(Id id){ + E entity = JPAUtils.execute(entityManager -> entityManager + .find(dbEntityGenericClass, id)); + Mapper mapper = ObjectMapperSingleton.getInstance(); + return mapper.map(entity, thriftGenericClass); + } + + public List<T> select(String query, int limit, int offset){ + List resultSet = JPAUtils.execute(entityManager -> entityManager.createQuery(query).setFirstResult(offset) + .setMaxResults(offset).getResultList()); + Mapper mapper = ObjectMapperSingleton.getInstance(); + List<T> gatewayList = new ArrayList<>(); + resultSet.stream().forEach(rs -> gatewayList.add(mapper.map(rs, thriftGenericClass))); + return gatewayList; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRespository.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRespository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRespository.java new file mode 100644 index 0000000..62d0976 --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRespository.java @@ -0,0 +1,43 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.repositories.expcatalog; + +import org.apache.airavata.model.experiment.ExperimentModel; +import org.apache.airavata.registry.core.entities.expcatalog.ExperimentEntity; +import org.apache.airavata.registry.core.repositories.AbstractRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; + +public class ExperimentRespository extends AbstractRepository<ExperimentModel, ExperimentEntity, String> { + private final static Logger logger = LoggerFactory.getLogger(ExperimentRespository.class); + + public ExperimentRespository(Class<ExperimentModel> thriftGenericClass, Class<ExperimentEntity> dbEntityGenericClass) { + super(thriftGenericClass, dbEntityGenericClass); + } + + @Override + public List<ExperimentModel> select(String criteria, int offset, int limit){ + throw new UnsupportedOperationException("Due to performance overheads this method is not supported. Instead use" + + " ExperimentSummaryRepository"); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/GatewayRepository.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/GatewayRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/GatewayRepository.java new file mode 100644 index 0000000..aed6681 --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/GatewayRepository.java @@ -0,0 +1,35 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.repositories.workspacecatalog; + +import org.apache.airavata.model.workspace.Gateway; +import org.apache.airavata.registry.core.entities.workspacecatalog.GatewayEntity; +import org.apache.airavata.registry.core.repositories.AbstractRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class GatewayRepository extends AbstractRepository<Gateway, GatewayEntity, String> { + private final static Logger logger = LoggerFactory.getLogger(GatewayRepository.class); + + public GatewayRepository(Class<Gateway> thriftGenericClass, Class<GatewayEntity> dbEntityGenericClass) { + super(thriftGenericClass, dbEntityGenericClass); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/NotificationRepository.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/NotificationRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/NotificationRepository.java new file mode 100644 index 0000000..8332024 --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/NotificationRepository.java @@ -0,0 +1,35 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.repositories.workspacecatalog; + +import org.apache.airavata.model.workspace.Notification; +import org.apache.airavata.registry.core.entities.workspacecatalog.NotificationEntity; +import org.apache.airavata.registry.core.repositories.AbstractRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class NotificationRepository extends AbstractRepository<Notification, NotificationEntity, String> { + private final static Logger logger = LoggerFactory.getLogger(NotificationRepository.class); + + public NotificationRepository(Class thriftGenericClass, Class dbEntityGenericClass) { + super(thriftGenericClass, dbEntityGenericClass); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/ProjectRepository.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/ProjectRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/ProjectRepository.java new file mode 100644 index 0000000..eebf5fb --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/ProjectRepository.java @@ -0,0 +1,35 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.repositories.workspacecatalog; + +import org.apache.airavata.model.workspace.Project; +import org.apache.airavata.registry.core.entities.workspacecatalog.ProjectEntity; +import org.apache.airavata.registry.core.repositories.AbstractRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ProjectRepository extends AbstractRepository<Project, ProjectEntity, String> { + private final static Logger logger = LoggerFactory.getLogger(ProjectRepository.class); + + public ProjectRepository(Class<Project> thriftGenericClass, Class<ProjectEntity> dbEntityGenericClass) { + super(thriftGenericClass, dbEntityGenericClass); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ad06b474/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/UserProfileRepository.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/UserProfileRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/UserProfileRepository.java new file mode 100644 index 0000000..f067370 --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workspacecatalog/UserProfileRepository.java @@ -0,0 +1,43 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.repositories.workspacecatalog; + +import org.apache.airavata.model.user.UserProfile; +import org.apache.airavata.registry.core.entities.workspacecatalog.UserProfileEntity; +import org.apache.airavata.registry.core.repositories.AbstractRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; + +public class UserProfileRepository extends AbstractRepository<UserProfile, UserProfileEntity, String> { + private final static Logger logger = LoggerFactory.getLogger(UserProfileRepository.class); + + public UserProfileRepository(Class<UserProfile> thriftGenericClass, Class<UserProfileEntity> dbEntityGenericClass) { + super(thriftGenericClass, dbEntityGenericClass); + } + + @Override + public List<UserProfile> select(String query, int offset, int limit) { + throw new UnsupportedOperationException("Due to performance overheads this method is not supported. Instead use" + + " UserProfileSummaryRepository"); + } +} \ No newline at end of file