You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2012/09/01 02:22:09 UTC
svn commit: r1379677 - in
/incubator/airavata/sandbox/airavata-registry-rest: ./
src/main/java/org/apache/airavata/services/registry/rest/
src/main/java/org/apache/airavata/services/registry/rest/resources/
src/main/java/org/apache/airavata/services/re...
Author: smarru
Date: Sat Sep 1 00:22:08 2012
New Revision: 1379677
URL: http://svn.apache.org/viewvc?rev=1379677&view=rev
Log:
commiting Amila's patch to sandbox for AIRAVATA-561
Modified:
incubator/airavata/sandbox/airavata-registry-rest/README.txt
incubator/airavata/sandbox/airavata-registry-rest/pom.xml
incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/User.java
incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/RegistryApplication.java
incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/RegistryResource.java
incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/security/AuthenticationFilter.java
incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/RegistryListener.java
incubator/airavata/sandbox/airavata-registry-rest/src/main/resources/ServiceMessage.xsd
incubator/airavata/sandbox/airavata-registry-rest/src/main/resources/log4j.xml
incubator/airavata/sandbox/airavata-registry-rest/src/main/resources/service.properties
incubator/airavata/sandbox/airavata-registry-rest/src/main/webapp/WEB-INF/web.xml
incubator/airavata/sandbox/airavata-registry-rest/src/main/webapp/index.jsp
incubator/airavata/sandbox/airavata-registry-rest/src/test/resources/service.properties
Modified: incubator/airavata/sandbox/airavata-registry-rest/README.txt
URL: http://svn.apache.org/viewvc/incubator/airavata/sandbox/airavata-registry-rest/README.txt?rev=1379677&r1=1379676&r2=1379677&view=diff
==============================================================================
--- incubator/airavata/sandbox/airavata-registry-rest/README.txt (original)
+++ incubator/airavata/sandbox/airavata-registry-rest/README.txt Sat Sep 1 00:22:08 2012
@@ -4,6 +4,14 @@ mvn clean install
For development run
mvn cargo:start
+Update Message beans
+xjc src/main/resources/ServiceMessage.xsd -p org.apache.airavata.services.message -d src/main/java/
+To build
+mvn clean install
+
+For development run
+mvn cargo:start
+
To test
* Start jackrabbit on port 8081
* for simple methods you can use curl for testing. For example, if you want to get the usename, you can run the command
Modified: incubator/airavata/sandbox/airavata-registry-rest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/sandbox/airavata-registry-rest/pom.xml?rev=1379677&r1=1379676&r2=1379677&view=diff
==============================================================================
--- incubator/airavata/sandbox/airavata-registry-rest/pom.xml (original)
+++ incubator/airavata/sandbox/airavata-registry-rest/pom.xml Sat Sep 1 00:22:08 2012
@@ -107,6 +107,216 @@
<artifactId>airavata-client-api</artifactId>
<version>${airavata.version}</version>
</dependency-->
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-registry-api</artifactId>
+ <version>${airavata.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jackrabbit</groupId>
+ <artifactId>jackrabbit-jcr-rmi</artifactId>
+ <version>2.2.7</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jackrabbit</groupId>
+ <artifactId>jackrabbit-core</artifactId>
+ <version>2.2.7</version>
+ </dependency>
+
+ <!-- Logging -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${org.slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>${org.slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>${org.slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${org.slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-security</artifactId>
+ <version>0.5-incubating-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <jersey.version>1.13</jersey.version>
+ <grizzly.version>2.0.0-M3</grizzly.version>
+ <org.slf4j.version>1.6.1</org.slf4j.version>
+ <log4j.version>1.2.16</log4j.version>
+ <airavata.version>0.4-incubating</airavata.version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <cargo.version>1.2.1</cargo.version>
+ <!-- if you want a remote debugging on a different a address override on
+ command line with -Dcargo.debug.addres=xxxx -->
+ <cargo.debug.address>8000</cargo.debug.address>
+ <!-- if you want to start remote debugging session suspended override on
+ command line with -Dcargo.debug.suspend=y -->
+ <cargo.debug.suspend>n</cargo.debug.suspend>
+ <javaagent />
+ </properties>
+ <repositories>
+ <repository>
+ <id>central</id>
+ <name>Maven Central</name>
+ <url>http://repo1.maven.org/maven2</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <name>ogce.m2.all</name>
+ <id>ogce.m2.all</id>
+ <url>http://community.ucs.indiana.edu:9090/archiva/repository/ogce.m2.all</url>
+ <snapshots>
+ <!--updatePolicy>daily</updatePolicy -->
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>m2-snapshot-repository</id>
+ <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ <releases>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>OW2</id>
+ <name>OW2 Repository</name>
+ <url>http://maven.ow2.org/maven2</url>
+ </repository>
+ </repositories>
+</project>
+<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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.airavata.services</groupId>
+ <artifactId>airavata-registry-rest-services</artifactId>
+ <packaging>war</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <name>airavata-registry-rest-services</name>
+ <build>
+ <finalName>airavata-registry-rest-services</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>${cargo.version}</version>
+ <configuration>
+ <wait>true</wait>
+ <configuration>
+ <properties>
+ <cargo.servlet.port>9080</cargo.servlet.port>
+ <cargo.tomcat.ajp.port>9009</cargo.tomcat.ajp.port>
+ <cargo.rmi.port>9099</cargo.rmi.port>
+ <cargo.jvmargs>
+ <![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=${cargo.debug.address},server=y,suspend=${cargo.debug.suspend} -noverify ${javaagent}]]>
+ </cargo.jvmargs>
+ <cargo.tomcat.context.reloadable>true</cargo.tomcat.context.reloadable>
+ </properties>
+ <home>${project.build.directory}/tomcat6x</home>
+ <deployables>
+ <deployable>
+ <groupId>org.apache.airavata.services</groupId>
+ <artifactId>airavata-registry-rest-services</artifactId>
+ <type>war</type>
+ <properties>
+ <context>/airavata-services</context>
+ </properties>
+ </deployable>
+ </deployables>
+ </configuration>
+ <container>
+ <containerId>tomcat6x</containerId>
+ <timeout>180000</timeout>
+ <zipUrlInstaller>
+ <url>
+ http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.tar.gz
+ </url>
+ </zipUrlInstaller>
+ <systemProperties>
+
+ </systemProperties>
+ </container>
+ </configuration>
+ </plugin>
+ </plugins>
+
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-servlet</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-json</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey.contribs</groupId>
+ <artifactId>jersey-multipart</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey.jersey-test-framework</groupId>
+ <artifactId>jersey-test-framework-grizzly2</artifactId>
+ <version>${jersey.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-server</artifactId>
+ <version>${jersey.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-client</artifactId>
+ <version>${jersey.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>3.0</version>
+ </dependency>
+
+ <!-- Airavata -->
+ <!--dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-client-api</artifactId>
+ <version>${airavata.version}</version>
+ </dependency-->
<dependency>
<groupId>org.apache.airavata</groupId>
<artifactId>airavata-registry-api</artifactId>
Modified: incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/User.java
URL: http://svn.apache.org/viewvc/incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/User.java?rev=1379677&r1=1379676&r2=1379677&view=diff
==============================================================================
--- incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/User.java (original)
+++ incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/User.java Sat Sep 1 00:22:08 2012
@@ -31,3 +31,36 @@ public class User {
this.password = password;
}
}
+package org.apache.airavata.services.registry.rest;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: amila
+ * Date: 8/29/12
+ * Time: 10:33 AM
+ * To change this template use File | Settings | File Templates.
+ */
+public class User {
+
+ private String userName;
+ private String password;
+
+ public User() {
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+}
Modified: incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/RegistryApplication.java
URL: http://svn.apache.org/viewvc/incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/RegistryApplication.java?rev=1379677&r1=1379676&r2=1379677&view=diff
==============================================================================
--- incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/RegistryApplication.java (original)
+++ incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/RegistryApplication.java Sat Sep 1 00:22:08 2012
@@ -19,3 +19,24 @@ public class RegistryApplication extends
}
}
+package org.apache.airavata.services.registry.rest.resources;
+
+import javax.ws.rs.core.Application;
+import java.util.HashSet;
+import java.util.Set;
+
+public class RegistryApplication extends Application {
+ @Override
+ public Set<Class<?>> getClasses() {
+ final Set<Class<?>> classes = new HashSet<Class<?>>();
+ // register root resource
+ classes.add(RegistryResource.class);
+ return classes;
+ }
+
+ @Override
+ public Set<Object> getSingletons() {
+ return super.getSingletons();
+ }
+
+}
Modified: incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/RegistryResource.java
URL: http://svn.apache.org/viewvc/incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/RegistryResource.java?rev=1379677&r1=1379676&r2=1379677&view=diff
==============================================================================
--- incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/RegistryResource.java (original)
+++ incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/resources/RegistryResource.java Sat Sep 1 00:22:08 2012
@@ -11,6 +11,537 @@ import org.apache.airavata.registry.api.
import org.apache.airavata.registry.api.workflow.WorkflowIOData;
import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus;
import org.apache.airavata.registry.api.workflow.WorkflowServiceIOData;
+import org.apache.xmlbeans.XmlException;
+
+import javax.jcr.Node;
+import javax.servlet.ServletContext;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.xml.namespace.QName;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.sql.Timestamp;
+import java.util.List;
+import java.util.Map;
+
+@Path("/airavataRegistry/api")
+public class RegistryResource {
+ private AiravataRegistry airavataRegistry;
+ private Axis2Registry axis2Registry;
+ private DataRegistry dataRegistry;
+
+ @Context
+ ServletContext context;
+
+ @Path("/userName")
+ @GET
+ @Produces("text/plain")
+ public String getUserName() {
+ airavataRegistry = (AiravataRegistry) context.getAttribute("airavataRegistry");
+ return airavataRegistry.getUsername();
+ }
+
+ @Path("/repositoryUrl")
+ @GET
+ @Produces("text/plain")
+ public String getRepositoryURI() {
+ airavataRegistry = (AiravataRegistry) context.getAttribute("airavataRegistry");
+ return airavataRegistry.getRepositoryURI().toString();
+ }
+
+ @Path("/repositoryName")
+ @GET
+ @Produces("text/plain")
+ public String getName() {
+ airavataRegistry = (AiravataRegistry) context.getAttribute("airavataRegistry");
+ return airavataRegistry.getName();
+ }
+
+ @Path("/service/wsdl")
+ @GET
+ @Produces("text/xml")
+ public Response getWSDL(@QueryParam("serviceName") String serviceName) {
+ axis2Registry = (Axis2Registry) context.getAttribute("axis2Registry");
+ try {
+ String result = axis2Registry.getWSDL(serviceName);
+ if (result != null) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity(result);
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+ return builder.build();
+ }
+ } catch (Exception e) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+ return builder.build();
+ }
+ }
+
+
+ //need to check the name
+ @Path("/service/description/wsdl")
+ @GET
+ @Produces("text/xml")
+ public Response getWSDLFromServiceDescription(@FormParam("service") String service) {
+ axis2Registry = (Axis2Registry) context.getAttribute("axis2Registry");
+ try {
+ ServiceDescription serviceDescription = ServiceDescription.fromXML(service);
+ String result = axis2Registry.getWSDL(serviceDescription);
+ if (result != null) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity(result);
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+ return builder.build();
+ }
+ } catch (Exception e) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+ return builder.build();
+ }
+ }
+
+
+
+ @Path("/service/description")
+ @GET
+ @Produces("text/xml")
+ public String getServiceDescription(@QueryParam("serviceID") String serviceId) throws RegistryException {
+ airavataRegistry = (AiravataRegistry) context.getAttribute("airavataRegistry");
+ return airavataRegistry.getServiceDescription(serviceId).toXML();
+ }
+
+ @Path("/service/deploymentDescription")
+ @GET
+ @Produces("text/xml")
+ public String getDeploymentDescription(@QueryParam("serviceID") String serviceId,
+ @QueryParam("hostId") String hostId)
+ throws RegistryException {
+ airavataRegistry = (AiravataRegistry) context.getAttribute("airavataRegistry");
+ return airavataRegistry.getDeploymentDescription(serviceId, hostId).toXML();
+ }
+
+ @Path("host/description")
+ @GET
+ @Produces("text/xml")
+ public String getHostDescription(@QueryParam("hostId") String hostId) throws RegistryException {
+ airavataRegistry = (AiravataRegistry) context.getAttribute("airavataRegistry");
+ return airavataRegistry.getHostDescription(hostId).toXML();
+ }
+
+
+ @POST
+ @Path("save/hostDescription")
+ @Produces("text/plain")
+ public Response saveHostDescription(@FormParam("host") String host) {
+ airavataRegistry = (AiravataRegistry) context.getAttribute("airavataRegistry");
+ try {
+ HostDescription hostDescription = HostDescription.fromXML(host);
+ String result = airavataRegistry.saveHostDescription(hostDescription);
+ if (result != null) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity(result);
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NOT_MODIFIED);
+ return builder.build();
+ }
+ } catch (RegistryException e) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+ return builder.build();
+ } catch (XmlException e) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
+ builder.entity("Invalid XML");
+ return builder.build();
+ }
+ }
+
+ @POST
+ @Path("save/serviceDescription")
+ @Produces("text/plain")
+ public Response saveServiceDescription(@FormParam("service") String service) {
+ airavataRegistry = (AiravataRegistry) context.getAttribute("airavataRegistry");
+ try {
+ ServiceDescription serviceDescription = ServiceDescription.fromXML(service);
+ String result = airavataRegistry.saveServiceDescription(serviceDescription);
+ if (result != null) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity(result);
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NOT_MODIFIED);
+ return builder.build();
+ }
+ } catch (RegistryException e) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+ return builder.build();
+ } catch (XmlException e) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
+ builder.entity("Invalid XML");
+ return builder.build();
+ }
+ }
+
+ @POST
+ @Path("save/deploymentDescription")
+ @Produces("text/plain")
+ public Response saveDeploymentDescription(@FormParam("serviceId") String serviceId,
+ @FormParam("hostId") String hostId,
+ @FormParam("app") String app) {
+
+ airavataRegistry = (AiravataRegistry) context.getAttribute("airavataRegistry");
+ try {
+ ApplicationDeploymentDescription deploymentDescription =
+ ApplicationDeploymentDescription.fromXML(app);
+
+ String result = airavataRegistry.saveDeploymentDescription(serviceId, hostId, deploymentDescription);
+ if (result != null) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity(result);
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NOT_MODIFIED);
+ return builder.build();
+ }
+ } catch (RegistryException e) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+ return builder.build();
+ } catch (XmlException e) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
+ return builder.build();
+ }
+ }
+
+ @POST
+ @Path("service/deployOnHost")
+ @Produces("text/plain")
+ public Response deployServiceOnHost(@FormParam("serviceName") String serviceName,
+ @FormParam("hostName") String hostName) {
+ airavataRegistry = (AiravataRegistry) context.getAttribute("airavataRegistry");
+
+ boolean state;
+ try {
+ state = airavataRegistry.deployServiceOnHost(serviceName, hostName);
+ if (state) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity("True");
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NOT_MODIFIED);
+ return builder.build();
+ }
+ } catch (RegistryException e) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+ return builder.build();
+ }
+ }
+
+ public List<HostDescription> searchHostDescription(String name) throws RegistryException {
+ return null;
+ }
+
+ public List<ServiceDescription> searchServiceDescription(String nameRegEx) throws RegistryException {
+ return null;
+ }
+
+ public List<ApplicationDeploymentDescription> searchDeploymentDescription(String serviceName, String hostName)
+ throws RegistryException {
+ return null;
+ }
+
+ public Map<HostDescription, List<ApplicationDeploymentDescription>> searchDeploymentDescription(String serviceName)
+ throws RegistryException {
+ return null;
+ }
+
+ public List<ApplicationDeploymentDescription> searchDeploymentDescription(String serviceName, String hostName,
+ String applicationName) throws RegistryException {
+ return null;
+ }
+
+ public Map<ApplicationDeploymentDescription, String> searchDeploymentDescription() throws RegistryException {
+ return null;
+ }
+
+ @POST
+ @Path("save/gfacDescriptor")
+ @Produces("text/plain")
+ public Response saveGFacDescriptor(@FormParam("gfacURL") String gfacURL) {
+ airavataRegistry = (AiravataRegistry) context.getAttribute("airavataRegistry");
+ try {
+ Boolean result = airavataRegistry.saveGFacDescriptor(gfacURL);
+ if (result) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity("true");
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NOT_MODIFIED);
+ return builder.build();
+ }
+ } catch (RegistryException e) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+ return builder.build();
+ }
+ }
+
+
+ @DELETE
+ @Path("delete/gfacDescriptor")
+ @Produces("text/plain")
+ public Response deleteGFacDescriptor(@QueryParam("gfacURL") String gfacURL) throws RegistryException {
+ airavataRegistry = (AiravataRegistry) context.getAttribute("airavataRegistry");
+ try {
+ Boolean result = airavataRegistry.deleteGFacDescriptor(gfacURL);
+ if (result) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity("true");
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NOT_MODIFIED);
+ return builder.build();
+ }
+ } catch (RegistryException e) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+ return builder.build();
+ }
+ }
+
+ public List<URI> getInterpreterServiceURLList() throws RegistryException {
+ return null;
+ }
+
+
+ @POST
+ @Path("save/interpreterServiceUrl")
+ @Produces("text/plain")
+ public Response saveInterpreterServiceURL(@QueryParam("gfacURL") String gfacURL) {
+ airavataRegistry = (AiravataRegistry) context.getAttribute("airavataRegistry");
+ try {
+ URI gfacURI = new URI(gfacURL);
+ Boolean result = airavataRegistry.saveInterpreterServiceURL(gfacURI);
+ if (result) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity("true");
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NOT_MODIFIED);
+ return builder.build();
+ }
+ } catch (RegistryException e) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
+ return builder.build();
+ } catch (URISyntaxException e) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
+ return builder.build();
+ }
+ }
+
+
+ @DELETE
+ @Path("delete/interpreterServiceURL")
+ @Produces("text/plain")
+ public Response deleteInterpreterServiceURL(URI gfacURL) throws RegistryException {
+ return null;
+ }
+
+ public List<URI> getMessageBoxServiceURLList() throws RegistryException {
+ return null;
+ }
+
+ public boolean saveMessageBoxServiceURL(URI gfacURL) throws RegistryException {
+ return true;
+ }
+
+ public boolean deleteMessageBoxServiceURL(URI gfacURL) throws RegistryException {
+ return true;
+ }
+
+ public List<URI> getEventingServiceURLList() throws RegistryException {
+ return null;
+ }
+
+ public boolean saveEventingServiceURL(URI gfacURL) throws RegistryException {
+ return true;
+ }
+
+ public boolean deleteEventingServiceURL(URI gfacURL) throws RegistryException {
+ return true;
+ }
+
+ public List<String> getGFacDescriptorList() throws RegistryException {
+ return null;
+ }
+
+ public boolean saveWorkflow(QName ResourceID, String workflowName, String resourceDesc, String workflowAsaString,
+ String owner, boolean isMakePublic) throws RegistryException {
+ return true;
+ }
+
+ public Map<QName, Node> getWorkflows(String userName) throws RegistryException {
+ return null;
+ }
+
+ public Node getWorkflow(QName templateID, String userName) throws RegistryException {
+ return null;
+ }
+
+ public boolean deleteWorkflow(QName resourceID, String userName) throws RegistryException {
+ return true;
+ }
+
+ public void deleteServiceDescription(String serviceId) throws RegistryException {
+
+ }
+
+ public void deleteDeploymentDescription(String serviceName, String hostName, String applicationName)
+ throws RegistryException {
+
+ }
+
+ public void deleteHostDescription(String hostId) throws RegistryException {
+
+ }
+
+ public boolean saveWorkflowExecutionServiceInput(WorkflowServiceIOData workflowInputData) throws RegistryException {
+ return true;
+ }
+
+ public boolean saveWorkflowExecutionServiceOutput(WorkflowServiceIOData workflowOutputData) throws RegistryException {
+ return true;
+ }
+
+ public List<WorkflowServiceIOData> searchWorkflowExecutionServiceInput(String experimentIdRegEx, String workflowNameRegEx, String nodeNameRegEx) throws RegistryException {
+ return null;
+ }
+
+ public String getWorkflowExecutionTemplateName(String experimentId) throws RegistryException {
+ return null;
+ }
+
+ public List<WorkflowServiceIOData> searchWorkflowExecutionServiceOutput(String experimentIdRegEx, String workflowNameRegEx, String nodeNameRegEx) throws RegistryException {
+ return null;
+ }
+
+ public boolean saveWorkflowExecutionName(String experimentId, String workflowIntanceName) throws RegistryException {
+ return true;
+ }
+
+ public boolean saveWorkflowExecutionStatus(String experimentId, WorkflowInstanceStatus status) throws RegistryException {
+ return true;
+ }
+
+ public boolean saveWorkflowExecutionStatus(String experimentId, WorkflowInstanceStatus.ExecutionStatus status) throws RegistryException {
+ return true;
+ }
+
+ public WorkflowInstanceStatus getWorkflowExecutionStatus(String experimentId) throws RegistryException {
+ return null;
+ }
+
+ public boolean saveWorkflowExecutionOutput(String experimentId, String outputNodeName, String output) throws RegistryException {
+ return true;
+ }
+
+ public boolean saveWorkflowExecutionOutput(String experimentId, WorkflowIOData data) throws RegistryException {
+ return true;
+ }
+
+ public WorkflowIOData getWorkflowExecutionOutput(String experimentId, String outputNodeName) throws RegistryException {
+ return null;
+ }
+
+ public List<WorkflowIOData> getWorkflowExecutionOutput(String experimentId) throws RegistryException {
+ return null;
+ }
+
+ public String[] getWorkflowExecutionOutputNames(String exeperimentId) throws RegistryException {
+ return null;
+ }
+
+ public boolean saveWorkflowExecutionUser(String experimentId, String user) throws RegistryException {
+ return true;
+ }
+
+ public String getWorkflowExecutionUser(String experimentId) throws RegistryException {
+ return null;
+ }
+
+ public String getWorkflowExecutionName(String experimentId) throws RegistryException {
+ return null;
+ }
+
+ public WorkflowExecution getWorkflowExecution(String experimentId) throws RegistryException {
+ return null;
+ }
+
+ public List<String> getWorkflowExecutionIdByUser(String user) throws RegistryException {
+ return null;
+ }
+
+ public List<WorkflowExecution> getWorkflowExecutionByUser(String user) throws RegistryException {
+ return null;
+ }
+
+ public List<WorkflowExecution> getWorkflowExecutionByUser(String user, int pageSize, int pageNo) throws RegistryException {
+ return null;
+ }
+
+ public String getWorkflowExecutionMetadata(String experimentId) throws RegistryException {
+ return null;
+ }
+
+ public boolean saveWorkflowExecutionMetadata(String experimentId, String metadata) throws RegistryException {
+ return true;
+ }
+
+// public boolean saveWorkflowData(WorkflowRunTimeData workflowData)throws RegistryException{
+// return true;
+// }
+
+ public boolean saveWorkflowLastUpdateTime(String experimentId, Timestamp timestamp) throws RegistryException {
+ return true;
+ }
+
+ public boolean saveWorkflowNodeStatus(String workflowInstanceID, String workflowNodeID, WorkflowInstanceStatus.ExecutionStatus status) throws RegistryException {
+ return true;
+ }
+
+ public boolean saveWorkflowNodeLastUpdateTime(String workflowInstanceID, String workflowNodeID, Timestamp lastUpdateTime) throws RegistryException {
+ return true;
+ }
+
+// public boolean saveWorkflowNodeGramData(WorkflowNodeGramData workflowNodeGramData)throws RegistryException{
+// return true;
+// }
+
+ public boolean saveWorkflowNodeGramLocalJobID(String workflowInstanceID, String workflowNodeID, String localJobID) throws RegistryException {
+ return true;
+ }
+
+
+}
+
+package org.apache.airavata.services.registry.rest.resources;
+
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+import org.apache.airavata.registry.api.AiravataRegistry;
+import org.apache.airavata.registry.api.Axis2Registry;
+import org.apache.airavata.registry.api.DataRegistry;
+import org.apache.airavata.registry.api.workflow.WorkflowExecution;
+import org.apache.airavata.registry.api.workflow.WorkflowIOData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus;
+import org.apache.airavata.registry.api.workflow.WorkflowServiceIOData;
import org.apache.airavata.services.registry.rest.resourcemappings.HostDescriptionList;
import org.apache.airavata.services.registry.rest.resourcemappings.ServiceURLList;
import org.apache.xmlbeans.XmlException;
Modified: incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/security/AuthenticationFilter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/security/AuthenticationFilter.java?rev=1379677&r1=1379676&r2=1379677&view=diff
==============================================================================
--- incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/security/AuthenticationFilter.java (original)
+++ incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/security/AuthenticationFilter.java Sat Sep 1 00:22:08 2012
@@ -36,3 +36,41 @@ public class AuthenticationFilter implem
return containerRequest; //To change body of implemented methods use File | Settings | File Templates.
}
}
+package org.apache.airavata.services.registry.rest.security;
+
+import com.sun.jersey.spi.container.ContainerRequest;
+import com.sun.jersey.spi.container.ContainerRequestFilter;
+
+import javax.ws.rs.core.MultivaluedMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Filter which intercept requests and do authentication.
+ */
+public class AuthenticationFilter implements ContainerRequestFilter {
+
+
+ public ContainerRequest filter(ContainerRequest containerRequest) {
+
+ System.out.println("Filter called !!");
+
+ MultivaluedMap<String,String> mmap = containerRequest.getRequestHeaders();
+
+ Iterator<Map.Entry<String, List<String>>> iterator = mmap.entrySet().iterator();
+
+ while (iterator.hasNext()) {
+ Map.Entry<String, List<String>> entry = iterator.next();
+ System.out.println(entry.getKey());
+
+ List<String> lstString = entry.getValue();
+
+ for (String s : lstString) {
+ System.out.println(s);
+ }
+ }
+
+ return containerRequest; //To change body of implemented methods use File | Settings | File Templates.
+ }
+}
Modified: incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/RegistryListener.java
URL: http://svn.apache.org/viewvc/incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/RegistryListener.java?rev=1379677&r1=1379676&r2=1379677&view=diff
==============================================================================
--- incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/RegistryListener.java (original)
+++ incubator/airavata/sandbox/airavata-registry-rest/src/main/java/org/apache/airavata/services/registry/rest/utils/RegistryListener.java Sat Sep 1 00:22:08 2012
@@ -1,5 +1,61 @@
package org.apache.airavata.services.registry.rest.utils;
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+import org.apache.airavata.registry.api.AiravataRegistry;
+import org.apache.airavata.registry.api.Axis2Registry;
+import org.apache.airavata.registry.api.DataRegistry;
+import org.apache.airavata.registry.api.impl.AiravataJCRRegistry;
+
+import javax.jcr.RepositoryException;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+
+public class RegistryListener implements ServletContextListener {
+
+ private static AiravataRegistry airavataRegistry;
+ private static Axis2Registry axis2Registry;
+ private static DataRegistry dataRegistry;
+
+ public void contextInitialized(ServletContextEvent servletContextEvent) {
+ try{
+ ServletContext servletContext = servletContextEvent.getServletContext();
+ URI url = new URI("http://localhost:8081/rmi");
+ String username = "admin";
+ String password = "admin";
+ HashMap<String, String> map = new HashMap<String, String>();
+ map.put("org.apache.jackrabbit.repository.uri", url.toString());
+
+
+ airavataRegistry = new AiravataJCRRegistry(url,
+ "org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory", username, password, map);
+
+ axis2Registry =new AiravataJCRRegistry(url,
+ "org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory", username, password, map);
+
+ dataRegistry = new AiravataJCRRegistry(url,
+ "org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory", username, password, map);
+
+ servletContext.setAttribute("airavataRegistry", airavataRegistry);
+ servletContext.setAttribute("axis2Registry", axis2Registry);
+ servletContext.setAttribute("dataRegistry", dataRegistry);
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ } catch (RegistryException e) {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+
+ }
+
+ public void contextDestroyed(ServletContextEvent servletContextEvent) {
+
+ }
+}
+package org.apache.airavata.services.registry.rest.utils;
+
import org.apache.airavata.registry.api.AiravataRegistry;
import org.apache.airavata.registry.api.Axis2Registry;
import org.apache.airavata.registry.api.DataRegistry;
Modified: incubator/airavata/sandbox/airavata-registry-rest/src/main/resources/ServiceMessage.xsd
URL: http://svn.apache.org/viewvc/incubator/airavata/sandbox/airavata-registry-rest/src/main/resources/ServiceMessage.xsd?rev=1379677&r1=1379676&r2=1379677&view=diff
==============================================================================
--- incubator/airavata/sandbox/airavata-registry-rest/src/main/resources/ServiceMessage.xsd (original)
+++ incubator/airavata/sandbox/airavata-registry-rest/src/main/resources/ServiceMessage.xsd Sat Sep 1 00:22:08 2012
@@ -174,3 +174,179 @@
</xs:annotation>
</xs:element>
</xs:schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:element name="Message">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="Header"/>
+ <xs:element ref="Body"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="Header">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="experimentid" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="hostname" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="processorcount" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="hostcount" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="queuename" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="walltime" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="gfaclocation" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="user" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="messengerURL" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="serviceName" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="workflowName" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="experimentid" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Host name</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="hostname" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Host name</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="processorcount" type="xs:int">
+ <xs:annotation>
+ <xs:documentation>Process Count</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="hostcount" type="xs:int">
+ <xs:annotation>
+ <xs:documentation>Process Count</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="queuename" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Queue Name</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="walltime" type="xs:int">
+ <xs:annotation>
+ <xs:documentation>Walltime</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="gfaclocation" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Gfac location</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="user" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>User information</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="messengerURL" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Messenger URL information</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="serviceName" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Service Name</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="workflowName" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Workflow Name</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="Body">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="inputs" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="inputs">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="input" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="input">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="name" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="param" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="value" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="type" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Input Name</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="param" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Input Params</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="value" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Input Value</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="type" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Input Type</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="MessageResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="experimentid" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="status" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="message" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="inputs" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="outputs" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="stdout" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="stderr" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="status" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Status</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="message" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>Message</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="outputs">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="output" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="output">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="name" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="value" minOccurs="0" maxOccurs="1"/>
+ <xs:element ref="type" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="stdout" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>stdout </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="stderr" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>stderr</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+</xs:schema>
Modified: incubator/airavata/sandbox/airavata-registry-rest/src/main/resources/log4j.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/sandbox/airavata-registry-rest/src/main/resources/log4j.xml?rev=1379677&r1=1379676&r2=1379677&view=diff
==============================================================================
--- incubator/airavata/sandbox/airavata-registry-rest/src/main/resources/log4j.xml (original)
+++ incubator/airavata/sandbox/airavata-registry-rest/src/main/resources/log4j.xml Sat Sep 1 00:22:08 2012
@@ -46,4 +46,53 @@
<appender-ref ref="console" />
</root>
+</log4j:configuration>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+
+ $Id$
+-->
+<!DOCTYPE log4j:configuration PUBLIC "-//LOGGER" "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <!-- Appenders -->
+ <appender name="console" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%-5p: %c - %m%n" />
+ </layout>
+ </appender>
+
+ <!-- Jersey logger -->
+ <logger name="com.sun.jersey">
+ <level value="info" />
+ </logger>
+
+ <!-- Airavata logger -->
+ <logger name="org.apache.airavata">
+ <level value="info" />
+ </logger>
+
+ <!-- Root Logger -->
+ <root>
+ <priority value="info" />
+ <appender-ref ref="console" />
+ </root>
+
</log4j:configuration>
\ No newline at end of file
Modified: incubator/airavata/sandbox/airavata-registry-rest/src/main/resources/service.properties
URL: http://svn.apache.org/viewvc/incubator/airavata/sandbox/airavata-registry-rest/src/main/resources/service.properties?rev=1379677&r1=1379676&r2=1379677&view=diff
==============================================================================
--- incubator/airavata/sandbox/airavata-registry-rest/src/main/resources/service.properties (original)
+++ incubator/airavata/sandbox/airavata-registry-rest/src/main/resources/service.properties Sat Sep 1 00:22:08 2012
@@ -19,3 +19,24 @@
jcr.username=admin
jcr.password=admin
jcr.url=http://localhost:8081/rmi
+#
+# 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.
+#
+jcr.username=admin
+jcr.password=admin
+jcr.url=http://localhost:8081/rmi
Modified: incubator/airavata/sandbox/airavata-registry-rest/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/sandbox/airavata-registry-rest/src/main/webapp/WEB-INF/web.xml?rev=1379677&r1=1379676&r2=1379677&view=diff
==============================================================================
--- incubator/airavata/sandbox/airavata-registry-rest/src/main/webapp/WEB-INF/web.xml (original)
+++ incubator/airavata/sandbox/airavata-registry-rest/src/main/webapp/WEB-INF/web.xml Sat Sep 1 00:22:08 2012
@@ -16,6 +16,35 @@
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>org.apache.airavata.services.registry.rest</param-value>
</init-param>
+ <init-param>
+ <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
+ <param-value>org.apache.airavata.services.registry.rest.security.AuthenticationFilter</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Airavata Web Application</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This web.xml file is not required when using Servlet 3.0 container,
+ see implementation details http://jersey.java.net/nonav/documentation/latest/jax-rs.html#d4e194 -->
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <listener>
+ <listener-class>org.apache.airavata.services.registry.rest.utils.RegistryListener</listener-class>
+ </listener>
+ <!--context-param>
+ <param-name>configFile</param-name>
+ <param-value>/WEB-INF/classes/service.properties</param-value>
+ </context-param-->
+ <servlet>
+ <servlet-name>Airavata Web Application</servlet-name>
+ <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
+ <init-param>
+ <param-name>com.sun.jersey.config.property.packages</param-name>
+ <param-value>org.apache.airavata.services.registry.rest</param-value>
+ </init-param>
<!--init-param>
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
<param-value>org.apache.airavata.services.registry.rest.security.AuthenticationFilter</param-value>
Modified: incubator/airavata/sandbox/airavata-registry-rest/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/incubator/airavata/sandbox/airavata-registry-rest/src/main/webapp/index.jsp?rev=1379677&r1=1379676&r2=1379677&view=diff
==============================================================================
--- incubator/airavata/sandbox/airavata-registry-rest/src/main/webapp/index.jsp (original)
+++ incubator/airavata/sandbox/airavata-registry-rest/src/main/webapp/index.jsp Sat Sep 1 00:22:08 2012
@@ -6,3 +6,11 @@
for more information on Jersey!
</body>
</html>
+<html>
+<body>
+<h2>Jersey RESTful Web Application!</h2>
+<p><a href="webresources/myresource">Jersey resource</a>
+<p>Visit the <a href="http://jersey.java.net">Project Jersey website</a>
+for more information on Jersey!
+</body>
+</html>
Modified: incubator/airavata/sandbox/airavata-registry-rest/src/test/resources/service.properties
URL: http://svn.apache.org/viewvc/incubator/airavata/sandbox/airavata-registry-rest/src/test/resources/service.properties?rev=1379677&r1=1379676&r2=1379677&view=diff
==============================================================================
--- incubator/airavata/sandbox/airavata-registry-rest/src/test/resources/service.properties (original)
+++ incubator/airavata/sandbox/airavata-registry-rest/src/test/resources/service.properties Sat Sep 1 00:22:08 2012
@@ -16,6 +16,27 @@
# specific language governing permissions and limitations
# under the License.
#
-jcr.username=admin
-jcr.password=admin
+jcr.username=$USER
+jcr.password=$PWD
+jcr.url=http://localhost:8081/rmi
+#
+# 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.
+#
+jcr.username=$USER
+jcr.password=$PWD
jcr.url=http://localhost:8081/rmi