You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streams.apache.org by ds...@apache.org on 2013/11/01 19:53:37 UTC

svn commit: r1538033 - in /incubator/streams/branches/webservice: ./ poms/ poms/compiled/ poms/wrappers/ provision/ streams-components/ streams-components/src/main/java/org/apache/streams/components/service/impl/ streams-components/src/main/java/org/ap...

Author: dsullivan
Date: Fri Nov  1 18:53:37 2013
New Revision: 1538033

URL: http://svn.apache.org/r1538033
Log:
cleaning up pom

Added:
    incubator/streams/branches/webservice/streams-persistence/src/test/java/org/apache/streams/persistence/repository/cassandra/CassandraActiivtyStreamsRepositoryTest.java
Removed:
    incubator/streams/branches/webservice/poms/compiled/
    incubator/streams/branches/webservice/poms/pom.xml
    incubator/streams/branches/webservice/poms/wrappers/
    incubator/streams/branches/webservice/provision/pom.xml
Modified:
    incubator/streams/branches/webservice/pom.xml
    incubator/streams/branches/webservice/streams-components/pom.xml
    incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/CassandraActivityService.java
    incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/storm/StormSubscriberBolt.java
    incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/storm/StormSubscriberSpout.java
    incubator/streams/branches/webservice/streams-persistence/pom.xml
    incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/SubscriptionRepository.java
    incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/cassandra/CassandraPublisherRepository.java
    incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/cassandra/CassandraSubscriptionRepository.java
    incubator/streams/branches/webservice/streams-persistence/src/main/resources/cassandra.properties
    incubator/streams/branches/webservice/streams-web/pom.xml

Modified: incubator/streams/branches/webservice/pom.xml
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/pom.xml?rev=1538033&r1=1538032&r2=1538033&view=diff
==============================================================================
--- incubator/streams/branches/webservice/pom.xml (original)
+++ incubator/streams/branches/webservice/pom.xml Fri Nov  1 18:53:37 2013
@@ -45,11 +45,13 @@
                 <enabled>false</enabled>
             </releases>
         </repository>
+        <repository>
+            <id>clojars.org</id>
+            <url>http://clojars.org/repo</url>
+        </repository>
     </repositories>
 
     <properties>
-        <org.osgi.service.http.port>8080</org.osgi.service.http.port>
-        <org.osgi.service.http.port.secure>8443</org.osgi.service.http.port.secure>
         <rave.version>0.22</rave.version>
         <datastax.version>1.0.3</datastax.version>
         <spring.version>3.2.4.RELEASE</spring.version>
@@ -59,28 +61,17 @@
         <jackson.version>1.9.11</jackson.version>
         <storm.version>0.8.2</storm.version>
         <netty.version>3.2.9.Final</netty.version>
+        <camel.version>2.12.1</camel.version>
+        <slf4j.version>1.7.5</slf4j.version>
+        <log4j.version>1.2.17</log4j.version>
     </properties>
 
     <packaging>pom</packaging>
 
     <modules>
-        <module>poms</module>
-        <module>provision</module>
         <module>streams-web</module>
         <module>streams-components</module>
         <module>streams-persistence</module>
     </modules>
 
-    <build>
-
-    </build>
-
-    <dependencies>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>${junit.version}</version>
-        </dependency>
-    </dependencies>
-
 </project>

Modified: incubator/streams/branches/webservice/streams-components/pom.xml
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/pom.xml?rev=1538033&r1=1538032&r2=1538033&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-components/pom.xml (original)
+++ incubator/streams/branches/webservice/streams-components/pom.xml Fri Nov  1 18:53:37 2013
@@ -10,6 +10,7 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>streams-components</artifactId>
+    <packaging>jar</packaging>
 
     <properties>
         <bundle.symbolicName>streams-components</bundle.symbolicName>
