Example usage for org.joda.time Duration standardMinutes

List of usage examples for org.joda.time Duration standardMinutes

Introduction

In this page you can find the example usage for org.joda.time Duration standardMinutes.

Prototype

public static Duration standardMinutes(long minutes) 

Source Link

Document

Create a duration with the specified number of minutes assuming that there are the standard number of milliseconds in a minute.

Usage

From source file:org.atlasapi.equiv.EquivModule.java

License:Apache License

private EquivalenceUpdater<Item> aliasIdentifiedBroadcastItemEquivalenceUpdater(Set<Publisher> sources) {
    return ContentEquivalenceUpdater.<Item>builder()
            .withGenerator(new BroadcastMatchingItemEquivalenceGenerator(scheduleResolver, channelResolver,
                    sources, Duration.standardMinutes(5), Predicates.alwaysTrue()))
            .withScorer(new BroadcastAliasScorer(Score.negativeOne()))
            .withCombiner(new NullScoreAwareAveragingCombiner<Item>()).withFilter(AlwaysTrueFilter.<Item>get())
            .withExtractor(new PercentThresholdEquivalenceExtractor<Item>(0.95))
            .withHandler(itemResultHandlers(sources)).build();
}

From source file:org.atlasapi.remotesite.youtube.YouTubeGraphExtractor.java

License:Apache License

private Item item(YouTubeSource source) {
    Item item = new Item(source.getUri(), YoutubeUriCanonicaliser.curieFor(source.getUri()), Publisher.YOUTUBE);

    item.setTitle(source.getVideoTitle());
    item.setDescription(source.getDescription());

    item.setTags(source.getTags());//from ww  w  .java 2s .  c o  m

    item.setThumbnail(source.getThumbnailImageUri());
    item.setImage(source.getImageUri());
    if (source.getVideos().size() > 0) {
        item.setIsLongForm(
                (source.getVideos().get(0).getDuration()).isLongerThan(Duration.standardMinutes(15)));
    }
    item.setMediaType(MediaType.VIDEO);

    item.setGenres(genreMap.map(source.getCategories()));
    return item;
}

From source file:org.axonframework.test.saga.StubSaga.java

License:Apache License

@StartSaga
@SagaEventHandler(associationProperty = "identifier")
public void handleSagaStart(TriggerSagaStartEvent event, EventMessage<TriggerSagaStartEvent> message) {
    handledEvents.add(event);/*from w  w  w .j a v a  2s .  c om*/
    timer = scheduler.schedule(Duration.standardMinutes(TRIGGER_DURATION_MINUTES),
            new GenericEventMessage<TimerTriggeredEvent>(new TimerTriggeredEvent(event.getIdentifier())));
}

From source file:org.axonframework.test.saga.StubSaga.java

License:Apache License

@StartSaga(forceNew = true)
@SagaEventHandler(associationProperty = "identifier")
public void handleForcedSagaStart(ForceTriggerSagaStartEvent event) {
    handledEvents.add(event);//from   ww  w  .  j a v  a 2  s .  co m
    timer = scheduler.schedule(Duration.standardMinutes(TRIGGER_DURATION_MINUTES),
            new GenericEventMessage<TimerTriggeredEvent>(new TimerTriggeredEvent(event.getIdentifier())));
}

From source file:org.axonframework.test.saga.StubSaga.java

License:Apache License

@SagaEventHandler(associationProperty = "identifier")
public void handleResetTriggerEvent(ResetTriggerEvent event) {
    handledEvents.add(event);/*from  w  w  w .  j a  v a2 s  .c  om*/
    scheduler.cancelSchedule(timer);
    timer = scheduler.schedule(Duration.standardMinutes(TRIGGER_DURATION_MINUTES),
            new GenericEventMessage<TimerTriggeredEvent>(new TimerTriggeredEvent(event.getIdentifier())));
}

From source file:org.cook_e.data.SQLFileCreator.java

License:Open Source License

private static Recipe createFriedRiceRecipe() {
    List<Step> steps = new ArrayList<>();
    List<String> first_ings = new ArrayList<>();
    first_ings.add("4 cups rice");
    Step first = new Step(first_ings, "Cook rice", Duration.standardMinutes(30), true, 0);
    steps.add(first);/*from   ww w  . j  a v  a2  s.  com*/
    List<String> second_ings = new ArrayList<>();
    first_ings.add("1 carrot");
    Step second = new Step(second_ings, "Shred carrot", Duration.standardMinutes(1), false, 1);
    steps.add(second);
    List<String> third_ings = new ArrayList<>();
    third_ings.add("2 beaten eggs");
    Step third = new Step(third_ings,
            "Heat a large skillet on medium-high heat. Spray skillet with cooking spray. Scramble eggs in skillet. Remove from pan and keep warm",
            Duration.standardSeconds(60), false, 2);
    steps.add(third);
    List<String> fourth_ings = new ArrayList<>();
    fourth_ings.add("3-4 slices chopped cooked ham");
    Step fourth = new Step(fourth_ings,
            "Heat chopped ham in skillet until slightly brown. Remove from the pan and keep warm.",
            Duration.standardMinutes(2), false, 3);
    steps.add(fourth);
    List<String> fifth_ings = new ArrayList<>();
    fifth_ings.add("1 cup frozen peas");
    fifth_ings.add("carrots");
    fifth_ings.add("rice");
    fifth_ings.add("ham");
    fifth_ings.add("salt");
    fifth_ings.add("pepper");
    Step fifth = new Step(fifth_ings,
            "Add peas and carrots to skillet and cook until they are tender. Add rice, cooked eggs and ham to the skillet and mix well",
            Duration.standardMinutes(5), false, 4);
    steps.add(fifth);
    return new Recipe("Fried Rice", "ventra", steps);

}

From source file:org.eclipse.jetty.gcloud.session.GCloudSessionTestSupport.java

License:Open Source License

public void tearDown() throws Exception {
    _helper.stop(Duration.standardMinutes(1)); //wait up to 1min for shutdown
}

From source file:org.hawkular.metrics.datetime.DateTimeService.java

License:Apache License

/**
 * @return A DateTime object rounded down to the start of the current minute. For example if the current time is
 * 17:21:09, then 17:21:00 is returned.//  w  w  w .j  a  v  a  2 s .  c  o  m
 */
public static DateTime currentMinute() {
    return getTimeSlice(now.get(), Duration.standardMinutes(1));
}

From source file:org.hawkular.metrics.tasks.impl.TaskContainer.java

License:Apache License

public TaskContainer(TaskType taskType, DateTime timeSlice, int segment, String target, Set<String> sources,
        int interval, int window, Set<DateTime> failedTimeSlices) {
    this.taskType = taskType;
    this.timeSlice = timeSlice;
    this.segment = segment;
    this.target = target;
    this.sources = sources;
    this.interval = Duration.standardMinutes(interval);
    this.window = Duration.standardMinutes(window);
    this.failedTimeSlices.addAll(failedTimeSlices);
}

From source file:org.hawkular.metrics.tasks.impl.TaskSchedulerImpl.java

License:Apache License

private Date currentTimeSlice() {
    //        return dateTimeService.getTimeSlice(now(), Duration.standardSeconds(1)).toDate();
    return dateTimeService.getTimeSlice(new DateTime(tickScheduler.now()), Duration.standardMinutes(1))
            .toDate();//from  w w  w  .j  a v  a  2s.  c  o m
}