airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramin...@apache.org
Subject svn commit: r1139850 [5/7] - in /incubator/airavata/services/trunk/xregistry/src: ./ main/ main/java/ main/java/org/ main/java/org/apache/ main/java/org/apache/airavata/ main/java/org/apache/airavata/xregistry/ main/java/org/apache/airavata/xregistry/a...
Date Sun, 26 Jun 2011 17:50:31 GMT
Added: incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/impl/XregistryImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/impl/XregistryImpl.java?rev=1139850&view=auto
==============================================================================
--- incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/impl/XregistryImpl.java (added)
+++ incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/impl/XregistryImpl.java Sun Jun 26 17:50:29 2011
@@ -0,0 +1,307 @@
+/*
+* 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.xregistry.impl;
+
+import java.sql.Timestamp;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.xregistry.XregistryConstants;
+import org.apache.airavata.xregistry.XregistryException;
+import org.apache.airavata.xregistry.XregistryConstants.Action;
+import org.apache.airavata.xregistry.XregistryConstants.DocType;
+import org.apache.airavata.xregistry.cap.CapabilityRegistry;
+import org.apache.airavata.xregistry.cap.CapabilityRegistryImpl;
+import org.apache.airavata.xregistry.context.GlobalContext;
+import org.apache.airavata.xregistry.doc.AppData;
+import org.apache.airavata.xregistry.doc.DocData;
+import org.apache.airavata.xregistry.doc.DocumentRegistry;
+import org.apache.airavata.xregistry.doc.DocumentRegistryImpl;
+import org.apache.airavata.xregistry.doc.ResourceUtils;
+import org.apache.airavata.xregistry.group.Group;
+import org.apache.airavata.xregistry.group.GroupManager;
+
+import xregistry.generated.CapabilityToken;
+import xregistry.generated.ListSubActorsGivenAGroupResponseDocument.ListSubActorsGivenAGroupResponse.Actor;
+import xsul.MLogger;
+
+public class XregistryImpl{
+    protected static MLogger log = MLogger.getLogger(XregistryConstants.LOGGER_NAME);
+    private final GlobalContext globalContext;
+    private final GroupManager groupManager;
+    private final DocumentRegistry docRegistry;
+    private final CapabilityRegistry capabilityRegistry;
+    
+    
+    public XregistryImpl(GlobalContext globalContext){
+        this.globalContext = globalContext;
+        groupManager = globalContext.getGroupManager();
+        docRegistry = new DocumentRegistryImpl(globalContext);
+        capabilityRegistry = new CapabilityRegistryImpl(globalContext,groupManager);
+    }
+   
+    private boolean authorize(String user,String resourceID,Action action) throws XregistryException{
+        log.info("Request Recived for "+ resourceID + " from "+user + " for action "+ action );
+        boolean isAUthorized =  globalContext.getAuthorizer().isAuthorized(user, resourceID, action);
+//        if(isAUthorized){
+//            log.info("Request Authorized for "+ resourceID + " from "+user + " for action "+ action );
+//        }
+        
+        return isAUthorized;
+    }
+    
+    
+    
+    /** 
+     * Add/remove/ get documents
+     */
+    public String getAppDesc(String user, String appQName, String hostName) throws XregistryException {
+        authorize(user, ResourceUtils.getResourceID(DocType.AppDesc,appQName,hostName ), Action.Read);
+        return docRegistry.getAppDesc( appQName, hostName);
+    }
+    public String getHostDesc(String user, String hostName) throws XregistryException {
+        authorize(user, ResourceUtils.getResourceID( DocType.HostDesc,hostName), Action.Read);
+        return docRegistry.getHostDesc( hostName);
+    }
+
+    public String getServiceDesc(String user, String serviceQName) throws XregistryException {
+        authorize(user, ResourceUtils.getResourceID(DocType.ServiceDesc,serviceQName), Action.Read);
+        return docRegistry.getServiceDesc(serviceQName);
+    }
+
+    public String registerAppDesc(String user, String appDescAsStr) throws XregistryException {
+        authorize(user, null, Action.AddNew);
+        return docRegistry.registerAppDesc(user, appDescAsStr);
+    }
+
+    
+    public String registerHostDesc(String user, String hostDescAsStr) throws XregistryException {
+        authorize(user, null, Action.AddNew);
+        return docRegistry.registerHostDesc(user, hostDescAsStr);
+    }
+
+    public String registerServiceDesc(String user, String serviceMapAsStr, String abstractWsdlAsString) throws XregistryException {
+        authorize(user, null, Action.AddNew);
+        return docRegistry.registerServiceDesc(user, serviceMapAsStr, abstractWsdlAsString);
+    }
+
+    public void removeAppDesc(String user, String appQName, String hostName) throws XregistryException {
+        authorize(user, ResourceUtils.getResourceID(DocType.AppDesc,appQName,hostName), Action.Write);
+        docRegistry.removeAppDesc(appQName, hostName);
+        
+    }
+
+
+    public void removeHostDesc(String user, String hostName) throws XregistryException {
+        authorize(user, ResourceUtils.getResourceID(DocType.HostDesc,hostName),Action.Write);
+        docRegistry.removeHostDesc( hostName);
+    }
+
+    public void removeServiceDesc(String user, String serviceQName) throws XregistryException {
+        authorize(user, ResourceUtils.getResourceID(DocType.ServiceDesc,serviceQName),Action.Write);
+        docRegistry.removeServiceDesc( serviceQName);
+        
+    }
+
+    public void removeConcreteWsdl(String user, String wsdlQName) throws XregistryException {
+        authorize(user, ResourceUtils.getResourceID(DocType.CWsdl,wsdlQName),Action.Write);
+        docRegistry.removeConcreteWsdl( wsdlQName);
+        
+    }
+    public String registerConcreteWsdl(String user, String wsdlAsStr, int lifetimeAsSeconds) throws XregistryException {
+        authorize(user, null, Action.AddNew);
+        return docRegistry.registerConcreteWsdl(user, wsdlAsStr, lifetimeAsSeconds);
+    }
+    
+    public String getConcreateWsdl(String user, String wsdlQName) throws XregistryException {
+        authorize(user, ResourceUtils.getResourceID(DocType.CWsdl,wsdlQName), Action.Read);
+        return docRegistry.getConcreateWsdl( wsdlQName);
+    }
+
+    public String getAbstractWsdl(String user, String wsdlQName) throws XregistryException {
+        authorize(user, ResourceUtils.getResourceID(DocType.ServiceDesc,wsdlQName), Action.Read);
+        return docRegistry.getAbstractWsdl( wsdlQName);
+    }
+
+    
+    /**
+     * Capability Management operations
+     * @throws XregistryException 
+     */
+    
+    public void removeCapability(String user,String resourceID, String actor) throws XregistryException {
+        authorize(user, resourceID, Action.ResourceAdmin);
+        capabilityRegistry.removeCapability(user, resourceID, actor);
+    }
+    
+    public void addCapability(String user, String resourceID, String actor, boolean isUser, String action) throws XregistryException {
+        authorize(user, resourceID, Action.ResourceAdmin);
+        capabilityRegistry.addCapability(user, resourceID, actor, isUser, action);
+    }
+    
+    public void addCapability(String user, String resourceID, String actor, boolean isUser, String action,String assertions, Timestamp notbefore, Timestamp notafter) throws XregistryException {
+        authorize(user, resourceID, Action.ResourceAdmin);
+        capabilityRegistry.addCapability(user, resourceID, actor, isUser, action,assertions, notbefore, notafter);  
+    }
+    public CapabilityToken[] getCapability(String user, String resourceID, String actor, boolean actorType, String action) throws XregistryException  {
+        authorize(user, resourceID, Action.Read);
+        return capabilityRegistry.getCapability(user, resourceID, actor, actorType, action);
+    }
+
+    public List<DocData>  findServiceInstance(String user,String serviceName)throws XregistryException{
+        authorize(user, null, Action.Read);
+        return docRegistry.findServiceInstance(user, serviceName);
+    }
+
+    public List<AppData> findAppDesc(String user, String query) throws XregistryException {
+        authorize(user, null, Action.Read);
+        return docRegistry.findAppDesc(user, query);
+    }
+
+    public List<DocData> findHosts(String user, String hostName) throws XregistryException {
+        authorize(user, null, Action.Read);
+        return docRegistry.findHosts(user,hostName);
+    }
+
+    public List<DocData> findServiceDesc(String user, String serviceName) throws XregistryException {
+        authorize(user, null, Action.Read);
+        return docRegistry.findServiceDesc(user, serviceName);
+    }
+
+    public void addUsertoGroup(String user,String groupName, String usertoAdded) throws XregistryException {
+        authorize(user, null, Action.SysAdmin);
+        groupManager.addUsertoGroup(groupName, usertoAdded);
+    }
+
+    public void createGroup(String user,String newGroup, String description) throws XregistryException {
+        authorize(user, null, Action.SysAdmin);
+        groupManager.createGroup(newGroup, description);
+    }
+
+    public void createUser(String user,String newUser, String description) throws XregistryException {
+        authorize(user, null, Action.SysAdmin);
+        groupManager.createUser(newUser, description,false);
+    }
+
+    public void deleteGroup(String user,String groupID) throws XregistryException {
+        authorize(user, null, Action.SysAdmin);
+        groupManager.deleteGroup(groupID);
+    }
+
+    public void deleteUser(String user,String userID) throws XregistryException {
+        authorize(user, null, Action.SysAdmin);
+        groupManager.deleteUser(userID);
+    }
+
+    public void addAGroupToGroup(String user,String groupName,String grouptoAddedName) throws XregistryException {
+        authorize(user, null, Action.SysAdmin);
+        groupManager.addGrouptoGroup(groupName, grouptoAddedName);
+    }
+
+    
+    public Group getGroup(String user,String name) throws XregistryException {
+        return groupManager.getGroup(name);
+    }
+
+    public String[]  listGroups(String user) throws XregistryException {
+        authorize(user, null, Action.Read);
+        return groupManager.listGroups();
+    }
+
+    public String[]  listGroupsGivenAUser(String user,String targetUser) throws XregistryException {
+        authorize(user, null, Action.Read);
+        return groupManager.listGroupsGivenAUser(targetUser);
+    }
+
+    public String[]  listUsers(String user) throws XregistryException {
+        authorize(user, null, Action.Read);
+        return groupManager.listUsers();
+    }
+
+
+    public void removeUserFromGroup(String user, String group, String usertoRemoved) throws XregistryException {
+        authorize(user, null, Action.Read);
+        groupManager.removeUserFromGroup(group, usertoRemoved);
+        
+    }
+
+    
+    public void removeGroupFromGroup(String user,String group,String grouptoRemoved)throws XregistryException{
+        authorize(user, null, Action.SysAdmin);
+        groupManager.removeGroupFromGroup( group, grouptoRemoved);
+    }
+
+    public String[]  app2Hosts(String user, String appName) throws XregistryException {
+        authorize(user, null, Action.Read);
+        return docRegistry.app2Hosts( appName);
+    }
+
+   
+    
+    public Actor[]  listSubActorsGivenAGroup(String user,String targetGroup) throws XregistryException {
+        authorize(user, null, Action.Read);
+        return groupManager.listSubActorsGivenAGroup(targetGroup);
+    }
+
+    public boolean isAuthorizedToAcsses(String user, String resourceID, String actor, String action) throws XregistryException {
+        return capabilityRegistry.isAuthorizedToAcsses(resourceID, actor, action);
+    }
+    
+    
+     public void registerDocument(String user,QName resourceID,String document)throws XregistryException{
+         authorize(user, null, Action.Read);
+         docRegistry.registerDocument(user, resourceID, document);
+     }
+    
+    public void removeDocument(String user,QName resourceID)throws XregistryException{
+        authorize(user, null, Action.Read);
+        docRegistry.removeDocument(user, resourceID);
+    }
+    
+    public List<DocData> findDocument(String user,String query)throws XregistryException{
+        authorize(user, null, Action.Read);
+        return docRegistry.findDocument(user, query);
+    }
+    
+    public String getDocument(String user,QName docName) throws XregistryException{
+        authorize(user, null, Action.Read);
+        return docRegistry.getDocument(user,docName);
+    }
+    
+    public void registerOGCEResource(String user,QName resourceID,String resourceName, String resourceType, String resourceDesc, String resourceDocument, String parentTypedID)throws XregistryException{
+        authorize(user, null, Action.Read);
+        docRegistry.registerOGCEResource(user, resourceID,resourceName, resourceType, resourceDesc, resourceDocument, parentTypedID);
+    }
+   
+   public void removeOGCEResource(String user,QName resourceID, String resourceType)throws XregistryException{
+       authorize(user, null, Action.Read);
+       docRegistry.removeOGCEResource(user, resourceID, resourceType);
+   }
+   
+   public List<DocData> findOGCEResource(String user,String query, String resourceName,String resourceType, String parentTypedID)throws XregistryException{
+       authorize(user, null, Action.Read);
+       return docRegistry.findOGCEResource(user, query,resourceName,resourceType, parentTypedID);
+   }
+   
+   public String getOGCEResource(String user,QName resourceID,String resourceType,String parentTypedID) throws XregistryException{
+       authorize(user, resourceID.toString(), Action.Read);
+       return docRegistry.getOGCEResource(user,resourceID,resourceType,parentTypedID);
+   }
+}
+

