You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streams.apache.org by sb...@apache.org on 2014/03/22 00:20:13 UTC
[35/71] [abbrv] fixing STREAMS-26 branch
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/runner/felix/config.ini
----------------------------------------------------------------------
diff --git a/trunk/runner/felix/config.ini b/trunk/runner/felix/config.ini
deleted file mode 100644
index b29e914..0000000
--- a/trunk/runner/felix/config.ini
+++ /dev/null
@@ -1,34 +0,0 @@
-################################################
-# ______ ________ __ __ #
-# / __ / / __ / / / / / #
-# / ___/ / __ / _\ \ _/ #
-# / / / / / / / _\ \ #
-# /__/ /__/ /__/ /_/ /_/ #
-# #
-# Pax Runner from OPS4J - http://www.ops4j.org #
-################################################
-
-##############################
-# Felix settings
-##############################
-org.osgi.framework.storage=felix/cache/runner
-org.osgi.framework.startlevel.beginning=6
-felix.startlevel.bundle=5
-org.osgi.framework.storage.clean=onFirstInit
-org.osgi.framework.executionenvironment=J2SE-1.2,J2SE-1.3,J2SE-1.4,J2SE-1.5,JRE-1.1,JavaSE-1.6,OSGi/Minimum-1.0,OSGi/Minimum-1.1,OSGi/Minimum-1.2
-org.osgi.framework.system.packages=javax.accessibility,javax.activation,javax.activity,javax.annotation,javax.annotation.processing,javax.crypto,javax.crypto.interfaces,javax.crypto.spec,javax.imageio,javax.imageio.event,javax.imageio.metadata,javax.imageio.plugins.bmp,javax.imageio.plugins.jpeg,javax.imageio.spi,javax.imageio.stream,javax.jws,javax.jws.soap,javax.lang.model,javax.lang.model.element,javax.lang.model.type,javax.lang.model.util,javax.management,javax.management.loading,javax.management.modelmbean,javax.management.monitor,javax.management.openmbean,javax.management.relation,javax.management.remote,javax.management.remote.rmi,javax.management.timer,javax.naming,javax.naming.directory,javax.naming.event,javax.naming.ldap,javax.naming.spi,javax.net,javax.net.ssl,javax.print,javax.print.attribute,javax.print.attribute.standard,javax.print.event,javax.rmi,javax.rmi.CORBA,javax.rmi.ssl,javax.script,javax.security.auth,javax.security.auth.callback,javax.security.auth.kerberos
,javax.security.auth.login,javax.security.auth.spi,javax.security.auth.x500,javax.security.cert,javax.security.sasl,javax.sound.midi,javax.sound.midi.spi,javax.sound.sampled,javax.sound.sampled.spi,javax.sql,javax.sql.rowset,javax.sql.rowset.serial,javax.sql.rowset.spi,javax.swing,javax.swing.border,javax.swing.colorchooser,javax.swing.event,javax.swing.filechooser,javax.swing.plaf,javax.swing.plaf.basic,javax.swing.plaf.metal,javax.swing.plaf.multi,javax.swing.plaf.synth,javax.swing.table,javax.swing.text,javax.swing.text.html,javax.swing.text.html.parser,javax.swing.text.rtf,javax.swing.tree,javax.swing.undo,javax.tools,javax.transaction,javax.transaction.xa,javax.xml,javax.xml.bind,javax.xml.bind.annotation,javax.xml.bind.annotation.adapters,javax.xml.bind.attachment,javax.xml.bind.helpers,javax.xml.bind.util,javax.xml.crypto,javax.xml.crypto.dom,javax.xml.crypto.dsig,javax.xml.crypto.dsig.dom,javax.xml.crypto.dsig.keyinfo,javax.xml.crypto.dsig.spec,javax.xml.datatype,javax.xml.n
amespace,javax.xml.parsers,javax.xml.soap,javax.xml.stream,javax.xml.stream.events,javax.xml.stream.util,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stax,javax.xml.transform.stream,javax.xml.validation,javax.xml.ws,javax.xml.ws.handler,javax.xml.ws.handler.soap,javax.xml.ws.http,javax.xml.ws.soap,javax.xml.ws.spi,javax.xml.xpath,org.ietf.jgss,org.omg.CORBA,org.omg.CORBA.DynAnyPackage,org.omg.CORBA.ORBPackage,org.omg.CORBA.TypeCodePackage,org.omg.CORBA.portable,org.omg.CORBA_2_3,org.omg.CORBA_2_3.portable,org.omg.CosNaming,org.omg.CosNaming.NamingContextExtPackage,org.omg.CosNaming.NamingContextPackage,org.omg.Dynamic,org.omg.DynamicAny,org.omg.DynamicAny.DynAnyFactoryPackage,org.omg.DynamicAny.DynAnyPackage,org.omg.IOP,org.omg.IOP.CodecFactoryPackage,org.omg.IOP.CodecPackage,org.omg.Messaging,org.omg.PortableInterceptor,org.omg.PortableInterceptor.ORBInitInfoPackage,org.omg.PortableServer,org.omg.PortableServer.CurrentPackage,org.omg.Porta
bleServer.POAManagerPackage,org.omg.PortableServer.POAPackage,org.omg.PortableServer.ServantLocatorPackage,org.omg.PortableServer.portable,org.omg.SendingContext,org.omg.stub.java.rmi,org.w3c.dom,org.w3c.dom.bootstrap,org.w3c.dom.css,org.w3c.dom.events,org.w3c.dom.html,org.w3c.dom.ls,org.w3c.dom.ranges,org.w3c.dom.stylesheets,org.w3c.dom.traversal,org.w3c.dom.views ,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers,org.osgi.framework;version=1.6.0,org.osgi.framework.launch;version=1.0.0,org.osgi.framework.wiring;version=1.0.0,org.osgi.framework.startlevel;version=1.0.0,org.osgi.framework.hooks.bundle;version=1.0.0,org.osgi.framework.hooks.resolver;version=1.0.0,org.osgi.framework.hooks.service;version=1.1.0,org.osgi.framework.hooks.weaving;version=1.0.0,org.osgi.service.packageadmin;version=1.2.0,org.osgi.service.startlevel;version=1.1.0,org.osgi.service.url;version=1.0.0,org.osgi.util.tracker;version=1.5.0
-
-##############################
-# Client bundles to install
-##############################
-felix.auto.start.1=\
-"file:bundles/org.apache.felix.gogo.command_0.12.0.jar" \
-"file:bundles/org.apache.felix.gogo.runtime_0.10.0.jar" \
-"file:bundles/org.apache.felix.gogo.shell_0.10.0.jar"
-felix.auto.start.5="file:bundles/org.apache.streams.activity.publisher.registration_1.0.0.SNAPSHOT.jar"
-
-##############################
-# System properties
-##############################
-org.osgi.service.http.port=8080
-org.osgi.service.http.port.secure=8443
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-cassandra/pom.xml
----------------------------------------------------------------------
diff --git a/trunk/streams-cassandra/pom.xml b/trunk/streams-cassandra/pom.xml
deleted file mode 100644
index 4837649..0000000
--- a/trunk/streams-cassandra/pom.xml
+++ /dev/null
@@ -1,142 +0,0 @@
-<!--
- ~ 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
- ~
- ~ 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.
- -->
-
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.streams</groupId>
- <artifactId>streams-project</artifactId>
- <version>0.1-SNAPSHOT</version>
- </parent>
-
- <artifactId>streams-cassandra</artifactId>
-
- <name>${bundle.symbolicName} [${bundle.namespace}]</name>
-
- <properties>
- <bundle.symbolicName>streams-cassandra</bundle.symbolicName>
- <bundle.namespace>org.apache.streams</bundle.namespace>
- <easymock.version>3.2</easymock.version>
- </properties>
-
- <packaging>bundle</packaging>
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
-
- <resource>
- <directory>.</directory>
- <includes>
- <include>plugin.xml</include>
- <include>plugin.properties</include>
- <include>icons/**</include>
- </includes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.ops4j</groupId>
- <artifactId>maven-pax-plugin</artifactId>
- <!--
- | enable improved OSGi compilation support for the bundle life-cycle.
- | to switch back to the standard bundle life-cycle, move this setting
- | down to the maven-bundle-plugin section
- -->
- <extensions>true</extensions>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>1.4.3</version>
- <!--
- | the following instructions build a simple set of public/private classes into an OSGi bundle
- -->
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
- <Bundle-Version>${project.version}</Bundle-Version>
- <Export-Package>
- ${bundle.namespace};version="${project.version}",org.apache.streams.cassandra.repository.impl, org.apache.streams.cassandra.model, org.apache.streams.cassandra.configuration
- </Export-Package>
- <Private-Package>${bundle.namespace}.cassandra.repository.impl.*,${bundle.namespace}.cassandra.model, ${bundle.namespace}.cassandra.configuration </Private-Package>
- <Import-Package>
- org.apache.rave.model,org.apache.rave.portal.model.impl,
- com.datastax.driver.core, com.datastax.driver.core.exceptions, org.codehaus.jackson.map.annotate,
- javax.persistence, org.apache.commons.logging, com.google.common.collect, org.codehaus.jackson.map,
- org.apache.commons.lang,
- org.apache.streams.osgi.components.activitysubscriber,
- org.springframework.beans.factory.annotation, org.springframework.stereotype
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.rave</groupId>
- <artifactId>rave-core-api</artifactId>
- <version>${rave.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.rave</groupId>
- <artifactId>rave-core</artifactId>
- <version>${rave.version}</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.2</version>
- </dependency>
-
- <dependency>
- <groupId>com.datastax.cassandra</groupId>
- <artifactId>cassandra-driver-core</artifactId>
- <version>${datastax.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.netty</groupId>
- <artifactId>netty</artifactId>
- <version>3.2.9.Final</version>
- </dependency>
- <dependency>
- <groupId>org.apache.streams.osgi.components</groupId>
- <artifactId>activity-subscriber</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <version>${easymock.version}</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/configuration/CassandraConfiguration.java
----------------------------------------------------------------------
diff --git a/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/configuration/CassandraConfiguration.java b/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/configuration/CassandraConfiguration.java
deleted file mode 100644
index 39e74a7..0000000
--- a/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/configuration/CassandraConfiguration.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.apache.streams.cassandra.configuration;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-
-@Component
-public class CassandraConfiguration {
- @Value("${keyspaceName}")
- private String keyspaceName;
-
- @Value("${activitystreamsColumnFamilyName}")
- private String activitystreamsColumnFamilyName;
-
- @Value("${subscriptionColumnFamilyName}")
- private String subscriptionColumnFamilyName;
-
- @Value("${publisherColumnFamilyName}")
- private String publisherColumnFamilyName;
-
- @Value("${cassandraPort}")
- private String cassandraPort;
-
- public String getKeyspaceName() {
- return keyspaceName;
- }
-
- public void setKeyspaceName(String keyspaceName) {
- this.keyspaceName = keyspaceName;
- }
-
- public String getActivitystreamsColumnFamilyName() {
- return activitystreamsColumnFamilyName;
- }
-
- public void setActivitystreamsColumnFamilyName(String activitystreamsColumnFamilyName) {
- this.activitystreamsColumnFamilyName = activitystreamsColumnFamilyName;
- }
-
- public String getSubscriptionColumnFamilyName() {
- return subscriptionColumnFamilyName;
- }
-
- public void setSubscriptionColumnFamilyName(String subscriptionColumnFamilyName) {
- this.subscriptionColumnFamilyName = subscriptionColumnFamilyName;
- }
-
- public String getPublisherColumnFamilyName() {
- return publisherColumnFamilyName;
- }
-
- public void setPublisherColumnFamilyName(String publisherColumnFamilyName) {
- this.publisherColumnFamilyName = publisherColumnFamilyName;
- }
-
- public String getCassandraPort() {
- return cassandraPort;
- }
-
- public void setCassandraPort(String cassandraPort) {
- this.cassandraPort = cassandraPort;
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/model/CassandraActivityStreamsEntry.java
----------------------------------------------------------------------
diff --git a/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/model/CassandraActivityStreamsEntry.java b/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/model/CassandraActivityStreamsEntry.java
deleted file mode 100644
index 2a2321a..0000000
--- a/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/model/CassandraActivityStreamsEntry.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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
- *
- * 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.streams.cassandra.model;
-
-import org.apache.rave.model.ActivityStreamsObject;
-import org.apache.rave.portal.model.impl.ActivityStreamsEntryImpl;
-import org.apache.rave.portal.model.impl.ActivityStreamsObjectImpl;
-import org.codehaus.jackson.map.annotate.JsonDeserialize;
-
-import java.util.Date;
-
-public class CassandraActivityStreamsEntry extends ActivityStreamsEntryImpl implements Comparable<CassandraActivityStreamsEntry>{
-
- @JsonDeserialize(as=ActivityStreamsObjectImpl.class)
- private ActivityStreamsObject object;
-
- @JsonDeserialize(as=ActivityStreamsObjectImpl.class)
- private ActivityStreamsObject target;
-
- @JsonDeserialize(as=ActivityStreamsObjectImpl.class)
- private ActivityStreamsObject actor;
-
- @JsonDeserialize(as=ActivityStreamsObjectImpl.class)
- private ActivityStreamsObject provider;
-
- public int compareTo(CassandraActivityStreamsEntry entry){
- return (this.getPublished()).compareTo(entry.getPublished());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/repository/impl/CassandraActivityStreamsRepository.java
----------------------------------------------------------------------
diff --git a/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/repository/impl/CassandraActivityStreamsRepository.java b/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/repository/impl/CassandraActivityStreamsRepository.java
deleted file mode 100644
index 56e5416..0000000
--- a/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/repository/impl/CassandraActivityStreamsRepository.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * 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
- *
- * 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.streams.cassandra.repository.impl;
-
-import com.datastax.driver.core.Cluster;
-import com.datastax.driver.core.ResultSet;
-import com.datastax.driver.core.Row;
-import com.datastax.driver.core.Session;
-import com.datastax.driver.core.exceptions.AlreadyExistsException;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.rave.model.ActivityStreamsEntry;
-import org.apache.rave.model.ActivityStreamsObject;
-import org.apache.rave.portal.model.impl.ActivityStreamsEntryImpl;
-import org.apache.rave.portal.model.impl.ActivityStreamsObjectImpl;
-import org.apache.streams.cassandra.configuration.CassandraConfiguration;
-import org.apache.streams.cassandra.model.CassandraActivityStreamsEntry;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-
-public class CassandraActivityStreamsRepository {
-
- private static final Log LOG = LogFactory.getLog(CassandraActivityStreamsRepository.class);
-
- private CassandraKeyspace keyspace;
- private CassandraConfiguration configuration;
-
- @Autowired
- public CassandraActivityStreamsRepository(CassandraKeyspace keyspace, CassandraConfiguration configuration) {
- this.configuration = configuration;
- this.keyspace = keyspace;
-
- try {
- keyspace.getSession().execute("CREATE TABLE " + configuration.getActivitystreamsColumnFamilyName() + " (" +
- "id text, " +
- "published timestamp, " +
- "verb text, " +
- "tags text, " +
-
- "actor_displayname text, " +
- "actor_id text, " +
- "actor_url text, " +
- "actor_objecttype text, " +
-
- "target_displayname text, " +
- "target_id text, " +
- "target_url text, " +
-
- "provider_url text, " +
-
- "object_url text, " +
- "object_displayname text, " +
- "object_id text, " +
- "object_objecttype text, " +
-
- "PRIMARY KEY (id, tags, published));");
- } catch (AlreadyExistsException ignored) {
- }
- }
-
- public void save(ActivityStreamsEntry entry) {
- String sql = "INSERT INTO " + configuration.getActivitystreamsColumnFamilyName() + " (" +
- "id, published, verb, tags, " +
- "actor_displayname, actor_objecttype, actor_id, actor_url, " +
- "target_displayname, target_id, target_url, " +
- "provider_url, " +
- "object_displayname, object_objecttype, object_id, object_url) " +
- "VALUES ('" +
- entry.getId() + "','" +
- entry.getPublished().getTime() + "','" +
- entry.getVerb() + "','" +
- entry.getTags() + "','" +
-
- entry.getActor().getDisplayName() + "','" +
- entry.getActor().getObjectType() + "','" +
- entry.getActor().getId() + "','" +
- entry.getActor().getUrl() + "','" +
-
- entry.getTarget().getDisplayName() + "','" +
- entry.getTarget().getId() + "','" +
- entry.getTarget().getUrl() + "','" +
-
- entry.getProvider().getUrl() + "','" +
-
- entry.getObject().getDisplayName() + "','" +
- entry.getObject().getObjectType() + "','" +
- entry.getObject().getId() + "','" +
- entry.getObject().getUrl() +
-
- "')";
- keyspace.getSession().execute(sql);
- }
-
- public List<CassandraActivityStreamsEntry> getActivitiesForFilters(List<String> filters, Date lastUpdated) {
- List<CassandraActivityStreamsEntry> results = new ArrayList<CassandraActivityStreamsEntry>();
-
- for (String tag : filters) {
- String cql = "SELECT * FROM " + configuration.getActivitystreamsColumnFamilyName() + " WHERE ";
-
- //add filters
- cql = cql + " tags = '" + tag + "' AND ";
-
- //specify last modified
- cql = cql + "published > " + lastUpdated.getTime() + " ALLOW FILTERING";
-
- //execute the cql query and store the results
- ResultSet set = keyspace.getSession().execute(cql);
-
- //iterate through the results and create a new ActivityStreamsEntry for every result returned
-
- for (Row row : set) {
- CassandraActivityStreamsEntry entry = new CassandraActivityStreamsEntry();
- ActivityStreamsObject actor = new ActivityStreamsObjectImpl();
- ActivityStreamsObject target = new ActivityStreamsObjectImpl();
- ActivityStreamsObject object = new ActivityStreamsObjectImpl();
- ActivityStreamsObject provider = new ActivityStreamsObjectImpl();
-
- actor.setDisplayName(row.getString("actor_displayname"));
- actor.setId(row.getString("actor_id"));
- actor.setObjectType(row.getString("actor_objecttype"));
- actor.setUrl(row.getString("actor_url"));
-
- target.setDisplayName(row.getString("target_displayname"));
- target.setId(row.getString("target_id"));
- target.setUrl(row.getString("target_url"));
-
- object.setDisplayName(row.getString("object_displayname"));
- object.setObjectType(row.getString("object_objecttype"));
- object.setUrl(row.getString("object_url"));
- object.setId(row.getString("object_id"));
-
- provider.setUrl(row.getString("provider_url"));
-
- entry.setPublished(row.getDate("published"));
- entry.setVerb(row.getString("verb"));
- entry.setId(row.getString("id"));
- entry.setTags(row.getString("tags"));
- entry.setActor(actor);
- entry.setTarget(target);
- entry.setObject(object);
- entry.setProvider(provider);
-
- results.add(entry);
- }
- }
-
- return results;
- }
-
- public void dropTable(String table) {
- String cql = "DROP TABLE " + table;
- keyspace.getSession().execute(cql);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/repository/impl/CassandraKeyspace.java
----------------------------------------------------------------------
diff --git a/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/repository/impl/CassandraKeyspace.java b/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/repository/impl/CassandraKeyspace.java
deleted file mode 100644
index 0551bf2..0000000
--- a/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/repository/impl/CassandraKeyspace.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.apache.streams.cassandra.repository.impl;
-
-import com.datastax.driver.core.Cluster;
-import com.datastax.driver.core.Session;
-import com.datastax.driver.core.exceptions.AlreadyExistsException;
-import org.apache.streams.cassandra.configuration.CassandraConfiguration;
-import org.springframework.beans.factory.annotation.Autowired;
-
-public class CassandraKeyspace {
- private CassandraConfiguration configuration;
- private Cluster cluster;
- private Session session;
-
- @Autowired
- public CassandraKeyspace(CassandraConfiguration configuration){
- this.configuration = configuration;
-
- cluster = Cluster.builder().addContactPoint(configuration.getCassandraPort()).build();
- session = cluster.connect();
-
- //TODO: cassandra 2 will have support for CREATE KEYSPACE IF NOT EXISTS
- try {
- session.execute("CREATE KEYSPACE " + configuration.getKeyspaceName() + " WITH replication = { 'class': 'SimpleStrategy','replication_factor' : 1 };");
- } catch (AlreadyExistsException ignored) {
- }
-
- //connect to the keyspace
- session = cluster.connect(configuration.getKeyspaceName());
- }
-
- public Session getSession(){
- return session;
- }
-
- @Override
- protected void finalize() throws Throwable {
- try {
- cluster.shutdown();
- } finally {
- super.finalize();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/repository/impl/CassandraSubscriptionRepository.java
----------------------------------------------------------------------
diff --git a/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/repository/impl/CassandraSubscriptionRepository.java b/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/repository/impl/CassandraSubscriptionRepository.java
deleted file mode 100644
index f5fe471..0000000
--- a/trunk/streams-cassandra/src/main/java/org/apache/streams/cassandra/repository/impl/CassandraSubscriptionRepository.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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
- *
- * 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.streams.cassandra.repository.impl;
-
-import com.datastax.driver.core.ResultSet;
-import com.datastax.driver.core.exceptions.AlreadyExistsException;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.streams.cassandra.configuration.CassandraConfiguration;
-import org.apache.streams.osgi.components.activitysubscriber.ActivityStreamsSubscription;
-import org.springframework.beans.factory.annotation.Autowired;
-
-public class CassandraSubscriptionRepository {
- private static final Log LOG = LogFactory.getLog(CassandraSubscriptionRepository.class);
-
- private CassandraKeyspace keyspace;
- private CassandraConfiguration configuration;
-
- @Autowired
- public CassandraSubscriptionRepository(CassandraKeyspace keyspace, CassandraConfiguration configuration) {
- this.keyspace = keyspace;
- this.configuration = configuration;
-
- try {
- keyspace.getSession().execute("CREATE TABLE " + configuration.getSubscriptionColumnFamilyName() + " (" +
- "id text, " +
- "filters text, " +
-
- "PRIMARY KEY (id));");
- } catch (AlreadyExistsException ignored) {
- }
- }
-
- public String getFilters(String id){
- String cql = "SELECT * FROM " + configuration.getSubscriptionColumnFamilyName() + " WHERE id = '" + id+"';";
-
- ResultSet set = keyspace.getSession().execute(cql);
-
- return set.one().getString("filters");
- }
-
- public void save(ActivityStreamsSubscription subscription){
- String cql = "INSERT INTO " + configuration.getSubscriptionColumnFamilyName() + " (" +
- "id, filters) " +
- "VALUES ('" +
- subscription.getAuthToken() + "','" +
- StringUtils.join(subscription.getFilters(), " ") +
-
- "')";
- keyspace.getSession().execute(cql);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-cassandra/src/main/resources/META_INF/spring/streams-cassandra-context.xml
----------------------------------------------------------------------
diff --git a/trunk/streams-cassandra/src/main/resources/META_INF/spring/streams-cassandra-context.xml b/trunk/streams-cassandra/src/main/resources/META_INF/spring/streams-cassandra-context.xml
deleted file mode 100644
index 842c918..0000000
--- a/trunk/streams-cassandra/src/main/resources/META_INF/spring/streams-cassandra-context.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
- ~ 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
- ~
- ~ 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.
- -->
-<beans
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.springframework.org/schema/beans"
- xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
-
-</beans>
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-cassandra/src/test/java/org/apache/streams/cassandra/repository/impl/CassandraActivityStreamsRepositoryTest.java
----------------------------------------------------------------------
diff --git a/trunk/streams-cassandra/src/test/java/org/apache/streams/cassandra/repository/impl/CassandraActivityStreamsRepositoryTest.java b/trunk/streams-cassandra/src/test/java/org/apache/streams/cassandra/repository/impl/CassandraActivityStreamsRepositoryTest.java
deleted file mode 100644
index 978af10..0000000
--- a/trunk/streams-cassandra/src/test/java/org/apache/streams/cassandra/repository/impl/CassandraActivityStreamsRepositoryTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * 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
- *
- * 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.streams.cassandra.repository.impl;
-
-import com.datastax.driver.core.ResultSet;
-import org.apache.rave.model.ActivityStreamsEntry;
-import org.apache.rave.model.ActivityStreamsObject;
-import org.apache.rave.portal.model.impl.ActivityStreamsEntryImpl;
-import org.apache.rave.portal.model.impl.ActivityStreamsObjectImpl;
-import org.apache.streams.cassandra.configuration.CassandraConfiguration;
-import org.apache.streams.cassandra.model.CassandraActivityStreamsEntry;
-import static org.easymock.EasyMock.*;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-
-public class CassandraActivityStreamsRepositoryTest {
-
- private CassandraActivityStreamsRepository repository;
-
-
- @Before
- public void setup() {
- CassandraKeyspace keyspace = createMock(CassandraKeyspace.class);
- CassandraConfiguration configuration = createMock(CassandraConfiguration.class);
- repository = new CassandraActivityStreamsRepository(keyspace, configuration);
- }
-
- @Ignore
- @Test
- public void saveActivity() {
- ActivityStreamsEntry entry = new ActivityStreamsEntryImpl();
- ActivityStreamsObject actor = new ActivityStreamsObjectImpl();
- ActivityStreamsObject target = new ActivityStreamsObjectImpl();
- ActivityStreamsObject object = new ActivityStreamsObjectImpl();
- ActivityStreamsObject provider = new ActivityStreamsObjectImpl();
-
- actor.setId("actorid1");
- actor.setUrl("actorurl1");
- actor.setDisplayName("actorname1");
-
- target.setId("targetid1");
- target.setUrl("targeturl1");
- target.setDisplayName("r501");
-
- provider.setUrl("providerurl");
-
- object.setId("objectid1");
- object.setDisplayName("objectname1");
-
- entry.setId("dink");
- entry.setVerb("verb1");
- entry.setTags("r501");
- entry.setProvider(provider);
- Date d = new Date();
- entry.setPublished(d);
- entry.setActor(actor);
- entry.setObject(object);
- entry.setTarget(target);
-
- repository.save(entry);
- }
-
- @Ignore
- @Test
- public void getActivity() {
- String cql = "tags";
- String other = "r501";
- List<String> f = Arrays.asList(cql, other);
- Date d = new Date(0);
- List<CassandraActivityStreamsEntry> results = repository.getActivitiesForFilters(f,d);
- }
-
- @Ignore
- @Test
- public void dropTableTest(){
- repository.dropTable("coltest");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-cassandra/src/test/java/org/apache/streams/cassandra/repository/impl/CassandraActivitySubscriptionTest.java
----------------------------------------------------------------------
diff --git a/trunk/streams-cassandra/src/test/java/org/apache/streams/cassandra/repository/impl/CassandraActivitySubscriptionTest.java b/trunk/streams-cassandra/src/test/java/org/apache/streams/cassandra/repository/impl/CassandraActivitySubscriptionTest.java
deleted file mode 100644
index 2a90462..0000000
--- a/trunk/streams-cassandra/src/test/java/org/apache/streams/cassandra/repository/impl/CassandraActivitySubscriptionTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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
- *
- * 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.streams.cassandra.repository.impl;
-
-import org.apache.streams.osgi.components.activitysubscriber.ActivityStreamsSubscription;
-import org.apache.streams.osgi.components.activitysubscriber.impl.ActivityStreamsSubscriptionImpl;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.util.Arrays;
-
-public class CassandraActivitySubscriptionTest {
-
- public CassandraSubscriptionRepository repository;
-
-
- @Before
- public void setup() {
-// repository = new CassandraSubscriptionRepository();
- }
-
- @Ignore
- @Test
- public void saveTest(){
- ActivityStreamsSubscription subscription = new ActivityStreamsSubscriptionImpl();
- subscription.setFilters(Arrays.asList("thisis", "atest"));
- subscription.setAuthToken("subid");
-
- repository.save(subscription);
- }
-
- @Ignore
- @Test
- public void getTest(){
- String filters = repository.getFilters("subid");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-config-graph/pom.xml
----------------------------------------------------------------------
diff --git a/trunk/streams-config-graph/pom.xml b/trunk/streams-config-graph/pom.xml
deleted file mode 100644
index d4a3dbb..0000000
--- a/trunk/streams-config-graph/pom.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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
- ~
- ~ 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.
- -->
-
-<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/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.streams</groupId>
- <artifactId>streams-project</artifactId>
- <version>0.1-SNAPSHOT</version>
- </parent>
-
- <artifactId>streams-config-graph</artifactId>
-
- <dependencies>
- <dependency>
- <artifactId>gs-core</artifactId>
- <groupId>org.graphstream</groupId>
- <version>1.2</version>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <sourceDirectory>src/main/java</sourceDirectory>
- <testSourceDirectory>src/test/java</testSourceDirectory>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- </testResource>
- </testResources>
- </build>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-config-graph/src/main/java/org/apache/streams/config/graph/PipelineGraphConfigurator.java
----------------------------------------------------------------------
diff --git a/trunk/streams-config-graph/src/main/java/org/apache/streams/config/graph/PipelineGraphConfigurator.java b/trunk/streams-config-graph/src/main/java/org/apache/streams/config/graph/PipelineGraphConfigurator.java
deleted file mode 100644
index 3d7b6dd..0000000
--- a/trunk/streams-config-graph/src/main/java/org/apache/streams/config/graph/PipelineGraphConfigurator.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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
- *
- * 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.streams.config.graph;
-
-import org.graphstream.graph.Graph;
-import org.graphstream.graph.implementations.SingleGraph;
-import org.graphstream.stream.file.FileSource;
-import org.graphstream.stream.file.FileSourceFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.Collections;
-import java.util.Enumeration;
-
-/**
- * Created with IntelliJ IDEA.
- * User: sblackmon
- * Date: 9/23/13
- * Time: 10:44 AM
- * To change this template use File | Settings | File Templates.
- */
-public class PipelineGraphConfigurator {
-
- public static Graph pipeline = loadPipeline();
-
- private static Graph loadPipeline() {
-
- Graph pipeline = new SingleGraph("pipelines");
-
- // this class looks for any pipelines specified with a graph definition
- // each is loaded into the execution graph
- // the application is responsible for launching each
- Enumeration<URL> pipelineFiles;
- try {
- pipelineFiles = PipelineGraphConfigurator.class.getClassLoader().getResources("*.dot");
-
- for( URL pipelineFile : Collections.list(pipelineFiles) ) {
- File file = new File(pipelineFile.toURI());
- String filePath = file.getAbsolutePath();
- FileSource fileSource = FileSourceFactory.sourceFor(filePath);
-
- fileSource.addSink(pipeline);
-
- try {
- fileSource.begin(filePath);
-
- while (fileSource.nextEvents()) {
- // Optionally some code here ...
- }
- } catch( IOException e) {
- e.printStackTrace();
- }
-
- try {
- fileSource.end();
- } catch( IOException e) {
- e.printStackTrace();
- } finally {
- fileSource.removeSink(pipeline);
- }
- }
- } catch (IOException e) {
- e.printStackTrace();
- } catch (URISyntaxException e) {
- e.printStackTrace();
- }
-
- return pipeline;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-config/pom.xml
----------------------------------------------------------------------
diff --git a/trunk/streams-config/pom.xml b/trunk/streams-config/pom.xml
deleted file mode 100644
index a8cdd9a..0000000
--- a/trunk/streams-config/pom.xml
+++ /dev/null
@@ -1,129 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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
- ~
- ~ 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.
- -->
-
-<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/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.streams</groupId>
- <artifactId>streams-project</artifactId>
- <version>0.1-SNAPSHOT</version>
- </parent>
-
- <artifactId>streams-config</artifactId>
-
- <dependencies>
- <dependency>
- <groupId>com.typesafe</groupId>
- <artifactId>config</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jsonschema2pojo</groupId>
- <artifactId>jsonschema2pojo-core</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.dataformat</groupId>
- <artifactId>jackson-dataformat-yaml</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <sourceDirectory>src/main/java</sourceDirectory>
- <testSourceDirectory>src/test/java</testSourceDirectory>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.8</version>
- <executions>
- <execution>
- <id>add-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>target/generated-sources/jsonschema2pojo</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.jsonschema2pojo</groupId>
- <artifactId>jsonschema2pojo-maven-plugin</artifactId>
- <configuration>
- <addCompileSourceRoot>true</addCompileSourceRoot>
- <generateBuilders>true</generateBuilders>
- <sourcePaths>
- <sourcePath>src/main/jsonschema/StreamsConfiguration.json</sourcePath>
- </sourcePaths>
- <outputDirectory>target/generated-sources/jsonschema2pojo</outputDirectory>
- <targetPackage>org.apache.streams.config</targetPackage>
- <useLongIntegers>true</useLongIntegers>
- <useJodaDates>false</useJodaDates>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-config/src/main/java/org/apache/streams/config/StreamsConfigurator.java
----------------------------------------------------------------------
diff --git a/trunk/streams-config/src/main/java/org/apache/streams/config/StreamsConfigurator.java b/trunk/streams-config/src/main/java/org/apache/streams/config/StreamsConfigurator.java
deleted file mode 100644
index e35dd5d..0000000
--- a/trunk/streams-config/src/main/java/org/apache/streams/config/StreamsConfigurator.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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
- *
- * 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.streams.config;
-
-import com.typesafe.config.Config;
-import com.typesafe.config.ConfigFactory;
-
-/**
- * Created with IntelliJ IDEA.
- * User: sblackmon
- * Date: 9/23/13
- * Time: 10:44 AM
- * To change this template use File | Settings | File Templates.
- */
-public class StreamsConfigurator {
-
- /*
- Pull all configuration files from the classpath, system properties, and environment variables
- */
- public static Config config = ConfigFactory.load();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-config/src/main/jsonschema/StreamsConfiguration.json
----------------------------------------------------------------------
diff --git a/trunk/streams-config/src/main/jsonschema/StreamsConfiguration.json b/trunk/streams-config/src/main/jsonschema/StreamsConfiguration.json
deleted file mode 100644
index 9a23130..0000000
--- a/trunk/streams-config/src/main/jsonschema/StreamsConfiguration.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "type": "object",
- "$schema": "http://json-schema.org/draft-03/schema",
- "id": "#",
- "javaType" : "org.apache.streams.StreamsConfiguration",
- "javaInterfaces": ["java.io.Serializable"],
- "properties": {
- "pipeline": {
- "type" : "string"
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-contrib/pom.xml
----------------------------------------------------------------------
diff --git a/trunk/streams-contrib/pom.xml b/trunk/streams-contrib/pom.xml
deleted file mode 100644
index c08b0d7..0000000
--- a/trunk/streams-contrib/pom.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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
- ~
- ~ 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.
- -->
-
-<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/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>streams-project</artifactId>
- <groupId>org.apache.streams</groupId>
- <version>0.1-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>streams-contrib</artifactId>
-
- <packaging>pom</packaging>
-
- <properties>
-
- </properties>
-
- <modules>
- <module>streams-persist-console</module>
- <module>streams-persist-elasticsearch</module>
- <!--<module>streams-persist-hbase</module>-->
- <!--<module>streams-persist-hdfs</module>-->
- <!--<module>streams-persist-kafka</module>-->
- <!--<module>streams-persist-mongo</module>-->
- <!--<module>streams-provider-datasift</module>-->
- <!--<module>streams-provider-facebook</module>-->
- <!--<module>streams-provider-gnip</module>-->
- <!--<module>streams-provider-moreover</module>-->
- <module>streams-provider-twitter</module>
- <!--<module>streams-provider-sysomos</module>-->
- <!--<module>streams-provider-rss</module>-->
- <!--<module>streams-proxy-semantria</module>-->
- </modules>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.apache.streams</groupId>
- <artifactId>streams-config</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.streams</groupId>
- <artifactId>streams-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.streams</groupId>
- <artifactId>streams-pojo</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-contrib/streams-persist-console/pom.xml
----------------------------------------------------------------------
diff --git a/trunk/streams-contrib/streams-persist-console/pom.xml b/trunk/streams-contrib/streams-persist-console/pom.xml
deleted file mode 100644
index c7f2cd3..0000000
--- a/trunk/streams-contrib/streams-persist-console/pom.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>streams-contrib</artifactId>
- <groupId>org.apache.streams</groupId>
- <version>0.1-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>streams-persist-console</artifactId>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.streams</groupId>
- <artifactId>streams-core</artifactId>
- <version>0.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.streams</groupId>
- <artifactId>streams-pojo</artifactId>
- <version>0.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-contrib/streams-persist-console/src/main/java/org/apache/streams/console/ConsolePersistWriter.java
----------------------------------------------------------------------
diff --git a/trunk/streams-contrib/streams-persist-console/src/main/java/org/apache/streams/console/ConsolePersistWriter.java b/trunk/streams-contrib/streams-persist-console/src/main/java/org/apache/streams/console/ConsolePersistWriter.java
deleted file mode 100644
index 7e62a7d..0000000
--- a/trunk/streams-contrib/streams-persist-console/src/main/java/org/apache/streams/console/ConsolePersistWriter.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.apache.streams.console;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.common.base.Preconditions;
-import org.apache.streams.core.StreamsDatum;
-import org.apache.streams.core.StreamsPersistWriter;
-import org.apache.streams.core.tasks.StreamsPersistWriterTask;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-public class ConsolePersistWriter extends StreamsPersistWriterTask implements StreamsPersistWriter {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(ConsolePersistWriter.class);
-
- private ObjectMapper mapper = new ObjectMapper();
-
- public ConsolePersistWriter(StreamsPersistWriter writer) {
- super(writer);
- }
-
- @Override
- public void prepare(Object o) {
- Preconditions.checkNotNull(this.getInputQueues());
- }
-
- @Override
- public void cleanUp() {
-
- }
-
- @Override
- public void write(StreamsDatum entry) {
-
- try {
-
- String text = mapper.writeValueAsString(entry);
-
- System.out.println(text);
-
- } catch (JsonProcessingException e) {
- LOGGER.warn("save: {}", e);
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-contrib/streams-persist-elasticsearch/pom.xml
----------------------------------------------------------------------
diff --git a/trunk/streams-contrib/streams-persist-elasticsearch/pom.xml b/trunk/streams-contrib/streams-persist-elasticsearch/pom.xml
deleted file mode 100644
index 2b99973..0000000
--- a/trunk/streams-contrib/streams-persist-elasticsearch/pom.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>streams-contrib</artifactId>
- <groupId>org.apache.streams</groupId>
- <version>0.1-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>streams-persist-elasticsearch</artifactId>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.streams</groupId>
- <artifactId>streams-config</artifactId>
- <version>0.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.streams</groupId>
- <artifactId>streams-core</artifactId>
- <version>0.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.streams</groupId>
- <artifactId>streams-pojo</artifactId>
- <version>0.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.streams</groupId>
- <artifactId>streams-util</artifactId>
- <version>0.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.elasticsearch</groupId>
- <artifactId>elasticsearch</artifactId>
- <version>0.90.5</version>
- <scope>compile</scope>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- <version>20090211</version>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.8</version>
- <executions>
- <execution>
- <id>add-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>target/generated-sources/jsonschema2pojo</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.jsonschema2pojo</groupId>
- <artifactId>jsonschema2pojo-maven-plugin</artifactId>
- <configuration>
- <addCompileSourceRoot>true</addCompileSourceRoot>
- <generateBuilders>true</generateBuilders>
- <sourcePaths>
- <sourcePath>src/main/jsonschema/org/apache/streams/elasticsearch/ElasticsearchConfiguration.json</sourcePath>
- </sourcePaths>
- <outputDirectory>target/generated-sources/jsonschema2pojo</outputDirectory>
- <targetPackage>org.apache.streams.elasticsearch.pojo</targetPackage>
- <useLongIntegers>true</useLongIntegers>
- <useJodaDates>false</useJodaDates>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchClient.java
----------------------------------------------------------------------
diff --git a/trunk/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchClient.java b/trunk/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchClient.java
deleted file mode 100644
index cc75fb0..0000000
--- a/trunk/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchClient.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.apache.streams.elasticsearch;
-
-import org.elasticsearch.Version;
-import org.elasticsearch.client.Client;
-
-/**
- * Created by sblackmon on 2/10/14.
- */
-public class ElasticsearchClient {
-
- private Client client;
- private Version version;
-
- public ElasticsearchClient(Client client, Version version) {
- this.client = client;
- this.version = version;
- }
-
- public Client getClient() {
- return client;
- }
-
- public Version getVersion() {
- return version;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchClientManager.java
----------------------------------------------------------------------
diff --git a/trunk/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchClientManager.java b/trunk/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchClientManager.java
deleted file mode 100644
index f1d6aad..0000000
--- a/trunk/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchClientManager.java
+++ /dev/null
@@ -1,171 +0,0 @@
-package org.apache.streams.elasticsearch;
-
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.elasticsearch.Version;
-import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequestBuilder;
-import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
-import org.elasticsearch.action.admin.cluster.state.ClusterStateRequestBuilder;
-import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
-import org.elasticsearch.action.admin.indices.refresh.RefreshResponse;
-import org.elasticsearch.client.Client;
-import org.elasticsearch.client.transport.TransportClient;
-import org.elasticsearch.common.settings.ImmutableSettings;
-import org.elasticsearch.common.settings.Settings;
-import org.elasticsearch.common.transport.InetSocketTransportAddress;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ExecutionException;
-
-/**
- * Created by sblackmon on 2/10/14.
- */
-public class ElasticsearchClientManager
-{
- private static final Logger LOGGER = LoggerFactory.getLogger(ElasticsearchClientManager.class);
- private static Map<String, ElasticsearchClient> ALL_CLIENTS = new HashMap<String, ElasticsearchClient>();
-
- private ElasticsearchConfiguration elasticsearchConfiguration;
-
- public ElasticsearchConfiguration getElasticsearchConfiguration() { return elasticsearchConfiguration; }
- public String toString() { return ToStringBuilder.reflectionToString(this); }
- public boolean equals(Object o) { return EqualsBuilder.reflectionEquals(this, o, Arrays.asList(this.elasticsearchConfiguration.toString())); }
- public int hashCode() { return HashCodeBuilder.reflectionHashCode(this, Arrays.asList(this.elasticsearchConfiguration.toString())); }
-
- public ElasticsearchClientManager(ElasticsearchConfiguration elasticsearchConfiguration) {
- this.elasticsearchConfiguration = elasticsearchConfiguration;
- }
-
- /**************************************************************************************
- * Get the Client for this return, it is actually a transport client, but it is much
- * easier to work with the generic object as this interface likely won't change from
- * elasticsearch. This method is synchronized to block threads from creating
- * too many of these at any given time.
- * @return
- * Client for elasticsearch
- *************************************************************************************/
- public Client getClient()
- {
- checkAndLoadClient(null);
-
- return ALL_CLIENTS.get(this.elasticsearchConfiguration.getClusterName()).getClient();
- }
-
- public Client getClient(String clusterName)
- {
- checkAndLoadClient(clusterName);
-
- return ALL_CLIENTS.get(this.elasticsearchConfiguration.getClusterName()).getClient();
- }
-
- private synchronized void checkAndLoadClient(String clusterName) {
-
- if( clusterName == null )
- clusterName = this.elasticsearchConfiguration.getClusterName();
-
- // If it is there, exit early
- if (ALL_CLIENTS.containsKey(clusterName))
- return;
-
- try
- {
- // We are currently using lazy loading to start the elasticsearch cluster, however.
- LOGGER.info("Creating a new TransportClient: {}", this.elasticsearchConfiguration.getHosts());
-
- Settings settings = ImmutableSettings.settingsBuilder()
- .put("cluster.name", this.elasticsearchConfiguration.getClusterName())
- .put("client.transport.ping_timeout", "90s")
- .put("client.transport.nodes_sampler_interval", "60s")
- .build();
-
-
- // Create the client
- TransportClient client = new TransportClient(settings);
- for(String h : this.getElasticsearchConfiguration().getHosts()) {
- LOGGER.info("Adding Host: {}", h);
- client.addTransportAddress(new InetSocketTransportAddress(h, this.getElasticsearchConfiguration().getPort().intValue()));
- }
-
- // Add the client and figure out the version.
- ElasticsearchClient elasticsearchClient = new ElasticsearchClient(client, getVersion(client));
-
- // Add it to our static map
- ALL_CLIENTS.put(clusterName, elasticsearchClient);
-
- }
- catch(Exception e)
- {
- LOGGER.error("Could not Create elasticsearch Transport Client: {}", e);
- }
-
- }
-
-
- private Version getVersion(Client client) {
- try {
- ClusterStateRequestBuilder clusterStateRequestBuilder = new ClusterStateRequestBuilder(client.admin().cluster());
- ClusterStateResponse clusterStateResponse = clusterStateRequestBuilder.execute().actionGet();
-
- return clusterStateResponse.getState().getNodes().getMasterNode().getVersion();
- }
- catch (Exception e) {
- return null;
- }
- }
-
-
- public boolean isOnOrAfterVersion(Version version) {
- return ALL_CLIENTS.get(this.elasticsearchConfiguration.toString()).getVersion().onOrAfter(version);
- }
-
- public void start() throws Exception
- {
- /***********************************************************************
- * Note:
- * Everything in these classes is being switched to lazy loading. Within
- * Heroku you only have 60 seconds to connect, and bind to the service,
- * and you are only allowed to run in 1Gb of memory. Switching all
- * of this to lazy loading is how we are fixing some of the issues
- * if you are having issues with these classes, please, refactor
- * and create a UNIT TEST CASE!!!!!! To ensure that everything is
- * working before you check it back in.
- *
- * Author: Smashew @ 2013-08-26
- **********************************************************************/
- }
-
- public boolean refresh(String index) {
- return refresh(new String[]{index});
- }
-
- public boolean refresh(String[] indexes) {
- RefreshResponse refreshResponse = this.getClient().admin().indices().prepareRefresh(indexes).execute().actionGet();
- return refreshResponse.getFailedShards() == 0;
- }
-
- public synchronized void stop()
- {
- // Terminate the elasticsearch cluster
- // Check to see if we have a client.
- if (ALL_CLIENTS.containsKey(this.elasticsearchConfiguration.toString()))
- {
- // Close the client
- ALL_CLIENTS.get(this.elasticsearchConfiguration.toString()).getClient().close();
-
- // Remove it so that it isn't in memory any more.
- ALL_CLIENTS.remove(this.elasticsearchConfiguration.toString());
- }
- }
-
- public ClusterHealthResponse getStatus() throws ExecutionException, InterruptedException
- {
- return new ClusterHealthRequestBuilder(this.getClient().admin().cluster())
- .execute()
- .get();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/6ea69f29/trunk/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchConfigurator.java
----------------------------------------------------------------------
diff --git a/trunk/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchConfigurator.java b/trunk/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchConfigurator.java
deleted file mode 100644
index 224f7da..0000000
--- a/trunk/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchConfigurator.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.apache.streams.elasticsearch;
-
-import com.typesafe.config.Config;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.List;
-
-/**
- * Created by sblackmon on 12/10/13.
- */
-public class ElasticsearchConfigurator {
-
- private final static Logger LOGGER = LoggerFactory.getLogger(ElasticsearchConfigurator.class);
-
- public static ElasticsearchConfiguration detectConfiguration(Config elasticsearch) {
- List<String> hosts = elasticsearch.getStringList("hosts");
- Long port = elasticsearch.getLong("port");
- String clusterName = elasticsearch.getString("clusterName");
-
- ElasticsearchConfiguration elasticsearchConfiguration = new ElasticsearchConfiguration();
-
- elasticsearchConfiguration.setHosts(hosts);
- elasticsearchConfiguration.setPort(port);
- elasticsearchConfiguration.setClusterName(clusterName);
-
- return elasticsearchConfiguration;
- }
-
-}