You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2012/12/04 14:57:32 UTC
svn commit: r1416940 - in /airavata/trunk/modules/rest:
mappings/src/main/java/org/apache/airavata/rest/mappings/utils/
service/src/main/java/org/apache/airavata/services/registry/rest/utils/
service/src/main/resources/
Author: chathuri
Date: Tue Dec 4 13:57:30 2012
New Revision: 1416940
URL: http://svn.apache.org/viewvc?rev=1416940&view=rev
Log:
updating rest service
Modified:
airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RestServicesConstants.java
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/utils/RegPoolUtils.java
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/utils/RegistryListener.java
airavata/trunk/modules/rest/service/src/main/resources/airavata-server.properties
Modified: airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RestServicesConstants.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RestServicesConstants.java?rev=1416940&r1=1416939&r2=1416940&view=diff
==============================================================================
--- airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RestServicesConstants.java (original)
+++ airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RestServicesConstants.java Tue Dec 4 13:57:30 2012
@@ -25,5 +25,6 @@ import org.apache.commons.codec.binary.B
public class RestServicesConstants {
public static final String GATEWAY = "gateway";
+ public static final String AIRAVATA_USER = "airavataUser";
public static final String AIRAVATA_REGISTRY_POOL = "airavataRegistryPool";
}
Modified: airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/utils/RegPoolUtils.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/utils/RegPoolUtils.java?rev=1416940&r1=1416939&r2=1416940&view=diff
==============================================================================
--- airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/utils/RegPoolUtils.java (original)
+++ airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/utils/RegPoolUtils.java Tue Dec 4 13:57:30 2012
@@ -44,7 +44,10 @@ public class RegPoolUtils {
public static AiravataRegistry2 acquireRegistry(ServletContext context) {
AiravataRegistry2 airavataRegistry=null;
RequestContext requestContext = WorkflowContext.get();
- String user = requestContext.getUserIdentity();
+ String user = (String)context.getAttribute(RestServicesConstants.AIRAVATA_USER);
+ if(requestContext != null){
+ user = requestContext.getUserIdentity();
+ }
Gateway gateway = (Gateway)context.getAttribute(RestServicesConstants.GATEWAY);
AiravataUser airavataUser = new AiravataUser(user);
Modified: airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/utils/RegistryListener.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/utils/RegistryListener.java?rev=1416940&r1=1416939&r2=1416940&view=diff
==============================================================================
--- airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/utils/RegistryListener.java (original)
+++ airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/utils/RegistryListener.java Tue Dec 4 13:57:30 2012
@@ -38,9 +38,11 @@ public class RegistryListener implements
try {
ServletContext servletContext = servletContextEvent.getServletContext();
String gatewayID = ServerSettings.getDefaultGatewayId();
+ String user = ServerSettings.getSystemUser();
Gateway gateway = new Gateway(gatewayID);
servletContext.setAttribute(RestServicesConstants.GATEWAY, gateway);
+ servletContext.setAttribute(RestServicesConstants.AIRAVATA_USER, user);
servletContext.setAttribute(RestServicesConstants.AIRAVATA_REGISTRY_POOL,new RegistryInstancesPool(100));
} catch (Exception e) {
e.printStackTrace();
Modified: airavata/trunk/modules/rest/service/src/main/resources/airavata-server.properties
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/resources/airavata-server.properties?rev=1416940&r1=1416939&r2=1416940&view=diff
==============================================================================
--- airavata/trunk/modules/rest/service/src/main/resources/airavata-server.properties (original)
+++ airavata/trunk/modules/rest/service/src/main/resources/airavata-server.properties Tue Dec 4 13:57:30 2012
@@ -26,7 +26,7 @@
###########################################################################
###########################################################################
-# Airavata Axis2-Tomcat Server Configuration
+# Airavata Embedded-Tomcat Server Configuration
###########################################################################
# By default, tomcat runs on port 80. If the port is changed, it will be
# have to be specified with port properties. This will be picked up by
@@ -38,26 +38,30 @@ port=8080
# but some DHCP enables machines do not report correct ip addresses,
# in which case, the IP address can be manually specified.
-#ip=192.2.33.12
+#ip=192.2.33.12
###########################################################################
# Airavata Registry Configuration
###########################################################################
-registry.user=admin
-registry.password=admin
+#registry.user=admin
+#registry.password=admin
gateway.id=default
-registry.jdbc.user=airavata
-registry.jdbc.password=airavata
-start.derby.server.mode=true
+#registry.jdbc.user=airavata
+#registry.jdbc.password=airavata
+#start.derby.server.mode=true
+
+system.gateway=default
+system.user=admin
+system.password=admin
#for mysql
-#registry.jdbc.driver=com.mysql.jdbc.Driver
+ #registry.jdbc.driver=com.mysql.jdbc.Driver
#registry.jdbc.url=jdbc:mysql://localhost:3306/persistent_data
#for derby
-registry.jdbc.driver=org.apache.derby.jdbc.ClientDriver
-registry.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
+#registry.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+#registry.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=true;user=airavata;password=airavata
###########################################################################
# Airavata Workflow Interpreter Configurations
@@ -196,3 +200,5 @@ messagePerservationIntervalDays=0
messagePerservationIntervalHours=1
messagePerservationIntervalMinutes=0
+
+