Added: incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/impl/XregistryPortType.java
URL: http://svn.apache.org/viewvc/incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/impl/XregistryPortType.java?rev=1139850&view=auto
==============================================================================
--- incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/impl/XregistryPortType.java (added)
+++ incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/impl/XregistryPortType.java Sun Jun 26 17:50:29 2011
@@ -0,0 +1,70 @@
+/*
+* 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.
+*/
+/* DO NOT MODIFY!!!! This file was generated automatically by xwsdlc (version 2.8.2) */
+package org.apache.airavata.xregistry.impl;
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.xregistry.XregistryException;
+
+public interface XregistryPortType {
+    public final static QName XWSDLC_PORTTYPE_QNAME = new QName("http://extreme.indiana.edu/xregistry2/2007_02_21", "IXregistryPortType");
+    public xregistry.generated.GetAbstractWsdlResponseDocument getAbstractWsdl(xregistry.generated.GetAbstractWsdlDocument input)throws XregistryException;
+    public xregistry.generated.GetAppDescResponseDocument getAppDesc(xregistry.generated.GetAppDescDocument input)throws XregistryException;
+    public xregistry.generated.GetConcreateWsdlResponseDocument getConcreateWsdl(xregistry.generated.GetConcreateWsdlDocument input)throws XregistryException;
+    public xregistry.generated.GetHostDescResponseDocument getHostDesc(xregistry.generated.GetHostDescDocument input)throws XregistryException;
+    public xregistry.generated.GetServiceDescResponseDocument getServiceDesc(xregistry.generated.GetServiceDescDocument input)throws XregistryException;
+    public xregistry.generated.RegisterAppDescResponseDocument registerAppDesc(xregistry.generated.RegisterAppDescDocument input)throws XregistryException;
+    public xregistry.generated.RegisterConcreteWsdlResponseDocument registerConcreteWsdl(xregistry.generated.RegisterConcreteWsdlDocument input)throws XregistryException;
+    public xregistry.generated.RegisterHostDescResponseDocument registerHostDesc(xregistry.generated.RegisterHostDescDocument input)throws XregistryException;
+    public xregistry.generated.RegisterServiceDescResponseDocument registerServiceDesc(xregistry.generated.RegisterServiceDescDocument input)throws XregistryException;
+    public xregistry.generated.App2HostsResponseDocument app2Hosts(xregistry.generated.App2HostsDocument input)throws XregistryException;
+    public xregistry.generated.FindHostsResponseDocument findHosts(xregistry.generated.FindHostsDocument input)throws XregistryException;
+    public xregistry.generated.FindServiceDescResponseDocument findServiceDesc(xregistry.generated.FindServiceDescDocument input)throws XregistryException;
+    public xregistry.generated.FindServiceInstanceResponseDocument findServiceInstance(xregistry.generated.FindServiceInstanceDocument input)throws XregistryException;
+    public xregistry.generated.ListGroupsResponseDocument listGroups(xregistry.generated.ListGroupsDocument input)throws XregistryException;
+    public xregistry.generated.ListGroupsGivenAUserResponseDocument listGroupsGivenAUser(xregistry.generated.ListGroupsGivenAUserDocument input)throws XregistryException;
+    public xregistry.generated.ListUsersResponseDocument listUsers(xregistry.generated.ListUsersDocument input)throws XregistryException;
+    public xregistry.generated.ListSubActorsGivenAGroupResponseDocument listSubActorsGivenAGroup(xregistry.generated.ListSubActorsGivenAGroupDocument input)throws XregistryException;
+    public xregistry.generated.FindAppDescResponseDocument findAppDesc(xregistry.generated.FindAppDescDocument input)throws XregistryException;
+    public xregistry.generated.AddCapabilityResponseDocument addCapability(xregistry.generated.AddCapabilityDocument input)throws XregistryException;
+    public xregistry.generated.AddCapabilityTokenResponseDocument addCapabilityToken(xregistry.generated.AddCapabilityTokenDocument input)throws XregistryException;
+    public xregistry.generated.AddUsertoGroupResponseDocument addUsertoGroup(xregistry.generated.AddUsertoGroupDocument input)throws XregistryException;
+    public xregistry.generated.AddGrouptoGroupResponseDocument addGrouptoGroup(xregistry.generated.AddGrouptoGroupDocument input)throws XregistryException;
+    public xregistry.generated.CreateGroupResponseDocument createGroup(xregistry.generated.CreateGroupDocument input)throws XregistryException;
+    public xregistry.generated.CreateUserResponseDocument createUser(xregistry.generated.CreateUserDocument input)throws XregistryException;
+    public xregistry.generated.DeleteGroupResponseDocument deleteGroup(xregistry.generated.DeleteGroupDocument input)throws XregistryException;
+    public xregistry.generated.DeleteUserResponseDocument deleteUser(xregistry.generated.DeleteUserDocument input)throws XregistryException;
+    public xregistry.generated.GetCapabilityResponseDocument getCapability(xregistry.generated.GetCapabilityDocument input)throws XregistryException;
+    public xregistry.generated.RemoveAppDescResponseDocument removeAppDesc(xregistry.generated.RemoveAppDescDocument input)throws XregistryException;
+    public xregistry.generated.RemoveCapabilityResponseDocument removeCapability(xregistry.generated.RemoveCapabilityDocument input)throws XregistryException;
+    public xregistry.generated.RemoveConcreteWsdlResponseDocument removeConcreteWsdl(xregistry.generated.RemoveConcreteWsdlDocument input)throws XregistryException;
+    public xregistry.generated.RemoveGroupFromGroupResponseDocument removeGroupFromGroup(xregistry.generated.RemoveGroupFromGroupDocument input)throws XregistryException;
+    public xregistry.generated.RemoveHostDescResponseDocument removeHostDesc(xregistry.generated.RemoveHostDescDocument input)throws XregistryException;
+    public xregistry.generated.RemoveServiceDescResponseDocument removeServiceDesc(xregistry.generated.RemoveServiceDescDocument input)throws XregistryException;
+    public xregistry.generated.RemoveUserFromGroupResponseDocument removeUserFromGroup(xregistry.generated.RemoveUserFromGroupDocument input)throws XregistryException;
+    public xregistry.generated.IsAuthorizedToAcssesResponseDocument isAuthorizedToAcsses(xregistry.generated.IsAuthorizedToAcssesDocument input)throws XregistryException;
+    public xregistry.generated.AddResourceResponseDocument addResource(xregistry.generated.AddResourceDocument input)throws XregistryException;
+    public xregistry.generated.RemoveResourceResponseDocument removeResource(xregistry.generated.RemoveResourceDocument input)throws XregistryException;
+    public xregistry.generated.FindResourceResponseDocument findResource(xregistry.generated.FindResourceDocument input)throws XregistryException;
+    public xregistry.generated.GetResourceResponseDocument getResource(xregistry.generated.GetResourceDocument input)throws XregistryException;
+    public xregistry.generated.AddOGCEResourceResponseDocument addOGCEResource(xregistry.generated.AddOGCEResourceDocument input)throws XregistryException;
+    public xregistry.generated.RemoveOGCEResourceResponseDocument removeOGCEResource(xregistry.generated.RemoveOGCEResourceDocument input)throws XregistryException;
+    public xregistry.generated.FindOGCEResourceResponseDocument findOGCEResource(xregistry.generated.FindOGCEResourceDocument input)throws XregistryException;
+    public xregistry.generated.GetOGCEResourceResponseDocument getOGCEResource(xregistry.generated.GetOGCEResourceDocument input)throws XregistryException;
+
+}
+

