Improvements to Adapt sample server/client
authorjani <jani@asema.com>
Tue, 27 Aug 2019 12:43:11 +0000 (15:43 +0300)
committerjani <jani@asema.com>
Tue, 27 Aug 2019 12:43:11 +0000 (15:43 +0300)
Common/Java/SmartAPI/src/smartapi/common/NS.java
Common/Java/SmartAPI/src/smartapi/common/Tools.java
Examples/Python/AdaptDataService/AdaptDataService.py
Examples/Python/AdaptDataService/SampleSearchClient.py

index e3fc1b7f3681249de1d4c196a9dbefb5ec4d1311..cd26349badf326346af4c2ba826fcf5d2d854ed1 100644 (file)
@@ -15,8 +15,9 @@ public final class NS {
 
        // namespaces
        public static final String DC = "http://purl.org/dc/terms/";
-       public static final String GEO = "http://www.w3.org/2003/01/geo/wgs84_pos#";
        public static final String GR = "http://purl.org/goodrelations/v1#";
+       public static final String ELEMENTS = "http://purl.org/dc/elements/1.1/";
+       public static final String GEO = "http://www.w3.org/2003/01/geo/wgs84_pos#";
        public static final String OWL = "http://www.w3.org/2002/07/owl#";
        public static final String RDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
        public static final String RDFS = "http://www.w3.org/2000/01/rdf-schema#";
index c2807a2179be7f27b39929ba9eb1bfb5f5278bf6..0963e4642da37b62fc90498c0d42268330dd550f 100644 (file)
@@ -130,7 +130,7 @@ public class Tools {
        public static void uploadPublicKey(String publicKey, String identifier, String username, String password, String serverUri)
        {
                try {
-                       Crypto.uploadPublicKey(publicKey, identifier, serverUri, username, password);                   
+                       Crypto.uploadPublicKey(publicKey, identifier, serverUri, username, password);
                } catch ( Exception e ) {
                        System.err.println("Failed to upload public key.");
                        e.printStackTrace();
@@ -144,7 +144,7 @@ public class Tools {
                } catch ( Exception e ) {
                        System.err.println("Failed to revoke public key.");
                        e.printStackTrace();
-               }               
+               }
        }
        
        public static Request parseRequest(String content, String contentType)
index 9b1f7b1afac32406f74298ca768ff59b801a0d63..4c799f2cd2ed15fa11b1df8cd9c533b24688608e 100755 (executable)
@@ -124,7 +124,7 @@ class SampleRegistration(object):
                        dataSource = Entity()
                        dataSource.setIdentifierUri(myDeviceIdentity)
                        dataSource.setName("Demo Adapt datasource")
-                       dataSource.setDescription("This datasource profived random power readings as a demo for attaching a source into Asema Adapt")
+                       dataSource.setDescription("This datasource provides random power readings as a demo for attaching a source into Asema Adapt")
                        dataSource.addCapability(read)
                        dataSource.setManagedBy(myIdentity)
                        dataSource.setServedBy(adaptServiceIdentity)
index 0744ce24ec68acc70fe67e0c21d28b59f532fded..008819015c248efec0aaa38d8ceda6620c3961a1 100755 (executable)
@@ -24,7 +24,7 @@ class SampleSearch(object):
        def do(self):
                agent = SearchAgent(myIdentity)
                agent.setServerAddress(registrationServerUri)
-               agent.setDebugMode(False)
+               agent.setDebugMode(True)
 
                e = Entity()
                e.setServedBy(adaptServiceIdentity)