Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 4 additions & 43 deletions content/epn-datastore/src/main/resources/epn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,25 @@
"version": "1",

"subscriptions": [
{
"nodeName": "ElasticSearchActivityUnitStore",
"subject": "ActivityUnits"
} ,
{
"nodeName": "ElasticSearchResponseTimeStore",
"subject": "ServiceResponseTimes"

} ,
{
"nodeName": "ElasticSearchSituationStore",
"subject": "Situations"
}
],
"nodes": [
{
"name": "ElasticSearchActivityUnitStore",
"eventProcessor": {
"@class": "org.overlord.rtgov.ep.keyvaluestore.KeyValueStoreEventProcessor",
"services": {
"KeyValueStore": {
"@class": "org.overlord.rtgov.activity.store.elasticsearch.ElasticsearchActivityStore",
"index": "rtgov",
"type": "activity",
"hosts": "${Elasticsearch.hosts}"

}
}
}
},
{
"name": "ElasticSearchResponseTimeStore",
"eventProcessor": {
"@class": "org.overlord.rtgov.ep.keyvaluestore.KeyValueStoreEventProcessor",
"services": {
"KeyValueStore": {
"@class": "org.overlord.rtgov.common.elasticsearch.ElasticSearchKeyValueStore",
"@class": "org.overlord.rtgov.common.elasticsearch.ElasticsearchKeyValueStore",
"index": "rtgov",
"type": "responsetime",
"hosts": "${Elasticsearch.hosts}"
}
}
}
} ,
{
"name": "ElasticSearchSituationStore",
"eventProcessor": {
"@class": "org.overlord.rtgov.ep.keyvaluestore.KeyValueStoreEventProcessor",
"services": {
"KeyValueStore": {
"@class": "org.overlord.rtgov.common.elasticsearch.ElasticSearchKeyValueStore",
"index": "rtgov",
"type": "situation",
"hosts": "${Elasticsearch.hosts}"
"type": "responsetime"
}
}
}
}


]}
]
}
2 changes: 1 addition & 1 deletion content/services/elasticsearch-rests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-Activator>org.overlord.rtgov.elasticsearch.rest.osgi.ElasticSearchRESTServerActivator</Bundle-Activator>
<Bundle-Activator>org.overlord.rtgov.elasticsearch.rest.osgi.ElasticsearchRESTServerActivator</Bundle-Activator>
<Export-Package>
org.overlord.rtgov.elasticsearch.rest.*;version=${project.version}
</Export-Package>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,24 @@
* https://github.com/dsmiley/HTTP-Proxy-Servlet
*
*/
public class ElasticSearchClient {
public class ElasticsearchHttpClient {

private static final String DEFAULT_ELASTIC_SEARCH_URL = "http://localhost:9200";

private static final Logger LOG=Logger.getLogger(ElasticSearchClient.class.getName());
private static final Logger LOG=Logger.getLogger(ElasticsearchHttpClient.class.getName());

private HttpClient _proxyClient;
private String _url;

/**
* The default constructor.
*/
public ElasticSearchClient() {
public ElasticsearchHttpClient() {
HttpParams hcParams = new BasicHttpParams();
_proxyClient = new DefaultHttpClient(new PoolingClientConnectionManager(),hcParams);

// Get URL
_url = RTGovProperties.getProperties().getProperty("ElasticSearch.server", DEFAULT_ELASTIC_SEARCH_URL);
_url = RTGovProperties.getProperties().getProperty("Elasticsearch.server", DEFAULT_ELASTIC_SEARCH_URL);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
* Based on the http servlet proxy implemented by David Smiley:
* https://github.com/dsmiley/HTTP-Proxy-Servlet
*/
public class ElasticSearchRESTServer extends HttpServlet {
public class ElasticsearchRESTServer extends HttpServlet {

private static final long serialVersionUID = 1L;

private static final Logger LOG=Logger.getLogger(ElasticSearchRESTServer.class.getName());
private static final Logger LOG=Logger.getLogger(ElasticsearchRESTServer.class.getName());

private ElasticSearchClient _client=new ElasticSearchClient();
private ElasticsearchHttpClient _client=new ElasticsearchHttpClient();

/**
* {@inheritDoc}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpService;

import org.overlord.rtgov.elasticsearch.rest.ElasticSearchRESTServer;
import org.overlord.rtgov.elasticsearch.rest.ElasticsearchRESTServer;

/**
* This class represents the activator for the ElasticSearch REST server.
*
*/
public class ElasticSearchRESTServerActivator implements BundleActivator {
public class ElasticsearchRESTServerActivator implements BundleActivator {

private ElasticSearchRESTServer _elasticSearchServer=null;
private ElasticsearchRESTServer _elasticSearchServer=null;

/**
* {@inheritDoc}
Expand All @@ -40,7 +40,7 @@ public void start(final BundleContext context) throws Exception {
if (sRef != null) {
HttpService service = (HttpService)context.getService(sRef);

_elasticSearchServer = new ElasticSearchRESTServer();
_elasticSearchServer = new ElasticsearchRESTServer();

service.registerServlet("/overlord-rtgov-elasticsearch", _elasticSearchServer, null, null);
} else {
Expand Down
1 change: 1 addition & 0 deletions modules/activity-analysis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<module>service-dependency-svg</module>
<module>situation-manager</module>
<module>situation-store</module>
<module>situation-store-elasticsearch</module>
<module>situation-store-jpa</module>
<module>situation-store-mem</module>
</modules>
Expand Down
89 changes: 89 additions & 0 deletions modules/activity-analysis/situation-store-elasticsearch/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.overlord.rtgov.activity-analysis</groupId>
<artifactId>situation-store-elasticsearch</artifactId>
<packaging>bundle</packaging>
<name>Overlord RTGov::Modules::Activity Analysis::SituationStoreElasticsearch</name>

<parent>
<groupId>org.overlord.rtgov</groupId>
<artifactId>activity-analysis</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<dependencies>

<!-- RTGov dependencies -->
<dependency>
<groupId>org.overlord.rtgov.common</groupId>
<artifactId>rtgov-common</artifactId>
</dependency>
<dependency>
<groupId>org.overlord.rtgov.common</groupId>
<artifactId>rtgov-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>org.overlord.rtgov.activity-management</groupId>
<artifactId>activity</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.overlord.rtgov.activity-analysis</groupId>
<artifactId>analytics</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.overlord.rtgov.activity-analysis</groupId>
<artifactId>situation-store</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<scope>provided</scope>
</dependency>

<!-- Test only dependencies -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Export-Package>
org.overlord.rtgov.analytics.situation.store.elasticsearch.*;version=${project.version}
</Export-Package>
<Import-Package>
org.overlord.rtgov.analytics.situation,
*
</Import-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>

</project>
Loading