Added: incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/impl/XregistryServer.java
URL: http://svn.apache.org/viewvc/incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/impl/XregistryServer.java?rev=1139850&view=auto
==============================================================================
--- incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/impl/XregistryServer.java (added)
+++ incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/impl/XregistryServer.java Sun Jun 26 17:50:29 2011
@@ -0,0 +1,176 @@
+/*
+* 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.xregistry.impl;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.security.cert.X509Certificate;
+
+import org.apache.airavata.xregistry.XregistryConstants;
+import org.apache.airavata.xregistry.XregistryException;
+import org.apache.airavata.xregistry.context.GlobalContext;
+import org.globus.gsi.GlobusCredential;
+import org.globus.gsi.TrustedCertificates;
+import org.globus.gsi.gssapi.GlobusGSSCredentialImpl;
+import org.globus.gsi.ptls.PureTLSContext;
+import org.ietf.jgss.GSSCredential;
+
+import xsul.MLogger;
+import xsul.http_server.HttpServerException;
+import xsul.http_server.ServerSocketFactory;
+import xsul.processor.DynamicInfosetProcessorException;
+import xsul.puretls_server_socket_factory.PuretlsServerSocketFactory;
+import xsul.xservices_xbeans.XmlBeansBasedService;
+import xsul.xservo.XService;
+import xsul.xservo_soap_http.HttpBasedServices;
+import COM.claymoresystems.sslg.SSLPolicyInt;
+
+public class XregistryServer {
+    static{
+        System.setProperty("log",XregistryConstants.LOGGER_NAME+":ALL");
+        System.setProperty("showtime","false");
+        System.setProperty("log.multiline","true");
+    }
+    protected static MLogger log = MLogger.getLogger(XregistryConstants.LOGGER_NAME);
+    private XService cmsvc;
+
+    public XregistryServer(GlobalContext globalContext) throws XregistryException {
+        try {
+            int port = globalContext.getPort();
+            PureTLSContext ctx = null;
+            String trustedCertsFile = globalContext.getTrustedCertsFile();
+            String certKeyFile = globalContext.getHostcertsKeyFile();
+            
+            //try to load host certificate
+            if(globalContext.isSecurityEnabled()){
+                if(certKeyFile != null){
+                    ctx = new PureTLSContext();
+                    if(globalContext.getTrustedCertificates() != null){
+                        ctx.setTrustedCertificates(globalContext.getTrustedCertificates());
+                    }else if(trustedCertsFile != null && new File(trustedCertsFile).isFile()){
+                        ctx.loadRootCertificates(trustedCertsFile);    
+                    }else if(trustedCertsFile != null && new File(trustedCertsFile).isDirectory()){
+                    	TrustedCertificates certificates = TrustedCertificates.load(trustedCertsFile);
+                		TrustedCertificates.setDefaultTrustedCertificates(certificates);
+                    	ctx.setTrustedCertificates(certificates.getCertificates());    
+                    }
+                    else{
+                        TrustedCertificates tc = TrustedCertificates.getDefaultTrustedCertificates();
+                        ctx.setTrustedCertificates(tc.getCertificates());
+                    }
+                    ctx.loadEAYKeyFile(certKeyFile, "");
+                    SSLPolicyInt policy = new SSLPolicyInt();
+                    policy.requireClientAuth(true);
+                    policy.setAcceptNoClientCert(true);
+                    ctx.setPolicy(policy);
+                }else{
+                    //Use Globous crednatials if it is there
+                    try {
+                        ctx = new PureTLSContext();
+                        GSSCredential gssCredntial = globalContext.getCredential();
+                        if(gssCredntial instanceof GlobusGSSCredentialImpl){
+                            GlobusCredential globusCred = ((GlobusGSSCredentialImpl)gssCredntial).getGlobusCredential();
+                            TrustedCertificates tc = TrustedCertificates.getDefaultTrustedCertificates();
+                            if (tc == null)
+                            {
+                                throw new XregistryException("Trusted certificates is null");
+                            }
+                            X509Certificate[] certs = tc.getCertificates();
+                            ctx.setTrustedCertificates(certs);
+                            ctx.setCredential(globusCred);
+                        }else{
+                            throw new XregistryException("Can not find the credantial to start a secure server");
+                        }
+                    } catch (RuntimeException e) {
+                        throw new XregistryException("Secuirty is enabled, but no credentials found");
+                    }
+                }
+
+            }
+            //This is to provide rest support
+//            HttpBasedServices httpServices;
+//            XregistryXmlBeansWrapper xregistryXmlBeansWrapper = new XregistryXmlBeansWrapper(globalContext);
+//            if(ctx != null){
+//                ServerSocketFactory secureSocketFactory = new PuretlsServerSocketFactory(port, ctx);
+//                httpServices = new XregistryHttpbasedServices(secureSocketFactory,xregistryXmlBeansWrapper.getRegistryImpl());
+//            }else{
+//                httpServices = new XregistryHttpbasedServices(port,xregistryXmlBeansWrapper.getRegistryImpl());
+//            }
+//            String cwsdlLoc = Thread.currentThread().getContextClassLoader().getResource("xregistry.wsdl").toString();
+//            
+//
+//            ExtendedXbeanBasedService service = new ExtendedXbeanBasedService("xregistry", cwsdlLoc,
+//                    xregistryXmlBeansWrapper);
+//            cmsvc = httpServices.addService(service);
+//            service.addHandler(new xsul.xhandler_context.ServerContextAccessHandler("service-context"));
+//            //service.startService();
+//            service.initManagmentAgent();
+            
+            XregistryXmlBeansWrapper xregistryXmlBeansWrapper = new XregistryXmlBeansWrapper(globalContext);
+            HttpBasedServices httpServices;
+            if(ctx != null){
+                ServerSocketFactory secureSocketFactory = new PuretlsServerSocketFactory(port, ctx);
+                httpServices = new XregistryHttpbasedServices(secureSocketFactory,xregistryXmlBeansWrapper.getRegistryImpl());
+            }else{
+                httpServices = new XregistryHttpbasedServices(port,xregistryXmlBeansWrapper.getRegistryImpl());
+            }
+            String cwsdlLoc = Thread.currentThread().getContextClassLoader().getResource("xregistry.wsdl").toString();
+            
+            
+            XmlBeansBasedService xbeanBasedService = new XmlBeansBasedService("xregistry", cwsdlLoc,
+                    xregistryXmlBeansWrapper);
+            cmsvc = httpServices.addService(xbeanBasedService)
+            .addHandler(new xsul.xhandler_context.ServerContextAccessHandler("service-context"));
+            
+            System.out.println("Server started on "+httpServices.getServer().getLocation());
+        } catch (HttpServerException e) {
+            throw new XregistryException(e);
+        } catch (DynamicInfosetProcessorException e) {
+            throw new XregistryException(e);
+        } catch (FileNotFoundException e) {
+            throw new XregistryException(e);
+        } catch (IOException e) {
+            throw new XregistryException(e);
+        } catch (GeneralSecurityException e) {
+            throw new XregistryException(e);
+        }
+    }
+
+    public void start() {
+        cmsvc.startService();
+    }
+    
+    public static void main(String[] args){
+        try {
+            GlobalContext globalContext;
+            if(args.length > 0){
+                globalContext = new GlobalContext(false,args[0]);
+            }else{
+                globalContext = new GlobalContext(false);
+            }
+            XregistryServer xregistryService = new XregistryServer(globalContext);
+            xregistryService.start();
+        } catch (XregistryException e) {
+            log.caught(e);
+            //Killing off everything
+            System.exit(0);
+        }
+    }
+
+}

Added: incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/impl/XregistryXmlBeansWrapper.java
URL: http://svn.apache.org/viewvc/incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/impl/XregistryXmlBeansWrapper.java?rev=1139850&view=auto
==============================================================================
--- incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/impl/XregistryXmlBeansWrapper.java (added)
+++ incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/impl/XregistryXmlBeansWrapper.java Sun Jun 26 17:50:29 2011
@@ -0,0 +1,836 @@
+/*
+* 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.xregistry.impl;
+
+import java.sql.Timestamp;
+import java.util.List;
+
+import org.apache.airavata.xregistry.XregistryConstants;
+import org.apache.airavata.xregistry.XregistryException;
+import org.apache.airavata.xregistry.XregistryConstants.DocType;
+import org.apache.airavata.xregistry.context.GlobalContext;
+import org.apache.airavata.xregistry.doc.DocData;
+import org.apache.airavata.xregistry.doc.ResourceUtils;
+import org.apache.airavata.xregistry.utils.Utils;
+
+import xregistry.generated.AddCapabilityDocument;
+import xregistry.generated.AddCapabilityResponseDocument;
+import xregistry.generated.AddCapabilityTokenDocument;
+import xregistry.generated.AddCapabilityTokenResponseDocument;
+import xregistry.generated.AddGrouptoGroupDocument;
+import xregistry.generated.AddGrouptoGroupResponseDocument;
+import xregistry.generated.AddOGCEResourceDocument;
+import xregistry.generated.AddOGCEResourceResponseDocument;
+import xregistry.generated.AddResourceDocument;
+import xregistry.generated.AddResourceResponseDocument;
+import xregistry.generated.AddUsertoGroupDocument;
+import xregistry.generated.AddUsertoGroupResponseDocument;
+import xregistry.generated.App2HostsDocument;
+import xregistry.generated.App2HostsResponseDocument;
+import xregistry.generated.CapabilityToken;
+import xregistry.generated.CreateGroupDocument;
+import xregistry.generated.CreateGroupResponseDocument;
+import xregistry.generated.CreateUserDocument;
+import xregistry.generated.CreateUserResponseDocument;
+import xregistry.generated.DeleteGroupDocument;
+import xregistry.generated.DeleteGroupResponseDocument;
+import xregistry.generated.DeleteUserDocument;
+import xregistry.generated.DeleteUserResponseDocument;
+import xregistry.generated.FindAppDescDocument;
+import xregistry.generated.FindAppDescResponseDocument;
+import xregistry.generated.FindHostsDocument;
+import xregistry.generated.FindHostsResponseDocument;
+import xregistry.generated.FindOGCEResourceDocument;
+import xregistry.generated.FindOGCEResourceResponseDocument;
+import xregistry.generated.FindResourceDocument;
+import xregistry.generated.FindResourceResponseDocument;
+import xregistry.generated.FindServiceDescDocument;
+import xregistry.generated.FindServiceDescResponseDocument;
+import xregistry.generated.FindServiceInstanceDocument;
+import xregistry.generated.FindServiceInstanceResponseDocument;
+import xregistry.generated.GetAbstractWsdlDocument;
+import xregistry.generated.GetAbstractWsdlResponseDocument;
+import xregistry.generated.GetAppDescDocument;
+import xregistry.generated.GetAppDescResponseDocument;
+import xregistry.generated.GetCapabilityDocument;
+import xregistry.generated.GetCapabilityResponseDocument;
+import xregistry.generated.GetConcreateWsdlDocument;
+import xregistry.generated.GetConcreateWsdlResponseDocument;
+import xregistry.generated.GetHostDescDocument;
+import xregistry.generated.GetHostDescResponseDocument;
+import xregistry.generated.GetOGCEResourceDocument;
+import xregistry.generated.GetOGCEResourceResponseDocument;
+import xregistry.generated.GetResourceDocument;
+import xregistry.generated.GetResourceResponseDocument;
+import xregistry.generated.GetServiceDescDocument;
+import xregistry.generated.GetServiceDescResponseDocument;
+import xregistry.generated.HostDescData;
+import xregistry.generated.IsAuthorizedToAcssesDocument;
+import xregistry.generated.IsAuthorizedToAcssesResponseDocument;
+import xregistry.generated.ListGroupsDocument;
+import xregistry.generated.ListGroupsGivenAUserDocument;
+import xregistry.generated.ListGroupsGivenAUserResponseDocument;
+import xregistry.generated.ListGroupsResponseDocument;
+import xregistry.generated.ListSubActorsGivenAGroupDocument;
+import xregistry.generated.ListSubActorsGivenAGroupResponseDocument;
+import xregistry.generated.ListUsersDocument;
+import xregistry.generated.ListUsersResponseDocument;
+import xregistry.generated.OGCEResourceData;
+import xregistry.generated.RegisterAppDescDocument;
+import xregistry.generated.RegisterAppDescResponseDocument;
+import xregistry.generated.RegisterConcreteWsdlDocument;
+import xregistry.generated.RegisterConcreteWsdlResponseDocument;
+import xregistry.generated.RegisterHostDescDocument;
+import xregistry.generated.RegisterHostDescResponseDocument;
+import xregistry.generated.RegisterServiceDescDocument;
+import xregistry.generated.RegisterServiceDescResponseDocument;
+import xregistry.generated.RemoveAppDescDocument;
+import xregistry.generated.RemoveAppDescResponseDocument;
+import xregistry.generated.RemoveCapabilityDocument;
+import xregistry.generated.RemoveCapabilityResponseDocument;
+import xregistry.generated.RemoveConcreteWsdlDocument;
+import xregistry.generated.RemoveConcreteWsdlResponseDocument;
+import xregistry.generated.RemoveGroupFromGroupDocument;
+import xregistry.generated.RemoveGroupFromGroupResponseDocument;
+import xregistry.generated.RemoveHostDescDocument;
+import xregistry.generated.RemoveHostDescResponseDocument;
+import xregistry.generated.RemoveOGCEResourceDocument;
+import xregistry.generated.RemoveOGCEResourceResponseDocument;
+import xregistry.generated.RemoveResourceDocument;
+import xregistry.generated.RemoveResourceResponseDocument;
+import xregistry.generated.RemoveServiceDescDocument;
+import xregistry.generated.RemoveServiceDescResponseDocument;
+import xregistry.generated.RemoveUserFromGroupDocument;
+import xregistry.generated.RemoveUserFromGroupResponseDocument;
+import xregistry.generated.ResourceData;
+import xregistry.generated.ServiceDescData;
+import xregistry.generated.WsdlData;
+import xregistry.generated.AddCapabilityDocument.AddCapability;
+import xregistry.generated.AddCapabilityTokenDocument.AddCapabilityToken;
+import xregistry.generated.AddOGCEResourceDocument.AddOGCEResource;
+import xregistry.generated.AddResourceDocument.AddResource;
+import xregistry.generated.App2HostsResponseDocument.App2HostsResponse;
+import xregistry.generated.FindAppDescResponseDocument.FindAppDescResponse;
+import xregistry.generated.FindAppDescResponseDocument.FindAppDescResponse.AppData;
+import xregistry.generated.FindHostsResponseDocument.FindHostsResponse;
+import xregistry.generated.FindOGCEResourceDocument.FindOGCEResource;
+import xregistry.generated.FindOGCEResourceResponseDocument.FindOGCEResourceResponse;
+import xregistry.generated.FindResourceDocument.FindResource;
+import xregistry.generated.FindResourceResponseDocument.FindResourceResponse;
+import xregistry.generated.FindServiceDescResponseDocument.FindServiceDescResponse;
+import xregistry.generated.FindServiceInstanceResponseDocument.FindServiceInstanceResponse;
+import xregistry.generated.GetCapabilityDocument.GetCapability;
+import xregistry.generated.GetCapabilityResponseDocument.GetCapabilityResponse;
+import xregistry.generated.GetOGCEResourceDocument.GetOGCEResource;
+import xregistry.generated.GetResourceDocument.GetResource;
+import xregistry.generated.IsAuthorizedToAcssesDocument.IsAuthorizedToAcsses;
+import xregistry.generated.ListGroupsGivenAUserResponseDocument.ListGroupsGivenAUserResponse;
+import xregistry.generated.ListGroupsResponseDocument.ListGroupsResponse;
+import xregistry.generated.ListSubActorsGivenAGroupDocument.ListSubActorsGivenAGroup;
+import xregistry.generated.ListSubActorsGivenAGroupResponseDocument.ListSubActorsGivenAGroupResponse.Actor;
+import xregistry.generated.ListUsersResponseDocument.ListUsersResponse;
+import xregistry.generated.RemoveOGCEResourceDocument.RemoveOGCEResource;
+import xregistry.generated.RemoveResourceDocument.RemoveResource;
+import xsul.MLogger;
+import xsul.message_router.MessageContext;
+
+public class XregistryXmlBeansWrapper implements XregistryPortType {
+    protected static MLogger log = MLogger.getLogger(XregistryConstants.LOGGER_NAME);
+
+    private XregistryImpl registryImpl;
+
+    public XregistryXmlBeansWrapper(GlobalContext globalContext) {
+        registryImpl = new XregistryImpl(globalContext);
+    }
+
+    private String findUserDN() {
+        String userDN = null;
+         MessageContext mc = xsul.xhandler_context.ServerContextAccessHandler.getContext();
+        if (mc != null) {
+            userDN = mc.getIncomingUserDn();
+        }
+        
+        if(userDN == null){
+            userDN = XregistryConstants.ANONYMOUS_USER;
+        }
+        userDN = Utils.canonicalizeDN(userDN);
+        log.info("Invoker = " + userDN);
+        return userDN;
+    }
+
+    public AddCapabilityResponseDocument addCapability(AddCapabilityDocument capabilityDocument)
+            throws XregistryException {
+        log.info("Request: " + capabilityDocument.xmlText());
+        AddCapability addCapability = capabilityDocument.getAddCapability();
+        registryImpl.addCapability(findUserDN(), addCapability.getResourceID(), addCapability
+                .getActor(), addCapability.getIsActorAUser(), addCapability.getAction());
+        AddCapabilityResponseDocument responseDocument = AddCapabilityResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewAddCapabilityResponse();
+        log.info("Response: " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public AddCapabilityTokenResponseDocument addCapabilityToken(AddCapabilityTokenDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        AddCapabilityToken captoken = input.getAddCapabilityToken();
+
+        Timestamp notBefore = new Timestamp(captoken.xgetNotbefore().getDateValue().getTime());
+        Timestamp notAfter = new Timestamp(captoken.xgetNotafter().getDateValue().getTime());
+
+        registryImpl.addCapability(findUserDN(), captoken.getResourceID(), captoken.getActor(),
+                captoken.getActorType(), captoken.getAction(), captoken.getAssertions(), notBefore,
+                notAfter);
+        AddCapabilityTokenResponseDocument responseDocument = AddCapabilityTokenResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewAddCapabilityTokenResponse();
+        log.info("Response: " + responseDocument.xmlText());
+        return responseDocument;
+
+    }
+
+    public AddUsertoGroupResponseDocument addUsertoGroup(AddUsertoGroupDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        registryImpl.addUsertoGroup(findUserDN(), input.getAddUsertoGroup().getGroup(), input
+                .getAddUsertoGroup().getUserToAdd());
+
+        AddUsertoGroupResponseDocument responseDocument = AddUsertoGroupResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewAddUsertoGroupResponse();
+        log.info("Response: " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public App2HostsResponseDocument app2Hosts(App2HostsDocument input) throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        String[] hostList = registryImpl.app2Hosts(findUserDN(), input.getApp2Hosts().getAppName());
+
+        App2HostsResponseDocument app2HostResDoc = App2HostsResponseDocument.Factory.newInstance();
+        App2HostsResponse app2HostRes = app2HostResDoc.addNewApp2HostsResponse();
+
+        if (hostList != null) {
+            for (String host : hostList) {
+                app2HostRes.addNewHost().setStringValue(host);
+            }
+        }
+        log.info("Response:" + app2HostResDoc.xmlText());
+        return app2HostResDoc;
+    }
+
+    public CreateGroupResponseDocument createGroup(CreateGroupDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        registryImpl.createGroup(findUserDN(), input.getCreateGroup().getGroupName(), input
+                .getCreateGroup().getDescription());
+        CreateGroupResponseDocument responseDocument = CreateGroupResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewCreateGroupResponse();
+        log.info("Response: " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public CreateUserResponseDocument createUser(CreateUserDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        registryImpl.createUser(findUserDN(), input.getCreateUser().getUserName(), input
+                .getCreateUser().getDescription());
+        CreateUserResponseDocument responseDocument = CreateUserResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewCreateUserResponse();
+        log.info("Response: " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public DeleteGroupResponseDocument deleteGroup(DeleteGroupDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        registryImpl.deleteGroup(findUserDN(), input.getDeleteGroup().getGroupName());
+        DeleteGroupResponseDocument responseDocument = DeleteGroupResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewDeleteGroupResponse();
+        log.info("Response: " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public DeleteUserResponseDocument deleteUser(DeleteUserDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        registryImpl.deleteUser(findUserDN(), input.getDeleteUser().getUserName());
+        DeleteUserResponseDocument responseDocument = DeleteUserResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewDeleteUserResponse();
+        log.info("Response: " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public FindAppDescResponseDocument findAppDesc(FindAppDescDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        List<org.apache.airavata.xregistry.doc.AppData> appsData = registryImpl.findAppDesc(findUserDN(), input.getFindAppDesc()
+                .getAppNameSearchStr());
+        FindAppDescResponseDocument res = FindAppDescResponseDocument.Factory.newInstance();
+
+        FindAppDescResponse appDescResponse = res.addNewFindAppDescResponse();
+        
+        
+        if (appsData != null) {
+            for (org.apache.airavata.xregistry.doc.AppData appData : appsData) {
+                AppData xbeansAppData = appDescResponse.addNewAppData();
+                copyAppData(appData, xbeansAppData);
+            }
+        } else {
+            res.addNewFindAppDescResponse();
+        }
+        log.info("Response: " + res.xmlText());
+        return res;
+    }
+
+    public FindHostsResponseDocument findHosts(FindHostsDocument input) throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        List<DocData> hostList = registryImpl.findHosts(findUserDN(), input.getFindHosts()
+                .getHostNameSearchStr());
+
+        FindHostsResponseDocument app2HostResDoc = FindHostsResponseDocument.Factory.newInstance();
+        FindHostsResponse hostsRes = app2HostResDoc.addNewFindHostsResponse();
+        if (hostList != null) {
+            for (DocData hostdata : hostList) {
+                HostDescData result = hostsRes.addNewResults();
+                copyResourceData(hostdata, result);
+            }
+        }
+        log.info("Response  Sent  " + app2HostResDoc.xmlText());
+        return app2HostResDoc;
+    }
+
+    public FindServiceDescResponseDocument findServiceDesc(FindServiceDescDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        List<DocData> serviceList = registryImpl.findServiceDesc(findUserDN(), input
+                .getFindServiceDesc().getServiceQNameSearchStr());
+
+        FindServiceDescResponseDocument findServiceDescResponseDocument = FindServiceDescResponseDocument.Factory
+                .newInstance();
+        FindServiceDescResponse findServiceDescResponse = findServiceDescResponseDocument
+                .addNewFindServiceDescResponse();
+        if (serviceList != null) {
+            for (DocData service : serviceList) {
+                ServiceDescData serviceDescData = findServiceDescResponse.addNewServiceName();
+                copyResourceData(service, serviceDescData);
+            }
+        }
+        log.info("Response  Sent  " + findServiceDescResponseDocument.xmlText());
+        return findServiceDescResponseDocument;
+    }
+
+    public FindServiceInstanceResponseDocument findServiceInstance(FindServiceInstanceDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        List<DocData> serviceInstanceList = registryImpl.findServiceInstance(findUserDN(), input
+                .getFindServiceInstance().getServiceQnameSearchStr());
+
+        FindServiceInstanceResponseDocument findServiceInstanceResponseDocument = FindServiceInstanceResponseDocument.Factory
+                .newInstance();
+        FindServiceInstanceResponse findServiceDescResponse = findServiceInstanceResponseDocument
+                .addNewFindServiceInstanceResponse();
+        if (serviceInstanceList != null) {
+            for (DocData service : serviceInstanceList) {
+                WsdlData wsdlData = findServiceDescResponse.addNewServiceInstance();
+                copyResourceData(service, wsdlData);
+            }
+        }
+        log.info("Response  Sent  " + findServiceInstanceResponseDocument.xmlText());
+        return findServiceInstanceResponseDocument;
+    }
+
+    public GetAbstractWsdlResponseDocument getAbstractWsdl(GetAbstractWsdlDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        String wsdlAsStr = registryImpl.getAbstractWsdl(findUserDN(), input.getGetAbstractWsdl()
+                .getWsdlQName().toString());
+        GetAbstractWsdlResponseDocument responseDocument = GetAbstractWsdlResponseDocument.Factory
+                .newInstance();
+        if (wsdlAsStr != null) {
+            responseDocument.addNewGetAbstractWsdlResponse().setWsdlAsStr(wsdlAsStr);
+        } else {
+            responseDocument.addNewGetAbstractWsdlResponse().setNilWsdlAsStr();
+        }
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public GetAppDescResponseDocument getAppDesc(GetAppDescDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        String appDescAsStr = registryImpl.getAppDesc(findUserDN(), input.getGetAppDesc()
+                .getAppQName(), input.getGetAppDesc().getHostName());
+        GetAppDescResponseDocument responseDocument = GetAppDescResponseDocument.Factory
+                .newInstance();
+        if (appDescAsStr != null) {
+            responseDocument.addNewGetAppDescResponse().setAppdescAsStr(appDescAsStr);
+        } else {
+            responseDocument.addNewGetAppDescResponse().setNilAppdescAsStr();
+        }
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public GetCapabilityResponseDocument getCapability(GetCapabilityDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        GetCapability capabilityData = input.getGetCapability();
+        CapabilityToken[] capabilities = registryImpl.getCapability(findUserDN(), capabilityData
+                .getResourceID(), capabilityData.getUser(), capabilityData.getActorType(),
+                capabilityData.getAction());
+
+        GetCapabilityResponseDocument responseDocument = GetCapabilityResponseDocument.Factory
+                .newInstance();
+        GetCapabilityResponse capabilityResponse = responseDocument.addNewGetCapabilityResponse();
+        if (capabilities != null) {
+            capabilityResponse.setTokenArray(capabilities);
+        }
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public GetConcreateWsdlResponseDocument getConcreateWsdl(GetConcreateWsdlDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        String cwsdlAsStr = registryImpl.getConcreateWsdl(findUserDN(), input.getGetConcreateWsdl()
+                .getWsdlQname().toString());
+        GetConcreateWsdlResponseDocument responseDocument = GetConcreateWsdlResponseDocument.Factory
+                .newInstance();
+        if (cwsdlAsStr == null) {
+            responseDocument.addNewGetConcreateWsdlResponse().setNilWsdlAsStr();
+        } else {
+            responseDocument.addNewGetConcreateWsdlResponse().setWsdlAsStr(cwsdlAsStr);
+        }
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public GetHostDescResponseDocument getHostDesc(GetHostDescDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        String hostDescAsStr = registryImpl.getHostDesc(findUserDN(), input.getGetHostDesc()
+                .getHostName());
+
+        GetHostDescResponseDocument responseDocument = GetHostDescResponseDocument.Factory
+                .newInstance();
+        if (hostDescAsStr != null) {
+            responseDocument.addNewGetHostDescResponse().setHostDescAsStr(hostDescAsStr);
+        } else {
+            responseDocument.addNewGetHostDescResponse().setNilHostDescAsStr();
+        }
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public GetServiceDescResponseDocument getServiceDesc(GetServiceDescDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        String serviceDescAsStr = registryImpl.getServiceDesc(findUserDN(), input
+                .getGetServiceDesc().getServiceQname().toString());
+        GetServiceDescResponseDocument responseDocument = GetServiceDescResponseDocument.Factory
+                .newInstance();
+        if (serviceDescAsStr != null) {
+            responseDocument.addNewGetServiceDescResponse().setServiceDescAsStr(serviceDescAsStr);
+        } else {
+            responseDocument.addNewGetServiceDescResponse().setNilServiceDescAsStr();
+        }
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public ListGroupsResponseDocument listGroups(ListGroupsDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        String[] groups = registryImpl.listGroups(findUserDN());
+        ListGroupsResponseDocument responseDocument = ListGroupsResponseDocument.Factory
+                .newInstance();
+        ListGroupsResponse listGroupsResponse = responseDocument.addNewListGroupsResponse();
+
+        if (groups != null) {
+            for (String group : groups) {
+                listGroupsResponse.addNewGroup().setStringValue(group);
+            }
+        }
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public ListGroupsGivenAUserResponseDocument listGroupsGivenAUser(
+            ListGroupsGivenAUserDocument input) throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        String[] groups = registryImpl.listGroupsGivenAUser(findUserDN(), input
+                .getListGroupsGivenAUser().getUserName());
+        ListGroupsGivenAUserResponseDocument responseDocument = ListGroupsGivenAUserResponseDocument.Factory
+                .newInstance();
+        ListGroupsGivenAUserResponse listGroupsResponse = responseDocument
+                .addNewListGroupsGivenAUserResponse();
+
+        if (groups != null) {
+            for (String group : groups) {
+                listGroupsResponse.addNewGroup().setStringValue(group);
+            }
+        }
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public ListUsersResponseDocument listUsers(ListUsersDocument input) throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        String[] users = registryImpl.listUsers(findUserDN());
+        ListUsersResponseDocument responseDocument = ListUsersResponseDocument.Factory
+                .newInstance();
+        ListUsersResponse listGroupsResponse = responseDocument.addNewListUsersResponse();
+
+        if (users != null) {
+            for (String user : users) {
+                listGroupsResponse.addNewUser().setStringValue(user);
+            }
+        }
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    
+    
+    public ListSubActorsGivenAGroupResponseDocument listSubActorsGivenAGroup(ListSubActorsGivenAGroupDocument input) throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        ListSubActorsGivenAGroup listSubActorsGivenAGroup = input.getListSubActorsGivenAGroup();
+        Actor[] actors = registryImpl.listSubActorsGivenAGroup(findUserDN(), listSubActorsGivenAGroup.getGroup());
+
+        ListSubActorsGivenAGroupResponseDocument responseDocument = ListSubActorsGivenAGroupResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewListSubActorsGivenAGroupResponse().setActorArray(actors);
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+
+    public RegisterAppDescResponseDocument registerAppDesc(RegisterAppDescDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        String resourceID = registryImpl.registerAppDesc(findUserDN(), input.getRegisterAppDesc()
+                .getAppDescAsStr());
+        RegisterAppDescResponseDocument responseDocument = RegisterAppDescResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewRegisterAppDescResponse().setResourceID(resourceID);
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public RegisterConcreteWsdlResponseDocument registerConcreteWsdl(
+            RegisterConcreteWsdlDocument input) throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        String userDN = findUserDN();
+        String resourceID = registryImpl.registerConcreteWsdl(userDN, input
+                .getRegisterConcreteWsdl().getWsdlAsStr(), input.getRegisterConcreteWsdl()
+                .getLifetimeAsSeconds());
+        registryImpl.addCapability(userDN, resourceID, XregistryConstants.PUBLIC_GROUP, 
+                false, XregistryConstants.Action.Read.toString());
+        RegisterConcreteWsdlResponseDocument responseDocument = RegisterConcreteWsdlResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewRegisterConcreteWsdlResponse().setResourceID(resourceID);
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public RegisterHostDescResponseDocument registerHostDesc(RegisterHostDescDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        String resourceID = registryImpl.registerHostDesc(findUserDN(), input.getRegisterHostDesc()
+                .getHostDescAsStr());
+        RegisterHostDescResponseDocument responseDocument = RegisterHostDescResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewRegisterHostDescResponse().setResourceID(resourceID);
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public RegisterServiceDescResponseDocument registerServiceDesc(RegisterServiceDescDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        String resourceID = registryImpl.registerServiceDesc(findUserDN(), input
+                .getRegisterServiceDesc().getServiceDescAsStr(), input.getRegisterServiceDesc()
+                .getAwsdlAdStr());
+        RegisterServiceDescResponseDocument responseDocument = RegisterServiceDescResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewRegisterServiceDescResponse().setResourceID(resourceID);
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public RemoveAppDescResponseDocument removeAppDesc(RemoveAppDescDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        registryImpl.removeAppDesc(findUserDN(), input.getRemoveAppDesc().getAppName().toString(), input
+                .getRemoveAppDesc().getHostName());
+        RemoveAppDescResponseDocument responseDocument = RemoveAppDescResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewRemoveAppDescResponse();
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public RemoveCapabilityResponseDocument removeCapability(RemoveCapabilityDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        registryImpl.removeCapability(findUserDN(), input.getRemoveCapability().getResourceID(),
+                input.getRemoveCapability().getActor());
+        RemoveCapabilityResponseDocument responseDocument = RemoveCapabilityResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewRemoveCapabilityResponse();
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public RemoveConcreteWsdlResponseDocument removeConcreteWsdl(RemoveConcreteWsdlDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        String userdn = findUserDN();
+        String wsdlQname = input.getRemoveConcreteWsdl().getWsdlQName().toString();
+        String resourceID = ResourceUtils.getResourceID(DocType.CWsdl,wsdlQname);
+        registryImpl.removeCapability(userdn, resourceID, XregistryConstants.PUBLIC_GROUP);
+        registryImpl.removeConcreteWsdl(userdn, wsdlQname);
+        RemoveConcreteWsdlResponseDocument responseDocument = RemoveConcreteWsdlResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewRemoveConcreteWsdlResponse();
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public RemoveGroupFromGroupResponseDocument removeGroupFromGroup(
+            RemoveGroupFromGroupDocument input) throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        registryImpl.removeGroupFromGroup(findUserDN(), input.getRemoveGroupFromGroup()
+                .getMasterGroup(), input.getRemoveGroupFromGroup().getGroupToremove());
+        RemoveGroupFromGroupResponseDocument responseDocument = RemoveGroupFromGroupResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewRemoveGroupFromGroupResponse();
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public RemoveHostDescResponseDocument removeHostDesc(RemoveHostDescDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        registryImpl.removeHostDesc(findUserDN(), input.getRemoveHostDesc().getHostName());
+        RemoveHostDescResponseDocument responseDocument = RemoveHostDescResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewRemoveHostDescResponse();
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public RemoveServiceDescResponseDocument removeServiceDesc(RemoveServiceDescDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        registryImpl
+                .removeServiceDesc(findUserDN(), input.getRemoveServiceDesc().getServiceQname().toString());
+        RemoveServiceDescResponseDocument responseDocument = RemoveServiceDescResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewRemoveServiceDescResponse();
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public RemoveUserFromGroupResponseDocument removeUserFromGroup(RemoveUserFromGroupDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        registryImpl.removeUserFromGroup(findUserDN(), input.getRemoveUserFromGroup()
+                .getGroupName(), input.getRemoveUserFromGroup().getUserName());
+        RemoveUserFromGroupResponseDocument responseDocument = RemoveUserFromGroupResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewRemoveUserFromGroupResponse();
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+
+    }
+
+    public AddGrouptoGroupResponseDocument addGrouptoGroup(AddGrouptoGroupDocument input)
+            throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        registryImpl.addAGroupToGroup(findUserDN(), input.getAddGrouptoGroup().getGroup(), input
+                .getAddGrouptoGroup().getGroupToAdd());
+        AddGrouptoGroupResponseDocument responseDocument = AddGrouptoGroupResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewAddGrouptoGroupResponse();
+        log.info("Response  Sent  " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public IsAuthorizedToAcssesResponseDocument isAuthorizedToAcsses(
+            IsAuthorizedToAcssesDocument input) throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        IsAuthorizedToAcsses isAuthorizedToAcsses = input.getIsAuthorizedToAcsses();
+        boolean decision = registryImpl
+                .isAuthorizedToAcsses(findUserDN(), isAuthorizedToAcsses.getResourceID(),
+                        isAuthorizedToAcsses.getActor(), isAuthorizedToAcsses.getAction());
+        IsAuthorizedToAcssesResponseDocument responseDocument = IsAuthorizedToAcssesResponseDocument.Factory
+                .newInstance();
+        responseDocument.addNewIsAuthorizedToAcssesResponse().setDecision(decision);
+        log.info("Response " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public AddResourceResponseDocument addResource(AddResourceDocument input) throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        AddResource resource = input.getAddResource();
+        registryImpl.registerDocument(findUserDN(), resource.getResourceName(), resource.getResourceAsStr());
+        AddResourceResponseDocument responseDocument = AddResourceResponseDocument.Factory.newInstance();
+        responseDocument.addNewAddResourceResponse();
+        log.info("Response " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public FindResourceResponseDocument findResource(FindResourceDocument input) throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        FindResource resource = input.getFindResource();
+        List<DocData> list = registryImpl.findDocument(findUserDN(), resource.getResourceNameQuery());
+        
+        FindResourceResponseDocument responseDocument = FindResourceResponseDocument.Factory.newInstance();
+        FindResourceResponse findResourceResponse = responseDocument.addNewFindResourceResponse();
+        if(list != null){
+            for(DocData data:list){
+                ResourceData resourceData = findResourceResponse.addNewResource();
+                copyResourceData(data, resourceData);
+            }
+        }
+        log.info("Response " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public RemoveResourceResponseDocument removeResource(RemoveResourceDocument input) throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        RemoveResource resource = input.getRemoveResource();
+        registryImpl.removeDocument(findUserDN(), resource.getResourceName());
+        RemoveResourceResponseDocument responseDocument = RemoveResourceResponseDocument.Factory.newInstance();
+        responseDocument.addNewRemoveResourceResponse();
+        log.info("Response " + responseDocument.xmlText());
+        return responseDocument;
+
+    }
+
+    public GetResourceResponseDocument getResource(GetResourceDocument input) throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        GetResource resource = input.getGetResource();
+        GetResourceResponseDocument responseDocument = GetResourceResponseDocument.Factory.newInstance();
+        responseDocument.addNewGetResourceResponse().setResourceAsStr(registryImpl.getDocument(findUserDN(), resource.getResourceName()));
+        log.info("Response " + responseDocument.xmlText());
+        return responseDocument;
+    }
+    
+    private void copyAppData(org.apache.airavata.xregistry.doc.AppData data,AppData xbeansAppData){
+        copyResourceData(data, xbeansAppData);
+        xbeansAppData.setHostName(data.secondryName);
+    }
+    
+    private void copyResourceData(DocData data,ResourceData resourceData){
+        resourceData.setAllowedAction(data.allowedAction);
+        resourceData.setOwner(data.owner);
+        resourceData.setResourceID(data.resourceID.toString());
+        resourceData.setName(data.name);
+    }
+
+    public XregistryImpl getRegistryImpl() {
+        return registryImpl;
+    }
+    public AddOGCEResourceResponseDocument addOGCEResource(AddOGCEResourceDocument input) throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        AddOGCEResource resource = input.getAddOGCEResource();
+        String userDN = null;
+        if(resource.getOwner() != null && resource.getOwner() != ""){
+        	userDN = resource.getOwner();
+        }else{
+        	userDN = findUserDN();
+        }
+        String parentTypedID = resource.getParentTypedID();
+        if(parentTypedID == null || parentTypedID.trim() == "" )
+        {
+        	parentTypedID = XregistryConstants.DEFAULTPARENT;
+        }
+        registryImpl.registerOGCEResource(userDN, resource.getResourceID(),resource.getResourceName(),  resource.getResourceType(),resource.getResourceDesc(), resource.getResourceDocument(), parentTypedID);
+        AddOGCEResourceResponseDocument responseDocument = AddOGCEResourceResponseDocument.Factory.newInstance();
+        responseDocument.addNewAddOGCEResourceResponse();
+        log.info("Response " + responseDocument.xmlText());
+        return responseDocument;
+    }
+	public GetOGCEResourceResponseDocument getOGCEResource(GetOGCEResourceDocument input) throws XregistryException {
+		log.info("Request Received " + input.xmlText());
+	 	GetOGCEResource resource = input.getGetOGCEResource();
+		GetOGCEResourceResponseDocument responseDocument = GetOGCEResourceResponseDocument.Factory
+				.newInstance();
+		 String parentTypedID = resource.getParentTypedID();
+	        if(parentTypedID == null || parentTypedID.trim() == "" )
+	        {
+	        	parentTypedID = XregistryConstants.DEFAULTPARENT;
+	        }
+		responseDocument.addNewGetOGCEResourceResponse().setResourceAsStr(registryImpl.getOGCEResource(findUserDN(),
+		 resource.getResourceID(), resource.getResourceType(), parentTypedID));
+		log.info("Response " + responseDocument.xmlText());
+		return responseDocument;
+
+	}
+
+    public FindOGCEResourceResponseDocument findOGCEResource(FindOGCEResourceDocument input) throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        FindOGCEResource resource = input.getFindOGCEResource();
+        String parentTypedID = resource.getParentTypedID();
+        if(parentTypedID == null || parentTypedID.trim() == "" )
+        {
+        	parentTypedID = XregistryConstants.DEFAULTPARENT;
+        }
+        
+        List<DocData> list = registryImpl.findOGCEResource(findUserDN(), resource.getResourceNameQuery(), resource.getResourceName() ,resource.getResourceType(),parentTypedID);
+        
+        FindOGCEResourceResponseDocument responseDocument = FindOGCEResourceResponseDocument.Factory.newInstance();
+        FindOGCEResourceResponse findResourceResponse = responseDocument.addNewFindOGCEResourceResponse();
+        if(list != null){
+            for(DocData data:list){
+            	OGCEResourceData resourceData = findResourceResponse.addNewResource();
+                copyOGCEResourceData(data, resourceData);
+            }
+       }
+        log.info("Response " + responseDocument.xmlText());
+        return responseDocument;
+    }
+
+    public RemoveOGCEResourceResponseDocument removeOGCEResource(RemoveOGCEResourceDocument input) throws XregistryException {
+        log.info("Request Received " + input.xmlText());
+        RemoveOGCEResource resource = input.getRemoveOGCEResource();
+        registryImpl.removeOGCEResource(findUserDN(), resource.getResourceID(), resource.getResourceType());
+        RemoveOGCEResourceResponseDocument responseDocument = RemoveOGCEResourceResponseDocument.Factory.newInstance();
+        responseDocument.addNewRemoveOGCEResourceResponse();
+        log.info("Response " + responseDocument.xmlText());
+        return responseDocument;
+
+    }
+    private void copyOGCEResourceData(DocData data,OGCEResourceData resourceData){
+        resourceData.setAllowedAction(data.allowedAction);
+        resourceData.setOwner(data.owner);
+        resourceData.setResourceID(data.resourceID);
+        resourceData.setResourceName(data.resourcename);
+        resourceData.setName(data.resourceID);
+        resourceData.setResourceType(data.resourcetype);
+        resourceData.setResourceDesc(data.resourcedesc);
+        resourceData.setCreated(data.created);
+        
+    }
+}

Added: incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/tables.sql
URL: http://svn.apache.org/viewvc/incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/tables.sql?rev=1139850&view=auto
==============================================================================
--- incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/tables.sql (added)
+++ incubator/airavata/services/trunk/xregistry/src/main/java/org/apache/airavata/xregistry/tables.sql Sun Jun 26 17:50:29 2011
@@ -0,0 +1,117 @@
+-- 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.
+
+CREATE TABLE IF NOT EXISTS user_table(
+	userid VARCHAR(200) NOT NULL PRIMARY KEY,
+	description TEXT,
+	isAdmin BIT
+)ENGINE=InnoDB;
+
+CREATE TABLE IF NOT EXISTS group_table(
+	groupid VARCHAR(200) NOT NULL PRIMARY KEY,
+	description TEXT
+)ENGINE=InnoDB;
+
+CREATE TABLE IF NOT EXISTS user_groups_table (
+	groupid VARCHAR(200) NOT NULL, 
+	userid VARCHAR(200) NOT NULL,
+	FOREIGN KEY (groupid) REFERENCES group_table(groupid),
+	FOREIGN KEY (userid) REFERENCES user_table (userid)
+)ENGINE=InnoDB;
+
+CREATE TABLE IF NOT EXISTS resource_table(
+	resourceid VARCHAR(200) NOT NULL ,
+	owner VARCHAR(200) NOT NULL,
+	created TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
+	PRIMARY KEY(resourceid,owner)
+)ENGINE=InnoDB;
+
+CREATE TABLE IF NOT EXISTS group_group_table(
+	groupid VARCHAR(200) NOT NULL,
+	contained_groupid VARCHAR(200) NOT NULL,
+	FOREIGN KEY (groupid) REFERENCES group_table(groupid),
+	FOREIGN KEY (contained_groupid) REFERENCES group_table(groupid)
+)ENGINE=InnoDB;
+
+CREATE TABLE IF NOT EXISTS hostdesc_table(
+	resourceid VARCHAR(200) NOT NULL,
+	host_name VARCHAR(200) NOT NULL PRIMARY KEY, INDEX(host_name),
+	hostdesc_str LONGTEXT NOT NULL,
+	FOREIGN KEY (resourceid) REFERENCES resource_table(resourceid)
+);
+
+CREATE TABLE IF NOT EXISTS appdesc_table(
+	resourceid VARCHAR(200) NOT NULL,
+	qname VARCHAR(200) NOT NULL,
+	host_name VARCHAR(200) NOT NULL,
+	appdesc_str LONGTEXT NOT NULL,
+	PRIMARY KEY (qname,host_name),
+	FOREIGN KEY (resourceid) REFERENCES resource_table(resourceid)/*,
+	FOREIGN KEY (host_name) REFERENCES hostdesc_table(host_name) */
+)ENGINE=InnoDB;
+
+CREATE TABLE IF NOT EXISTS service_map_table(
+	resourceid VARCHAR(200) NOT NULL,
+	qname VARCHAR(200) NOT NULL PRIMARY KEY,
+	servicemap_str LONGTEXT NOT NULL,
+	awsdl_str LONGTEXT NOT NULL,
+	FOREIGN KEY (resourceid) REFERENCES resource_table(resourceid)
+)ENGINE=InnoDB;
+
+CREATE TABLE IF NOT EXISTS cwsdl_table(
+	resourceid VARCHAR(200) NOT NULL,
+	qname VARCHAR(200) NOT NULL PRIMARY KEY,
+	wsdl_str LONGTEXT NOT NULL,
+	time_stamp BIGINT,
+	life_time BIGINT,
+	port_type_name VARCHAR(200) NOT NULL,
+	FOREIGN KEY (resourceid) REFERENCES resource_table(resourceid)
+)ENGINE=InnoDB;
+
+
+CREATE TABLE IF NOT EXISTS capability_table(
+        owner VARCHAR(200) NOT NULL,
+        resourceid VARCHAR(200) NOT NULL,
+        allowed_actor VARCHAR(200) NOT NULL,
+        isUser BIT,
+        action_type VARCHAR(200) NOT NULL,
+        assertions LONGTEXT,
+        notbefore TIMESTAMP,
+        notafter TIMESTAMP,
+        PRIMARY KEY (resourceid,allowed_actor),
+        FOREIGN KEY (owner) REFERENCES user_table (userid)
+ )ENGINE=InnoDB;
+ 
+ CREATE TABLE IF NOT EXISTS doc_table(
+	resourceid VARCHAR(200) NOT NULL,
+	doc_str LONGTEXT NOT NULL,
+	FOREIGN KEY (resourceid) REFERENCES resource_table(resourceid)
+);
+
+CREATE TABLE IF NOT EXISTS ogce_resource_table(
+    resourceid VARCHAR(200) NOT NULL,
+    resourcename VARCHAR(200),
+    resourcetype VARCHAR(200) NOT NULL,
+    resourceDesc LONGTEXT,
+    resourceDocument LONGTEXT,
+    parentTypedID VARCHAR(200),
+    created TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
+    FOREIGN KEY (resourceid) REFERENCES resource_table(resourceid)
+)ENGINE=InnoDB;
+   
+
+  
+	
+	
\ No newline at end of file



Mime
View raw message