All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.livefyre.factory.CursorFactory Maven / Gradle / Ivy

There is a newer version: 1.3.5
Show newest version
package com.livefyre.factory;

import java.util.Calendar;
import java.util.Date;

import com.livefyre.core.LfCore;
import com.livefyre.core.Network;
import com.livefyre.entity.TimelineCursor;
import com.livefyre.entity.Topic;

public class CursorFactory {
    public static TimelineCursor getTopicStreamCursor(LfCore core, Topic topic) {
        return getTopicStreamCursor(core, topic, 50, Calendar.getInstance().getTime());
    }
    
    public static TimelineCursor getTopicStreamCursor(LfCore core, Topic topic, Integer limit, Date date) {
        String resource = topic.getId() + ":topicStream";
        return new TimelineCursor(core, resource, limit, date);
    }
    
    public static TimelineCursor getPersonalStreamCursor(Network network, String user) {
        return getPersonalStreamCursor(network, user, 50, Calendar.getInstance().getTime());
    }
    
    public static TimelineCursor getPersonalStreamCursor(Network network, String user, Integer limit, Date date) {
        String resource = network.getUserUrn(user) + ":personalStream";
        return new TimelineCursor(network, resource, limit, date);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy