You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2014/04/23 21:42:33 UTC

[6/8] merging monitoring with gfac-core, later this will be separated

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/monitor/util/CommonUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/monitor/util/CommonUtils.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/monitor/util/CommonUtils.java
new file mode 100644
index 0000000..30f1ae4
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/monitor/util/CommonUtils.java
@@ -0,0 +1,172 @@
+/*
+ *
+ * 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.gfac.monitor.util;
+
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.gfac.monitor.HostMonitorData;
+import org.apache.airavata.gfac.monitor.MonitorID;
+import org.apache.airavata.gfac.monitor.UserMonitorData;
+import org.apache.airavata.gfac.monitor.exception.AiravataMonitorException;
+import org.apache.airavata.schemas.gfac.GsisshHostType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.BlockingQueue;
+
+public class CommonUtils {
+    private final static Logger logger = LoggerFactory.getLogger(CommonUtils.class);
+
+    public static boolean isPBSHost(HostDescription host){
+        if("pbs".equals(((GsisshHostType)host.getType()).getJobManager()) ||
+                "".equals(((GsisshHostType)host.getType()).getJobManager())){
+         return true;
+        }else{
+            // default is pbs so we return true
+            return false;
+        }
+    }
+    public static boolean isSlurm(HostDescription host){
+        if("slurm".equals(((GsisshHostType)host.getType()).getJobManager())){
+         return true;
+        }else{
+            // default is pbs so we return true
+            return false;
+        }
+    }
+    public static boolean isSGE(HostDescription host){
+        if("sge".equals(((GsisshHostType)host.getType()).getJobManager())){
+         return true;
+        }else{
+            // default is pbs so we return true
+            return false;
+        }
+    }
+    public static String getChannelID(MonitorID monitorID) {
+        return monitorID.getUserName() + "-" + monitorID.getHost().getType().getHostName();
+    }
+
+    public static String getRoutingKey(MonitorID monitorID) {
+        return "*." + monitorID.getUserName() + "." + monitorID.getHost().getType().getHostAddress();
+    }
+
+    public static String getChannelID(String userName,String hostAddress) {
+        return userName + "-" + hostAddress;
+    }
+
+    public static String getRoutingKey(String userName,String hostAddress) {
+        return "*." + userName + "." + hostAddress;
+    }
+
+    public static void addMonitortoQueue(BlockingQueue<UserMonitorData> queue, MonitorID monitorID) throws AiravataMonitorException {
+        Iterator<UserMonitorData> iterator = queue.iterator();
+        while (iterator.hasNext()) {
+            UserMonitorData next = iterator.next();
+            if (next.getUserName().equals(monitorID.getUserName())) {
+                // then this is the right place to update
+                List<HostMonitorData> monitorIDs = next.getHostMonitorData();
+                for (HostMonitorData host : monitorIDs) {
+                    if (host.getHost().equals(monitorID.getHost())) {
+                        // ok we found right place to add this monitorID
+                        host.addMonitorIDForHost(monitorID);
+                        return;
+                    }
+                }
+                // there is a userMonitor object for this user name but no Hosts for this host
+                // so we have to create new Hosts
+                HostMonitorData hostMonitorData = new HostMonitorData(monitorID.getHost());
+                hostMonitorData.addMonitorIDForHost(monitorID);
+                next.addHostMonitorData(hostMonitorData);
+                return;
+            }
+        }
+        HostMonitorData hostMonitorData = new HostMonitorData(monitorID.getHost());
+        hostMonitorData.addMonitorIDForHost(monitorID);
+
+        UserMonitorData userMonitorData = new UserMonitorData(monitorID.getUserName());
+        userMonitorData.addHostMonitorData(hostMonitorData);
+        try {
+            queue.put(userMonitorData);
+        } catch (InterruptedException e) {
+            throw new AiravataMonitorException(e);
+        }
+    }
+    public static boolean isTheLastJobInQueue(BlockingQueue<MonitorID> queue,MonitorID monitorID){
+        Iterator<MonitorID> iterator = queue.iterator();
+        while(iterator.hasNext()){
+            MonitorID next = iterator.next();
+            if(monitorID.getUserName().equals(next.getUserName()) && CommonUtils.isEqual(monitorID.getHost(), next.getHost())){
+                return false;
+            }
+        }
+        return true;
+    }
+    public static void removeMonitorFromQueue(BlockingQueue<UserMonitorData> queue,MonitorID monitorID) throws AiravataMonitorException {
+        Iterator<UserMonitorData> iterator = queue.iterator();
+        while(iterator.hasNext()){
+            UserMonitorData next = iterator.next();
+            if(next.getUserName().equals(monitorID.getUserName())){
+                // then this is the right place to update
+                List<HostMonitorData> hostMonitorData = next.getHostMonitorData();
+                for(HostMonitorData iHostMonitorID:hostMonitorData){
+                    if(iHostMonitorID.getHost().equals(monitorID.getHost())) {
+                        List<MonitorID> monitorIDs = iHostMonitorID.getMonitorIDs();
+                        for(MonitorID iMonitorID:monitorIDs){
+                            if(iMonitorID.getJobID().equals(monitorID.getJobID())) {
+                                // OK we found the object, we cannot do list.remove(object) states of two objects
+                                // could be different, thats why we check the jobID
+                                monitorIDs.remove(iMonitorID);
+                                if(monitorIDs.size()==0) {
+                                    hostMonitorData.remove(iHostMonitorID);
+                                    if (hostMonitorData.size() == 0) {
+                                        // no useful data so we have to remove the element from the queue
+                                        queue.remove(next);
+                                    }
+                                }
+                                return;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        throw new AiravataMonitorException("Cannot find the given MonitorID in the queue with userName " +
+                monitorID.getUserName() + "  and jobID " + monitorID.getJobID());
+
+    }
+
+    public static boolean isEqual(HostDescription host1,HostDescription host2) {
+        if ((host1.getType() instanceof GsisshHostType) && (host2.getType() instanceof GsisshHostType)) {
+            GsisshHostType hostType1 = (GsisshHostType)host1.getType();
+            GsisshHostType hostType2 = (GsisshHostType)host2.getType();
+            if(hostType1.getHostAddress().equals(hostType2.getHostAddress())
+                    && hostType1.getJobManager().equals(hostType2.getJobManager())
+                    && (hostType1.getPort() == hostType2.getPort())
+                    && hostType1.getMonitorMode().equals(hostType2.getMonitorMode())){
+                return true;
+            }
+        } else {
+            logger.error("This method is only impmlemented to handle Gsissh host types");
+        }
+        return false;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/monitor/util/X509Helper.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/monitor/util/X509Helper.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/monitor/util/X509Helper.java
new file mode 100644
index 0000000..c29490a
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/monitor/util/X509Helper.java
@@ -0,0 +1,161 @@
+/*
+ *
+ * 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.gfac.monitor.util;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.openssl.PEMReader;
+
+import java.io.*;
+import java.security.*;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.CertificateParsingException;
+import java.security.cert.X509Certificate;
+import java.security.spec.InvalidKeySpecException;
+
+public class X509Helper {
+
+    static {
+        // parsing of RSA key fails without this
+        java.security.Security.addProvider(new BouncyCastleProvider());
+    }
+
+
+
+    public static KeyStore keyStoreFromPEM(String proxyFile,
+                                           String keyPassPhrase) throws IOException,
+            CertificateException,
+            NoSuchAlgorithmException,
+            InvalidKeySpecException,
+            KeyStoreException {
+        return keyStoreFromPEM(proxyFile,proxyFile,keyPassPhrase);
+    }
+
+    public static KeyStore keyStoreFromPEM(String certFile,
+                                           String keyFile,
+                                           String keyPassPhrase) throws IOException,
+                                                                        CertificateException,
+                                                                        NoSuchAlgorithmException,
+                                                                        InvalidKeySpecException,
+                                                                        KeyStoreException {
+        CertificateFactory cf = CertificateFactory.getInstance("X.509");
+        X509Certificate cert = (X509Certificate)cf.generateCertificate(new FileInputStream(certFile));
+        //System.out.println(cert.toString());
+
+        // this works for proxy files, too, since it skips over the certificate
+        BufferedReader reader = new BufferedReader(new FileReader(keyFile));
+        String line = null;
+        StringBuilder builder = new StringBuilder();
+        boolean inKey = false;
+        while((line=reader.readLine()) != null) {
+            if (line.contains("-----BEGIN RSA PRIVATE KEY-----")) {
+                inKey = true;
+            }
+            if (inKey) {
+                builder.append(line);
+                builder.append(System.getProperty("line.separator"));
+            }
+            if (line.contains("-----END RSA PRIVATE KEY-----")) {
+                inKey = false;
+            }
+        }
+        String privKeyPEM = builder.toString();
+        //System.out.println(privKeyPEM);
+
+        // using BouncyCastle
+        PEMReader pemParser = new PEMReader(new StringReader(privKeyPEM));
+        Object object = pemParser.readObject();
+
+        PrivateKey privKey = null;
+        if(object instanceof KeyPair){
+            privKey = ((KeyPair)object).getPrivate();
+        }
+        // PEMParser from BouncyCastle is good for reading PEM files, but I didn't want to add that dependency
+        /*
+        // Base64 decode the data
+        byte[] encoded = javax.xml.bind.DatatypeConverter.parseBase64Binary(privKeyPEM);
+
+        // PKCS8 decode the encoded RSA private key
+        java.security.spec.PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(encoded);
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        PrivateKey privKey = kf.generatePrivate(keySpec);
+        //RSAPrivateKey privKey = (RSAPrivateKey)kf.generatePrivate(keySpec);
+        */
+        //System.out.println(privKey.toString());
+
+        KeyStore keyStore = KeyStore.getInstance("PKCS12");
+        keyStore.load(null,null);
+
+        KeyStore.PrivateKeyEntry entry =
+            new KeyStore.PrivateKeyEntry(privKey,
+                                         new java.security.cert.Certificate[] {(java.security.cert.Certificate)cert});
+        KeyStore.PasswordProtection prot = new KeyStore.PasswordProtection(keyPassPhrase.toCharArray());
+        keyStore.setEntry(cert.getSubjectX500Principal().getName(), entry, prot);
+
+        return keyStore;
+    }
+
+
+    public static KeyStore trustKeyStoreFromCertDir() throws IOException,
+                                                             KeyStoreException,
+                                                             CertificateException,
+                                                             NoSuchAlgorithmException, ApplicationSettingsException {
+        return trustKeyStoreFromCertDir(ServerSettings.getSetting("trusted.cert.location"));
+    }
+
+    public static KeyStore trustKeyStoreFromCertDir(String certDir) throws IOException,
+                                                                           KeyStoreException,
+                                                                           CertificateException,
+                                                                           NoSuchAlgorithmException {
+        KeyStore ks = KeyStore.getInstance("JKS");
+        ks.load(null,null);
+
+        File dir = new File(certDir);
+        for(File file : dir.listFiles()) {
+            if (!file.isFile()) {
+                continue;
+            }
+            if (!file.getName().endsWith(".0")) {
+                continue;
+            }
+
+            try {
+                //System.out.println("reading file "+file.getName());
+                CertificateFactory cf = CertificateFactory.getInstance("X.509");
+                X509Certificate cert = (X509Certificate) cf.generateCertificate(new FileInputStream(file));
+                //System.out.println(cert.toString());
+
+                KeyStore.TrustedCertificateEntry entry = new KeyStore.TrustedCertificateEntry(cert);
+
+                ks.setEntry(cert.getSubjectX500Principal().getName(), entry, null);
+            } catch (KeyStoreException e) {
+            } catch (CertificateParsingException e) {
+                continue;
+            }
+
+        }
+
+        return ks;
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/GFacProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/GFacProvider.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/GFacProvider.java
index 5c33ec1..cf77fab 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/GFacProvider.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/GFacProvider.java
@@ -25,8 +25,8 @@ import java.util.Map;
 
 import org.apache.airavata.gfac.GFacException;
 import org.apache.airavata.gfac.context.JobExecutionContext;
-import org.apache.airavata.job.monitor.AbstractActivityListener;
-import org.apache.airavata.job.monitor.command.TaskCancelRequest;
+import org.apache.airavata.gfac.monitor.AbstractActivityListener;
+import org.apache.airavata.gfac.monitor.command.TaskCancelRequest;
 
 import com.google.common.eventbus.Subscribe;
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/AbstractProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/AbstractProvider.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/AbstractProvider.java
index 5966233..a3f8879 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/AbstractProvider.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/AbstractProvider.java
@@ -27,11 +27,11 @@ import org.apache.airavata.gfac.GFacException;
 import org.apache.airavata.gfac.context.JobExecutionContext;
 import org.apache.airavata.gfac.provider.GFacProvider;
 import org.apache.airavata.gfac.provider.GFacProviderException;
-import org.apache.airavata.job.monitor.JobIdentity;
-import org.apache.airavata.job.monitor.MonitorID;
-import org.apache.airavata.job.monitor.command.TaskCancelRequest;
-import org.apache.airavata.job.monitor.event.MonitorPublisher;
-import org.apache.airavata.job.monitor.state.JobStatusChangeRequest;
+import org.apache.airavata.gfac.monitor.JobIdentity;
+import org.apache.airavata.gfac.monitor.MonitorID;
+import org.apache.airavata.gfac.monitor.command.TaskCancelRequest;
+import org.apache.airavata.gfac.monitor.event.MonitorPublisher;
+import org.apache.airavata.gfac.monitor.state.JobStatusChangeRequest;
 import org.apache.airavata.model.workspace.experiment.JobDetails;
 import org.apache.airavata.model.workspace.experiment.JobState;
 import org.apache.airavata.model.workspace.experiment.JobStatus;

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GSISSHProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GSISSHProvider.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GSISSHProvider.java
index 69ad519..5fbaa5d 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GSISSHProvider.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GSISSHProvider.java
@@ -25,7 +25,6 @@ import java.util.Map;
 import org.apache.airavata.gfac.GFacException;
 import org.apache.airavata.gfac.context.JobExecutionContext;
 import org.apache.airavata.gfac.context.security.GSISecurityContext;
-import org.apache.airavata.gfac.context.security.SSHSecurityContext;
 import org.apache.airavata.gfac.notification.events.StartExecutionEvent;
 import org.apache.airavata.gfac.provider.GFacProviderException;
 import org.apache.airavata.gfac.utils.GFacUtils;
@@ -65,8 +64,6 @@ public class GSISSHProvider extends AbstractProvider{
             Cluster cluster = null;
             if (jobExecutionContext.getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT) != null) {
                 cluster = ((GSISecurityContext) jobExecutionContext.getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT)).getPbsCluster();
-            } else {
-                cluster = ((SSHSecurityContext) jobExecutionContext.getSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT)).getPbsCluster();
             }
             if (cluster == null) {
                 throw new GFacProviderException("Security context is not set properly");

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/AccessPolicy.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/AccessPolicy.json b/modules/gfac/gfac-core/src/main/resources/schema/AccessPolicy.json
new file mode 100644
index 0000000..8f6cfe1
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/AccessPolicy.json
@@ -0,0 +1,13 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/AccessPolicy.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Policy.json"}],
+  "properties": {
+    "EndpointID": {
+      "type": "string",
+      "description": "The ID of the Endpoint this AccessPolicy is for"
+    }
+  },
+  "required": ["EndpointID"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/Activity.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/Activity.json b/modules/gfac/gfac-core/src/main/resources/schema/Activity.json
new file mode 100644
index 0000000..8bd2495
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/Activity.json
@@ -0,0 +1,31 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Activity.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Entity.json"}],
+  "properties": {
+    "UserDomainID": {
+      "type": "string",
+      "description": "An ID"
+    },
+    "EndpointID": {
+      "type": "string",
+      "description": "The ID of the Endpoint managing Activity"
+    },
+    "ShareID": {
+      "type": "string",
+      "description": "The ID of the Share servicing this Activity"
+    },
+    "ResourceID": {
+      "type": "string",
+      "description": "The ID of the Resource executing this Activity"
+    },
+    "ActivityID": {
+      "type": "array",
+      "description": "The IDs of other Activities related to this one",
+      "items": {
+        "type": "string"
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/AdminDomain.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/AdminDomain.json b/modules/gfac/gfac-core/src/main/resources/schema/AdminDomain.json
new file mode 100644
index 0000000..8ed4606
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/AdminDomain.json
@@ -0,0 +1,51 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/AdminDomain.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Domain.json"}],
+  "properties": {
+    "Distributed": {
+      "type": "boolean",
+      "description": "true if the services managed by the AdminDomain are geographically distributed"
+    },
+    "Owner": {
+      "type": "array",
+      "description": "Identification of persons or legal entities that own the resources in this AdminDomain",
+      "items": {
+        "type": "string"
+      }
+    },
+    "ServiceID": {
+      "type": "array",
+      "description": "IDs of Services in this AdminDomain",
+      "items": {
+        "type": "string"
+      }
+    },
+    "ChildDomainID": {
+      "type": "array",
+      "description": "IDs of AdminDomains aggregated by this AdminDomain",
+      "items": {
+        "type": "string"
+      }
+    },
+    "ParentDomainID": {
+      "type": "string",
+      "description": "The ID of the AdminDomain that this AdminDomain participates in"
+    },
+    "ComputingServiceID": {
+      "type": "array",
+      "description": "IDs of ComputingServices in this AdminDomain",
+      "items": {
+        "type": "string"
+      }
+    },
+    "StorageServiceID": {
+      "type": "array",
+      "description": "IDs of StorageServices in this AdminDomain",
+      "items": {
+        "type": "string"
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/ApplicationEnvironment.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/ApplicationEnvironment.json b/modules/gfac/gfac-core/src/main/resources/schema/ApplicationEnvironment.json
new file mode 100644
index 0000000..89c78e0
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/ApplicationEnvironment.json
@@ -0,0 +1,86 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ApplicationEnvironment.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Entity.json"}],
+  "properties": {
+    "AppName": {
+      "type": "string",
+      "description": "The name of the application"
+    },
+    "AppVersion": {
+      "type": "string",
+      "description": "The version of the application"
+    },
+    "State": {
+      "type": "string",
+      "description": "The current installation state of the application - AppEnvState_t"
+    },
+    "RemovalDate": {
+      "type": "string",
+      "description": "The date/time after which the application may be removed - DateTime_t"
+    },
+    "License": {
+      "type": "string",
+      "description": "The license under which the application is usable - License_t"
+    },
+    "Description": {
+      "type": "string",
+      "description": "A human-readable description of the application"
+    },
+    "BestBenchmark": {
+      "type": "array",
+      "description": "The type(s) of the benchmarks which best describe the sensitivity of this application to the performance of the ExecutionEnvironment - Benchmark_t",
+      "items": {
+        "type": "string"
+      }
+    },
+    "ParallelSupport": {
+      "type": "string",
+      "description": "The type of supported parallel execution - ParallelSupport_t"
+    },
+    "MaxSlots": {
+      "type": "integer",
+      "description": "The maximum number of concurrent slots that may be used to run the application"
+    },
+    "MaxJobs": {
+      "type": "integer",
+      "description": "The maximum number of concurrent jobs that can run the application"
+    },
+    "MaxUserSeats": {
+      "type": "integer",
+      "description": "The maximum number of concurrent users that can run the application"
+    },
+    "FreeSlots": {
+      "type": "integer",
+      "description": "The maximum number slots currently available to run the application"
+    },
+    "FreeJobs": {
+      "type": "integer",
+      "description": "The maximum number of additional jobs that can run the application"
+    },
+    "FreeUserSeats": {
+      "type": "integer",
+      "description": "The maximum number of additional users that can run the application"
+    },
+    "ExecutionEnvironmentID": {
+      "type": "array",
+      "description": "ID(s) of ExecutionEnvironments where this ApplicationEnvironment can be used",
+      "items": {
+        "type": "string"
+      }
+    },
+    "ComputingManagerID": {
+      "type": "string",
+      "description": "ID of the ComputingManager this ApplicationEnvironment is associated with"
+    },
+    "ApplicationHandleID": {
+      "type": "array",
+      "description": "ID(s) of the ApplicationHandles that can be used to refer to this environment",
+      "items": {
+        "type": "string"
+      }
+    }
+  },
+  "required": ["AppName","ComputingManagerID"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/ApplicationHandle.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/ApplicationHandle.json b/modules/gfac/gfac-core/src/main/resources/schema/ApplicationHandle.json
new file mode 100644
index 0000000..e7972e9
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/ApplicationHandle.json
@@ -0,0 +1,21 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ApplicationHandle.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Entity.json"}],
+  "properties": {
+    "Type": {
+      "type": "string",
+      "description": "The type of method used to set up an ApplicationEnvironment - ApplicationHandle_t (open enumeration)"
+    },
+    "Value": {
+      "type": "string",
+      "description": "How to set up the ApplicationEnvironment in the context of the Type"
+    },
+    "ApplicationEnvironmentID": {
+      "type": "string",
+      "description": "The ID of the ApplicationEnvironment this ApplicationHandle refers to"
+    }
+  },
+  "required": ["Type","Value","ApplicationEnvironmentID"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/Benchmark.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/Benchmark.json b/modules/gfac/gfac-core/src/main/resources/schema/Benchmark.json
new file mode 100644
index 0000000..2b64261
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/Benchmark.json
@@ -0,0 +1,21 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Benchmark.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Entity.json"}],
+  "properties": {
+    "Type": {
+      "type": "string",
+      "description": "The type of the benchmark - Benchmark_t (open enumeration)"
+    },
+    "Value": {
+      "type": "number",
+      "description": "The value of the benchmark"
+    },
+    "ComputingManagerID": {
+      "type": "string",
+      "description": "The ID of the ComputingManager this benchmark is for"
+    }
+  },
+  "required": ["Type","Value"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/ComputingActivity.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/ComputingActivity.json b/modules/gfac/gfac-core/src/main/resources/schema/ComputingActivity.json
new file mode 100644
index 0000000..5fcae72
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/ComputingActivity.json
@@ -0,0 +1,165 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ComputingActivity.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Activity.json"}],
+  "properties": {
+    "Type": {
+      "type": "string",
+      "description": "closed enumeration ComputingActivityType_t",
+      "enum": ["collectionelement","parallelelement","single","workflownode"]
+    },
+    "IDFromEndpoint": {
+      "type": "string",
+      "description": "The ID assigned by the ComputingEndpoint"
+    },
+    "LocalIDFromManager": {
+      "type": "string",
+      "description": "The local ID assigned by the ComputingManager"
+    },
+    "State": {
+      "type": "array",
+      "description": "open enumeration ComputingActivityState_t",
+      "items": {
+        "type": "string"
+      },
+      "minItems": 1
+    },
+    "RestartState": {
+      "type": "array",
+      "description": "open enumeration ComputingActivityState_t",
+      "items": {
+        "type": "string"
+      }
+    },
+    "ExitCode": {
+      "type": "integer",
+      "description": "The exit code as returned by the main executable code or script of the job"
+    },
+    "ComputingManagerExitCode": {
+      "type": "string",
+      "description": "The exit code provided by the ComputingManager"
+    },
+    "Error": {
+      "type": "array",
+      "description": "The error messages as provided by the software components involved in the management of the job",
+      "items": {
+        "type": "string"
+      }
+    },
+    "WaitingPosition": {
+      "type": "integer",
+      "description": "The position of the job in the queue, if the job is waiting"
+    },
+    "Owner": {
+      "type": "string",
+      "description": "The Grid identity of the job's owner"
+    },
+    "LocalOwner": {
+      "type": "string",
+      "description": "The local user name of the job's owner"
+    },
+    "RequestedTotalWallTime": {
+      "type": "integer",
+      "description": "The total wall clock time requested by the job"
+    },
+    "RequestedTotalCPUTime": {
+      "type": "integer",
+      "description": "The total CPU time requested by the job"
+    },
+    "RequestedSlots": {
+      "type": "integer",
+      "description": "The number of slots requested for the job"
+    },
+    "RequestedApplicationEnvironment": {
+      "type": "array",
+      "description": "The AppName and Version of the requested ApplicationEnvironments",
+      "items": {
+        "type": "string"
+      }
+    },
+    "StdIn": {
+      "type": "string",
+      "description": "The name of the file used for standard input"
+    },
+    "StdOut": {
+      "type": "string",
+      "description": "The name of the file used for standard output"
+    },
+    "StdErr": {
+      "type": "string",
+      "description": "The name of the file used for standard error"
+    },
+    "LogDir": {
+      "type": "string",
+      "description": "The name of the directory which contains job logs"
+    },
+    "ExecutionNode": {
+      "type": "array",
+      "description": "Hostnames associated with the ExecutionEnvironments running the job",
+      "items": {
+        "type": "string"
+      }
+    },
+    "Queue": {
+      "type": "string",
+      "description": "The name of the ComputingManager queue that held the job before execution"
+    },
+    "UsedTotalWallTime": {
+      "type": "integer",
+      "description": "The total wall clock time consumed by the job so far (slots*seconds)"
+    },
+    "UsedTotalCpuTime": {
+      "type": "integer",
+      "description": "The total CPU time consumed by the job so far (seconds)"
+    },
+    "UsedMainMemory": {
+      "type": "integer",
+      "description": "The physical RAM currently used by the job (MB)"
+    },
+    "SubmissionTime": {
+      "type": "string",
+      "description": "The time when the job was submitted to the ComputingEndpoint (DateTime_t)"
+    },
+    "ComputingManagerSubmissionTime": {
+      "type": "string",
+      "description": "The time when the job was submitted to the ComputingManager (DateTime_t)"
+    },
+    "StartTime": {
+      "type": "string",
+      "description": "The time when the ComputingManager started the job (DateTime_t)"
+    },
+    "EndTime": {
+      "type": "string",
+      "description": "The time when the job ended in the Grid layer (DateTime_t)"
+    },
+    "ComputingManagerEndTime": {
+      "type": "string",
+      "description": "The time when the job ended according to the ComputingManager (DateTime_t)"
+    },
+    "WorkingAreaEraseTime": {
+      "type": "string",
+      "description": "The time when working area will be removed from storage (DateTime_t)"
+    },
+    "ProxyExpirationTime": {
+      "type": "string",
+      "description": "The expiration time of the Grid proxy associated with the job (DateTime_t)"
+    },
+    "SubmissionHost": {
+      "type": "string",
+      "description": "The name of the host from which the job was submitted"
+    },
+    "SubmissionClientName": {
+      "type": "string",
+      "description": "The name of the software client used to submit the job"
+    },
+    "OtherMessages": {
+      "type": "array",
+      "description": "Optional messages provided by either the Grid layer or the ComputingManager",
+      "items": {
+        "type": "string"
+      }
+    }
+  },
+  "required": ["State","Owner"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/ComputingEndpoint.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/ComputingEndpoint.json b/modules/gfac/gfac-core/src/main/resources/schema/ComputingEndpoint.json
new file mode 100644
index 0000000..f94f889
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/ComputingEndpoint.json
@@ -0,0 +1,44 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ComputingEndpoint.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Endpoint.json"}],
+  "properties": {
+    "Staging": {
+      "type": "string",
+      "description": "Supported file staging functionality - Staging_t",
+      "enum": ["none","stagingin","staginginout","stagingout"]
+    },
+    "JobDescription": {
+      "type": "array",
+      "description": "Supported job description languages - JobDescription_t (open Enumeration)",
+      "items": {
+        "type": "string"
+      }
+    },
+    "TotalJobs": {
+      "type": "integer",
+      "description": "The total number of Grid jobs known to the system"
+    },
+    "RunningJobs": {
+      "type": "integer",
+      "description": "The number of Grid jobs which are running in an ExecutionEnvironment"
+    },
+    "WaitingJobs": {
+      "type": "integer",
+      "description": "The number of Grid jobs which are waiting to start executing"
+    },
+    "StagingJobs": {
+      "type": "integer",
+      "description": "The number of Grid jobs staging files before or after execution"
+    },
+    "SuspendedJobs": {
+      "type": "integer",
+      "description": "The number of Grid jobs that started to execute, but are now suspended"
+    },
+    "PreLRMSWaitingJobs": {
+      "type": "integer",
+      "description": "The number of Grid jobs managed by the Grid software, but not yet passed to the LRMS"
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/ComputingManager.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/ComputingManager.json b/modules/gfac/gfac-core/src/main/resources/schema/ComputingManager.json
new file mode 100644
index 0000000..aecb114
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/ComputingManager.json
@@ -0,0 +1,117 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ComputingManager.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Share.json"}],
+  "properties": {
+    "Reservation": {
+      "type": "boolean",
+      "description": "Whether advance reservation is supported (no value implies undefined in ExtendedBoolean_t)"
+    },
+    "BulkSubmission": {
+      "type": "boolean",
+      "description": "Whether multiple jobs can be submitted at once (no value implies undefined in ExtendedBoolean_t)"
+    },
+    "TotalPhysicalCPUs": {
+      "type": "integer",
+      "description": "The total number of physical CPUs managed by this ComputingManager"
+    },
+    "TotalLogicalCPUs": {
+      "type": "integer",
+      "description": "The total number of logical CPUs managed by this ComputingManager"
+    },
+    "TotalSlots": {
+      "type": "integer",
+      "description": "The total number of slots managed by this ComputingManager"
+    },
+    "SlotsUsedByLocalJobs": {
+      "type": "integer",
+      "description": "The number of slots currently used by jobs submitted via a non-Grid interface"
+    },
+    "SlotsUsedByGridJobs": {
+      "type": "integer",
+      "description": "The number of slots currently used by jobs submitted via a non-Grid interface"
+    },
+    "Homogeneous": {
+      "type": "boolean",
+      "description": "Whether this ComputingManager manages only one type of ExecutionEnvironment"
+    },
+    "NetworkInfo": {
+      "type": "array",
+      "description": "The types of internal network connections between ExecutionEnvironments (NetworkInfo_t)",
+      "items": {
+        "type": "string"
+      }
+    },
+    "LocalCPUDistribution": {
+      "type": "boolean",
+      "description": "Classification of the managed ExecutionEnvironments aggregated by the number of logical CPUs"
+    },
+    "WorkingAreaShared": {
+      "type": "boolean",
+      "description": "True if the working area is shared across different ExecutionEnvironments"
+    },
+    "WorkingAreaGuaranteed": {
+      "type": "boolean",
+      "description": "True if the job is guaranteed all of WorkingAreaTotal"
+    },
+    "WorkingAreaTotal": {
+      "type": "integer",
+      "description": "Total size of the working area available to single slot jobs (GB)"
+    },
+    "WorkingAreaFree": {
+      "type": "integer",
+      "description": "The amount of free space in the working area (GB)"
+    },
+    "WorkingAreaLifeTime": {
+      "type": "integer",
+      "description": "The minimum guaranteed lifetime of files created in the working area (seconds)"
+    },
+    "WorkingAreaMultiSlotTotal": {
+      "type": "integer",
+      "description": "The total size of the working area across all ExecutionEnvironments (GB)"
+    },
+    "WorkingAreaMultiSlotFree": {
+      "type": "integer",
+      "description": "The available space in the working area across all ExecutionEnvironments (GB)"
+    },
+    "WorkingAreaMultiSlotLifeTime": {
+      "type": "integer",
+      "description": "The minimum guaranteed lifetime of files created in the working area (seconds)"
+    },
+    "CacheTotal": {
+      "type": "integer",
+      "description": "If local caching of input files is supported, the total size of the area they may be stored in"
+    },
+    "CacheFree": {
+      "type": "integer",
+      "description": "If local caching of input files is supported, the available size of the area they may be stored in"
+    },
+    "TmpDir": {
+      "type": "string",
+      "description": "The absolute path of a temporary directory local to an ExecutionEnvironment"
+    },
+    "ScratchDir": {
+      "type": "string",
+      "description": "The absolute path of a shared directory available for application data"
+    },
+    "ApplicationDir": {
+      "type": "string",
+      "description": "The absolute path of a directory available for installation of persistent application software"
+    },
+    "ApplicationEnvironmentID": {
+      "type": "array",
+      "description": "ID(s) of ApplicationEnvironments provided by this ComputingManager",
+      "items": {
+        "type": "string"
+      }
+    },
+    "BenchmarkID": {
+      "type": "array",
+      "description": "ID(s) of Benchmarks associated with this ComputingManager",
+      "items": {
+        "type": "string"
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/ComputingService.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/ComputingService.json b/modules/gfac/gfac-core/src/main/resources/schema/ComputingService.json
new file mode 100644
index 0000000..9cfde1b
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/ComputingService.json
@@ -0,0 +1,32 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ComputingService.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Service.json"}],
+  "properties": {
+    "TotalJobs": {
+      "type": "integer",
+      "description": "The total number of Grid jobs known to the system"
+    },
+    "RunningJobs": {
+      "type": "integer",
+      "description": "The number of Grid jobs which are running in an ExecutionEnvironment"
+    },
+    "WaitingJobs": {
+      "type": "integer",
+      "description": "The number of Grid jobs which are waiting to start executing"
+    },
+    "StagingJobs": {
+      "type": "integer",
+      "description": "The number of Grid jobs staging files before or after execution"
+    },
+    "SuspendedJobs": {
+      "type": "integer",
+      "description": "The number of Grid jobs that started to execute, but are now suspended"
+    },
+    "PreLRMSWaitingJobs": {
+      "type": "integer",
+      "description": "The number of Grid jobs managed by the Grid software, but not yet passed to the LRMS"
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/ComputingShare.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/ComputingShare.json b/modules/gfac/gfac-core/src/main/resources/schema/ComputingShare.json
new file mode 100644
index 0000000..340c83e
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/ComputingShare.json
@@ -0,0 +1,182 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ComputingShare.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Share.json"}],
+  "properties": {
+    "MappingQueue": {
+      "type": "string",
+      "description": "The name of the queue in the LRMS where jobs in this share are submitted"
+    },
+    "MaxWallTime": {
+      "type": "integer",
+      "description": "The maximum wall clock time that a single-slot job can run (seconds)"
+    },
+    "MaxMultiSlotWallTime": {
+      "type": "integer",
+      "description": "The maximum wall clock time that a multi-slot job can run (seconds)"
+    },
+    "DefaultWallTime": {
+      "type": "integer",
+      "description": "The default wall clock per slot assumed by the LRMS if a maximum time is not specified (seconds)"
+    },
+    "MaxCPUTime": {
+      "type": "integer",
+      "description": "The maximum pre-slot CPU time that a job can request (seconds)"
+    },
+    "MaxTotalCPUTime": {
+      "type": "integer",
+      "description": "The maximum amount of CPU time that a job can request across all slots assigned to it (seconds)"
+    },
+    "MinCPUTime": {
+      "type": "integer",
+      "description": "The minimum pre-slot CPU time that a job can request (seconds)"
+    },
+    "DefaultCPUTime": {
+      "type": "integer",
+      "description": "The default CPU time limit assumed by the LRMS if a maximum time is not specified (seconds)"
+    },
+    "MaxTotalJobs": {
+      "type": "integer",
+      "description": "The maximum number of jobs that can be in this Share"
+    },
+    "MaxRunningJobs": {
+      "type": "integer",
+      "description": "The maximum number of jobs that can be running in this Share"
+    },
+    "MaxWaitingJobs": {
+      "type": "integer",
+      "description": "The maximum number of jobs that can be waiting in this Share"
+    },
+    "MaxPreLRMSWaitingJobs": {
+      "type": "integer",
+      "description": "The maximum number of jobs that can be waiting in the Grid layer for this Share"
+    },
+    "MaxUserRunningJobs": {
+      "type": "integer",
+      "description": "The maximum number of jobs that can be running in this Share per user"
+    },
+    "MaxSlotsPerJob": {
+      "type": "integer",
+      "description": "The maximum number of slots that can be allocated to a single job in this Share"
+    },
+    "MaxStageInStreams": {
+      "type": "integer",
+      "description": "The maximum number of streams available to stage files in"
+    },
+    "MaxStageOutStreams": {
+      "type": "integer",
+      "description": "The maximum number of streams available to stage files out"
+    },
+    "ScheduingPolicy": {
+      "type": "string",
+      "description": "The scheduling policy used by the share - SchedulingPolicy_t (open enumeration)"
+    },
+    "MaxMainMemory": {
+      "type": "integer",
+      "description": "The maximum amount of physical RAM that a job can use (MB)"
+    },
+    "GuaranteedMainMemory": {
+      "type": "integer",
+      "description": "The amount of physical RAM that a job will have available (MB)"
+    },
+    "MaxVirtualMemory": {
+      "type": "integer",
+      "description": "The maximum amount memory (RAM+swap) that a job can use (MB)"
+    },
+    "GuaranteedVirtualMemory": {
+      "type": "integer",
+      "description": "The amount of memory (RAM+swap) that a job will have available (MB)"
+    },
+    "MaxDiskSpace": {
+      "type": "integer",
+      "description": "The maximum disk space that a job can use in the working area (GB)"
+    },
+    "DefaultStorageServiceID": {
+      "type": "string",
+      "description": "The ID of the default StorageService used to store files"
+    },
+    "Preemption": {
+      "type": "boolean",
+      "description": "Whether jobs can be preempted and resumed (no value implies undefined in ExtendedBoolean_t)"
+    },
+    "ServingState": {
+      "type": "string",
+      "description": "How the Share is currently serving jobs",
+      "enum": ["closed","draining","production","queueing"]
+    },
+    "TotalJobs": {
+      "type": "integer",
+      "description": "The total number of jobs in any state"
+    },
+    "RunningJobs": {
+      "type": "integer",
+      "description": "The number of running jobs submitted through Grid or non-Grid interfaces"
+    },
+    "LocalRunningJobs": {
+      "type": "integer",
+      "description": "The number of running jobs submitted using non-Grid interfaces"
+    },
+    "WaitingJobs": {
+      "type": "integer",
+      "description": "The number of waiting jobs submitted through Grid or non-Grid interfaces"
+    },
+    "LocalWaitingJobs": {
+      "type": "integer",
+      "description": "The number of waiting jobs submitted using non-Grid interfaces"
+    },
+    "SuspendedJobs": {
+      "type": "integer",
+      "description": "The number of suspended jobs submitted through Grid or non-Grid interfaces"
+    },
+    "LocalSuspendedJobs": {
+      "type": "integer",
+      "description": "The number of suspended jobs submitted using non-Grid interfaces"
+    },
+    "StagingJobs": {
+      "type": "integer",
+      "description": "The number of jobs staging files before or after execution"
+    },
+    "PreLRMSWaitingJobs": {
+      "type": "integer",
+      "description": "The number of Grid jobs which have not yet been passed to the LRMS"
+    },
+    "EstimatedAverageWaitingTime": {
+      "type": "integer",
+      "description": "An estimate of the average time a job will wait before it starts to execute (seconds)"
+    },
+    "EstimatedWorstWaitingTime": {
+      "type": "integer",
+      "description": "An estimate of the worst-case time a job will wait before it starts to execute (seconds)"
+    },
+    "FreeSlots": {
+      "type": "integer",
+      "description": "The number of slots which are currently available for use"
+    },
+    "FreeSlotsWithDuration": {
+      "type": "string",
+      "description": "The number of slots which are currently available for use and how long they are available"
+    },
+    "UsedSlots": {
+      "type": "integer",
+      "description": "The number of slots currently in use"
+    },
+    "RequestedSlots": {
+      "type": "integer",
+      "description": "The number of slots needd to execute all waiting and staging jobs"
+    },
+    "ReservationPolicy": {
+      "type": "string",
+      "description": "The policy used for advance reservation - ReservationPolicy_t",
+      "enum": ["mandatory","none","optional"]
+    },
+    "Tag": {
+      "type": "array",
+      "description": "UserDomain-defined tags for this Share",
+      "items": {
+        "type": "string"
+      }
+    }
+  },
+  "required": ["ServingState"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/Contact.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/Contact.json b/modules/gfac/gfac-core/src/main/resources/schema/Contact.json
new file mode 100644
index 0000000..436b262
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/Contact.json
@@ -0,0 +1,32 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Contact.json",
+  "description": "A GLUE 2 Contact",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Entity.json"}],
+  "properties": {
+    "Detail": {
+      "type": "string",
+      "description": "A URI embedding the contact information"
+    },
+    "Type": {
+      "type": "string",
+      "description": "closed enumeration ContactType_t",
+      "enum": ["general","security","sysadmin","usersupport"]
+    },
+    "ServiceID": {
+      "type": "array",
+      "description": "The IDs of Services associated with this Contact",
+      "items": {
+        "type": "string"
+      }
+    },
+    "DomainID": {
+      "type": "array",
+      "description": "The IDs of Domains associated with this Contact",
+      "items": {
+        "type": "string"
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/DataStore.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/DataStore.json b/modules/gfac/gfac-core/src/main/resources/schema/DataStore.json
new file mode 100644
index 0000000..8f15447
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/DataStore.json
@@ -0,0 +1,30 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/DataStore.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Resource.json"}],
+  "properties": {
+    "Type": {
+      "type": "string",
+      "description": "The type of storage medium - DataStoreType_t (disk,optical,tape,...)"
+    },
+    "Latency": {
+      "type": "string",
+      "description": "The latency category under normal operating conditions - AccessLatency_t",
+      "enum": ["nearline","offline","online"]
+    },
+    "TotalSize": {
+      "type": "integer",
+      "description": "The total amount of storage (GB)"
+    },
+    "FreeSize": {
+      "type": "integer",
+      "description": "The amount of available storage (GB)"
+    },
+    "UsedSize": {
+      "type": "integer",
+      "description": "The amount of used storage (GB)"
+    }
+  },
+  "required": ["Type","Latency"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/Domain.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/Domain.json b/modules/gfac/gfac-core/src/main/resources/schema/Domain.json
new file mode 100644
index 0000000..5bd996b
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/Domain.json
@@ -0,0 +1,30 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Domain.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Entity.json"}],
+  "properties": {
+    "Description": {
+      "type": "string",
+      "description": "A description of the Domain"
+    },
+    "WWW": {
+      "type": "array",
+      "description": "URLs of web pages with more information about the Domain",
+      "items": {
+        "type": "string"
+      }
+    },
+    "ContactID": {
+      "type": "array",
+      "description": "IDs of Contacts for this Domain",
+      "items": {
+        "type": "string"
+      }
+    },
+    "LocationID": {
+      "type": "string",
+      "description": "The ID of the primary Location for this Domain"
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/Endpoint.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/Endpoint.json b/modules/gfac/gfac-core/src/main/resources/schema/Endpoint.json
new file mode 100644
index 0000000..b75b02a
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/Endpoint.json
@@ -0,0 +1,147 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Endpoint.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Entity.json"}],
+  "properties": {
+    "URL": {
+      "type": "string",
+      "description": "Network location of the endpoint"
+    },
+    "Capability": {
+      "type": "array",
+      "description": "Capability_t (open enumeration)",
+      "items": {
+        "type": "string"
+      }
+    },
+    "Technology": {
+      "type": "string",
+      "description": "EndpointTechnology_t"
+    },
+    "InterfaceName": {
+      "type": "string",
+      "description": "InterfaceName_t"
+    },
+    "InterfaceVersion": {
+      "type": "string",
+      "description": "The version of the primary interface protocol (free format)"
+    },
+    "InterfaceExtension": {
+      "type": "array",
+      "description": "URIs identifying supported extensions to the interface protocol",
+      "items": {
+        "type": "string"
+      }
+    },
+    "WSDL": {
+      "type": "array",
+      "description": "URLs of WSDL document(s) describing the interface",
+      "items": {
+        "type": "string"
+      }
+    },
+    "SupportedProfile": {
+      "type": "array",
+      "description": "URI(s) identifying supported profiles for the Endpoint",
+      "items": {
+        "type": "string"
+      }
+    },
+    "Semantics": {
+      "type": "array",
+      "description": "URL(s) of documents providing human-readable descriptions of the semantics of the Endpoint",
+      "items": {
+        "type": "string"
+      }
+    },
+    "Implementor": {
+      "type": "string",
+      "description": "The name of the main organization implementing the Endpoint"
+    },
+    "ImplementationName": {
+      "type": "string",
+      "description": "The name of the implementation of the Endpoint"
+    },
+    "ImplementationVersion": {
+      "type": "string",
+      "description": "The version of the implementation of the Endpoint"
+    },
+    "QualityLevel": {
+      "type": "string",
+      "description": "QualityLevel_t",
+      "enum": ["development","pre-production","production","testing"]
+    },
+    "HealthState": {
+      "type": "string",
+      "description": "The operational status of the Endpoint",
+      "enum": ["critical","ok","other","unknown","warning"]
+    },
+    "HealthStateInfo": {
+      "type": "string",
+      "description": "A human-readable explanation of the HealthState of this Endpoint"
+    },
+    "ServingState": {
+      "type": "string",
+      "description": "If the endpoint is accepting and serving requests",
+      "enum": ["closed","draining","production","queueing"]
+    },
+    "StartTime": {
+      "type": "string",
+      "description": "The start time of the Service associated with this Endpoint (DateTime_t)"
+    },
+    "IssuerCA": {
+      "type": "string",
+      "description": "The DN of the CA issuing the certificate presented by this Endpoint"
+    },
+    "TrustedCA": {
+      "type": "array",
+      "description": "DN(s) of CAs trusted by this Endpoint",
+      "items": {
+        "type": "string"
+      }
+    },
+    "DowntimeAnnounce": {
+      "type": "string",
+      "description": "When the next scheduled downtime was announced (DateTime_t)"
+    },
+    "DowntimeStart": {
+      "type": "string",
+      "description": "When the next scheduled downtime will start (DateTime_t)"
+    },
+    "DowntimeEnd": {
+      "type": "string",
+      "description": "When the next scheduled downtime will end (DateTime_t)"
+    },
+    "DowntimeInfo": {
+      "type": "string",
+      "description": "Human-readable of the next scheduled downtime"
+    },
+    "ServiceID": {
+      "type": "string",
+      "description": "The ID of the Service associated with this Endpoint"
+    },
+    "ShareID": {
+      "type": "array",
+      "description": "The IDs of the Shares accessible from this Endpoint",
+      "items": {
+        "type": "string"
+      }
+    },
+    "AccessPolicyID": {
+      "type": "array",
+      "description": "IDs of AccessPolicies associated with this Endpoint",
+      "items": {
+        "type": "string"
+      }
+    },
+    "ActivityID": {
+      "type": "array",
+      "description": "IDs of Activities being managed through this Endpoint",
+      "items": {
+        "type": "string"
+      }
+    }
+  },
+  "required": ["InterfaceName","QualityLevel","HealthState","ServingState","ServiceID"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/Entity.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/Entity.json b/modules/gfac/gfac-core/src/main/resources/schema/Entity.json
new file mode 100644
index 0000000..5d1ae46
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/Entity.json
@@ -0,0 +1,35 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Entity.json",
+  "type": "object",
+  "properties": {
+    "CreationTime": {
+      "type": "string",
+      "description": "The creation time of this entity in the format: CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm]"
+    },
+    "Validity": {
+      "type": "integer",
+      "description": "The number of seconds after CreationTime that this entity should be considered relevant"
+    },
+    "ID": {
+      "type": "string",
+      "description": "A globally unique identifier for this entity"
+    },
+    "Name": {
+      "type": "string",
+      "description": "A human-readable name"
+    },
+    "OtherInfo": {
+      "type": "array",
+      "description": "Placeholder for information that does not fit in any other attribute",
+      "items": {
+        "type": "string"
+      }
+    },
+    "Extension": {
+      "type": "object",
+      "description": "Key/value pairs enabling the association of extra information not captured by the model"
+    }
+  },
+  "required": ["ID"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/ExecutionEnvironment.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/ExecutionEnvironment.json b/modules/gfac/gfac-core/src/main/resources/schema/ExecutionEnvironment.json
new file mode 100644
index 0000000..77bf876
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/ExecutionEnvironment.json
@@ -0,0 +1,115 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ExecutionEnvironment.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Resource.json"}],
+  "properties": {
+    "Platform": {
+      "type": "string",
+      "description": "The platform architecture - Platform_t (open enumeration)"
+    },
+    "VirtualMachine": {
+      "type": "boolean",
+      "description": "True if the ExecutionEnvironment is a virtual machine"
+    },
+    "TotalInstances": {
+      "type": "integer",
+      "description": "The total number of ExecutionEnvironment instances"
+    },
+    "UsedInstances": {
+      "type": "integer",
+      "description": "The number of ExecutionEnvironment instances in use"
+    },
+    "UnavailableInstances": {
+      "type": "integer",
+      "description": "The number of ExecutionEnvironment instances that are unavailable"
+    },
+    "PhysicalCPUs": {
+      "type": "integer",
+      "description": "The number of physical CPUs in one ExecutionEnvironment instance"
+    },
+    "LogicalCPUs": {
+      "type": "integer",
+      "description": "The number of logical CPUs in one ExecutionEnvironment instance"
+    },
+    "CPUMultiplicity": {
+      "type": "string",
+      "description": "Information about the CPUs and cores in an execution environment",
+      "enum": ["multicpu-multicore","multicpu-singlecore","singlecpu-multicore","singlecpu-singlecore"]
+    },
+    "CPUVendor": {
+      "type": "string",
+      "description": "The name of the manufacturer of the CPU"
+    },
+    "CPUModel": {
+      "type": "string",
+      "description": "The model of the CPU, as defined by the vendor"
+    },
+    "CPUVersion": {
+      "type": "string",
+      "description": "The specific version name of the CPU, as defined by the vendor"
+    },
+    "CPUClockSpeed": {
+      "type": "integer",
+      "description": "The clock speed of the CPU (MHz)"
+    },
+    "CPUTimeScalingFactor": {
+      "type": "float",
+      "description": "The factor used by the ComputingManager to scale the CPU time limit"
+    },
+    "WallTimeScalingFactor": {
+      "type": "float",
+      "description": "The factor used by the ComputingManager to scale the wallclock time limit"
+    },
+    "MainMemorySize": {
+      "type": "integer",
+      "description": "The total amount of physical RAM in one ExecutionEnvironment instance (MB)"
+    },
+    "VirtualMemorySize": {
+      "type": "integer",
+      "description": "The total amount of virtual memory (RAM+swap) in one ExecutionEnvironment instance (MB)"
+    },
+    "OSFamily": {
+      "type": "string",
+      "description": "The general family of the operating system - OSFamily_t (open enumeration)"
+    },
+    "OSName": {
+      "type": "string",
+      "description": "The specific name of the operating system - OSName_t (open enumeration)"
+    },
+    "OSVersion": {
+      "type": "string",
+      "description": "The version of the operating system, as defined by the vendor"
+    },
+    "ConnectivityIn": {
+      "type": "boolean",
+      "description": "True if direct inbound network connectiity is available to a running job"
+    },
+    "ConnectivityOut": {
+      "type": "boolean",
+      "description": "True if direct outbound network connectiity is available to a running job"
+    },
+    "NetworkInfo": {
+      "type": "array",
+      "description": "The types of internal network connections between ExecutionEnvironments - NetworkInfo_t (open enumeration)",
+      "items": {
+        "type": "string"
+      }
+    },
+    "ApplicationEnvironmentID": {
+      "type": "array",
+      "description": "ID(s) of ApplicationEnvironments available in this ExecutionEnvironment",
+      "items": {
+        "type": "string"
+      }
+    },
+    "BenchmarkID": {
+      "type": "array",
+      "description": "ID(s) of Benchmarks associated with this ExecutionEnvironment",
+      "items": {
+        "type": "string"
+      }
+    }
+  },
+  "required": ["Platform","MainMemorySize","OSFamily","ConnectivityIn","ConnectivityOut"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/Glue2.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/Glue2.json b/modules/gfac/gfac-core/src/main/resources/schema/Glue2.json
new file mode 100644
index 0000000..bb80505
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/Glue2.json
@@ -0,0 +1,246 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Glue2.json",
+  "description": "A GLUE 2 document",
+  "type": "object",
+  "properties": {
+    "Entity": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Entity.json"}]
+      }
+    },
+    "Location": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Location.json"}]
+      }
+    },
+    "Contact": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Contact.json"}]
+      }
+    },
+    "Domain": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Domain.json"}]
+      }
+    },
+    "AdminDomain": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/AdminDomain.json"}]
+      }
+    },
+    "UserDomain": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/UserDomain.json"}]
+      }
+    },
+    "Service": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Service.json"}]
+      }
+    },
+    "Endpoint": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Endpoint.json"}]
+      }
+    },
+    "Share": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Share.json"}]
+      }
+    },
+    "Manager": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Manager.json"}]
+      }
+    },
+    "Resource": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Resource.json"}]
+      }
+    },
+    "Activity": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Activity.json"}]
+      }
+    },
+    "Policy": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Policy.json"}]
+      }
+    },
+    "AccessPolicy": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/AccessPolicy.json"}]
+      }
+    },
+    "MappingPolicy": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/MappingPolicy.json"}]
+      }
+    },
+    "ComputingService": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ComputingService.json"}]
+      }
+    },
+    "ComputingEndpoint": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ComputingEndpoint.json"}]
+      }
+    },
+    "ComputingShare": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ComputingShare.json"}]
+      }
+    },
+    "ComputingManager": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ComputingManager.json"}]
+      }
+    },
+    "Benchmark": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Benchmark.json"}]
+      }
+    },
+    "ExecutionEnvironment": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ExecutionEnvironment.json"}]
+      }
+    },
+    "ApplicationEnvironment": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ApplicationEnvironment.json"}]
+      }
+    },
+    "ApplicationHandle": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ApplicationHandle.json"}]
+      }
+    },
+    "ComputingActivity": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ComputingActivity.json"}]
+      }
+    },
+    "ToStorageService": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ToStorageService.json"}]
+      }
+    },
+    "StorageService": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/StorageService.json"}]
+      }
+    },
+    "StorageServiceCapacity": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/StorageServiceCapacity.json"}]
+      }
+    },
+    "StorageAccessProtocol": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/StorageAccessProtocol.json"}]
+      }
+    },
+    "StorageEndpoint": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/StorageEndpoint.json"}]
+      }
+    },
+    "StorageShare": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/StorageShare.json"}]
+      }
+    },
+    "StorageShareCapacity": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/StorageShareCapacity.json"}]
+      }
+    },
+    "StorageManager": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/StorageManager.json"}]
+      }
+    },
+    "DataStore": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/DataStore.json"}]
+      }
+    },
+    "ToComputingService": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/ToComputingService.json"}]
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/Location.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/Location.json b/modules/gfac/gfac-core/src/main/resources/schema/Location.json
new file mode 100644
index 0000000..8491cc0
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/Location.json
@@ -0,0 +1,47 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Location.json",
+  "description": "A GLUE 2 Location",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Entity.json"}],
+  "properties": {
+    "Address": {
+      "type": "string",
+      "description": "A free format street address"
+    },
+    "Place": {
+      "type": "string",
+      "description": "Name of town/city"
+    },
+    "Country": {
+      "type": "string",
+      "description": "Name of country"
+    },
+    "PostalCode": {
+      "type": "string",
+      "description": "Postal code"
+    },
+    "Latitude": {
+      "type": "number",
+      "description": "Position north (positive) or south (negative) of the equator in degrees"
+    },
+    "Longitude": {
+      "type": "number",
+      "description": "Position east (positive) or west (negative) of the primary meridian in degrees"
+    },
+    "ServiceID": {
+      "type": "array",
+      "description": "The IDs of Services at this location",
+      "items": {
+        "type": "string"
+      }
+    },
+    "DomainID": {
+      "type": "array",
+      "description": "The IDs of Domains at this location",
+      "items": {
+        "type": "string"
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/Manager.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/Manager.json b/modules/gfac/gfac-core/src/main/resources/schema/Manager.json
new file mode 100644
index 0000000..d1df50a
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/Manager.json
@@ -0,0 +1,28 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Manager.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Entity.json"}],
+  "properties": {
+    "ProductName": {
+      "type": "string",
+      "description": "The name of the software product which implements the Manager"
+    },
+    "ProductVersion": {
+      "type": "string",
+      "description": "The version of the software product which implements the Manager"
+    },
+    "ServiceID": {
+      "type": "string",
+      "description": "The ID of the Service this Share participates in"
+    },
+    "ResourceID": {
+      "type": "array",
+      "description": "ID(s) of Resources associated with this Share",
+      "items": {
+        "type": "string"
+      }
+    }
+  },
+  "required": ["ProductName","ServiceID","ResourceID"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/MappingPolicy.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/MappingPolicy.json b/modules/gfac/gfac-core/src/main/resources/schema/MappingPolicy.json
new file mode 100644
index 0000000..268844d
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/MappingPolicy.json
@@ -0,0 +1,13 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/MappingPolicy.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Policy.json"}],
+  "properties": {
+    "ShareID": {
+      "type": "string",
+      "description": "The ID of the Share this MappingPolicy is for"
+    }
+  },
+  "required": ["ShareID"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/Policy.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/Policy.json b/modules/gfac/gfac-core/src/main/resources/schema/Policy.json
new file mode 100644
index 0000000..f936699
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/Policy.json
@@ -0,0 +1,27 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Policy.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Entity.json"}],
+  "properties": {
+    "Scheme": {
+      "type": "string",
+      "description": "PolicyScheme_t (open enumeration)"
+    },
+    "Rule": {
+      "type": "array",
+      "description": "Policy rules",
+      "items": {
+        "type": "string"
+      }
+    },
+    "UserDomainID": {
+      "type": "array",
+      "description": "The ID(s) of the UserDomains this Policy applies to",
+      "items": {
+        "type": "string"
+      }
+    }
+  },
+  "required": ["Scheme","Rule","UserDomainID"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/Resource.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/Resource.json b/modules/gfac/gfac-core/src/main/resources/schema/Resource.json
new file mode 100644
index 0000000..88d08ad
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/Resource.json
@@ -0,0 +1,27 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Resource.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Entity.json"}],
+  "properties": {
+    "ManagerID": {
+      "type": "string",
+      "description": "The ID of the Manager for this Resource"
+    },
+    "ShareID": {
+      "type": "array",
+      "description": "The ID(s) of the Shares this Resource is part of",
+      "items": {
+        "type": "string"
+      }
+    },
+    "ActivityID": {
+      "type": "array",
+      "description": "The ID(s) of Activities consuming from this Share",
+      "items": {
+        "type": "string"
+      }
+    }
+  },
+  "required": ["ManagerID"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/Service.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/Service.json b/modules/gfac/gfac-core/src/main/resources/schema/Service.json
new file mode 100644
index 0000000..4662407
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/Service.json
@@ -0,0 +1,75 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Service.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Entity.json"}],
+  "properties": {
+    "Capability": {
+      "type": "array",
+      "description": "Capability_t (open enumeration)",
+      "items": {
+        "type": "string"
+      }
+    },
+    "Type": {
+      "type": "string",
+      "description": "ServiceType_t (open enumeration)"
+    },
+    "QualityLevel": {
+      "type": "string",
+      "description": "QualityLevel_t",
+      "enum": ["development","pre-production","production","testing"]
+    },
+    "StatusInfo": {
+      "type": "array",
+      "description": "URLs of web pages providing additional information",
+      "items": {
+        "type": "string"
+      }
+    },
+    "Complexity": {
+      "type": "string",
+      "description": "A human-readable description of the number of endpoint types, shares, and resources"
+    },
+    "EndpointID": {
+      "type": "array",
+      "description": "The IDs of Endpoints for this Service",
+      "items": {
+        "type": "string"
+      }
+    },
+    "ShareID": {
+      "type": "array",
+      "description": "The IDs of the Shares offered by this Service",
+      "items": {
+        "type": "string"
+      }
+    },
+    "ManagerID": {
+      "type": "array",
+      "description": "The IDs of the Managers of this Service",
+      "items": {
+        "type": "string"
+      }
+    },
+    "ContactID": {
+      "type": "array",
+      "description": "The IDs of Contacts for this Service",
+      "items": {
+        "type": "string"
+      }
+    },
+    "LocationID": {
+      "type": "string",
+      "description": "The ID of the primary Location of this Service"
+    },
+    "ServiceID": {
+      "type": "array",
+      "description": "The IDs of Services related to this Service",
+      "items": {
+        "type": "string"
+      }
+    }
+  },
+  "required": ["Type","QualityLevel"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/Share.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/Share.json b/modules/gfac/gfac-core/src/main/resources/schema/Share.json
new file mode 100644
index 0000000..258fc1b
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/Share.json
@@ -0,0 +1,45 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Share.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Entity.json"}],
+  "properties": {
+    "Description": {
+      "type": "string",
+      "description": "A human-readable description of the Share"
+    },
+    "EndpointID": {
+      "type": "array",
+      "description": "The ID(s) of the Endpoints that can be used to access this Share",
+      "items": {
+        "type": "string"
+      }
+    },
+    "ResourceID": {
+      "type": "array",
+      "description": "The ID(s) of the Resources associated with this Share",
+      "items": {
+        "type": "string"
+      }
+    },
+    "ServiceID": {
+      "type": "string",
+      "description": "The ID of the Service this Share participates in"
+    },
+    "ActivityID": {
+      "type": "array",
+      "description": "The ID(s) of Activities consuming from this Share",
+      "items": {
+        "type": "string"
+      }
+    },
+    "MappingPolicyID": {
+      "type": "array",
+      "description": "ID(s) of MappingPolicies associated with this Share",
+      "items": {
+        "type": "string"
+      }
+    }
+  },
+  "required": ["ServiceID"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/StorageAccessProtocol.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/StorageAccessProtocol.json b/modules/gfac/gfac-core/src/main/resources/schema/StorageAccessProtocol.json
new file mode 100644
index 0000000..05a830b
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/StorageAccessProtocol.json
@@ -0,0 +1,32 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/StorageAccessProtocol.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Entity.json"}],
+  "properties": {
+    "Type": {
+      "type": "string",
+      "description": "The type of the protocol - StorageAccessProtocol_t"
+    },
+    "Version": {
+      "type": "string",
+      "description": "The version of the protocol supported"
+    },
+    "MaxStreams": {
+      "type": "integer",
+      "description": "The maximum number of parallel network streams which can be usef for a single transfer"
+    },
+    "StorageServiceID": {
+      "type": "string",
+      "description": "The ID of the StorageService this protocol is available for"
+    },
+    "ToComputingServiceID": {
+      "type": "array",
+      "description": "The ID(s) ToComputingService objects that describe connectivity to ComputingServices",
+      "items": {
+        "type": "string"
+      }
+    }
+  },
+  "required": ["Type","Version","StorageServiceID"]
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/b0230849/modules/gfac/gfac-core/src/main/resources/schema/StorageEndpoint.json
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/resources/schema/StorageEndpoint.json b/modules/gfac/gfac-core/src/main/resources/schema/StorageEndpoint.json
new file mode 100644
index 0000000..38b27c4
--- /dev/null
+++ b/modules/gfac/gfac-core/src/main/resources/schema/StorageEndpoint.json
@@ -0,0 +1,8 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/StorageEndpoint.json",
+  "type": "object",
+  "allOf": [{"$ref": "http://schemas.ogf.org/glue/2013/05/spec_2.0_r1/Endpoint.json"}],
+  "properties": {
+  }
+}