Skip to content

Commit c1ed7a8

Browse files
committed
integrated latest gsn with security module and lsm
1 parent c04e1a8 commit c1ed7a8

25 files changed

+244
-698
lines changed

modules/x-gsn/conf/bind/VirtualSensorDescription.xml

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
<value name="name" field="name" style="attribute"/>
7474
<value name="type" field="type" style="attribute"/>
7575
<value field="description" style="text" usage="optional"/>
76+
<value name="property" field="property" style="attribute" usage="optional"/>
7677
</mapping>
7778

7879
<mapping name="command" class="org.openiot.gsn.beans.WebInput">

modules/x-gsn/conf/lsm_config.properties

-15
This file was deleted.

modules/x-gsn/conf/openiot.properties

-125
This file was deleted.

modules/x-gsn/gsn-start.sh

+1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ for jarFile in $( ls target/**/*jar ); do
77
cp=$cp:./$jarFile
88
done
99
#echo $cp
10+
#java -classpath target/dependencies/resteasy-jaxrs-2.3.5.Final.jar:target/classes:$cp -splash:lib/logo.png -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger -Dorg.mortbay.log.LogFactory.noDiscovery=false org.openiot.gsn.Main 22232 &
1011
java -classpath target/classes:$cp -splash:lib/logo.png -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger -Dorg.mortbay.log.LogFactory.noDiscovery=false org.openiot.gsn.Main 22232 &

modules/x-gsn/lsm-register.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
java -classpath "./target/*;./target/dependencies/*;./conf/*" -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger -Dorg.mortbay.log.LogFactory.noDiscovery=false org.openiot.gsn.metadata.LSM.utils %1
1+
java -classpath "./target/*;./target/dependencies/*;./conf/*" -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger -Dorg.mortbay.log.LogFactory.noDiscovery=false org.openiot.gsn.metadata.LSM.SensorAnnotator %1

modules/x-gsn/lsm-register.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ for jarFile in $( ls target/**/*jar ); do
44
cp=$cp:./$jarFile
55
done
66

7-
java -classpath target/classes:$cp:conf org.openiot.gsn.metadata.LSM.MetadataCreator "$@" &
7+
java -classpath target/classes:$cp:conf org.openiot.gsn.metadata.LSM.SensorAnnotator "$@" &

modules/x-gsn/pom.xml

+27-13
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@
6363
<target>1.7</target>
6464
</configuration>
6565
</plugin>
66+
<plugin>
67+
<groupId>org.apache.maven.plugins</groupId>
68+
<artifactId>maven-resources-plugin</artifactId>
69+
<version>2.6</version>
70+
</plugin>
6671
<plugin>
6772
<groupId>org.jibx</groupId>
6873
<artifactId>maven-jibx-plugin</artifactId>
@@ -156,11 +161,11 @@
156161
<version>7.1.0.v20100505</version>
157162
<!-- <version>7.0.2.v20100331</version> -->
158163
</dependency>
159-
<dependency>
164+
<!-- <dependency>
160165
<groupId>org.apache.jena</groupId>
161166
<artifactId>jena-core</artifactId>
162167
<version>2.11.1</version>
163-
</dependency>
168+
</dependency>-->
164169
<dependency>
165170
<groupId>com.vividsolutions</groupId>
166171
<artifactId>jts</artifactId>
@@ -385,6 +390,10 @@
385390
<groupId>org.slf4j</groupId>
386391
<artifactId>slf4j-log4j12</artifactId>
387392
</exclusion>
393+
<exclusion>
394+
<groupId>org.jboss.resteasy</groupId>
395+
<artifactId>resteasy-jaxrs</artifactId>
396+
</exclusion>
388397
</exclusions>
389398
</dependency>
390399
<dependency>
@@ -422,17 +431,22 @@
422431
<version>1.7.5</version>
423432
</dependency>
424433
<dependency>
425-
<groupId>org.glassfish.jersey.containers</groupId>
426-
<!-- if your container implements Servlet API older than 3.0, use "jersey-container-servlet-core" -->
427-
<artifactId>jersey-container-servlet-core</artifactId>
428-
<version>2.7</version>
429-
</dependency>
430-
<!-- Required only when you are using JAX-RS Client -->
431-
<dependency>
432-
<groupId>org.glassfish.jersey.core</groupId>
433-
<artifactId>jersey-client</artifactId>
434-
<version>2.7</version>
435-
</dependency>
434+
<groupId>org.glassfish.jersey.containers</groupId>
435+
<artifactId>jersey-container-servlet-core</artifactId>
436+
<version>2.7</version>
437+
</dependency>
438+
<!-- Required only when you are using JAX-RS Client -->
439+
<!--<dependency>
440+
<groupId>org.glassfish.jersey.core</groupId>
441+
<artifactId>jersey-client</artifactId>
442+
<version>2.7</version>
443+
</dependency>-->
444+
<dependency>
445+
<groupId>org.jboss.resteasy</groupId>
446+
<artifactId>resteasy-jaxrs</artifactId>
447+
<version>3.0.8.Final</version>
448+
</dependency>
449+
436450
</dependencies>
437451

