streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sblack...@apache.org
Subject [29/52] [abbrv] git commit: Tweaks to Twitter & ES to restore examples
Date Mon, 05 May 2014 18:54:16 GMT
Tweaks to Twitter & ES to restore examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/0c310661
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/0c310661
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/0c310661

Branch: refs/heads/sblackmon
Commit: 0c310661c8d437acd693ca7829db78b63bccffe1
Parents: 249198c
Author: sblackmon <sblackmon@w2odigital.com>
Authored: Wed Apr 2 23:27:01 2014 -0500
Committer: sblackmon <sblackmon@w2odigital.com>
Committed: Wed Apr 2 23:27:01 2014 -0500

----------------------------------------------------------------------
 .../streams/twitter/processor/TwitterEventProcessor.java      | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/0c310661/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/processor/TwitterEventProcessor.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/processor/TwitterEventProcessor.java
b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/processor/TwitterEventProcessor.java
index 270172f..4d66b51 100644
--- a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/processor/TwitterEventProcessor.java
+++ b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/processor/TwitterEventProcessor.java
@@ -5,11 +5,13 @@ import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.streams.core.StreamsDatum;
 import org.apache.streams.core.StreamsProcessor;
 import org.apache.streams.exceptions.ActivitySerializerException;
+import org.apache.streams.jackson.StreamsJacksonMapper;
 import org.apache.streams.pojo.json.Activity;
 import org.apache.streams.twitter.pojo.Delete;
 import org.apache.streams.twitter.pojo.Retweet;
@@ -91,6 +93,10 @@ public class TwitterEventProcessor implements StreamsProcessor, Runnable
{
 
         Object result = null;
 
+        Preconditions.checkNotNull(event);
+        Preconditions.checkNotNull(mapper);
+        Preconditions.checkNotNull(twitterJsonActivitySerializer);
+
         if( outClass.equals( Activity.class )) {
                 LOGGER.debug("ACTIVITY");
                 result = twitterJsonActivitySerializer.deserialize(
@@ -195,6 +201,7 @@ public class TwitterEventProcessor implements StreamsProcessor, Runnable
{
 
     @Override
     public void prepare(Object configurationObject) {
+        mapper = new StreamsJacksonMapper();
         twitterJsonActivitySerializer = new TwitterJsonActivitySerializer();
     }
 


Mime
View raw message