@@ -72,6 +73,12 @@
             <version>${project.version}</version>
         </dependency>
 
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>${junit.version}</version>
+        </dependency>
+
     </dependencies>
 
 

Modified: incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/CassandraActivityService.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/CassandraActivityService.java?rev=1538033&r1=1538032&r2=1538033&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/CassandraActivityService.java (original)
+++ incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/CassandraActivityService.java Fri Nov  1 18:53:37 2013
@@ -13,7 +13,6 @@ import org.springframework.beans.factory
 import org.springframework.stereotype.Component;
 
 import java.io.IOException;
-import java.io.Serializable;
 import java.util.*;
 
 @Component

Modified: incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/storm/StormSubscriberBolt.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/storm/StormSubscriberBolt.java?rev=1538033&r1=1538032&r2=1538033&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/storm/StormSubscriberBolt.java (original)
+++ incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/storm/StormSubscriberBolt.java Fri Nov  1 18:53:37 2013
@@ -8,8 +8,6 @@ import backtype.storm.topology.base.Base
 import backtype.storm.tuple.Fields;
 import backtype.storm.tuple.Tuple;
 import org.apache.streams.components.activitysubscriber.ActivityStreamsSubscriberWarehouse;
-import org.apache.streams.components.service.StreamsActivityRepositoryService;
-import org.apache.streams.components.activitysubscriber.ActivityStreamsSubscriber;
 import org.apache.streams.persistence.model.ActivityStreamsSubscription;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationContext;
@@ -45,10 +43,6 @@ public class StormSubscriberBolt extends
         }
     }
 
-    public void updateSubscription(ActivityStreamsSubscription subscription) {
-
-    }
-
     @Override
     public void declareOutputFields(OutputFieldsDeclarer declarer) {
         declarer.declare(new Fields("void"));

Modified: incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/storm/StormSubscriberSpout.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/storm/StormSubscriberSpout.java?rev=1538033&r1=1538032&r2=1538033&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/storm/StormSubscriberSpout.java (original)
+++ incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/storm/StormSubscriberSpout.java Fri Nov  1 18:53:37 2013
@@ -7,19 +7,10 @@ import backtype.storm.topology.base.Base
 import backtype.storm.tuple.Fields;
 import backtype.storm.tuple.Values;
 import backtype.storm.utils.Utils;
-import org.apache.streams.components.activitysubscriber.ActivityStreamsSubscriber;
-import org.apache.streams.components.activitysubscriber.ActivityStreamsSubscriberWarehouse;
-import org.apache.streams.components.activitysubscriber.impl.ActivityStreamsSubscriberWarehouseImpl;
-import org.apache.streams.components.service.StreamsActivityRepositoryService;
 import org.apache.streams.components.service.StreamsSubscriptionRepositoryService;
 import org.apache.streams.persistence.model.ActivityStreamsSubscription;
-import org.apache.streams.persistence.repository.SubscriptionRepository;
-import org.springframework.beans.factory.BeanFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.xml.XmlBeanFactory;
 import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.core.io.ClassPathResource;
 import org.springframework.stereotype.Component;
 
 import java.util.Iterator;

Modified: incubator/streams/branches/webservice/streams-persistence/pom.xml
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/pom.xml?rev=1538033&r1=1538032&r2=1538033&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/pom.xml (original)
+++ incubator/streams/branches/webservice/streams-persistence/pom.xml Fri Nov  1 18:53:37 2013
@@ -10,19 +10,20 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>streams-persistence</artifactId>
+    <packaging>jar</packaging>
 
     <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>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>com.datastax.cassandra</groupId>
@@ -39,6 +40,12 @@
             <artifactId>spring-context</artifactId>
             <version>${spring.version}</version>
         </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>${junit.version}</version>
+        </dependency>
     </dependencies>
 
 </project>
\ No newline at end of file

Modified: incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/SubscriptionRepository.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/SubscriptionRepository.java?rev=1538033&r1=1538032&r2=1538033&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/SubscriptionRepository.java (original)
+++ incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/SubscriptionRepository.java Fri Nov  1 18:53:37 2013
@@ -5,7 +5,7 @@ import org.apache.streams.persistence.mo
 import java.util.List;
 
 public interface SubscriptionRepository {
-    String getSubscriptionForId(String id);
+    ActivityStreamsSubscription getSubscription(String inRoute);
     List<ActivityStreamsSubscription> getAllSubscriptions();
     void save(ActivityStreamsSubscription subscription);
 }

Modified: incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/cassandra/CassandraPublisherRepository.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/cassandra/CassandraPublisherRepository.java?rev=1538033&r1=1538032&r2=1538033&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/cassandra/CassandraPublisherRepository.java (original)
+++ incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/cassandra/CassandraPublisherRepository.java Fri Nov  1 18:53:37 2013
@@ -27,11 +27,10 @@ public class CassandraPublisherRepositor
 
         try {
             keyspace.getSession().execute("CREATE TABLE " + configuration.getPublisherColumnFamilyName() + " (" +
-                    "id text, " +
                     "inroute text, " +
                     "src text, " +
 
-                    "PRIMARY KEY (id, inroute));");
+                    "PRIMARY KEY (inroute));");
         } catch (AlreadyExistsException ignored) {
         }
     }
