Add profile-service-commons dependency 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/45bacd67 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/45bacd67 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/45bacd67 Branch: refs/heads/user-profile Commit: 45bacd67fba7e9d728a8bd05a870745bf6677fed Parents: 5b35224 Author: Gourav Shenoy <[email protected]> Authored: Wed Mar 8 17:00:39 2017 -0500 Committer: Gourav Shenoy <[email protected]> Committed: Wed Mar 8 17:00:39 2017 -0500 ---------------------------------------------------------------------- .../commons/tenant/entities/Gateway.java | 2 +- .../handlers/UserProfileServiceHandler.java | 2 +- .../profile-service/profile-tenant-core/pom.xml | 36 ++------------------ .../tenant/core/impl/GatewayRegistry.java | 24 +++++++++++++ .../src/main/resources/META-INF/persistence.xml | 32 ----------------- .../src/main/resources/META-INF/persistence.xml | 33 ------------------ 6 files changed, 29 insertions(+), 100 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/45bacd67/airavata-services/profile-service/profile-service-commons/src/main/java/org/apache/airavata/service/profile/commons/tenant/entities/Gateway.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-service-commons/src/main/java/org/apache/airavata/service/profile/commons/tenant/entities/Gateway.java b/airavata-services/profile-service/profile-service-commons/src/main/java/org/apache/airavata/service/profile/commons/tenant/entities/Gateway.java index edb2a70..0a67383 100644 --- a/airavata-services/profile-service/profile-service-commons/src/main/java/org/apache/airavata/service/profile/commons/tenant/entities/Gateway.java +++ b/airavata-services/profile-service/profile-service-commons/src/main/java/org/apache/airavata/service/profile/commons/tenant/entities/Gateway.java @@ -210,7 +210,7 @@ public class Gateway { return requestCreationTime; } - private void setRequestCreationTime(long requestCreationTime) { + public void setRequestCreationTime(long requestCreationTime) { this.requestCreationTime = requestCreationTime; } http://git-wip-us.apache.org/repos/asf/airavata/blob/45bacd67/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/UserProfileServiceHandler.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/UserProfileServiceHandler.java b/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/UserProfileServiceHandler.java index 5ddfc19..6f7c1ba 100644 --- a/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/UserProfileServiceHandler.java +++ b/airavata-services/profile-service/profile-service-server/src/main/java/org/apache/airavata/service/profile/handlers/UserProfileServiceHandler.java @@ -21,7 +21,7 @@ package org.apache.airavata.service.profile.handlers; import org.apache.airavata.model.user.UserProfile; -import org.apache.airavata.service.profile.user.core.entities.UserProfileEntity; +import org.apache.airavata.service.profile.commons.user.entities.UserProfileEntity; import org.apache.airavata.service.profile.user.core.repositories.UserProfileRepository; import org.apache.airavata.service.profile.user.cpi.UserProfileService; import org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException; http://git-wip-us.apache.org/repos/asf/airavata/blob/45bacd67/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 index 4f7eba8..d6e2d1a 100644 --- a/airavata-services/profile-service/profile-tenant-core/pom.xml +++ b/airavata-services/profile-service/profile-tenant-core/pom.xml @@ -23,39 +23,9 @@ <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> + <groupId>org.apache.airavata</groupId> + <artifactId>profile-service-commons</artifactId> + <version>${project.version}</version> </dependency> </dependencies> </project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/45bacd67/airavata-services/profile-service/profile-tenant-core/src/main/java/org/apache/airavata/service/profile/tenant/core/impl/GatewayRegistry.java ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-tenant-core/src/main/java/org/apache/airavata/service/profile/tenant/core/impl/GatewayRegistry.java b/airavata-services/profile-service/profile-tenant-core/src/main/java/org/apache/airavata/service/profile/tenant/core/impl/GatewayRegistry.java index 3140e5c..4b90452 100644 --- a/airavata-services/profile-service/profile-tenant-core/src/main/java/org/apache/airavata/service/profile/tenant/core/impl/GatewayRegistry.java +++ b/airavata-services/profile-service/profile-tenant-core/src/main/java/org/apache/airavata/service/profile/tenant/core/impl/GatewayRegistry.java @@ -22,13 +22,17 @@ package org.apache.airavata.service.profile.tenant.core.impl; import org.apache.airavata.model.workspace.Gateway; +import org.apache.airavata.model.workspace.GatewayApprovalStatus; +import org.apache.airavata.service.profile.commons.utils.ObjectMapperSingleton; import org.apache.airavata.service.profile.tenant.core.resources.GatewayResource; import org.apache.airavata.service.profile.tenant.core.util.GatewayUtils; +import org.dozer.Mapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.sql.Timestamp; import java.util.ArrayList; +import java.util.Date; import java.util.List; public class GatewayRegistry { @@ -134,4 +138,24 @@ public class GatewayRegistry { } } +// public static void main(String args[]) { +// Mapper mapper = ObjectMapperSingleton.getInstance(); +// +// Gateway g = new Gateway(); +// g.setGatewayId("sd"); +// g.setRequestCreationTime(1213232); +// g.setGatewayApprovalStatus(GatewayApprovalStatus.ACTIVE); +// System.out.println("T: " + g); +// +// org.apache.airavata.service.profile.commons.tenant.entities.Gateway ge = new org.apache.airavata.service.profile.commons.tenant.entities.Gateway(); +// ge.setGatewayId("ads"); +// ge.setRequestCreationTime(new Date().getTime()); +// ge.setGatewayApprovalStatus("ACTIVE"); +// +// Class t = Gateway.class; +// Class e = org.apache.airavata.service.profile.commons.tenant.entities.Gateway.class; +// Object o = mapper.map(ge, t); +// System.out.println(o); +// } + } http://git-wip-us.apache.org/repos/asf/airavata/blob/45bacd67/airavata-services/profile-service/profile-tenant-core/src/main/resources/META-INF/persistence.xml ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-tenant-core/src/main/resources/META-INF/persistence.xml b/airavata-services/profile-service/profile-tenant-core/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index 2482da5..0000000 --- a/airavata-services/profile-service/profile-tenant-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/45bacd67/airavata-services/profile-service/profile-user-core/src/main/resources/META-INF/persistence.xml ---------------------------------------------------------------------- diff --git a/airavata-services/profile-service/profile-user-core/src/main/resources/META-INF/persistence.xml b/airavata-services/profile-service/profile-user-core/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index 12ae6cc..0000000 --- a/airavata-services/profile-service/profile-user-core/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,33 +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="user_profile_catalog"> - <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider> - <class>org.apache.airavata.user.registry.core.entities.UserProfileEntity</class> - <class>org.apache.airavata.user.registry.core.entities.NSFDemographicsEntity</class> - <exclude-unlisted-classes>true</exclude-unlisted-classes> - <properties> - <property name="openjpa.jdbc.MappingDefaults" - value="ForeignKeyDeleteAction=cascade, JoinForeignKeyDeleteAction=cascade" /> - </properties> - </persistence-unit> -</persistence>