438452
</project>

modules/x-gsn/src/main/java/org/openiot/gsn/Main.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@
9292
import org.openiot.gsn.vsensor.SQLValidatorIntegration;
9393
import org.openiot.gsn.wrappers.WrappersUtil;
9494

95+
import com.typesafe.config.Config;
96+
import com.typesafe.config.ConfigFactory;
97+
9598
/**
9699
* Web Service URLs : Microsoft SensorMap:
97100
* http://localhost:22001/services/Service?wsdl GSN:
@@ -310,10 +313,8 @@ public static void main(String[] args) {
310313
Main.getInstance();
311314
// checks to see if dynamic sensor control is active
312315
// and starts timer accordingly
313-
boolean isTrueDynamicControl = Boolean
314-
.parseBoolean(PropertiesReader.readProperty(
315-
LSMRepository.LSM_CONFIG_PROPERTIES_FILE,
316-
"dynamicControl").trim());
316+
Config conf=ConfigFactory.load();
317+
boolean isTrueDynamicControl = conf.getBoolean("dynamicControl");
317318
if (isTrueDynamicControl)
318319
DynamicControlTaskTimer.getInstance().startTimer();
319320

modules/x-gsn/src/main/java/org/openiot/gsn/beans/DataField.java

+5
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public final class DataField implements Serializable {
4040

4141
private String type;
4242

43+
private String property;
44+
4345
private DataField ( ) {}
4446

4547
public DataField ( final String fieldName , final String type , final String description ) throws GSNRuntimeException {
@@ -119,4 +121,7 @@ public String getType ( ) {
119121
return this.type;
120122
}
121123

124+
public String getProperty(){
125+
return property;
126+
}
122127
}

modules/x-gsn/src/main/java/org/openiot/gsn/http/restapi/VSManagerService.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import org.openiot.gsn.Main;
3838
import org.openiot.gsn.VSensorLoader;
3939
import org.openiot.gsn.metadata.LSM.LSMSensorMetaData;
40-
import org.openiot.gsn.metadata.LSM.MetadataCreator;
40+
import org.openiot.gsn.metadata.LSM.SensorAnnotator;
4141
import org.openiot.gsn.metadata.rdf.SensorMetadata;
4242
import org.slf4j.Logger;
4343
import org.slf4j.LoggerFactory;
@@ -92,7 +92,7 @@ public Response registerRdfVS(Reader metadata,@PathParam("vsname") String vsname
9292
concat+=line;
9393
InputStream is=new ByteArrayInputStream(concat.getBytes());
9494
meta.load(is);
95-
MetadataCreator.addRdfMetadatatoLSM(meta);
95+
SensorAnnotator.addRdfMetadatatoLSM(meta);
9696
FileWriter fw = new FileWriter(filePath, true);
9797
IOUtils.writeLines(lines, "\n", fw);
9898
fw.close();
@@ -117,7 +117,7 @@ public Response registerVS(InputStream metadata,@PathParam("vsname") String vsna
117117
LSMSensorMetaData lsmmd=new LSMSensorMetaData();
118118

119119
lsmmd.init(ConfigFactory.parseFile(new File(filePath)));
120-
sensorId=MetadataCreator.addSensorToLSM(lsmmd);
120+
sensorId=SensorAnnotator.addSensorToLSM(lsmmd);
121121

122122
} catch (Exception e) {
123123
e.printStackTrace();

0 commit comments

Comments
 (0)