INT-1603 renamed components and methods to be more consistent
This commit is contained in:
@@ -41,13 +41,13 @@ public class TwitterReceivingMessageSourceParser extends AbstractPollingInboundC
|
||||
String elementName = element.getLocalName().trim();
|
||||
String className = null;
|
||||
if ("inbound-channel-adapter".equals(elementName)) {
|
||||
className = BASE_PACKAGE + ".inbound.TimelineUpdateReceivingMessageSource";
|
||||
className = BASE_PACKAGE + ".inbound.TimelineReceivingMessageSource";
|
||||
}
|
||||
else if ("dm-inbound-channel-adapter".equals(elementName)) {
|
||||
className = BASE_PACKAGE + ".inbound.DirectMessageReceivingMessageSource";
|
||||
}
|
||||
else if ("mentions-inbound-channel-adapter".equals(elementName)) {
|
||||
className = BASE_PACKAGE + ".inbound.MentionReceivingMessageSource";
|
||||
className = BASE_PACKAGE + ".inbound.MentionsReceivingMessageSource";
|
||||
}
|
||||
else {
|
||||
parserContext.getReaderContext().error("element '" + elementName + "' is not supported by this parser.", element);
|
||||
|
||||
@@ -38,7 +38,7 @@ public class TwitterSendingMessageHandlerParser extends AbstractOutboundChannelA
|
||||
String elementName = element.getLocalName().trim();
|
||||
String className = null;
|
||||
if ("outbound-channel-adapter".equals(elementName)) {
|
||||
className = BASE_PACKAGE + ".outbound.TimelineUpdateSendingMessageHandler";
|
||||
className = BASE_PACKAGE + ".outbound.TimelineSendingMessageHandler";
|
||||
}
|
||||
else if ("dm-outbound-channel-adapter".equals(elementName)) {
|
||||
className = BASE_PACKAGE + ".outbound.DirectMessageSendingMessageHandler";
|
||||
|
||||
@@ -124,7 +124,7 @@ public class Twitter4jTemplate implements TwitterOperations{
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public List<Tweet> getHomeTimeline() {
|
||||
public List<Tweet> getTimeline() {
|
||||
try {
|
||||
ResponseList<Status> timelines = twitter.getHomeTimeline();
|
||||
return this.buildTweetsFromTwitterResponses(timelines);
|
||||
@@ -134,7 +134,7 @@ public class Twitter4jTemplate implements TwitterOperations{
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public List<Tweet> getHomeTimeline(long sinceId) {
|
||||
public List<Tweet> getTimeline(long sinceId) {
|
||||
try {
|
||||
ResponseList<Status> timelines = twitter.getHomeTimeline(new Paging(sinceId));
|
||||
return this.buildTweetsFromTwitterResponses(timelines);
|
||||
|
||||
@@ -118,9 +118,9 @@ public interface TwitterOperations {
|
||||
|
||||
List<Tweet> getMentions(long sinceId);
|
||||
|
||||
List<Tweet> getHomeTimeline();
|
||||
List<Tweet> getTimeline();
|
||||
|
||||
List<Tweet> getHomeTimeline(long sinceId);
|
||||
List<Tweet> getTimeline(long sinceId);
|
||||
|
||||
void sendDirectMessage(String userName, String text);
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ public abstract class AbstractTwitterMessageSource<T> extends AbstractEndpoint
|
||||
synchronized (this.markerGuard) {
|
||||
|
||||
long id = tweet.getId();
|
||||
|
||||
|
||||
if (id > this.markerId) {
|
||||
this.markerId = id;
|
||||
tweets.add(tweet);
|
||||
|
||||
@@ -27,9 +27,9 @@ import org.springframework.integration.twitter.core.TwitterOperations;
|
||||
* @author Josh Long
|
||||
* @author Oleg Zhurakousky
|
||||
*/
|
||||
public class MentionReceivingMessageSource extends AbstractTwitterMessageSource<Tweet> {
|
||||
public class MentionsReceivingMessageSource extends AbstractTwitterMessageSource<Tweet> {
|
||||
|
||||
public MentionReceivingMessageSource(TwitterOperations twitter){
|
||||
public MentionsReceivingMessageSource(TwitterOperations twitter){
|
||||
super(twitter);
|
||||
}
|
||||
@Override
|
||||
@@ -30,9 +30,9 @@ import org.springframework.integration.twitter.core.TwitterOperations;
|
||||
* @author Oleg Zhurakousky
|
||||
* @since 2.0
|
||||
*/
|
||||
public class TimelineUpdateReceivingMessageSource extends AbstractTwitterMessageSource<Tweet> {
|
||||
public class TimelineReceivingMessageSource extends AbstractTwitterMessageSource<Tweet> {
|
||||
|
||||
public TimelineUpdateReceivingMessageSource(TwitterOperations twitter){
|
||||
public TimelineReceivingMessageSource(TwitterOperations twitter){
|
||||
super(twitter);
|
||||
}
|
||||
@Override
|
||||
@@ -48,8 +48,8 @@ public class TimelineUpdateReceivingMessageSource extends AbstractTwitterMessage
|
||||
long sinceId = getMarkerId();
|
||||
if (tweets.size() <= prefetchThreshold){
|
||||
List<Tweet> tweets = !hasMarkedStatus()
|
||||
? twitter.getHomeTimeline()
|
||||
: twitter.getHomeTimeline(sinceId);
|
||||
? twitter.getTimeline()
|
||||
: twitter.getTimeline(sinceId);
|
||||
forwardAll(tweets);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -28,9 +28,9 @@ import org.springframework.integration.twitter.core.TwitterOperations;
|
||||
* @author Oleg Zhurakousky
|
||||
* @since 2.0
|
||||
*/
|
||||
public class TimelineUpdateSendingMessageHandler extends AbstractOutboundTwitterEndpointSupport {
|
||||
public class TimelineSendingMessageHandler extends AbstractOutboundTwitterEndpointSupport {
|
||||
|
||||
public TimelineUpdateSendingMessageHandler(TwitterOperations twitter){
|
||||
public TimelineSendingMessageHandler(TwitterOperations twitter){
|
||||
super(twitter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user