You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2017/02/02 21:23:59 UTC

[07/14] airavata git commit: renaming classes and including userProfileSerive exception

http://git-wip-us.apache.org/repos/asf/airavata/blob/39e22204/modules/user-profile/user-profile-stubs/src/main/java/org/apache/airavata/userprofile/crude/cpi/client/UserProfileServiceClientFactory.java
----------------------------------------------------------------------
diff --git a/modules/user-profile/user-profile-stubs/src/main/java/org/apache/airavata/userprofile/crude/cpi/client/UserProfileServiceClientFactory.java b/modules/user-profile/user-profile-stubs/src/main/java/org/apache/airavata/userprofile/crude/cpi/client/UserProfileServiceClientFactory.java
deleted file mode 100644
index 536d43c..0000000
--- a/modules/user-profile/user-profile-stubs/src/main/java/org/apache/airavata/userprofile/crude/cpi/client/UserProfileServiceClientFactory.java
+++ /dev/null
@@ -1,43 +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.userprofile.crude.cpi.client;
-
-import org.apache.airavata.registry.api.exception.RegistryServiceException;
-import org.apache.airavata.userprofile.crude.cpi.UserProfileCrudeService;
-import org.apache.thrift.protocol.TBinaryProtocol;
-import org.apache.thrift.protocol.TProtocol;
-import org.apache.thrift.transport.TSocket;
-import org.apache.thrift.transport.TTransport;
-import org.apache.thrift.transport.TTransportException;
-
-
-public class UserProfileServiceClientFactory {
-    public static UserProfileCrudeService.Client createRegistryClient(String serverHost, int serverPort)  throws RegistryServiceException {
-        try {
-            TTransport transport = new TSocket(serverHost, serverPort);
-            transport.open();
-            TProtocol protocol = new TBinaryProtocol(transport);
-            return new UserProfileCrudeService.Client(protocol);
-        } catch (TTransportException e) {
-            throw new RegistryServiceException();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39e22204/modules/user-profile/user-profile-stubs/src/main/java/org/apache/airavata/userprofile/crude/cpi/user_profile_crud_cpiConstants.java
----------------------------------------------------------------------
diff --git a/modules/user-profile/user-profile-stubs/src/main/java/org/apache/airavata/userprofile/crude/cpi/user_profile_crud_cpiConstants.java b/modules/user-profile/user-profile-stubs/src/main/java/org/apache/airavata/userprofile/crude/cpi/user_profile_crud_cpiConstants.java
deleted file mode 100644
index 91eb8c4..0000000
--- a/modules/user-profile/user-profile-stubs/src/main/java/org/apache/airavata/userprofile/crude/cpi/user_profile_crud_cpiConstants.java
+++ /dev/null
@@ -1,57 +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.
-     */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.airavata.userprofile.crude.cpi;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-public class user_profile_crud_cpiConstants {
-
-  public static final String USER_PROFILE_CPI_VERSION = "0.16.0";
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39e22204/thrift-interface-descriptions/component-cpis/generate-cpi-stubs.sh
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/component-cpis/generate-cpi-stubs.sh b/thrift-interface-descriptions/component-cpis/generate-cpi-stubs.sh
old mode 100644
new mode 100755
index 877ba8d..e8e301b
--- a/thrift-interface-descriptions/component-cpis/generate-cpi-stubs.sh
+++ b/thrift-interface-descriptions/component-cpis/generate-cpi-stubs.sh
@@ -73,7 +73,7 @@ GFAC_SRC_DIR='../../modules/gfac/gfac-client/src/main/java/'
 REGISTRY_THRIFT_FILE='registry-api.thrift'
 REGISTRY_SRC_DIR='../../modules/registry/registry-server/registry-api-stubs/src/main/java/'
 
-USER_PROFILE_THRIFT_FILE='user-profile-crud-cpi.thrift'
+USER_PROFILE_THRIFT_FILE='user-profile-cpi.thrift'
 USER_PROFILE_SRC_DIR='../../modules/user-profile/user-profile-stubs/src/main/java/'
 
 # Initialize the thrift arguments.

http://git-wip-us.apache.org/repos/asf/airavata/blob/39e22204/thrift-interface-descriptions/component-cpis/user-profile-cpi.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/component-cpis/user-profile-cpi.thrift b/thrift-interface-descriptions/component-cpis/user-profile-cpi.thrift
new file mode 100644
index 0000000..739ea1c
--- /dev/null
+++ b/thrift-interface-descriptions/component-cpis/user-profile-cpi.thrift
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ *
+ */
+
+/*
+ * Component Programming Interface definition for Apache Airavata User profile registry Service.
+ *
+*/
+
+include "../data-models/user-group-models/user_profile_model.thrift"
+include "user_profile_cpi_errors.thrift"
+
+
+namespace java org.apache.airavata.userprofile.cpi
+
+const string USER_PROFILE_CPI_VERSION = "0.17"
+
+service UserProfileService {
+
+  string addUserProfile (1: required user_profile_model.UserProfile userProfile)
+                        throws (1:user_profile_cpi_errors.UserProfileServiceException userProfileException);
+
+  bool updateUserProfile (1: required user_profile_model.UserProfile userProfile)
+                          throws (1:user_profile_cpi_errors.UserProfileServiceException userProfileException);
+
+  user_profile_model.UserProfile getUserProfileById(1: required string userId, 2: required string gatewayId)
+                                                throws (1:user_profile_cpi_errors.UserProfileServiceException userProfileException);
+
+  bool deleteUserProfile(1: required string userId)
+                                                  throws (1:user_profile_cpi_errors.UserProfileServiceException userProfileException);
+
+  list<user_profile_model.UserProfile> getAllUserProfilesInGateway (1: required string gatewayId, 2: required i32 offset, 3: required i32 limit)
+                          throws (1:user_profile_cpi_errors.UserProfileServiceException userProfileException);
+
+ user_profile_model.UserProfile getUserProfileByName(1: required string userName, 2: required string gatewayId)
+                                                throws (1:user_profile_cpi_errors.UserProfileServiceException userProfileException);
+
+   bool doesUserExist(1: required string userName, 2: required string gatewayId)
+                                                   throws (1:user_profile_cpi_errors.UserProfileServiceException userProfileException);
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/39e22204/thrift-interface-descriptions/component-cpis/user-profile-crud-cpi.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/component-cpis/user-profile-crud-cpi.thrift b/thrift-interface-descriptions/component-cpis/user-profile-crud-cpi.thrift
deleted file mode 100644
index cbdc53c..0000000
--- a/thrift-interface-descriptions/component-cpis/user-profile-crud-cpi.thrift
+++ /dev/null
@@ -1,58 +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.
- *
- */
-
-/*
- * Component Programming Interface definition for Apache Airavata User profile registry Service.
- *
-*/
-
-include "../data-models/user-group-models/user_profile_model.thrift"
-include "registry_api_errors.thrift"
-
-
-namespace java org.apache.airavata.userprofile.crude.cpi
-
-const string USER_PROFILE_CPI_VERSION = "0.16.0"
-
-service UserProfileCrudeService {
-
-  string addUserProfile (1: required user_profile_model.UserProfile userProfile)
-                        throws (1:registry_api_errors.RegistryServiceException registryException);
-
-  bool updateUserProfile (1: required user_profile_model.UserProfile userProfile)
-                          throws (1:registry_api_errors.RegistryServiceException registryException);
-
-  user_profile_model.UserProfile getUserProfileById(1: required string userId, 2: required string gatewayId)
-                                                throws (1:registry_api_errors.RegistryServiceException registryException);
-
-  bool deleteUserProfile(1: required string userId)
-                                                  throws (1:registry_api_errors.RegistryServiceException registryException);
-
-  list<user_profile_model.UserProfile> getAllUserProfilesInGateway (1: required string gatewayId, 2: required i32 offset, 3: required i32 limit)
-                          throws (1:registry_api_errors.RegistryServiceException registryException);
-
- user_profile_model.UserProfile getUserProfileByName(1: required string userName, 2: required string gatewayId)
-                                                throws (1:registry_api_errors.RegistryServiceException registryException);
-
-   bool doesUserExist(1: required string userName, 2: required string gatewayId)
-                                                   throws (1:registry_api_errors.RegistryServiceException registryException);
-
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/39e22204/thrift-interface-descriptions/component-cpis/user_profile_cpi_errors.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/component-cpis/user_profile_cpi_errors.thrift b/thrift-interface-descriptions/component-cpis/user_profile_cpi_errors.thrift
new file mode 100644
index 0000000..bd1984b
--- /dev/null
+++ b/thrift-interface-descriptions/component-cpis/user_profile_cpi_errors.thrift
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ *
+ */
+
+/*
+* This file describes the definitions of the Error Messages that can occur
+*  when invoking Apache Airavata Services through the API. In addition Thrift provides
+*  built in funcationality to raise TApplicationException for all internal server errors.
+*/
+
+namespace java org.apache.airavata.userprofile.cpi.exception
+namespace php Airavata.UserProfile.CPI.Error
+
+exception UserProfileServiceException {
+  1: required string message
+}