@@ -39,9 +38,8 @@ public class CassandraPublisherRepositor
     @Override
     public void save(ActivityStreamsPublisher publisher){
         String cql = "INSERT INTO " + configuration.getPublisherColumnFamilyName()  + " (" +
-                "id, inroute, src) " +
+                "inroute, src) " +
                 "VALUES ('" +
-                publisher.getId() + "','" +
                 publisher.getInRoute() + "','" +
                 publisher.getSrc() +
 
@@ -51,13 +49,12 @@ public class CassandraPublisherRepositor
 
     @Override
     public ActivityStreamsPublisher getPublisher(String inRoute){
-        String cql = "SELECT * FROM " + configuration.getPublisherColumnFamilyName()  + " WHERE inroute = '" + inRoute+"' ALLOW FILTERING;";
+        String cql = "SELECT * FROM " + configuration.getPublisherColumnFamilyName()  + " WHERE inroute = '" + inRoute+"'";
 
         ResultSet set = keyspace.getSession().execute(cql);
         Row row = set.one();
 
         ActivityStreamsPublisher publisher = new CassandraPublisher();
-        publisher.setId(row.getString("id"));
         publisher.setSrc(row.getString("src"));
         publisher.setInRoute(row.getString("inroute"));
 

Modified: incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/cassandra/CassandraSubscriptionRepository.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/cassandra/CassandraSubscriptionRepository.java?rev=1538033&r1=1538032&r2=1538033&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/cassandra/CassandraSubscriptionRepository.java (original)
+++ incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/cassandra/CassandraSubscriptionRepository.java Fri Nov  1 18:53:37 2013
@@ -31,21 +31,25 @@ public class CassandraSubscriptionReposi
 
         try {
             keyspace.getSession().execute("CREATE TABLE " + configuration.getSubscriptionColumnFamilyName() + " (" +
-                    "id text, " +
                     "inroute text, " +
                     "filters text, " +
 
-                    "PRIMARY KEY (id));");
+                    "PRIMARY KEY (inroute));");
         } catch (AlreadyExistsException ignored) {
         }
     }
 
