Package reddit.pojo.processing

Source Code of reddit.pojo.processing.RedditJSonProcessor

package reddit.pojo.processing;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import chatbot.client.MessageDispatcher;
import chatbot.client.ResponseProcessor;

import reddit.pojo.SubredditJson;

public class RedditJSonProcessor implements ResponseProcessor {
 
  private static final Logger logger = LoggerFactory.getLogger(RedditJSonProcessor.class);
 
  private MessageDispatcher dispatcher;
 
  public RedditJSonProcessor(MessageDispatcher dispatcher) {
    this.dispatcher = dispatcher;
  }

  @Override
    public void processMessage(String jsonResponse) {
    SubredditJson subreddit = SubredditJsonUnmarshaller.unmarshalJson(jsonResponse);
    logger.info("Json response successfully unmarshalled: {}", jsonResponse);
    dispatcher.dispatchMessage(subreddit.toString());
  }
}
TOP

Related Classes of reddit.pojo.processing.RedditJSonProcessor

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.