Refactor profile-gateway-core to profile-tenant-core
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/1a619c98 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/1a619c98 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/1a619c98 Branch: refs/heads/develop Commit: 1a619c98e2fff342a119928963895e90f9a797b3 Parents: f9e4b0d Author: Gourav Shenoy <[email protected]> Authored: Tue Mar 7 16:56:07 2017 -0500 Committer: Gourav Shenoy <[email protected]> Committed: Tue Mar 7 16:56:07 2017 -0500 ---------------------------------------------------------------------- airavata-services/profile-service/pom.xml | 2 +- .../profile-gateway-core/pom.xml | 61 ---- .../profile/gateway/core/entities/Gateway.java | 225 --------------- .../gateway/core/entities/GatewayProfile.java | 100 ------- .../gateway/core/impl/GatewayRegistry.java | 137 --------- .../gateway/core/resources/GatewayResource.java | 279 ------------------- .../profile/gateway/core/util/GatewayUtils.java | 266 ------------------ .../profile/gateway/core/util/JPAConstants.java | 33 --- .../profile/gateway/core/util/JPAUtils.java | 50 ---- .../gateway/core/util/QueryConstants.java | 15 - .../profile/gateway/core/util/Utils.java | 155 ----------- .../src/main/resources/META-INF/persistence.xml | 32 --- .../profile-service-server/pom.xml | 2 +- .../handlers/GatewayProfileServiceHandler.java | 130 --------- .../handlers/TenantProfileServiceHandler.java | 130 +++++++++ .../profile-service/profile-tenant-core/pom.xml | 61 ++++ .../profile/tenant/core/entities/Gateway.java | 224 +++++++++++++++ .../tenant/core/entities/GatewayProfile.java | 100 +++++++ .../tenant/core/impl/GatewayRegistry.java | 137 +++++++++ .../tenant/core/resources/GatewayResource.java | 278 ++++++++++++++++++ .../profile/tenant/core/util/GatewayUtils.java | 265 ++++++++++++++++++ .../profile/tenant/core/util/JPAConstants.java | 33 +++ .../profile/tenant/core/util/JPAUtils.java | 50 ++++ .../tenant/core/util/QueryConstants.java | 15 + .../service/profile/tenant/core/util/Utils.java | 155 +++++++++++ .../src/main/resources/META-INF/persistence.xml | 32 +++ 26 files changed, 1482 insertions(+), 1485 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/1a619c98/airavata-services/profile-service/pom.xml ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/pom.xml b/airavata-services/profile-service/pom.xml index 556f6de..a989e37 100644 --- a/airavata-services/profile-service/pom.xml +++ b/airavata-services/profile-service/pom.xml @@ -20,7 +20,7 @@ <modules> <module>profile-service-stubs</module> <module>profile-user-core</module> - <module>profile-gateway-core</module> + <module>profile-tenant-core</module> <module>profile-service-server</module> </modules> http://git-wip-us.apache.org/repos/asf/airavata/blob/1a619c98/airavata-services/profile-service/profile-gateway-core/pom.xml ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-gateway-core/pom.xml b/airavata-services/profile-service/profile-gateway-core/pom.xml deleted file mode 100644 index 9eb0f0b..0000000 --- a/airavata-services/profile-service/profile-gateway-core/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?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"> - <parent> - <artifactId>profile-service</artifactId> - <groupId>org.apache.airavata</groupId> - <version>0.17-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <modelVersion>4.0.0</modelVersion> - <artifactId>profile-gateway-core</artifactId> - <name>Profile Gateway Core</name> - - <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> - <openjpa.version>2.2.0</openjpa.version> - </properties> - - <dependencies> - <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>${openjpa.version}</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> - </dependencies> -</project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/1a619c98/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/entities/Gateway.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/entities/Gateway.java b/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/entities/Gateway.java deleted file mode 100644 index 728c206..0000000 --- a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/entities/Gateway.java +++ /dev/null @@ -1,225 +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.service.profile.gateway.core.entities; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.persistence.*; -import java.sql.Timestamp; -import java.util.Collection; - -@Entity -@Table(name = "GATEWAY") -public class Gateway { - private final static Logger logger = LoggerFactory.getLogger(Gateway.class); - 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 Timestamp requestCreationTime; - private String requesterUsername; - - @Id - @Column(name = "GATEWAY_ID") - public String getGatewayId() { - return gatewayId; - } - - public void setGatewayId(String gatewayId) { - this.gatewayId = gatewayId; - } - - @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; - } - - @Column(name = "GATEWAY_PUBLIC_ABSTRACT") - public String getGatewayPublicAbstract() { - return gatewayPublicAbstract; - } - - public void setGatewayPublicAbstract(String gatewayPublicAbstract) { - this.gatewayPublicAbstract = gatewayPublicAbstract; - } - - @Column(name = "GATEWAY_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 Timestamp getRequestCreationTime() { - return requestCreationTime; - } - - public void setRequestCreationTime(Timestamp 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/1a619c98/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/entities/GatewayProfile.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/entities/GatewayProfile.java b/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/entities/GatewayProfile.java deleted file mode 100644 index 6c5796b..0000000 --- a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/entities/GatewayProfile.java +++ /dev/null @@ -1,100 +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.service.profile.gateway.core.entities; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; -import java.io.Serializable; -import java.sql.Timestamp; - -@Entity -@Table(name = "GATEWAY_PROFILE") -public class GatewayProfile implements Serializable { - @Id - @Column(name = "GATEWAY_ID") - private String gatewayID; - @Column(name = "CREATION_TIME") - private Timestamp creationTime; - - @Column(name = "UPDATE_TIME") - private Timestamp updateTime; - - @Column(name = "CS_TOKEN") - private String credentialStoreToken; - - @Column(name = "IDENTITY_SERVER_TENANT") - private String identityServerTenant; - - @Column(name = "IDENTITY_SERVER_PWD_CRED_TOKEN") - private String identityServerPwdCredToken; - - public Timestamp getCreationTime() { - return creationTime; - } - - public void setCreationTime(Timestamp creationTime) { - this.creationTime = creationTime; - } - - public Timestamp getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Timestamp updateTime) { - this.updateTime = updateTime; - } - - - public String getGatewayID() { - return gatewayID; - } - - public void setGatewayID(String gatewayID) { - this.gatewayID = gatewayID; - } - - public String getCredentialStoreToken() { - return credentialStoreToken; - } - - public void setCredentialStoreToken(String credentialStoreToken) { - this.credentialStoreToken = credentialStoreToken; - } - - public String getIdentityServerTenant() { - return identityServerTenant; - } - - public void setIdentityServerTenant(String identityServerTenant) { - this.identityServerTenant = identityServerTenant; - } - - public String getIdentityServerPwdCredToken() { - return identityServerPwdCredToken; - } - - public void setIdentityServerPwdCredToken(String identityServerPwdCredToken) { - this.identityServerPwdCredToken = identityServerPwdCredToken; - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/1a619c98/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/impl/GatewayRegistry.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/impl/GatewayRegistry.java b/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/impl/GatewayRegistry.java deleted file mode 100644 index 4e6b3c2..0000000 --- a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/impl/GatewayRegistry.java +++ /dev/null @@ -1,137 +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.service.profile.gateway.core.impl; - -import org.apache.airavata.model.workspace.Gateway; -import org.apache.airavata.service.profile.gateway.core.resources.GatewayResource; -import org.apache.airavata.service.profile.gateway.core.util.GatewayUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.List; - -public class GatewayRegistry { - - private final static Logger logger = LoggerFactory.getLogger(GatewayRegistry.class); - - public GatewayResource getExistingGateway (String gatewayName) throws Exception { - return GatewayUtils.getGateway(gatewayName); - } - - public String addGateway (Gateway gateway) throws Exception { - try { - GatewayResource resource = GatewayUtils.createGateway(gateway.getGatewayId()); - resource.setGatewayApprovalStatus(gateway.getGatewayApprovalStatus().toString()); - resource.setGatewayName(gateway.getGatewayName()); - resource.setEmailAddress(gateway.getEmailAddress()); - resource.setDomain(gateway.getDomain()); - resource.setGatewayAcronym(gateway.getGatewayAcronym()); - resource.setGatewayUrl(gateway.getGatewayURL()); - resource.setGatewayPublicAbstract(gateway.getGatewayPublicAbstract()); - resource.setReviewProposalDescription(gateway.getReviewProposalDescription()); - resource.setGatewayAdminFirstName(gateway.getGatewayAdminFirstName()); - resource.setGetGatewayAdminLastName(gateway.getGatewayAdminLastName()); - resource.setGatewayAdminEmail(gateway.getGatewayAdminEmail()); - resource.setIdentityServerUserName(gateway.getIdentityServerUserName()); - resource.setIdentityServerPasswordToken(gateway.getIdentityServerPasswordToken()); - resource.setDeclinedReason(gateway.getDeclinedReason()); - resource.setOauthClientId(gateway.getOauthClientId()); - resource.setOauthClientSecret(gateway.getOauthClientSecret()); - resource.setRequestCreationTime(new Timestamp(System.currentTimeMillis())); - resource.setRequesterUsername(gateway.getRequesterUsername()); - resource.save(); - return gateway.getGatewayId(); - } catch (Exception e){ - logger.error("Error while saving gateway to registry, reason: " + e.getMessage(), e); - throw e; - } - } - - public void updateGateway (String gatewayId, Gateway updatedGateway) throws Exception { - try { - GatewayResource existingGateway = GatewayUtils.getGateway(gatewayId); - existingGateway.setGatewayApprovalStatus(updatedGateway.getGatewayApprovalStatus().toString()); - existingGateway.setGatewayName(updatedGateway.getGatewayName()); - existingGateway.setEmailAddress(updatedGateway.getEmailAddress()); - existingGateway.setDomain(updatedGateway.getDomain()); - existingGateway.setGatewayAcronym(updatedGateway.getGatewayAcronym()); - existingGateway.setGatewayUrl(updatedGateway.getGatewayURL()); - existingGateway.setGatewayPublicAbstract(updatedGateway.getGatewayPublicAbstract()); - existingGateway.setReviewProposalDescription(updatedGateway.getReviewProposalDescription()); - existingGateway.setGatewayAdminFirstName(updatedGateway.getGatewayAdminFirstName()); - existingGateway.setGetGatewayAdminLastName(updatedGateway.getGatewayAdminLastName()); - existingGateway.setGatewayAdminEmail(updatedGateway.getGatewayAdminEmail()); - existingGateway.setIdentityServerUserName(updatedGateway.getIdentityServerUserName()); - existingGateway.setIdentityServerPasswordToken(updatedGateway.getIdentityServerPasswordToken()); - existingGateway.setDeclinedReason(updatedGateway.getDeclinedReason()); - existingGateway.setOauthClientId(updatedGateway.getOauthClientId()); - existingGateway.setOauthClientSecret(updatedGateway.getOauthClientSecret()); - existingGateway.setRequesterUsername(updatedGateway.getRequesterUsername()); - existingGateway.save(); - } catch (Exception e){ - logger.error("Error while updating gateway to registry, reason: " + e.getMessage(), e); - throw e; - } - } - - public Gateway getGateway (String gatewayId) throws Exception { - try { - GatewayResource resource = GatewayUtils.getGateway(gatewayId); - return GatewayUtils.toGateway(resource); - } catch (Exception e){ - logger.error("Error while getting gateway, reason: " + e.getMessage(), e); - throw e; - } - } - - public boolean isGatewayExist (String gatewayId) throws Exception { - try { - return GatewayUtils.isGatewayExist(gatewayId); - } catch (Exception e){ - logger.error("Error while checking gateway exists, reason: " + e.getMessage(), e); - throw e; - } - } - - public boolean removeGateway (String gatewayId) throws Exception { - try { - return GatewayUtils.removeGateway(gatewayId); - } catch (Exception e){ - logger.error("Error while removing the gateway, reason: " + e.getMessage(), e); - throw new Exception(e); - } - } - - public List<Gateway> getAllGateways () throws Exception { - List<Gateway> gatewayList = new ArrayList<Gateway>(); - try { - List<GatewayResource> allGateways = GatewayUtils.getAllGateways(); - return GatewayUtils.getAllGateways(allGateways); - } catch (Exception e){ - logger.error("Error while getting all the gateways, reason: ", e); - throw e; - } - } - -} http://git-wip-us.apache.org/repos/asf/airavata/blob/1a619c98/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/resources/GatewayResource.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/resources/GatewayResource.java b/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/resources/GatewayResource.java deleted file mode 100644 index f6e4efd..0000000 --- a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/resources/GatewayResource.java +++ /dev/null @@ -1,279 +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.service.profile.gateway.core.resources; - -import org.apache.airavata.service.profile.gateway.core.entities.Gateway; -import org.apache.airavata.service.profile.gateway.core.util.GatewayUtils; -import org.apache.airavata.service.profile.gateway.core.util.JPAUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.persistence.EntityManager; -import java.sql.Timestamp; - -/** - * Created by goshenoy on 3/7/17. - */ -public class GatewayResource { - - private final static Logger logger = LoggerFactory.getLogger(GatewayResource.class); - - 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 oauthClientSecret; - private Timestamp requestCreationTime; - private String requesterUsername; - - public String getGatewayId() { - return gatewayId; - } - - public void setGatewayId(String gatewayId) { - this.gatewayId = gatewayId; - } - - public String getGatewayName() { - return gatewayName; - } - - public void setGatewayName(String gatewayName) { - this.gatewayName = gatewayName; - } - - public String getDomain() { - return domain; - } - - public void setDomain(String domain) { - this.domain = domain; - } - - public String getEmailAddress() { - return emailAddress; - } - - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } - - public String getGatewayApprovalStatus() { - return gatewayApprovalStatus; - } - - public void setGatewayApprovalStatus(String gatewayApprovalStatus) { - this.gatewayApprovalStatus = gatewayApprovalStatus; - } - - public String getGatewayAcronym() { - return gatewayAcronym; - } - - public void setGatewayAcronym(String gatewayAcronym) { - this.gatewayAcronym = gatewayAcronym; - } - - public String getGatewayUrl() { - return gatewayUrl; - } - - public void setGatewayUrl(String gatewayUrl) { - this.gatewayUrl = gatewayUrl; - } - - public String getGatewayPublicAbstract() { - return gatewayPublicAbstract; - } - - public void setGatewayPublicAbstract(String gatewayPublicAbstract) { - this.gatewayPublicAbstract = gatewayPublicAbstract; - } - - public String getReviewProposalDescription() { - return reviewProposalDescription; - } - - public void setReviewProposalDescription(String reviewProposalDescription) { - this.reviewProposalDescription = reviewProposalDescription; - } - - public String getGatewayAdminFirstName() { - return gatewayAdminFirstName; - } - - public void setGatewayAdminFirstName(String gatewayAdminFirstName) { - this.gatewayAdminFirstName = gatewayAdminFirstName; - } - - public String getGetGatewayAdminLastName() { - return getGatewayAdminLastName; - } - - public void setGetGatewayAdminLastName(String getGatewayAdminLastName) { - this.getGatewayAdminLastName = getGatewayAdminLastName; - } - - public String getGatewayAdminEmail() { - return gatewayAdminEmail; - } - - public void setGatewayAdminEmail(String gatewayAdminEmail) { - this.gatewayAdminEmail = gatewayAdminEmail; - } - - public String getIdentityServerUserName() { - return identityServerUserName; - } - - public void setIdentityServerUserName(String identityServerUserName) { - this.identityServerUserName = identityServerUserName; - } - - public String getIdentityServerPasswordToken() { - return identityServerPasswordToken; - } - - public void setIdentityServerPasswordToken(String identityServerPasswordToken) { - this.identityServerPasswordToken = identityServerPasswordToken; - } - - public String getDeclinedReason() { - return declinedReason; - } - - public void setDeclinedReason(String declinedReason) { - this.declinedReason = declinedReason; - } - - public String getOauthClientId() { - return oauthClientId; - } - - public void setOauthClientId(String oauthClientId) { - this.oauthClientId = oauthClientId; - } - - public String getOauthClientSecret() { - return oauthClientSecret; - } - - public void setOauthClientSecret(String oauthClientSecret) { - this.oauthClientSecret = oauthClientSecret; - } - - public Timestamp getRequestCreationTime() { - return requestCreationTime; - } - - public void setRequestCreationTime(Timestamp requestCreationTime) { - this.requestCreationTime = requestCreationTime; - } - - public String getRequesterUsername() { - return requesterUsername; - } - - public void setRequesterUsername(String requesterUsername) { - this.requesterUsername = requesterUsername; - } - - public void save() throws Exception { - EntityManager em = null; - try { - em = JPAUtils.getEntityManager(); - Gateway existingGateway = em.find(Gateway.class, gatewayId); - em.close(); - - em = JPAUtils.getEntityManager(); - em.getTransaction().begin(); - Gateway gateway = new Gateway(); - gateway.setGatewayName(gatewayName); - gateway.setGatewayId(gatewayId); - gateway.setGatewayApprovalStatus(gatewayApprovalStatus); - gateway.setDomain(domain); - gateway.setEmailAddress(emailAddress); - gateway.setGatewayAcronym(gatewayAcronym); - gateway.setGatewayUrl(gatewayUrl); - gateway.setGatewayPublicAbstract(gatewayPublicAbstract); - gateway.setReviewProposalDescription(reviewProposalDescription); - gateway.setGatewayAdminFirstName(gatewayAdminFirstName); - gateway.setGetGatewayAdminLastName(getGatewayAdminLastName); - gateway.setGatewayAdminEmail(gatewayAdminEmail); - gateway.setIdentityServerUserName(identityServerUserName); - gateway.setIdentityServerPasswordToken(identityServerPasswordToken); - gateway.setDeclinedReason(declinedReason); - gateway.setOauthClientId(oauthClientId); - gateway.setGetOauthClientSecret(oauthClientSecret); - gateway.setRequestCreationTime(requestCreationTime); - gateway.setRequesterUsername(requesterUsername); - if (existingGateway != null) { - existingGateway.setDomain(domain); - existingGateway.setGatewayApprovalStatus(gatewayApprovalStatus); - existingGateway.setGatewayName(gatewayName); - gateway.setGatewayApprovalStatus(gatewayApprovalStatus); - existingGateway.setEmailAddress(emailAddress); - existingGateway.setGatewayAcronym(gatewayAcronym); - existingGateway.setGatewayUrl(gatewayUrl); - existingGateway.setGatewayPublicAbstract(gatewayPublicAbstract); - existingGateway.setReviewProposalDescription(reviewProposalDescription); - existingGateway.setGatewayAdminFirstName(gatewayAdminFirstName); - existingGateway.setGetGatewayAdminLastName(getGatewayAdminLastName); - existingGateway.setGatewayAdminEmail(gatewayAdminEmail); - existingGateway.setIdentityServerUserName(identityServerUserName); - existingGateway.setIdentityServerPasswordToken(identityServerPasswordToken); - existingGateway.setDeclinedReason(declinedReason); - existingGateway.setOauthClientId(oauthClientId); - existingGateway.setGetOauthClientSecret(oauthClientSecret); - existingGateway.setRequestCreationTime(requestCreationTime); - existingGateway.setRequesterUsername(requesterUsername); - em.merge(existingGateway); - } else { - em.persist(gateway); - } - em.getTransaction().commit(); - em.close(); - } catch (Exception e) { - logger.error(e.getMessage(), e); - throw e; - } finally { - if (em != null && em.isOpen()) { - if (em.getTransaction().isActive()){ - em.getTransaction().rollback(); - } - em.close(); - } - } - - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/1a619c98/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/GatewayUtils.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/GatewayUtils.java b/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/GatewayUtils.java deleted file mode 100644 index 03d275e..0000000 --- a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/GatewayUtils.java +++ /dev/null @@ -1,266 +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.service.profile.gateway.core.util; - -import org.apache.airavata.model.workspace.GatewayApprovalStatus; -import org.apache.airavata.service.profile.gateway.core.entities.Gateway; -import org.apache.airavata.service.profile.gateway.core.resources.GatewayResource; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import sun.reflect.annotation.ExceptionProxy; - -import javax.persistence.EntityManager; -import javax.persistence.Query; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by goshenoy on 3/7/17. - */ -public class GatewayUtils { - - private final static Logger logger = LoggerFactory.getLogger(GatewayUtils.class); - - /** - * This method converts Gateway object to GatewayResource - * @param gateway - * @return - */ - public static GatewayResource toGatewayResource(Gateway gateway) throws Exception { - GatewayResource gatewayResource = new GatewayResource(); - return toGatewayResource(gatewayResource, gateway); - } - - /** - * This method converts Gateway object to GatewayResource - * @param gatewayResource - * @param gateway - * @return - */ - public static GatewayResource toGatewayResource(GatewayResource gatewayResource, Gateway gateway) throws Exception { - if (gatewayResource != null) { - gatewayResource.setGatewayName(gateway.getGatewayName()); - gatewayResource.setGatewayId(gateway.getGatewayId()); - gatewayResource.setDomain(gateway.getDomain()); - gatewayResource.setEmailAddress(gateway.getEmailAddress()); - gatewayResource.setGatewayApprovalStatus(gateway.getGatewayApprovalStatus()); - gatewayResource.setGatewayAcronym(gateway.getGatewayAcronym()); - gatewayResource.setGatewayUrl(gateway.getGatewayUrl()); - gatewayResource.setGatewayPublicAbstract(gateway.getGatewayPublicAbstract()); - gatewayResource.setReviewProposalDescription(gateway.getReviewProposalDescription()); - gatewayResource.setGatewayAdminFirstName(gateway.getGatewayAdminFirstName()); - gatewayResource.setGetGatewayAdminLastName(gateway.getGetGatewayAdminLastName()); - gatewayResource.setGatewayAdminEmail(gateway.getGatewayAdminEmail()); - gatewayResource.setIdentityServerUserName(gateway.getIdentityServerUserName()); - gatewayResource.setIdentityServerPasswordToken(gateway.getIdentityServerPasswordToken()); - gatewayResource.setDeclinedReason(gateway.getDeclinedReason()); - gatewayResource.setOauthClientId(gateway.getOauthClientId()); - gatewayResource.setRequestCreationTime(gateway.getRequestCreationTime()); - gatewayResource.setRequesterUsername(gateway.getRequesterUsername()); - gatewayResource.setOauthClientSecret(gateway.getGetOauthClientSecret()); - } else { - throw new Exception("Could not get GatewayResource object because Gateway object is null"); - } - return gatewayResource; - } - - /** - * This method converts GatewayResource to Gateway - * @param resource - * @return - */ - public static org.apache.airavata.model.workspace.Gateway toGateway (GatewayResource resource){ - org.apache.airavata.model.workspace.Gateway gateway = new org.apache.airavata.model.workspace.Gateway(); - gateway.setGatewayId(resource.getGatewayId()); - gateway.setGatewayApprovalStatus(GatewayApprovalStatus.valueOf(resource.getGatewayApprovalStatus())); - gateway.setGatewayName(resource.getGatewayName()); - gateway.setDomain(resource.getDomain()); - gateway.setEmailAddress(resource.getEmailAddress()); - gateway.setGatewayAcronym(resource.getGatewayAcronym()); - gateway.setGatewayURL(resource.getGatewayUrl()); - gateway.setGatewayPublicAbstract(resource.getGatewayPublicAbstract()); - gateway.setReviewProposalDescription(resource.getReviewProposalDescription()); - gateway.setDeclinedReason(resource.getDeclinedReason()); - gateway.setGatewayAdminFirstName(resource.getGatewayAdminFirstName()); - gateway.setGatewayAdminLastName(resource.getGetGatewayAdminLastName()); - gateway.setGatewayAdminEmail(resource.getGatewayAdminEmail()); - gateway.setIdentityServerUserName(resource.getIdentityServerUserName()); - gateway.setIdentityServerPasswordToken(resource.getIdentityServerPasswordToken()); - gateway.setOauthClientId(resource.getOauthClientId()); - gateway.setOauthClientSecret(resource.getOauthClientSecret()); - if (resource.getRequestCreationTime() != null) { - gateway.setRequestCreationTime(resource.getRequestCreationTime().getTime()); - } - gateway.setRequesterUsername(resource.getRequesterUsername()); - return gateway; - } - - /** - * This method gets all gateways - * @param gatewayList - * @return - */ - public static List<org.apache.airavata.model.workspace.Gateway> getAllGateways (List<GatewayResource> gatewayList){ - List<org.apache.airavata.model.workspace.Gateway> gateways = new ArrayList<org.apache.airavata.model.workspace.Gateway>(); - for (GatewayResource resource : gatewayList){ - gateways.add(toGateway(resource)); - } - return gateways; - } - - /** - * This method creates new or returns existing gateway - * @param gatewayId - * @return - * @throws Exception - */ - public static GatewayResource createGateway(String gatewayId) throws Exception { - if (!isGatewayExist(gatewayId)) { - GatewayResource gatewayResource = new GatewayResource(); - gatewayResource.setGatewayId(gatewayId); - return gatewayResource; - } else { - return getGateway(gatewayId); - } - } - - /** - * This method checks if a gateway exists - * @param gatewayId - * @return - */ - public static boolean isGatewayExist(String gatewayId) throws Exception { - EntityManager em = null; - try { - em = JPAUtils.getEntityManager(); - em.getTransaction().begin(); - Gateway gateway = em.find(Gateway.class, gatewayId); - return gateway != null; - } catch (Exception e){ - logger.error("Error checking if gateway exists, reason: " + e.getMessage(), e); - throw e; - } finally { - if (em != null && em.isOpen()){ - if (em.getTransaction().isActive()){ - em.getTransaction().rollback(); - } - em.close(); - } - } - } - - - /** - * This method finds a gateway by id - * @param gatewayId - * @return - * @throws Exception - */ - public static GatewayResource getGateway(String gatewayId) throws Exception { - EntityManager em = null; - try { - if (isGatewayExist(gatewayId)) { - em = JPAUtils.getEntityManager(); - Gateway gateway = em.find(Gateway.class, gatewayId); - GatewayResource gatewayResource = toGatewayResource(gateway); - em.close(); - return gatewayResource; - } - } catch (Exception e){ - logger.error("Error finding gateway, reason: " + e.getMessage(), e); - throw e; - } finally { - if (em != null && em.isOpen()){ - if (em.getTransaction().isActive()){ - em.getTransaction().rollback(); - } - em.close(); - } - } - return null; - } - - /** - * This method returns all gateways - * @return - * @throws Exception - */ - public static List<GatewayResource> getAllGateways() throws Exception { - List<GatewayResource> resourceList = new ArrayList<GatewayResource>(); - EntityManager em = null; - try { - em = JPAUtils.getEntityManager(); - em.getTransaction().begin(); - Query query = em.createQuery(QueryConstants.GET_ALL_GATEWAYS); - List results = query.getResultList(); - - if (!results.isEmpty()) { - for (Object result : results) { - Gateway gateway = (Gateway) result; - GatewayResource gatewayResource = toGatewayResource(gateway); - resourceList.add(gatewayResource); - } - } - em.getTransaction().commit(); - em.close(); - } catch (Exception e){ - logger.error(e.getMessage(), e); - throw e; - } finally { - if (em != null && em.isOpen()){ - if (em.getTransaction().isActive()){ - em.getTransaction().rollback(); - } - em.close(); - } - } - return resourceList; - } - - /** - * This method deletes a gateway - * @param gatewayId - * @return - */ - public static boolean removeGateway(String gatewayId) { - EntityManager em = null; - try { - em = JPAUtils.getEntityManager(); - em.getTransaction().begin(); - Query query = em.createQuery(MessageFormat.format(QueryConstants.DELETE_GATEWAY_BY_ID, gatewayId)); - query.executeUpdate(); - em.getTransaction().commit(); - em.close(); - return true; - } catch (Exception e) { - logger.error(e.getMessage(), e); - return false; - }finally { - if (em != null && em.isOpen()){ - if (em.getTransaction().isActive()){ - em.getTransaction().rollback(); - } - em.close(); - } - } - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/1a619c98/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/JPAConstants.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/JPAConstants.java b/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/JPAConstants.java deleted file mode 100644 index d9bec3c..0000000 --- a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/JPAConstants.java +++ /dev/null @@ -1,33 +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.service.profile.gateway.core.util; -public class JPAConstants { - public static final String KEY_JDBC_URL = "gateway.profile.catalog.registry.jdbc.url"; - public static final String KEY_JDBC_USER = "gateway.profile.catalog.registry.jdbc.user"; - public static final String KEY_JDBC_PASSWORD = "gateway.profile.catalog.registry.jdbc.password"; - public static final String KEY_JDBC_DRIVER = "gateway.profile.catalog.registry.jdbc.driver"; - // TODO: is this needed? - public static final String KEY_DERBY_START_ENABLE = "gateway.profile.catalog.start.derby.server.mode"; - public static final String VALIDATION_QUERY = "gateway.profile.catalog.validationQuery"; - public static final String JPA_CACHE_SIZE = "gateway.profile.catalog.jpa.cache.size"; - public static final String ENABLE_CACHING = "gateway.profile.catalog.cache.enable"; -} http://git-wip-us.apache.org/repos/asf/airavata/blob/1a619c98/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/JPAUtils.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/JPAUtils.java b/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/JPAUtils.java deleted file mode 100644 index aea36b3..0000000 --- a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/JPAUtils.java +++ /dev/null @@ -1,50 +0,0 @@ - -package org.apache.airavata.service.profile.gateway.core.util; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.persistence.*; -import java.util.HashMap; -import java.util.Map; - -/** - * Created by goshenoy on 3/6/17. - */ -public class JPAUtils { - - private final static Logger logger = LoggerFactory.getLogger(JPAUtils.class); - - private static final String PERSISTENCE_UNIT_NAME = "gateway_profile_catalog"; - - @PersistenceUnit(unitName = PERSISTENCE_UNIT_NAME) - private static EntityManagerFactory factory; - - @PersistenceContext(unitName = PERSISTENCE_UNIT_NAME) - private static EntityManager entityManager; - - public static EntityManager getEntityManager() { - if (factory == null) { - String connectionProperties = "DriverClassName=" + Utils.getJDBCDriver() + "," + "Url=" + - Utils.getJDBCURL() + "?autoReconnect=true," + - "Username=" + Utils.getJDBCUser() + "," + "Password=" + Utils.getJDBCPassword() + - ",validationQuery=" + Utils.getValidationQuery(); - logger.info(connectionProperties); - Map<String, String> properties = new HashMap<String, String>(); - properties.put("openjpa.ConnectionDriverName", "org.apache.commons.dbcp.BasicDataSource"); - properties.put("openjpa.ConnectionProperties", connectionProperties); - properties.put("openjpa.DynamicEnhancementAgent", "true"); - properties.put("openjpa.RuntimeUnenhancedClasses", "warn"); - properties.put("openjpa.RemoteCommitProvider", "sjvm"); - properties.put("openjpa.Log", "DefaultLevel=INFO, Runtime=INFO, Tool=INFO, SQL=INFO"); - properties.put("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)"); - properties.put("openjpa.jdbc.QuerySQLCache", "false"); - properties.put("openjpa.ConnectionFactoryProperties", "PrettyPrint=true, PrettyPrintLineLength=72," + - " PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=31536000, autoReconnect=true"); - factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME, properties); - } - - entityManager = factory.createEntityManager(); - return entityManager; - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/1a619c98/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/QueryConstants.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/QueryConstants.java b/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/QueryConstants.java deleted file mode 100644 index d41f66e..0000000 --- a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/QueryConstants.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.apache.airavata.service.profile.gateway.core.util; - -import org.apache.airavata.model.user.UserProfile; - -/** - * Created by goshenoy on 11/11/2016. - */ -public class QueryConstants { - - public static final String FIND_GATEWAY_BY_ID = "SELECT g FROM Gateway g where g.gatewayId='{0}'"; - - public static final String GET_ALL_GATEWAYS = "SELECT g FROM Gateway g"; - - public static final String DELETE_GATEWAY_BY_ID = "DELETE FROM Gateway g where g.gatewayId='{0}'"; -} http://git-wip-us.apache.org/repos/asf/airavata/blob/1a619c98/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/Utils.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/Utils.java b/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/Utils.java deleted file mode 100644 index 6bf28e2..0000000 --- a/airavata-services/profile-service/profile-gateway-core/src/main/java/org/apache/airavata/service/profile/gateway/core/util/Utils.java +++ /dev/null @@ -1,155 +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.service.profile.gateway.core.util; - -import org.apache.airavata.common.exception.ApplicationSettingsException; -import org.apache.airavata.common.utils.ServerSettings; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.net.URI; - - -public class Utils { - private final static Logger logger = LoggerFactory.getLogger(Utils.class); - - public static String getJDBCFullURL(){ - String jdbcUrl = getJDBCURL(); - String jdbcUser = getJDBCUser(); - String jdbcPassword = getJDBCPassword(); - jdbcUrl = jdbcUrl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword; - return jdbcUrl; - } - - public static String getJDBCURL(){ - try { - return ServerSettings.getSetting(JPAConstants.KEY_JDBC_URL); - } catch (ApplicationSettingsException e) { - logger.error(e.getMessage(), e); - return null; - } - } - - public static String getHost(){ - try{ - String jdbcURL = getJDBCURL(); - String cleanURI = jdbcURL.substring(5); - URI uri = URI.create(cleanURI); - return uri.getHost(); - } catch (Exception e) { - logger.error(e.getMessage(), e); - return null; - } - } - - public static int getPort(){ - try{ - String jdbcURL = getJDBCURL(); - String cleanURI = jdbcURL.substring(5); - URI uri = URI.create(cleanURI); - return uri.getPort(); - } catch (Exception e) { - logger.error(e.getMessage(), e); - return -1; - } - } - - public static int getJPACacheSize (){ - try { - String cache = ServerSettings.getSetting(JPAConstants.JPA_CACHE_SIZE, "5000"); - return Integer.parseInt(cache); - }catch (Exception e){ - logger.error(e.getMessage(), e); - return -1; - } - } - - public static String isCachingEnabled (){ - try { - return ServerSettings.getSetting(JPAConstants.ENABLE_CACHING, "true"); - }catch (Exception e){ - logger.error(e.getMessage(), e); - return "true"; - } - } - - public static String getDBType(){ - try{ - String jdbcURL = getJDBCURL(); - String cleanURI = jdbcURL.substring(5); - URI uri = URI.create(cleanURI); - return uri.getScheme(); - } catch (Exception e) { - logger.error(e.getMessage(), e); - return null; - } - } - - public static boolean isDerbyStartEnabled(){ - try { - String s = ServerSettings.getSetting(JPAConstants.KEY_DERBY_START_ENABLE); - if("true".equals(s)){ - return true; - } - } catch (ApplicationSettingsException e) { - logger.error(e.getMessage(), e); - return false; - } - return false; - } - - public static String getJDBCUser(){ - try { - return ServerSettings.getSetting(JPAConstants.KEY_JDBC_USER); - } catch (ApplicationSettingsException e) { - logger.error(e.getMessage(), e); - return null; - } - } - - public static String getValidationQuery(){ - try { - return ServerSettings.getSetting(JPAConstants.VALIDATION_QUERY); - } catch (ApplicationSettingsException e) { - logger.error(e.getMessage(), e); - return null; - } - } - - public static String getJDBCPassword(){ - try { - return ServerSettings.getSetting(JPAConstants.KEY_JDBC_PASSWORD); - } catch (ApplicationSettingsException e) { - logger.error(e.getMessage(), e); - return null; - } - - } - - public static String getJDBCDriver(){ - try { - return ServerSettings.getSetting(JPAConstants.KEY_JDBC_DRIVER); - } catch (ApplicationSettingsException e) { - logger.error(e.getMessage(), e); - return null; - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/1a619c98/airavata-services/profile-service/profile-gateway-core/src/main/resources/META-INF/persistence.xml ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-gateway-core/src/main/resources/META-INF/persistence.xml b/airavata-services/profile-service/profile-gateway-core/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index 2482da5..0000000 --- a/airavata-services/profile-service/profile-gateway-core/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.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. - * -* --> -<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> - <persistence-unit name="gateway_profile_catalog"> - <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider> - - <exclude-unlisted-classes>true</exclude-unlisted-classes> - <properties> - <property name="openjpa.jdbc.MappingDefaults" - value="ForeignKeyDeleteAction=cascade, JoinForeignKeyDeleteAction=cascade" /> - </properties> - </persistence-unit> -</persistence> http://git-wip-us.apache.org/repos/asf/airavata/blob/1a619c98/airavata-services/profile-service/profile-service-server/pom.xml ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-service-server/pom.xml b/airavata-services/profile-service/profile-service-server/pom.xml index df2a7ec..51f1a7b 100644 --- a/airavata-services/profile-service/profile-service-server/pom.xml +++ b/airavata-services/profile-service/profile-service-server/pom.xml @@ -27,7 +27,7 @@ </dependency> <dependency> <groupId>org.apache.airavata</groupId> - <artifactId>profile-gateway-core</artifactId> + <artifactId>profile-tenant-core</artifactId> <version>${project.version}</version> </dependency> </dependencies> http://git-wip-us.apache.org/repos/asf/airavata/blob/1a619c98/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/GatewayProfileServiceHandler.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/GatewayProfileServiceHandler.java b/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/GatewayProfileServiceHandler.java deleted file mode 100644 index d36af84..0000000 --- a/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/GatewayProfileServiceHandler.java +++ /dev/null @@ -1,130 +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.service.profile.handlers; - -import org.apache.airavata.model.workspace.Gateway; -import org.apache.airavata.service.profile.gateway.core.impl.GatewayRegistry; -import org.apache.airavata.service.profile.gateway.cpi.GatewayProfileService; -import org.apache.airavata.service.profile.gateway.cpi.exception.GatewayProfileServiceException; -import org.apache.airavata.service.profile.gateway.cpi.profile_gateway_cpiConstants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; - -/** - * Created by goshenoy on 3/6/17. - */ -public class GatewayProfileServiceHandler implements GatewayProfileService.Iface { - - private final static Logger logger = LoggerFactory.getLogger(GatewayProfileServiceHandler.class); - - private final GatewayRegistry gatewayRegistry = new GatewayRegistry(); - - @Override - public String getAPIVersion() throws GatewayProfileServiceException { - try { - return profile_gateway_cpiConstants.GATEWAY_PROFILE_CPI_VERSION; - } catch (Exception ex) { - logger.error("Error getting API version, reason: " + ex.getMessage(), ex); - GatewayProfileServiceException exception = new GatewayProfileServiceException(); - exception.setMessage("Error getting API version, reason: " + ex.getMessage()); - throw exception; - } - } - - @Override - public String addGateway(Gateway gateway) throws GatewayProfileServiceException { - try { - String gatewayId = gatewayRegistry.addGateway(gateway); - logger.debug("Airavata added gateway-profile with ID: " + gatewayId); - return gatewayId; - } catch (Exception ex) { - logger.error("Error adding gateway-profile, reason: " + ex.getMessage(), ex); - GatewayProfileServiceException exception = new GatewayProfileServiceException(); - exception.setMessage("Error adding gateway-profile, reason: " + ex.getMessage()); - throw exception; - } - } - - @Override - public boolean updateGateway(String gatewayId, Gateway updatedGateway) throws GatewayProfileServiceException { - try { - logger.debug("Updating gateway-profile with ID: " + gatewayId); - gatewayRegistry.updateGateway(gatewayId, updatedGateway); - return true; - } catch (Exception ex) { - logger.error("Error updating gateway-profile, reason: " + ex.getMessage(), ex); - GatewayProfileServiceException exception = new GatewayProfileServiceException(); - exception.setMessage("Error updating gateway-profile, reason: " + ex.getMessage()); - return false; - } - } - - @Override - public Gateway getGateway(String gatewayId) throws GatewayProfileServiceException { - try { - return gatewayRegistry.getGateway(gatewayId); - } catch (Exception ex) { - logger.error("Error getting gateway-profile, reason: " + ex.getMessage(), ex); - GatewayProfileServiceException exception = new GatewayProfileServiceException(); - exception.setMessage("Error getting gateway-profile, reason: " + ex.getMessage()); - throw exception; - } - } - - @Override - public boolean deleteGateway(String gatewayId) throws GatewayProfileServiceException { - try { - logger.debug("Deleting Airavata gateway-profile with ID: " + gatewayId); - return gatewayRegistry.removeGateway(gatewayId); - } catch (Exception ex) { - logger.error("Error deleting gateway-profile, reason: " + ex.getMessage(), ex); - GatewayProfileServiceException exception = new GatewayProfileServiceException(); - exception.setMessage("Error deleting gateway-profile, reason: " + ex.getMessage()); - throw exception; - } - } - - @Override - public List<Gateway> getAllGateways() throws GatewayProfileServiceException { - try { - return gatewayRegistry.getAllGateways(); - } catch (Exception ex) { - logger.error("Error getting all gateway-profiles, reason: " + ex.getMessage(), ex); - GatewayProfileServiceException exception = new GatewayProfileServiceException(); - exception.setMessage("Error getting all gateway-profiles, reason: " + ex.getMessage()); - throw exception; - } - } - - @Override - public boolean isGatewayExist(String gatewayId) throws GatewayProfileServiceException { - try { - return gatewayRegistry.isGatewayExist(gatewayId); - } catch (Exception ex) { - logger.error("Error checking if gateway-profile exists, reason: " + ex.getMessage(), ex); - GatewayProfileServiceException exception = new GatewayProfileServiceException(); - exception.setMessage("Error checking if gateway-profile exists, reason: " + ex.getMessage()); - throw exception; - } - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/1a619c98/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/TenantProfileServiceHandler.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/TenantProfileServiceHandler.java b/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/TenantProfileServiceHandler.java new file mode 100644 index 0000000..16a5666 --- /dev/null +++ b/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/TenantProfileServiceHandler.java @@ -0,0 +1,130 @@ +/* + * + * 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.service.profile.handlers; + +import org.apache.airavata.model.workspace.Gateway; +import org.apache.airavata.service.profile.tenant.core.impl.GatewayRegistry; +import org.apache.airavata.service.profile.gateway.cpi.GatewayProfileService; +import org.apache.airavata.service.profile.gateway.cpi.exception.GatewayProfileServiceException; +import org.apache.airavata.service.profile.gateway.cpi.profile_gateway_cpiConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; + +/** + * Created by goshenoy on 3/6/17. + */ +public class TenantProfileServiceHandler implements GatewayProfileService.Iface { + + private final static Logger logger = LoggerFactory.getLogger(TenantProfileServiceHandler.class); + + private final GatewayRegistry gatewayRegistry = new GatewayRegistry(); + + @Override + public String getAPIVersion() throws GatewayProfileServiceException { + try { + return profile_gateway_cpiConstants.GATEWAY_PROFILE_CPI_VERSION; + } catch (Exception ex) { + logger.error("Error getting API version, reason: " + ex.getMessage(), ex); + GatewayProfileServiceException exception = new GatewayProfileServiceException(); + exception.setMessage("Error getting API version, reason: " + ex.getMessage()); + throw exception; + } + } + + @Override + public String addGateway(Gateway gateway) throws GatewayProfileServiceException { + try { + String gatewayId = gatewayRegistry.addGateway(gateway); + logger.debug("Airavata added gateway-profile with ID: " + gatewayId); + return gatewayId; + } catch (Exception ex) { + logger.error("Error adding gateway-profile, reason: " + ex.getMessage(), ex); + GatewayProfileServiceException exception = new GatewayProfileServiceException(); + exception.setMessage("Error adding gateway-profile, reason: " + ex.getMessage()); + throw exception; + } + } + + @Override + public boolean updateGateway(String gatewayId, Gateway updatedGateway) throws GatewayProfileServiceException { + try { + logger.debug("Updating gateway-profile with ID: " + gatewayId); + gatewayRegistry.updateGateway(gatewayId, updatedGateway); + return true; + } catch (Exception ex) { + logger.error("Error updating gateway-profile, reason: " + ex.getMessage(), ex); + GatewayProfileServiceException exception = new GatewayProfileServiceException(); + exception.setMessage("Error updating gateway-profile, reason: " + ex.getMessage()); + return false; + } + } + + @Override + public Gateway getGateway(String gatewayId) throws GatewayProfileServiceException { + try { + return gatewayRegistry.getGateway(gatewayId); + } catch (Exception ex) { + logger.error("Error getting gateway-profile, reason: " + ex.getMessage(), ex); + GatewayProfileServiceException exception = new GatewayProfileServiceException(); + exception.setMessage("Error getting gateway-profile, reason: " + ex.getMessage()); + throw exception; + } + } + + @Override + public boolean deleteGateway(String gatewayId) throws GatewayProfileServiceException { + try { + logger.debug("Deleting Airavata gateway-profile with ID: " + gatewayId); + return gatewayRegistry.removeGateway(gatewayId); + } catch (Exception ex) { + logger.error("Error deleting gateway-profile, reason: " + ex.getMessage(), ex); + GatewayProfileServiceException exception = new GatewayProfileServiceException(); + exception.setMessage("Error deleting gateway-profile, reason: " + ex.getMessage()); + throw exception; + } + } + + @Override + public List<Gateway> getAllGateways() throws GatewayProfileServiceException { + try { + return gatewayRegistry.getAllGateways(); + } catch (Exception ex) { + logger.error("Error getting all gateway-profiles, reason: " + ex.getMessage(), ex); + GatewayProfileServiceException exception = new GatewayProfileServiceException(); + exception.setMessage("Error getting all gateway-profiles, reason: " + ex.getMessage()); + throw exception; + } + } + + @Override + public boolean isGatewayExist(String gatewayId) throws GatewayProfileServiceException { + try { + return gatewayRegistry.isGatewayExist(gatewayId); + } catch (Exception ex) { + logger.error("Error checking if gateway-profile exists, reason: " + ex.getMessage(), ex); + GatewayProfileServiceException exception = new GatewayProfileServiceException(); + exception.setMessage("Error checking if gateway-profile exists, reason: " + ex.getMessage()); + throw exception; + } + } +} http://git-wip-us.apache.org/repos/asf/airavata/blob/1a619c98/airavata-services/profile-service/profile-tenant-core/pom.xml ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-tenant-core/pom.xml b/airavata-services/profile-service/profile-tenant-core/pom.xml new file mode 100644 index 0000000..4f7eba8 --- /dev/null +++ b/airavata-services/profile-service/profile-tenant-core/pom.xml @@ -0,0 +1,61 @@ +<?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"> + <parent> + <artifactId>profile-service</artifactId> + <groupId>org.apache.airavata</groupId> + <version>0.17-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <modelVersion>4.0.0</modelVersion> + <artifactId>profile-tenant-core</artifactId> + <name>Profile Gateway Core</name> + + <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> + <openjpa.version>2.2.0</openjpa.version> + </properties> + + <dependencies> + <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>${openjpa.version}</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> + </dependencies> +</project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/1a619c98/airavata-services/profile-service/profile-tenant-core/src/main/java/org/apache/airavata/service/profile/tenant/core/entities/Gateway.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-tenant-core/src/main/java/org/apache/airavata/service/profile/tenant/core/entities/Gateway.java b/airavata-services/profile-service/profile-tenant-core/src/main/java/org/apache/airavata/service/profile/tenant/core/entities/Gateway.java new file mode 100644 index 0000000..504bf8d --- /dev/null +++ b/airavata-services/profile-service/profile-tenant-core/src/main/java/org/apache/airavata/service/profile/tenant/core/entities/Gateway.java @@ -0,0 +1,224 @@ +/* + * + * 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.service.profile.tenant.core.entities; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.persistence.*; +import java.sql.Timestamp; + +@Entity +@Table(name = "GATEWAY") +public class Gateway { + private final static Logger logger = LoggerFactory.getLogger(Gateway.class); + 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 Timestamp requestCreationTime; + private String requesterUsername; + + @Id + @Column(name = "GATEWAY_ID") + public String getGatewayId() { + return gatewayId; + } + + public void setGatewayId(String gatewayId) { + this.gatewayId = gatewayId; + } + + @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; + } + + @Column(name = "GATEWAY_PUBLIC_ABSTRACT") + public String getGatewayPublicAbstract() { + return gatewayPublicAbstract; + } + + public void setGatewayPublicAbstract(String gatewayPublicAbstract) { + this.gatewayPublicAbstract = gatewayPublicAbstract; + } + + @Column(name = "GATEWAY_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 Timestamp getRequestCreationTime() { + return requestCreationTime; + } + + public void setRequestCreationTime(Timestamp 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
