/** * @return When added to the current time, will result in some random time shortly after midnight tomorrow. */ @Override public Duration startIn() { final Duration random = TenantJob.super.startIn(); final ZonedDateTime triggerOn = DateUtil.localNow().toLocalDate() .plusDays(1) .atStartOfDay(Defaults.ZONE_ID) .plus(random); return Duration.between(DateUtil.zonedNow(), triggerOn); }
@Override public void markReloaded() { lastReloaded.set(DateUtil.now()); LOGGER.trace("Marked reloaded on {}.", this); }
public ZonkyApiToken(final String accessToken, final String refreshToken, final int expiresIn) { this(accessToken, refreshToken, expiresIn, DateUtil.offsetNow(), REFRESH_TOKEN_STRING, SCOPE_APP_WEB_STRING); }
public boolean isSelloffStarted() { if (exitProperties == null) { return false; } else { return exitProperties.getSelloffStart().isBefore(DateUtil.localNow().toLocalDate()); } }
@Test void replacesWithSynthetic() { SoftAssertions.assertSoftly(softly -> { softly.assertThat(DateUtil.now()).isEqualTo(INSTANT); softly.assertThat(DateUtil.localNow()).isEqualTo(LocalDateTime.ofInstant(INSTANT, Defaults.ZONE_ID)); softly.assertThat(DateUtil.offsetNow()).isEqualTo(OffsetDateTime.ofInstant(INSTANT, Defaults.ZONE_ID)); softly.assertThat(DateUtil.zonedNow()).isEqualTo(ZonedDateTime.ofInstant(INSTANT, Defaults.ZONE_ID)); }); }
public static Instant now() { return Instant.now(getSystemClock()); } }
public boolean isSelloffStarted() { if (exitProperties == null) { return false; } else { return exitProperties.getSelloffStart().isBefore(DateUtil.localNow().toLocalDate()); } }
public static LocalDateTime localNow() { return LocalDateTime.now(getSystemClock()); }
public ZonkyApiToken(final String accessToken, final String refreshToken, final int expiresIn,final String scope) { this(accessToken, refreshToken, expiresIn, DateUtil.offsetNow(), REFRESH_TOKEN_STRING, scope); }
public long getMonthsBeforeExit() { if (exitProperties == null) { return -1; } else { return Math.max(0, Period.between(DateUtil.localNow().toLocalDate(), exitProperties.getAccountTermination()).toTotalMonths()); } }
private boolean needsToForceMarketplaceCheck() { return lastSuccessfulMarketplaceCheck.get() .plus(FORCED_MARKETPLACE_CHECK_PERIOD) .isBefore(DateUtil.now()); }
/** * @return When added to the current time, will result in some random time shortly after midnight tomorrow. */ @Override public Duration startIn() { final Duration random = TenantJob.super.startIn(); final ZonedDateTime triggerOn = DateUtil.localNow().toLocalDate() .plusDays(1) .atStartOfDay(Defaults.ZONE_ID) .plus(random); return Duration.between(DateUtil.zonedNow(), triggerOn); }
public static ZonedDateTime zonedNow() { return ZonedDateTime.now(getSystemClock()); }
public ZonkyApiToken(final String accessToken, final String refreshToken, final int expiresIn, final OAuthScope scope) { this(accessToken, refreshToken, expiresIn, DateUtil.offsetNow(), REFRESH_TOKEN_STRING, scope); }
public long getMonthsBeforeExit() { if (exitProperties == null) { return -1; } else { return Math.max(0, Period.between(DateUtil.localNow().toLocalDate(), exitProperties.getAccountTermination()).toTotalMonths()); } }
@Override public boolean getAsBoolean() { final Instant lastReloadedInstant = lastReloaded.get(); return lastReloadedInstant == null || lastReloadedInstant.plus(reloadAfter).isBefore(DateUtil.now()); }
public static Instant now() { return Instant.now(getSystemClock()); } }
public ZonkyApiToken(final String accessToken, final String refreshToken, final int expiresIn) { this(accessToken, refreshToken, expiresIn, DateUtil.offsetNow(), REFRESH_TOKEN_STRING, OAuthScope.SCOPE_APP_WEB); }
private static long getMonthsElapsed(final Investment i) { return Period.between(i.getInvestmentDate().toLocalDate(), DateUtil.localNow().toLocalDate()).toTotalMonths(); }
@Override public boolean getAsBoolean() { final Instant lastReloadedInstant = lastReloaded.get(); return lastReloadedInstant == null || lastReloadedInstant.plus(reloadAfter.get()).isBefore(DateUtil.now()); }