Example usage for org.joda.time Duration standardHours

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

Introduction

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

Prototype

public static Duration standardHours(long hours) 

Source Link

Document

Create a duration with the specified number of hours assuming that there are the standard number of milliseconds in an hour.

Usage

From source file:com.predic8.membrane.core.interceptor.ratelimit.RateLimitInterceptor.java

License:Apache License

public RateLimitInterceptor() {
    this(Duration.standardHours(1), 1000);
}

From source file:com.sg.infrastructure.AuthTokenServiceImpl.java

private Duration getDurationForTokenType(TokenType type) {
    switch (type) {
    case WEB_SESSION_TOKEN:
        return Duration.standardHours(1l);
    case REGISTRATION_CONFIRMATION_TOKEN:
        return Duration.standardDays(60l);
    case PASWORD_RESET_TOKEN:
        return Duration.standardDays(1l);
    }// w  w w  .  j a  v  a  2s . c  om
    return null;
}

From source file:com.tomtom.speedtools.metrics.MetricsCollector.java

License:Apache License

@Nonnull
public static MetricsCollector create(@Nonnull final Period interval) {
    assert interval != null;
    switch (interval) {

    case LAST_MONTH:
        return new MetricsCollector(Duration.standardDays(30), 30);

    case LAST_WEEK:
        return new MetricsCollector(Duration.standardDays(7), 24 * 7);

    case LAST_DAY:
        return new MetricsCollector(Duration.standardDays(1), 48);

    case LAST_HOUR:
        return new MetricsCollector(Duration.standardHours(1), 60);

    case LAST_MINUTE:
        return new MetricsCollector(Duration.standardMinutes(1), 30);
    }//from   w  w w .ja v  a2 s .c o  m
    assert false;
    throw new IllegalStateException();
}

From source file:domains.donuts.config.DonutsRegistryConfig.java

License:Open Source License

@Override
public Duration getDomainLabelListCacheDuration() {
    return Duration.standardHours(1);
}

From source file:google.registry.config.ConfigModule.java

License:Open Source License

/**
 * Maximum amount of time generating an escrow deposit for a TLD could take, before killing.
 *
 * @see google.registry.rde.RdeStagingReducer
 *//*from w  w  w  . ja v a  2  s.c  o m*/
@Provides
@Config("rdeStagingLockTimeout")
public static Duration provideRdeStagingLockTimeout() {
    return Duration.standardHours(5);
}

From source file:google.registry.config.ConfigModule.java

License:Open Source License

/**
 * Minimum amount of time to wait between consecutive SFTP uploads on a single TLD.
 *
 * <p>This value was communicated to us by the escrow provider.
 *
 * @see google.registry.rde.RdeStagingReducer
 *//*from  w  w  w  .  j  a  v a  2  s. c  om*/
@Provides
@Config("rdeUploadSftpCooldown")
public static Duration provideRdeUploadSftpCooldown() {
    return Duration.standardHours(2);
}

From source file:google.registry.config.ConfigModule.java

License:Open Source License

/**
 * Maximum amount of time for syncing a spreadsheet, before killing.
 *
 * @see google.registry.export.sheet.SyncRegistrarsSheetAction
 *//*from  w  w  w  . j a va2  s. c o  m*/
@Provides
@Config("sheetLockTimeout")
public static Duration provideSheetLockTimeout() {
    return Duration.standardHours(1);
}

From source file:google.registry.config.RegistryConfig.java

License:Open Source License

/**
 * Returns the amount of time a domain label list should be cached in memory before expiring.
 *
 * @see google.registry.model.registry.label.ReservedList
 * @see google.registry.model.registry.label.PremiumList
 *///from   w w w. j  a  v  a2  s .  co m
public static Duration getDomainLabelListCacheDuration() {
    switch (RegistryEnvironment.get()) {
    case UNITTEST:
        return Duration.ZERO;
    default:
        return Duration.standardHours(1);
    }
}

From source file:google.registry.dns.writer.dnsupdate.DnsUpdateConfigModule.java

License:Open Source License

/**
 * The DNS time-to-live (TTL) for resource records created by the registry.
 *//*from  w  ww .  java 2 s .c o m*/
@Provides
@Config("dnsUpdateTimeToLive")
public static Duration provideDnsUpdateTimeToLive() {
    return Duration.standardHours(2);
}

From source file:io.ehdev.android.drivingtime.view.activity.RootActivity.java

License:Open Source License

private DialogFragment getInsertRecordDialog() throws SQLException {
    List<Task> drivingTaskList = databaseHelper.getTaskDao().queryForAll();
    if (drivingTaskList.size() == 0) {
        return new EditTaskDialog(new Task("", Duration.standardHours(1)), new PostEditExecution() {
            @Override//from  www.j ava  2s  .com
            public void execute() {
            }
        });
    } else {
        Record drivingRecord = new Record(drivingTaskList.get(0), new DateTime(), Duration.standardHours(1));
        return new InsertRecordDialogNoUpdate(drivingRecord, drivingTaskList, reloadView());
    }

}