-    public String getSubscriptionForId(String id){
-        String cql = "SELECT * FROM " + configuration.getSubscriptionColumnFamilyName()  + " WHERE id = '" + id+"';";
+    public ActivityStreamsSubscription getSubscription(String inRoute){
+        String cql = "SELECT * FROM " + configuration.getSubscriptionColumnFamilyName()  + " WHERE inroute = '" + inRoute+"';";
 
         ResultSet set = keyspace.getSession().execute(cql);
 
-        return set.one().getString("filters");
+        ActivityStreamsSubscription subscription = new CassandraSubscription();
+
+        subscription.setInRoute(set.one().getString("inroute"));
+        subscription.setFilters(Arrays.asList(set.one().getString("filters").split(",")));
+
+        return subscription;
     }
 
     public List<ActivityStreamsSubscription> getAllSubscriptions(){
@@ -57,7 +61,6 @@ public class CassandraSubscriptionReposi
         for (Row row : set) {
             ActivityStreamsSubscription subscription = new CassandraSubscription();
 
-            subscription.setId(row.getString("id"));
             subscription.setInRoute(row.getString("inroute"));
             subscription.setFilters(Arrays.asList(row.getString("filters").split(",")));
 
@@ -70,9 +73,8 @@ public class CassandraSubscriptionReposi
     public void save(ActivityStreamsSubscription subscription){
         //TODO: will this overwrite?
         String cql = "INSERT INTO " + configuration.getSubscriptionColumnFamilyName()  + " (" +
-                "id, inroute, filters) " +
+                "inroute, filters) " +
                 "VALUES ('" +
-                subscription.getId() + "','" +
                 subscription.getInRoute() + "','" +
                 StringUtils.join(subscription.getFilters(), ",") +
 

Modified: incubator/streams/branches/webservice/streams-persistence/src/main/resources/cassandra.properties
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/src/main/resources/cassandra.properties?rev=1538033&r1=1538032&r2=1538033&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/src/main/resources/cassandra.properties (original)
+++ incubator/streams/branches/webservice/streams-persistence/src/main/resources/cassandra.properties Fri Nov  1 18:53:37 2013
@@ -1,5 +1,5 @@
 cassandra.keyspaceName=keyspaceB
-cassandra.activitystreamsColumnFamilyName=activitystreamsB
-cassandra.subscriptionColumnFamilyName=subscriptionsB
-cassandra.publisherColumnFamilyName=publishersB
+cassandra.activitystreamsColumnFamilyName=activitystreamsC
+cassandra.subscriptionColumnFamilyName=subscriptionsC
+cassandra.publisherColumnFamilyName=publishersC
 cassandra.cassandraPort=127.0.0.1
\ No newline at end of file

Added: incubator/streams/branches/webservice/streams-persistence/src/test/java/org/apache/streams/persistence/repository/cassandra/CassandraActiivtyStreamsRepositoryTest.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/src/test/java/org/apache/streams/persistence/repository/cassandra/CassandraActiivtyStreamsRepositoryTest.java?rev=1538033&view=auto
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/src/test/java/org/apache/streams/persistence/repository/cassandra/CassandraActiivtyStreamsRepositoryTest.java (added)
+++ incubator/streams/branches/webservice/streams-persistence/src/test/java/org/apache/streams/persistence/repository/cassandra/CassandraActiivtyStreamsRepositoryTest.java Fri Nov  1 18:53:37 2013
@@ -0,0 +1,70 @@
+package org.apache.streams.persistence.repository.cassandra;
+
+import org.apache.rave.model.ActivityStreamsEntry;
+import org.apache.rave.model.ActivityStreamsObject;
+import org.apache.rave.portal.model.impl.ActivityStreamsObjectImpl;
+import org.apache.streams.persistence.configuration.CassandraConfiguration;
+import org.apache.streams.persistence.model.cassandra.CassandraActivityStreamsEntry;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.util.Date;
+
+public class CassandraActiivtyStreamsRepositoryTest {
+    private CassandraActivityStreamsRepository repository;
+
+    @Before
+    public void setup(){
+        CassandraConfiguration configuration = new CassandraConfiguration();
+        configuration.setCassandraPort("127.0.0.1");
+        configuration.setActivitystreamsColumnFamilyName("acitivites_Test1");
+        configuration.setKeyspaceName("keyspacetest");
+        CassandraKeyspace keyspace = new CassandraKeyspace(configuration);
+
+        repository = new CassandraActivityStreamsRepository(keyspace,configuration);
+    }
+
+    @Ignore
+    @Test
+    public void testNullFilters(){
+       repository.getActivitiesForFilters(null,new Date(0));
+    }
+
+    @Ignore
+    @Test
+    public void saveActivity(){
+        ActivityStreamsEntry entry = new CassandraActivityStreamsEntry();
+        ActivityStreamsObject actor = new ActivityStreamsObjectImpl();
+        ActivityStreamsObject target = new ActivityStreamsObjectImpl();
+        ActivityStreamsObject object = new ActivityStreamsObjectImpl();
+        ActivityStreamsObject provider = new ActivityStreamsObjectImpl();
+
+        actor.setDisplayName("actor_displayname");
+        actor.setId("actor_id");
+        actor.setObjectType("actor_objecttype");
+        actor.setUrl("actor_url");
+
+        target.setDisplayName("target_displayname");
+        target.setId("target_id");
+        target.setUrl("target_url");
+
+        object.setDisplayName("object_displayname");
+        object.setObjectType("object_objecttype");
+        object.setUrl("object_url");
+        object.setId("object_id");
+
+        provider.setUrl("provider_url");
+
+        entry.setPublished(new Date());
+        entry.setVerb("verb");
+        entry.setId("id");
+        entry.setTags("tags");
+        entry.setActor(actor);
+        entry.setTarget(target);
+        entry.setObject(object);
+        entry.setProvider(provider);
+
+        repository.save(entry);
+    }
+}

Modified: incubator/streams/branches/webservice/streams-web/pom.xml
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-web/pom.xml?rev=1538033&r1=1538032&r2=1538033&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-web/pom.xml (original)
+++ incubator/streams/branches/webservice/streams-web/pom.xml Fri Nov  1 18:53:37 2013
@@ -30,19 +30,7 @@
 
   <name>Apache Streams Web App</name>
 
-  <properties>
-    <junit.version>4.11</junit.version>
-    <jdk.version>1.6</jdk.version>
-  </properties>
-
   <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-      <scope>test</scope>
-    </dependency>
-
 
       <dependency>
           <groupId>org.apache.streams</groupId>
@@ -50,22 +38,21 @@
           <version>${project.version}</version>
       </dependency>
 
-
       <!-- logging -->
       <dependency>
           <groupId>org.slf4j</groupId>
           <artifactId>slf4j-api</artifactId>
-          <version>1.6.1</version>
+          <version>${slf4j.version}</version>
       </dependency>
       <dependency>
           <groupId>org.slf4j</groupId>
           <artifactId>slf4j-log4j12</artifactId>
-          <version>1.6.1</version>
+          <version>${slf4j.version}</version>
       </dependency>
       <dependency>
           <groupId>log4j</groupId>
           <artifactId>log4j</artifactId>
-          <version>1.2.16</version>
+          <version>${log4j.version}</version>
       </dependency>
 
 
@@ -89,6 +76,12 @@
 
       <dependency>
           <groupId>org.springframework</groupId>
+          <artifactId>spring-webmvc</artifactId>
+          <version>${spring.version}</version>
+      </dependency>
+
+      <dependency>
+          <groupId>org.springframework</groupId>
           <artifactId>spring-test</artifactId>
           <version>${spring.version}</version>
           <scope>test</scope>
@@ -125,8 +118,6 @@
                               <resource>
                                   <directory>${project.parent.basedir}/streams-eip-routes/src/main/resources/META-INF/spring</directory>
                                   <excludes>
-                                    <exclude>streams-eip-osgi-component-import.xml</exclude>
-                                     <exclude>propertiesLoader.xml</exclude>
                                     <exclude>streams.properties</exclude>
                                   </excludes>
                               </resource>