List of usage examples for org.joda.time Duration standardSeconds
public static Duration standardSeconds(long seconds)
From source file:org.apache.nutch.webui.client.impl.RemoteCommandsBatchFactory.java
License:Apache License
private RemoteCommand createFetchCommand() { return createBuilder(JobType.FETCH).withTimeout(Duration.standardSeconds(50)).build(); }
From source file:org.atlasapi.remotesite.youtube.YouTubeSource.java
License:Apache License
List<Video> getVideos() { List<Video> result = Lists.newArrayList(); if (videoEntry != null && videoEntry.player != null && videoEntry.player.defaultUrl != null) { Video video = new Video("application/x-shockwave-flash", Duration.standardSeconds(videoEntry.duration), videoEntry.player.defaultUrl, topContent(), true); result.add(video);//from www .ja v a2 s .c om } return result; }
From source file:org.axonframework.eventhandling.replay.BackloggingIncomingMessageHandler.java
License:Apache License
/** * Creates a new BackloggingIncomingMessageHandler. Event Messages that have been generated more than 5 seconds * before the start of the replay are not placed in the backlog, as they are assumed to be processed by the replay * process. If the latency of the replayed cluster is expected to be more than 5 seconds, use the {@link * #BackloggingIncomingMessageHandler(org.joda.time.Duration)} constructor to provide a margin that better suits * the latency./*w w w. j a va 2s . co m*/ */ public BackloggingIncomingMessageHandler() { this(Duration.standardSeconds(5)); }
From source file:org.axonframework.integration.cdi.quickstart.saga.ToDoSaga.java
License:Apache License
@StartSaga @SagaEventHandler(associationProperty = "todoId") public void onToDoItemCreated(ToDoItemCreatedEvent event) { deadline = eventScheduler.schedule(Duration.standardSeconds(2), new ToDoItemDeadlineExpiredEvent(event.getTodoId())); }
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);/* ww w. ja v a2 s .c o m*/ 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.emonocot.model.convert.StringToDurationConverter.java
License:Open Source License
@Override public Duration convert(String source) { if (source == null || source.isEmpty()) { return null; } else {/* w w w. j a va 2 s . c o m*/ return Duration.standardSeconds(formatter.parsePeriod(source).toStandardSeconds().getSeconds()); } }
From source file:org.graylog2.lookup.adapters.CSVFileDataAdapter.java
License:Open Source License
@Override public Duration refreshInterval() { return Duration.standardSeconds(Ints.saturatedCast(config.checkInterval())); }
From source file:org.graylog2.lookup.adapters.DSVHTTPDataAdapter.java
License:Open Source License
@Override public Duration refreshInterval() { return Duration.standardSeconds(Ints.saturatedCast(config.refreshInterval())); }
From source file:org.hawkular.metrics.core.service.transformers.MetricFromDataRowTransformer.java
License:Apache License
public MetricFromDataRowTransformer(String tenantId, MetricType<T> type, int defaultTTL) { this.type = type; this.tenantId = tenantId; this.defaultDataRetention = (int) Duration.standardSeconds(defaultTTL).getStandardDays(); }
From source file:org.hawkular.metrics.core.service.transformers.MetricFromFullDataRowTransformer.java
License:Apache License
public MetricFromFullDataRowTransformer(int defaultTTL) { this.defaultDataRetention = (int) Duration.standardSeconds(defaultTTL).getStandardDays(); }