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/07 18:01:19 UTC
svn commit: r1539714 - in /incubator/streams/branches/webservice: ./
streams-components/
streams-components/src/main/java/org/apache/streams/components/activitysubscriber/impl/
streams-components/src/main/java/org/apache/streams/components/service/
str...
Author: dsullivan
Date: Thu Nov 7 17:01:18 2013
New Revision: 1539714
URL: http://svn.apache.org/r1539714
Log:
figured out JSON issues
Added:
incubator/streams/branches/webservice/streams-components/src/test/java/org/
incubator/streams/branches/webservice/streams-components/src/test/java/org/apache/
incubator/streams/branches/webservice/streams-components/src/test/java/org/apache/streams/
incubator/streams/branches/webservice/streams-components/src/test/java/org/apache/streams/components/
incubator/streams/branches/webservice/streams-components/src/test/java/org/apache/streams/components/service/
incubator/streams/branches/webservice/streams-components/src/test/java/org/apache/streams/components/service/StreamsActivityRepositoryServiceTest.java
incubator/streams/branches/webservice/streams-components/src/test/java/org/apache/streams/components/service/StreamsSubscriberRegistrationServiceTest.java
incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/ActivityStreamsEntry.java
incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/ActivityStreamsObject.java
incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/cassandra/CassandraActivityStreamsObject.java
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/activitysubscriber/impl/ActivityStreamsSubscriberWarehouseImpl.java
incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsActivityRepositoryService.java
incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsSubscriberRegistrationService.java
incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsSubscriptionRepositoryService.java
incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsTagsUpdatingService.java
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/service/impl/CassandraSubscriptionService.java
incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/StreamsPublisherRegistrationServiceImpl.java
incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/StreamsSubscriberRegistrationServiceImpl.java
incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/StreamsTagsUpdatingServiceImpl.java
incubator/streams/branches/webservice/streams-components/src/main/resources/streams_components_applicationContext.xml
incubator/streams/branches/webservice/streams-persistence/pom.xml
incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/ActivityStreamsSubscription.java
incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/cassandra/CassandraActivityStreamsEntry.java
incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/cassandra/CassandraSubscription.java
incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/ActivityStreamsRepository.java
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/CassandraActivityStreamsRepository.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-persistence/src/test/java/org/apache/streams/persistence/repository/cassandra/CassandraActiivtyStreamsRepositoryTest.java
incubator/streams/branches/webservice/streams-persistence/src/test/java/org/apache/streams/persistence/repository/cassandra/CassandraSubscriptionRepositoryTest.java
incubator/streams/branches/webservice/streams-web/pom.xml
incubator/streams/branches/webservice/streams-web/src/main/java/org/apache/streams/mvc/controller/StreamsWebController.java
Modified: incubator/streams/branches/webservice/pom.xml
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/pom.xml?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/pom.xml (original)
+++ incubator/streams/branches/webservice/pom.xml Thu Nov 7 17:01:18 2013
@@ -58,12 +58,11 @@
<junit.version>4.9</junit.version>
<cglib.version>3.0</cglib.version>
<asm.version>3.3.1</asm.version>
- <jackson.version>2.2.3</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>
+ <logging.version>1.7.5</logging.version>
+ <easymock.version>3.2</easymock.version>
</properties>
<packaging>pom</packaging>
Modified: incubator/streams/branches/webservice/streams-components/pom.xml
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/pom.xml?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-components/pom.xml (original)
+++ incubator/streams/branches/webservice/streams-components/pom.xml Thu Nov 7 17:01:18 2013
@@ -25,22 +25,12 @@
</repositories>
<dependencies>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- <version>${jackson.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.rave</groupId>
- <artifactId>rave-core</artifactId>
- <version>${rave.version}</version>
- </dependency>
+ <!-- logging -->
<dependency>
- <groupId>org.apache.rave</groupId>
- <artifactId>rave-core-api</artifactId>
- <version>${rave.version}</version>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.3</version>
</dependency>
<dependency>
@@ -53,6 +43,16 @@
<groupId>storm</groupId>
<artifactId>storm</artifactId>
<version>${storm.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
@@ -79,6 +79,13 @@
<version>${junit.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>${easymock.version}</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
Modified: incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/activitysubscriber/impl/ActivityStreamsSubscriberWarehouseImpl.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/activitysubscriber/impl/ActivityStreamsSubscriberWarehouseImpl.java?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/activitysubscriber/impl/ActivityStreamsSubscriberWarehouseImpl.java (original)
+++ incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/activitysubscriber/impl/ActivityStreamsSubscriberWarehouseImpl.java Thu Nov 7 17:01:18 2013
@@ -29,7 +29,6 @@ public class ActivityStreamsSubscriberWa
if (!subscribers.containsKey(subscription.getInRoute())) {
ActivityStreamsSubscriber subscriber = new ActivityStreamsSubscriberDelegate();
subscribers.put(subscription.getInRoute(), subscriber);
- this.updateSubscriber(subscription);
}
}
@@ -54,7 +53,7 @@ public class ActivityStreamsSubscriberWa
if (subscriber != null) {
//TODO: an activity posted in between the cql query and setting the lastUpdated field will be lost
Set<String> activities = new TreeSet<String>();
- activities.addAll(activityService.getActivitiesForFilters(subscription.getFilters(), subscriber.getLastUpdated()));
+ activities.addAll(activityService.getActivitiesForTags(subscription.getTags(), subscriber.getLastUpdated()));
subscriber.setLastUpdated(new Date());
subscriber.receive(new ArrayList<String>(activities));
}
Modified: incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsActivityRepositoryService.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsActivityRepositoryService.java?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsActivityRepositoryService.java (original)
+++ incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsActivityRepositoryService.java Thu Nov 7 17:01:18 2013
@@ -2,14 +2,14 @@ package org.apache.streams.components.se
import org.apache.streams.persistence.model.ActivityStreamsPublisher;
-import java.io.IOException;
import java.util.Date;
import java.util.List;
+import java.util.Set;
public interface StreamsActivityRepositoryService {
void receiveActivity(ActivityStreamsPublisher publisher, String activityJSON) throws Exception;
- List<String> getActivitiesForFilters(List<String> filters, Date lastUpdated);
+ List<String> getActivitiesForTags(Set<String> tags, Date lastUpdated);
}
Modified: incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsSubscriberRegistrationService.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsSubscriberRegistrationService.java?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsSubscriberRegistrationService.java (original)
+++ incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsSubscriberRegistrationService.java Thu Nov 7 17:01:18 2013
@@ -3,5 +3,5 @@ package org.apache.streams.components.se
import java.io.IOException;
public interface StreamsSubscriberRegistrationService {
- String register(String subscriberJSON) throws IOException;
+ String register(String subscriberJSON) throws Exception;
}
Modified: incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsSubscriptionRepositoryService.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsSubscriptionRepositoryService.java?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsSubscriptionRepositoryService.java (original)
+++ incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsSubscriptionRepositoryService.java Thu Nov 7 17:01:18 2013
@@ -3,8 +3,12 @@ package org.apache.streams.components.se
import org.apache.streams.persistence.model.ActivityStreamsSubscription;
import java.util.List;
+import java.util.Set;
public interface StreamsSubscriptionRepositoryService{
void saveSubscription(ActivityStreamsSubscription subscription);
List<ActivityStreamsSubscription> getAllSubscriptions();
+ void updateTags(String subscriberId, Set<String> add, Set<String> remove);
+ ActivityStreamsSubscription getSubscriptionByUsername(String username);
+ ActivityStreamsSubscription getSubscriptionByInRoute(String inRoute);
}
Modified: incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsTagsUpdatingService.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsTagsUpdatingService.java?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsTagsUpdatingService.java (original)
+++ incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/StreamsTagsUpdatingService.java Thu Nov 7 17:01:18 2013
@@ -1,5 +1,5 @@
package org.apache.streams.components.service;
public interface StreamsTagsUpdatingService {
- String updateTags(String tagsJson);
+ String updateTags(String subscriberId, String tagsJson) throws Exception;
}
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=1539714&r1=1539713&r2=1539714&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 Thu Nov 7 17:01:18 2013
@@ -2,16 +2,16 @@ package org.apache.streams.components.se
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.rave.model.ActivityStreamsEntry;
import org.apache.streams.components.service.StreamsActivityRepositoryService;
+import org.apache.streams.persistence.model.ActivityStreamsEntry;
import org.apache.streams.persistence.model.ActivityStreamsPublisher;
import org.apache.streams.persistence.model.cassandra.CassandraActivityStreamsEntry;
import org.apache.streams.persistence.repository.ActivityStreamsRepository;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import org.codehaus.jackson.map.DeserializationConfig;
+import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.io.IOException;
import java.util.*;
@Component
@@ -23,9 +23,10 @@ public class CassandraActivityService im
private ObjectMapper mapper;
@Autowired
- public CassandraActivityService(ActivityStreamsRepository activityStreamsRepository, ObjectMapper mapper) {
+ public CassandraActivityService(ActivityStreamsRepository activityStreamsRepository) {
this.activityStreamsRepository = activityStreamsRepository;
- this.mapper = mapper;
+ this.mapper = new ObjectMapper();
+ mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@Override
@@ -40,8 +41,8 @@ public class CassandraActivityService im
}
@Override
- public List<String> getActivitiesForFilters(List<String> filters, Date lastUpdated) {
- List<ActivityStreamsEntry> activityObjects = activityStreamsRepository.getActivitiesForFilters(filters, lastUpdated);
+ public List<String> getActivitiesForTags(Set<String> tags, Date lastUpdated){
+ List<ActivityStreamsEntry> activityObjects = activityStreamsRepository.getActivitiesForTags(tags, lastUpdated);
Collections.sort(activityObjects, Collections.reverseOrder());
//TODO: make the number of streams returned configurable
return getJsonList(activityObjects.subList(0, Math.min(activityObjects.size(), 10)));
@@ -52,8 +53,8 @@ public class CassandraActivityService im
for (ActivityStreamsEntry entry : activities) {
try {
jsonList.add(mapper.writeValueAsString(entry));
- } catch (IOException e) {
- LOG.error("There was an error while trying to convert the java object to a string: " + entry, e);
+ } catch (Exception e) {
+ LOG.error("Error processing the entry with the id: "+entry.getId(),e);
}
}
return jsonList;
Modified: incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/CassandraSubscriptionService.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/CassandraSubscriptionService.java?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/CassandraSubscriptionService.java (original)
+++ incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/CassandraSubscriptionService.java Thu Nov 7 17:01:18 2013
@@ -6,10 +6,8 @@ import org.apache.streams.persistence.re
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
-import java.util.UUID;
+import java.util.Set;
@Component
public class CassandraSubscriptionService implements StreamsSubscriptionRepositoryService {
@@ -23,10 +21,6 @@ public class CassandraSubscriptionServic
@Override
public void saveSubscription(ActivityStreamsSubscription subscription) {
- subscription.setId("" + UUID.randomUUID());
- if(subscription.getFilters() == null){
- subscription.setFilters(new ArrayList<String>());
- }
repository.save(subscription);
}
@@ -34,4 +28,20 @@ public class CassandraSubscriptionServic
public List<ActivityStreamsSubscription> getAllSubscriptions(){
return repository.getAllSubscriptions();
}
+
+ @Override
+ public void updateTags(String subscriberId, Set<String> add, Set<String> remove){
+ repository.updateTags(subscriberId, add, remove);
+ }
+
+ @Override
+ public ActivityStreamsSubscription getSubscriptionByUsername(String username){
+ return repository.getSubscriptionByUsername(username);
+ }
+
+ @Override
+ public ActivityStreamsSubscription getSubscriptionByInRoute(String inRoute){
+ return repository.getSubscriptionByInRoute(inRoute);
+ }
+
}
Modified: incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/StreamsPublisherRegistrationServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/StreamsPublisherRegistrationServiceImpl.java?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/StreamsPublisherRegistrationServiceImpl.java (original)
+++ incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/StreamsPublisherRegistrationServiceImpl.java Thu Nov 7 17:01:18 2013
@@ -1,12 +1,14 @@
package org.apache.streams.components.service.impl;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.streams.components.service.StreamsPublisherRegistrationService;
import org.apache.streams.components.service.StreamsPublisherRepositoryService;
import org.apache.streams.persistence.model.ActivityStreamsPublisher;
import org.apache.streams.persistence.model.cassandra.CassandraPublisher;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import org.codehaus.jackson.map.DeserializationConfig;
+import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -20,9 +22,10 @@ public class StreamsPublisherRegistratio
private ObjectMapper mapper;
@Autowired
- public StreamsPublisherRegistrationServiceImpl(StreamsPublisherRepositoryService publisherRepositoryService, ObjectMapper mapper) {
+ public StreamsPublisherRegistrationServiceImpl(StreamsPublisherRepositoryService publisherRepositoryService) {
this.publisherRepositoryService = publisherRepositoryService;
- this.mapper = mapper;
+ this.mapper = new ObjectMapper();
+ mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
/**
Modified: incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/StreamsSubscriberRegistrationServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/StreamsSubscriberRegistrationServiceImpl.java?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/StreamsSubscriberRegistrationServiceImpl.java (original)
+++ incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/StreamsSubscriberRegistrationServiceImpl.java Thu Nov 7 17:01:18 2013
@@ -7,11 +7,11 @@ import org.apache.streams.components.ser
import org.apache.streams.components.activitysubscriber.ActivityStreamsSubscriberWarehouse;
import org.apache.streams.persistence.model.ActivityStreamsSubscription;
import org.apache.streams.persistence.model.cassandra.CassandraSubscription;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import org.codehaus.jackson.map.DeserializationConfig;
+import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.io.IOException;
import java.util.UUID;
@Component
@@ -25,25 +25,35 @@ public class StreamsSubscriberRegistrati
@Autowired
public StreamsSubscriberRegistrationServiceImpl(
StreamsSubscriptionRepositoryService subscriptionRepositoryService,
- ActivityStreamsSubscriberWarehouse activityStreamsSubscriberWarehouse,
- ObjectMapper mapper
+ ActivityStreamsSubscriberWarehouse activityStreamsSubscriberWarehouse
) {
this.subscriptionRepositoryService = subscriptionRepositoryService;
this.activityStreamsSubscriberWarehouse = activityStreamsSubscriberWarehouse;
- this.mapper = mapper;
+ this.mapper = new ObjectMapper();
+ mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
/**
* registers the subscriber according to the subscriberJSON
+ *
* @param subscriberJSON the JSON of the subscriber to be registered
* @return a url that the client can use to GET activity streams
- * */
- public String register(String subscriberJSON) throws IOException {
+ */
+ @Override
+ public String register(String subscriberJSON) throws Exception {
+ log.info("registering subscriber: "+subscriberJSON);
+
ActivityStreamsSubscription subscription = mapper.readValue(subscriberJSON, CassandraSubscription.class);
- subscription.setInRoute("" + UUID.randomUUID());
- subscriptionRepositoryService.saveSubscription(subscription);
- activityStreamsSubscriberWarehouse.register(subscription);
+ ActivityStreamsSubscription fromDB = subscriptionRepositoryService.getSubscriptionByUsername(subscription.getUsername());
+
+ if (fromDB != null) {
+ return fromDB.getInRoute();
+ } else {
+ subscription.setInRoute("" + UUID.randomUUID());
+ subscriptionRepositoryService.saveSubscription(subscription);
+ activityStreamsSubscriberWarehouse.register(subscription);
- return subscription.getInRoute();
+ return subscription.getInRoute();
+ }
}
}
Modified: incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/StreamsTagsUpdatingServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/StreamsTagsUpdatingServiceImpl.java?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/StreamsTagsUpdatingServiceImpl.java (original)
+++ incubator/streams/branches/webservice/streams-components/src/main/java/org/apache/streams/components/service/impl/StreamsTagsUpdatingServiceImpl.java Thu Nov 7 17:01:18 2013
@@ -1,26 +1,43 @@
package org.apache.streams.components.service.impl;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.streams.components.activitysubscriber.ActivityStreamsSubscriberWarehouse;
import org.apache.streams.components.service.StreamsSubscriptionRepositoryService;
import org.apache.streams.components.service.StreamsTagsUpdatingService;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import org.codehaus.jackson.map.DeserializationConfig;
+import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+
@Component
public class StreamsTagsUpdatingServiceImpl implements StreamsTagsUpdatingService {
+ private static final transient Log LOG = LogFactory.getLog(StreamsTagsUpdatingServiceImpl.class);
private StreamsSubscriptionRepositoryService repositoryService;
+ private ActivityStreamsSubscriberWarehouse subscriberWarehouse;
private ObjectMapper mapper;
@Autowired
- public StreamsTagsUpdatingServiceImpl(StreamsSubscriptionRepositoryService repositoryService, ObjectMapper mapper) {
+ public StreamsTagsUpdatingServiceImpl(StreamsSubscriptionRepositoryService repositoryService, ActivityStreamsSubscriberWarehouse subscriberWarehouse) {
this.repositoryService = repositoryService;
- this.mapper = mapper;
+ this.subscriberWarehouse = subscriberWarehouse;
+ this.mapper = new ObjectMapper();
+ mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
@Override
- public String updateTags(String tagsJson) {
- //TODO:implelement this!!!
+ public String updateTags(String subscriberId, String tagsJson) throws Exception {
+ LOG.info("updating tags for " + subscriberId);
+
+ Map<String, List> updateTags = (Map<String, List>) mapper.readValue(tagsJson, Map.class);
+ repositoryService.updateTags(subscriberId, new HashSet<String>(updateTags.get("add")), new HashSet<String>(updateTags.get("remove")));
+ subscriberWarehouse.updateSubscriber(repositoryService.getSubscriptionByInRoute(subscriberId));
+
return "Tags Updated Successfully!";
}
}
Modified: incubator/streams/branches/webservice/streams-components/src/main/resources/streams_components_applicationContext.xml
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/src/main/resources/streams_components_applicationContext.xml?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-components/src/main/resources/streams_components_applicationContext.xml (original)
+++ incubator/streams/branches/webservice/streams-components/src/main/resources/streams_components_applicationContext.xml Thu Nov 7 17:01:18 2013
@@ -10,17 +10,4 @@
<context:annotation-config />
<context:component-scan base-package="org.apache.streams.components"/>
- <!-- Jackson Mapper -->
- <bean id="mapper" class="com.fasterxml.jackson.databind.ObjectMapper" />
- <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
- <property name="targetObject" ref="mapper" />
- <property name="targetMethod" value="configure" />
- <property name="arguments">
- <list>
- <value type="com.fasterxml.jackson.databind.DeserializationFeature">FAIL_ON_UNKNOWN_PROPERTIES</value>
- <value>false</value>
- </list>
- </property>
- </bean>
-
</beans>
\ No newline at end of file
Added: incubator/streams/branches/webservice/streams-components/src/test/java/org/apache/streams/components/service/StreamsActivityRepositoryServiceTest.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/src/test/java/org/apache/streams/components/service/StreamsActivityRepositoryServiceTest.java?rev=1539714&view=auto
==============================================================================
--- incubator/streams/branches/webservice/streams-components/src/test/java/org/apache/streams/components/service/StreamsActivityRepositoryServiceTest.java (added)
+++ incubator/streams/branches/webservice/streams-components/src/test/java/org/apache/streams/components/service/StreamsActivityRepositoryServiceTest.java Thu Nov 7 17:01:18 2013
@@ -0,0 +1,43 @@
+package org.apache.streams.components.service;
+
+import org.apache.streams.persistence.model.ActivityStreamsEntry;
+import org.apache.streams.persistence.model.cassandra.CassandraActivityStreamsEntry;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.junit.Test;
+
+import java.io.IOException;
+
+public class StreamsActivityRepositoryServiceTest {
+
+ @Test
+ public void parseJsonTest() throws IOException {
+ ObjectMapper mapper = new ObjectMapper();
+ String activityJson = "{\n" +
+ " \"verb\": \"verb\",\n" +
+ " \"tags\": \"tags\",\n" +
+ " \"provider\": {\n" +
+ " \"url\": \"www.example.com\"\n" +
+ " },\n" +
+ " \"actor\": {\n" +
+ " \"id\": \"actorid\",\n" +
+ " \"objectType\": \"actorobject\",\n" +
+ " \"displayName\": \"actorname\",\n" +
+ " \"url\": \"www.actorexampleurl.com\"\n" +
+ " },\n" +
+ " \"target\": {\n" +
+ " \"id\": \"targetid\",\n" +
+ " \"displayName\": \"targetname\",\n" +
+ " \"url\": \"www.targeturl.com\"\n" +
+ " },\n" +
+ " \"object\": {\n" +
+ " \"id\": \"objectid\",\n" +
+ " \"displayName\": \"objectname\",\n" +
+ " \"objectType\": \"object\",\n" +
+ " \"url\": \"www.objecturl.org\"\n" +
+ " }\n" +
+ " }";
+
+ ActivityStreamsEntry a2 = mapper.readValue(activityJson,CassandraActivityStreamsEntry.class);
+
+ }
+}
Added: incubator/streams/branches/webservice/streams-components/src/test/java/org/apache/streams/components/service/StreamsSubscriberRegistrationServiceTest.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-components/src/test/java/org/apache/streams/components/service/StreamsSubscriberRegistrationServiceTest.java?rev=1539714&view=auto
==============================================================================
--- incubator/streams/branches/webservice/streams-components/src/test/java/org/apache/streams/components/service/StreamsSubscriberRegistrationServiceTest.java (added)
+++ incubator/streams/branches/webservice/streams-components/src/test/java/org/apache/streams/components/service/StreamsSubscriberRegistrationServiceTest.java Thu Nov 7 17:01:18 2013
@@ -0,0 +1,47 @@
+package org.apache.streams.components.service;
+
+import org.apache.streams.components.activitysubscriber.ActivityStreamsSubscriberWarehouse;
+import org.apache.streams.components.service.impl.CassandraSubscriptionService;
+import org.apache.streams.components.service.impl.StreamsSubscriberRegistrationServiceImpl;
+import org.apache.streams.persistence.configuration.CassandraConfiguration;
+import org.apache.streams.persistence.repository.SubscriptionRepository;
+import org.apache.streams.persistence.repository.cassandra.CassandraKeyspace;
+import org.apache.streams.persistence.repository.cassandra.CassandraSubscriptionRepository;
+import org.codehaus.jackson.map.DeserializationConfig;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import static org.easymock.EasyMock.createMock;
+
+public class StreamsSubscriberRegistrationServiceTest {
+ private StreamsSubscriberRegistrationService streamsSubscriberRegistrationService;
+
+ @Before
+ public void setup(){
+
+ CassandraConfiguration configuration = new CassandraConfiguration();
+ configuration.setCassandraPort("127.0.0.1");
+ configuration.setSubscriptionColumnFamilyName("subscriptionstestB");
+ configuration.setKeyspaceName("keyspacetest");
+
+ CassandraKeyspace keyspace = new CassandraKeyspace(configuration);
+ SubscriptionRepository subscriptionRepository = new CassandraSubscriptionRepository(keyspace,configuration);
+
+ ActivityStreamsSubscriberWarehouse warehouse = createMock(ActivityStreamsSubscriberWarehouse.class);
+ StreamsSubscriptionRepositoryService repositoryService = new CassandraSubscriptionService(subscriptionRepository);
+
+ streamsSubscriberRegistrationService = new StreamsSubscriberRegistrationServiceImpl(repositoryService, warehouse);
+ }
+
+ @Ignore
+ @Test
+ public void registerTest() throws Exception{
+ String subscriberJson = "{\"username\":\"newUsername\"}";
+
+ String inRoute = streamsSubscriberRegistrationService.register(subscriberJson);
+ assert(inRoute.equals(streamsSubscriberRegistrationService.register(subscriberJson)));
+ }
+
+}
Modified: incubator/streams/branches/webservice/streams-persistence/pom.xml
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/pom.xml?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/pom.xml (original)
+++ incubator/streams/branches/webservice/streams-persistence/pom.xml Thu Nov 7 17:01:18 2013
@@ -13,16 +13,12 @@
<packaging>jar</packaging>
<dependencies>
- <dependency>
- <groupId>org.apache.rave</groupId>
- <artifactId>rave-core-api</artifactId>
- <version>${rave.version}</version>
- </dependency>
+ <!-- logging -->
<dependency>
- <groupId>org.apache.rave</groupId>
- <artifactId>rave-core</artifactId>
- <version>${rave.version}</version>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.3</version>
</dependency>
<dependency>
Added: incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/ActivityStreamsEntry.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/ActivityStreamsEntry.java?rev=1539714&view=auto
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/ActivityStreamsEntry.java (added)
+++ incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/ActivityStreamsEntry.java Thu Nov 7 17:01:18 2013
@@ -0,0 +1,23 @@
+package org.apache.streams.persistence.model;
+
+import java.util.Date;
+
+public interface ActivityStreamsEntry {
+ String getVerb();
+ void setVerb(String verb);
+ String getId();
+ void setId(String id);
+ String getTags();
+ void setTags(String tags);
+ Date getPublished();
+ void setPublished(Date published);
+ ActivityStreamsObject getActor();
+ void setActor(ActivityStreamsObject actor);
+ ActivityStreamsObject getTarget();
+ void setTarget(ActivityStreamsObject actor);
+ ActivityStreamsObject getObject();
+ void setObject(ActivityStreamsObject actor);
+ ActivityStreamsObject getProvider();
+ void setProvider(ActivityStreamsObject actor);
+
+}
Added: incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/ActivityStreamsObject.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/ActivityStreamsObject.java?rev=1539714&view=auto
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/ActivityStreamsObject.java (added)
+++ incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/ActivityStreamsObject.java Thu Nov 7 17:01:18 2013
@@ -0,0 +1,12 @@
+package org.apache.streams.persistence.model;
+
+public interface ActivityStreamsObject {
+ String getDisplayName();
+ void setDisplayName(String displayName);
+ String getObjectType();
+ void setObjectType(String objectType);
+ String getId();
+ void setId(String id);
+ String getUrl();
+ void setUrl(String url);
+}
Modified: incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/ActivityStreamsSubscription.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/ActivityStreamsSubscription.java?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/ActivityStreamsSubscription.java (original)
+++ incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/ActivityStreamsSubscription.java Thu Nov 7 17:01:18 2013
@@ -1,16 +1,16 @@
package org.apache.streams.persistence.model;
-import java.util.List;
+import java.util.Set;
public interface ActivityStreamsSubscription {
- void setFilters(List<String> filters);
- List<String> getFilters();
-
- String getId();
- void setId(String id);
+ void setTags(Set<String> tags);
+ Set<String> getTags();
String getInRoute();
void setInRoute(String inRoute);
+ String getUsername();
+ void setUsername(String username);
+
}
Modified: incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/cassandra/CassandraActivityStreamsEntry.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/cassandra/CassandraActivityStreamsEntry.java?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/cassandra/CassandraActivityStreamsEntry.java (original)
+++ incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/cassandra/CassandraActivityStreamsEntry.java Thu Nov 7 17:01:18 2013
@@ -1,27 +1,95 @@
package org.apache.streams.persistence.model.cassandra;
-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.persistence.model.ActivityStreamsEntry;
+import org.apache.streams.persistence.model.ActivityStreamsObject;
import org.codehaus.jackson.map.annotate.JsonDeserialize;
import java.util.Date;
-public class CassandraActivityStreamsEntry extends ActivityStreamsEntryImpl implements Comparable<CassandraActivityStreamsEntry>{
+public class CassandraActivityStreamsEntry implements ActivityStreamsEntry, Comparable<CassandraActivityStreamsEntry>{
+ private String id;
+ private String tags;
+ private Date published;
+ private String verb;
- @JsonDeserialize(as=ActivityStreamsObjectImpl.class)
+ @JsonDeserialize(as = CassandraActivityStreamsObject.class)
+ private ActivityStreamsObject actor;
+
+ @JsonDeserialize(as = CassandraActivityStreamsObject.class)
private ActivityStreamsObject object;
- @JsonDeserialize(as=ActivityStreamsObjectImpl.class)
+ @JsonDeserialize(as = CassandraActivityStreamsObject.class)
+ private ActivityStreamsObject provider;
+
+ @JsonDeserialize(as = CassandraActivityStreamsObject.class)
private ActivityStreamsObject target;
- @JsonDeserialize(as=ActivityStreamsObjectImpl.class)
- private ActivityStreamsObject actor;
+ public String getId() {
+ return id;
+ }
- @JsonDeserialize(as=ActivityStreamsObjectImpl.class)
- private ActivityStreamsObject provider;
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getTags() {
+ return tags;
+ }
+
+ public void setTags(String tags) {
+ this.tags = tags;
+ }
+
+ public Date getPublished() {
+ return published;
+ }
+
+ public void setPublished(Date published) {
+ this.published = published;
+ }
+
+ public String getVerb() {
+ return verb;
+ }
+
+ public void setVerb(String verb) {
+ this.verb = verb;
+ }
+
+ public ActivityStreamsObject getActor() {
+ return actor;
+ }
+
+ public void setActor(ActivityStreamsObject actor) {
+ this.actor = actor;
+ }
+
+ public ActivityStreamsObject getObject() {
+ return object;
+ }
+
+ public void setObject(ActivityStreamsObject object) {
+ this.object = object;
+ }
+
+ public ActivityStreamsObject getProvider() {
+ return provider;
+ }
+
+ public void setProvider(ActivityStreamsObject provider) {
+ this.provider = provider;
+ }
+
+ public ActivityStreamsObject getTarget() {
+ return target;
+ }
+
+ public void setTarget(ActivityStreamsObject target) {
+ this.target = target;
+ }
public int compareTo(CassandraActivityStreamsEntry entry){
return (this.getPublished()).compareTo(entry.getPublished());
}
+
}
Added: incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/cassandra/CassandraActivityStreamsObject.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/cassandra/CassandraActivityStreamsObject.java?rev=1539714&view=auto
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/cassandra/CassandraActivityStreamsObject.java (added)
+++ incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/cassandra/CassandraActivityStreamsObject.java Thu Nov 7 17:01:18 2013
@@ -0,0 +1,42 @@
+package org.apache.streams.persistence.model.cassandra;
+
+import org.apache.streams.persistence.model.ActivityStreamsObject;
+
+public class CassandraActivityStreamsObject implements ActivityStreamsObject {
+ private String displayName;
+ private String id;
+ private String objectType;
+ private String url;
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getObjectType() {
+ return objectType;
+ }
+
+ public void setObjectType(String objectType) {
+ this.objectType = objectType;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+}
Modified: incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/cassandra/CassandraSubscription.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/cassandra/CassandraSubscription.java?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/cassandra/CassandraSubscription.java (original)
+++ incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/model/cassandra/CassandraSubscription.java Thu Nov 7 17:01:18 2013
@@ -3,46 +3,44 @@ package org.apache.streams.persistence.m
import org.apache.streams.persistence.model.ActivityStreamsSubscription;
import org.codehaus.jackson.map.annotate.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.HashSet;
+import java.util.Set;
public class CassandraSubscription implements ActivityStreamsSubscription {
- @JsonDeserialize(as=ArrayList.class)
- private List<String> filters;
-
- private String id;
+ @JsonDeserialize(as=HashSet.class)
+ private Set<String> tags;
+ private String username;
private String inRoute;
- public void setFilters(List<String> filters) {
+ public void setTags(Set<String> tags) {
//TODO: it's possible that this could be null
- this.filters = filters;
+ this.tags = tags;
}
@Override
- public List<String> getFilters(){
- return filters;
-
+ public Set<String> getTags(){
+ return tags;
}
@Override
- public String getId() {
- return id;
+ public String getInRoute() {
+ return inRoute;
}
@Override
- public void setId(String id) {
- this.id = id;
+ public void setInRoute(String inRoute) {
+ this.inRoute = inRoute;
}
@Override
- public String getInRoute() {
- return inRoute;
+ public String getUsername() {
+ return username;
}
@Override
- public void setInRoute(String inRoute) {
- this.inRoute = inRoute;
+ public void setUsername(String username) {
+ this.username = username;
}
}
Modified: incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/ActivityStreamsRepository.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/ActivityStreamsRepository.java?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/ActivityStreamsRepository.java (original)
+++ incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/ActivityStreamsRepository.java Thu Nov 7 17:01:18 2013
@@ -1,13 +1,15 @@
package org.apache.streams.persistence.repository;
-import org.apache.rave.model.ActivityStreamsEntry;
+
+import org.apache.streams.persistence.model.ActivityStreamsEntry;
import java.util.Date;
import java.util.List;
+import java.util.Set;
public interface ActivityStreamsRepository {
void save(ActivityStreamsEntry entry);
- List<ActivityStreamsEntry> getActivitiesForFilters(List<String> filters, Date lastUpdated);
+ List<ActivityStreamsEntry> getActivitiesForTags(Set<String> tags, Date lastUpdated);
void dropTable(String table);
}
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=1539714&r1=1539713&r2=1539714&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 Thu Nov 7 17:01:18 2013
@@ -3,9 +3,12 @@ package org.apache.streams.persistence.r
import org.apache.streams.persistence.model.ActivityStreamsSubscription;
import java.util.List;
+import java.util.Set;
public interface SubscriptionRepository {
- ActivityStreamsSubscription getSubscription(String inRoute);
+ ActivityStreamsSubscription getSubscriptionByInRoute(String inRoute);
+ ActivityStreamsSubscription getSubscriptionByUsername(String username);
List<ActivityStreamsSubscription> getAllSubscriptions();
void save(ActivityStreamsSubscription subscription);
+ void updateTags(String subscriberId, Set<String> add, Set<String> remove);
}
Modified: incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/cassandra/CassandraActivityStreamsRepository.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/cassandra/CassandraActivityStreamsRepository.java?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/cassandra/CassandraActivityStreamsRepository.java (original)
+++ incubator/streams/branches/webservice/streams-persistence/src/main/java/org/apache/streams/persistence/repository/cassandra/CassandraActivityStreamsRepository.java Thu Nov 7 17:01:18 2013
@@ -5,19 +5,19 @@ import com.datastax.driver.core.Row;
import com.datastax.driver.core.exceptions.AlreadyExistsException;
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.ActivityStreamsObjectImpl;
import org.apache.streams.persistence.configuration.CassandraConfiguration;
+import org.apache.streams.persistence.model.ActivityStreamsEntry;
+import org.apache.streams.persistence.model.ActivityStreamsObject;
import org.apache.streams.persistence.model.cassandra.CassandraActivityStreamsEntry;
+import org.apache.streams.persistence.model.cassandra.CassandraActivityStreamsObject;
import org.apache.streams.persistence.repository.ActivityStreamsRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import java.util.Set;
@Component
public class CassandraActivityStreamsRepository implements ActivityStreamsRepository {
@@ -60,6 +60,7 @@ public class CassandraActivityStreamsRep
}
}
+ @Override
public void save(ActivityStreamsEntry entry) {
//TODO: this should be random UUID
String sql = "INSERT INTO " + configuration.getActivitystreamsColumnFamilyName() + " (" +
@@ -94,13 +95,14 @@ public class CassandraActivityStreamsRep
keyspace.getSession().execute(sql);
}
- public List<ActivityStreamsEntry> getActivitiesForFilters(List<String> filters, Date lastUpdated) {
+ @Override
+ public List<ActivityStreamsEntry> getActivitiesForTags(Set<String> tags, Date lastUpdated) {
List<ActivityStreamsEntry> results = new ArrayList<ActivityStreamsEntry>();
- for (String tag : filters) {
+ for (String tag : tags) {
String cql = "SELECT * FROM " + configuration.getActivitystreamsColumnFamilyName() + " WHERE ";
- //add filters
+ //add tags
cql = cql + " tags = '" + tag + "' AND ";
//specify last modified
@@ -114,10 +116,10 @@ public class CassandraActivityStreamsRep
for (Row row : set) {
ActivityStreamsEntry entry = new CassandraActivityStreamsEntry();
- ActivityStreamsObject actor = new ActivityStreamsObjectImpl();
- ActivityStreamsObject target = new ActivityStreamsObjectImpl();
- ActivityStreamsObject object = new ActivityStreamsObjectImpl();
- ActivityStreamsObject provider = new ActivityStreamsObjectImpl();
+ ActivityStreamsObject actor = new CassandraActivityStreamsObject();
+ ActivityStreamsObject target = new CassandraActivityStreamsObject();
+ ActivityStreamsObject object = new CassandraActivityStreamsObject();
+ ActivityStreamsObject provider = new CassandraActivityStreamsObject();
actor.setDisplayName(row.getString("actor_displayname"));
actor.setId(row.getString("actor_id"));
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=1539714&r1=1539713&r2=1539714&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 Thu Nov 7 17:01:18 2013
@@ -14,45 +14,85 @@ import org.springframework.beans.factory
import org.springframework.stereotype.Component;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
+import java.util.Set;
@Component
-public class CassandraSubscriptionRepository implements SubscriptionRepository{
- private static final Log LOG = LogFactory.getLog(CassandraSubscriptionRepository.class);
+public class CassandraSubscriptionRepository implements SubscriptionRepository {
+ private Log LOG = LogFactory.getLog(CassandraSubscriptionRepository.class);
private CassandraKeyspace keyspace;
private CassandraConfiguration configuration;
@Autowired
public CassandraSubscriptionRepository(CassandraKeyspace keyspace, CassandraConfiguration configuration) {
+ LOG.info("connecting subscription repository");
+
this.keyspace = keyspace;
this.configuration = configuration;
try {
- keyspace.getSession().execute("CREATE TABLE " + configuration.getSubscriptionColumnFamilyName() + " (" +
+ String createTableCQL = "CREATE TABLE " + configuration.getSubscriptionColumnFamilyName() + " (" +
"inroute text, " +
- "filters text, " +
+ "username text, " +
+ "tags set<text>, " +
+
+ "PRIMARY KEY (inroute));";
+ String usernameIndexCQL = "CREATE INDEX ON " + configuration.getSubscriptionColumnFamilyName() + "(username)";
+
+ keyspace.getSession().execute(createTableCQL);
+ keyspace.getSession().execute(usernameIndexCQL);
- "PRIMARY KEY (inroute));");
} catch (AlreadyExistsException ignored) {
}
}
- public ActivityStreamsSubscription getSubscription(String inRoute){
- String cql = "SELECT * FROM " + configuration.getSubscriptionColumnFamilyName() + " WHERE inroute = '" + inRoute+"';";
+ @Override
+ public ActivityStreamsSubscription getSubscriptionByInRoute(String inRoute) {
+ LOG.info("retreiving subscription for inRoute: " + inRoute);
+
+ String cql = "SELECT * FROM " + configuration.getSubscriptionColumnFamilyName() + " WHERE inroute = '" + inRoute + "';";
+
+ ResultSet set = keyspace.getSession().execute(cql);
+ Row row = set.one();
+
+ if (row != null) {
+ ActivityStreamsSubscription subscription = new CassandraSubscription();
+
+ subscription.setInRoute(row.getString("inroute"));
+ subscription.setUsername(row.getString("username"));
+ subscription.setTags(row.getSet("tags", String.class));
+
+ return subscription;
+ }
+ return null;
+ }
+
+ @Override
+ public ActivityStreamsSubscription getSubscriptionByUsername(String username) {
+ LOG.info("retreiving subscription for username: " + username);
+
+ String cql = "SELECT * FROM " + configuration.getSubscriptionColumnFamilyName() + " WHERE username = '" + username + "';";
ResultSet set = keyspace.getSession().execute(cql);
+ Row row = set.one();
- ActivityStreamsSubscription subscription = new CassandraSubscription();
+ if (row != null) {
+ ActivityStreamsSubscription subscription = new CassandraSubscription();
- subscription.setInRoute(set.one().getString("inroute"));
- subscription.setFilters(Arrays.asList(set.one().getString("filters").split(",")));
+ subscription.setInRoute(row.getString("inroute"));
+ subscription.setUsername(row.getString("username"));
+ subscription.setTags(row.getSet("tags", String.class));
- return subscription;
+ return subscription;
+ }
+ return null;
}
- public List<ActivityStreamsSubscription> getAllSubscriptions(){
+ @Override
+ public List<ActivityStreamsSubscription> getAllSubscriptions() {
+ LOG.info("getting all subscriptions");
+
String cql = "SELECT * FROM " + configuration.getSubscriptionColumnFamilyName();
ResultSet set = keyspace.getSession().execute(cql);
@@ -62,7 +102,8 @@ public class CassandraSubscriptionReposi
ActivityStreamsSubscription subscription = new CassandraSubscription();
subscription.setInRoute(row.getString("inroute"));
- subscription.setFilters(Arrays.asList(row.getString("filters").split(",")));
+ subscription.setUsername(row.getString("username"));
+ subscription.setTags(row.getSet("tags", String.class));
results.add(subscription);
}
@@ -70,15 +111,33 @@ public class CassandraSubscriptionReposi
return results;
}
- public void save(ActivityStreamsSubscription subscription){
+ @Override
+ public void save(ActivityStreamsSubscription subscription) {
+ LOG.info("saving subscription username: " + subscription.getUsername() + " inRoute " + subscription.getInRoute());
+
//TODO: will this overwrite?
- String cql = "INSERT INTO " + configuration.getSubscriptionColumnFamilyName() + " (" +
- "inroute, filters) " +
+ String cql = "INSERT INTO " + configuration.getSubscriptionColumnFamilyName() + " (" +
+ "inroute, username, tags) " +
"VALUES ('" +
subscription.getInRoute() + "','" +
- StringUtils.join(subscription.getFilters(), ",") +
+ subscription.getUsername() + "'," +
+ "{}" +
+
+ ")";
+ keyspace.getSession().execute(cql);
+ }
+
+ @Override
+ public void updateTags(String subscriberId, Set<String> add, Set<String> remove) {
+ LOG.info("updating tags inRoute: " + subscriberId + " add: " + add + " remove: " + remove);
+
+ String cql = "UPDATE " + configuration.getSubscriptionColumnFamilyName() +
+ " SET tags = tags + {'" +
+ StringUtils.join(add, "','") + "'}," +
+ " tags = tags - {'" +
+ StringUtils.join(remove, "','") + "'}" +
+ " WHERE inroute = '" + subscriberId + "'";
- "')";
keyspace.getSession().execute(cql);
}
}
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=1539714&r1=1539713&r2=1539714&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 Thu Nov 7 17:01:18 2013
@@ -1,5 +1,5 @@
cassandra.keyspaceName=keyspaceB
-cassandra.activitystreamsColumnFamilyName=activitystreamsC
-cassandra.subscriptionColumnFamilyName=subscriptionsC
-cassandra.publisherColumnFamilyName=publishersC
+cassandra.activitystreamsColumnFamilyName=activitystreamsD
+cassandra.subscriptionColumnFamilyName=subscriptionsD
+cassandra.publisherColumnFamilyName=publishersD
cassandra.cassandraPort=127.0.0.1
\ No newline at end of file
Modified: 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=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/src/test/java/org/apache/streams/persistence/repository/cassandra/CassandraActiivtyStreamsRepositoryTest.java (original)
+++ incubator/streams/branches/webservice/streams-persistence/src/test/java/org/apache/streams/persistence/repository/cassandra/CassandraActiivtyStreamsRepositoryTest.java Thu Nov 7 17:01:18 2013
@@ -1,10 +1,10 @@
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.ActivityStreamsEntry;
+import org.apache.streams.persistence.model.ActivityStreamsObject;
import org.apache.streams.persistence.model.cassandra.CassandraActivityStreamsEntry;
+import org.apache.streams.persistence.model.cassandra.CassandraActivityStreamsObject;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@@ -27,18 +27,18 @@ public class CassandraActiivtyStreamsRep
@Ignore
@Test
- public void testNullFilters(){
- repository.getActivitiesForFilters(null,new Date(0));
+ public void testNullTags(){
+ repository.getActivitiesForTags(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();
+ ActivityStreamsObject actor = new CassandraActivityStreamsObject();
+ ActivityStreamsObject target = new CassandraActivityStreamsObject();
+ ActivityStreamsObject object = new CassandraActivityStreamsObject();
+ ActivityStreamsObject provider = new CassandraActivityStreamsObject();
actor.setDisplayName("actor_displayname");
actor.setId("actor_id");
Modified: incubator/streams/branches/webservice/streams-persistence/src/test/java/org/apache/streams/persistence/repository/cassandra/CassandraSubscriptionRepositoryTest.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-persistence/src/test/java/org/apache/streams/persistence/repository/cassandra/CassandraSubscriptionRepositoryTest.java?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-persistence/src/test/java/org/apache/streams/persistence/repository/cassandra/CassandraSubscriptionRepositoryTest.java (original)
+++ incubator/streams/branches/webservice/streams-persistence/src/test/java/org/apache/streams/persistence/repository/cassandra/CassandraSubscriptionRepositoryTest.java Thu Nov 7 17:01:18 2013
@@ -9,7 +9,9 @@ import org.junit.Ignore;
import org.junit.Test;
import java.util.Arrays;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
public class CassandraSubscriptionRepositoryTest {
@@ -19,7 +21,7 @@ public class CassandraSubscriptionReposi
public void setup() {
CassandraConfiguration configuration = new CassandraConfiguration();
configuration.setCassandraPort("127.0.0.1");
- configuration.setSubscriptionColumnFamilyName("subscriptionsA");
+ configuration.setSubscriptionColumnFamilyName("subscriptionstestA");
configuration.setKeyspaceName("keyspacetest");
CassandraKeyspace keyspace = new CassandraKeyspace(configuration);
@@ -30,17 +32,34 @@ public class CassandraSubscriptionReposi
@Test
public void getAllSubscriptionsTest() {
List<ActivityStreamsSubscription> subscriptions = repository.getAllSubscriptions();
+ }
+ @Ignore
+ @Test
+ public void getSubscriptionByUsernameTest() {
+ ActivityStreamsSubscription subscription = repository.getSubscriptionByUsername("newID2");
}
@Ignore
@Test
public void addSubscriptionsTest() {
ActivityStreamsSubscription subscription = new CassandraSubscription();
- subscription.setFilters(Arrays.asList("r501", "tags"));
- subscription.setId("newID2");
+ subscription.setUsername("newID2");
subscription.setInRoute("randomID");
repository.save(subscription);
}
+
+ @Ignore
+ @Test
+ public void updateTagsTest() {
+ ActivityStreamsSubscription subscription = new CassandraSubscription();
+ subscription.setInRoute("randomID");
+
+ Set<String> add = new HashSet<String>(Arrays.asList("five","six"));
+ Set<String> remove = new HashSet<String>(Arrays.asList("one","three"));
+
+
+ repository.updateTags("randomID", add, remove);
+ }
}
Modified: incubator/streams/branches/webservice/streams-web/pom.xml
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-web/pom.xml?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-web/pom.xml (original)
+++ incubator/streams/branches/webservice/streams-web/pom.xml Thu Nov 7 17:01:18 2013
@@ -17,115 +17,75 @@
specific language governing permissions and limitations
under the License.
-->
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>streams-project</artifactId>
- <groupId>org.apache.streams</groupId>
- <version>0.1-SNAPSHOT</version>
- </parent>
- <artifactId>streams-web</artifactId>
- <packaging>war</packaging>
-
- <name>Apache Streams Web App</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.streams</groupId>
- <artifactId>streams-components</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <!-- logging -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>${log4j.version}</version>
- </dependency>
-
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-webmvc</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <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>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
- <build>
- <finalName>streams-web</finalName>
- <plugins>
-
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.4.2</version>
- <executions>
- <execution>
- <id>default-copy-resources</id>
- <phase>process-resources</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <overwrite>true</overwrite>
- <outputDirectory>${project.build.directory}/${project.artifactId}/WEB-INF/spring</outputDirectory>
- <resources>
- <resource>
- <directory>${project.parent.basedir}/streams-eip-routes/src/main/resources/META-INF/spring</directory>
- <excludes>
- <exclude>streams.properties</exclude>
- </excludes>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>streams-project</artifactId>
+ <groupId>org.apache.streams</groupId>
+ <version>0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>streams-web</artifactId>
+ <packaging>war</packaging>
+
+ <name>Apache Streams Web App</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.streams</groupId>
+ <artifactId>streams-components</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- logging -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <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>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <finalName>streams-web</finalName>
+ </build>
</project>
Modified: incubator/streams/branches/webservice/streams-web/src/main/java/org/apache/streams/mvc/controller/StreamsWebController.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-web/src/main/java/org/apache/streams/mvc/controller/StreamsWebController.java?rev=1539714&r1=1539713&r2=1539714&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-web/src/main/java/org/apache/streams/mvc/controller/StreamsWebController.java (original)
+++ incubator/streams/branches/webservice/streams-web/src/main/java/org/apache/streams/mvc/controller/StreamsWebController.java Thu Nov 7 17:01:18 2013
@@ -66,7 +66,7 @@ public class StreamsWebController {
@ResponseBody
public ResponseEntity<String> registerSubscriber(@RequestBody String payload, @RequestHeader("host") String host) {
try {
- return new ResponseEntity<String>("http://" + host + "/streams-web/app/getActivity/" + subscriberRegistrationService.register(payload), HttpStatus.OK);
+ return new ResponseEntity<String>("http://" + host + "/streams-web/app/activity/" + subscriberRegistrationService.register(payload), HttpStatus.OK);
} catch (Exception e) {
log.error(e);
return new ResponseEntity<String>(e.getMessage(), HttpStatus.BAD_REQUEST);
@@ -115,7 +115,7 @@ public class StreamsWebController {
@ResponseBody
public ResponseEntity<String> updateTags(@PathVariable("subscriberID") String subscriberID, @RequestBody String payload) {
try {
- return new ResponseEntity<String>(tagsUpdatingService.updateTags(payload), HttpStatus.OK);
+ return new ResponseEntity<String>(tagsUpdatingService.updateTags(subscriberID, payload), HttpStatus.OK);
} catch (Exception e) {
log.error(e);
return new ResponseEntity<String>(e.getMessage(), HttpStatus.BAD_REQUEST);