Example usage for java.time Instant MIN

List of usage examples for java.time Instant MIN

Introduction

In this page you can find the example usage for java.time Instant MIN.

Prototype

Instant MIN

To view the source code for java.time Instant MIN.

Click Source Link

Document

The minimum supported Instant , '-1000000000-01-01T00:00Z'.

Usage

From source file:Main.java

public static void main(String[] args) {
    Instant instant = Instant.MIN;
    System.out.println(instant.getEpochSecond());

}

From source file:org.ulyssis.ipp.snapshot.StartEvent.java

/**
 * Private constructor for Jackson
 */
private StartEvent() {
    super(Instant.MIN);
}

From source file:org.ulyssis.ipp.snapshot.EndEvent.java

/**
 * Constructor for Jackson
 */
@SuppressWarnings("unused")
private EndEvent() {
    super(Instant.MIN);
}

From source file:org.ulyssis.ipp.snapshot.CorrectionEvent.java

/**
 * Constructor for Jackson
 */
@SuppressWarnings("unused")
private CorrectionEvent() {
    super(Instant.MIN);
}

From source file:com.offbynull.voip.kademlia.model.Router.java

/**
 * Constructs a {@link Router} object.//from  w w  w  .j  av  a 2  s .c om
 * @param baseId ID of the node that this router is for
 * @param branchStrategy branching strategy for the route tree to be created by this router (dictates how many branches to create at
 * each depth)
 * @param bucketStrategy bucket strategy for the route tree to be created by this router (dictates k-bucket parameters for each
 * k-bucket)
 * @throws NullPointerException if any argument is {@code null}
 * @throws IllegalStateException if either {@code branchStrategy} or {@code bucketStrategy} generates invalid data (see interfaces for
 * restrictions)
 */
public Router(Id baseId, RouteTreeBranchStrategy branchStrategy, RouteTreeBucketStrategy bucketStrategy) {
    Validate.notNull(baseId);
    Validate.notNull(branchStrategy);
    Validate.notNull(bucketStrategy);

    this.baseId = baseId;
    this.routeTree = new RouteTree(baseId, branchStrategy, bucketStrategy);
    this.lastTouchTime = Instant.MIN;
}

From source file:com.offbynull.voip.kademlia.model.RouteTree.java

/**
 * Construct a {@link RouteTree} object.
 * @param baseId ID of the node that this route tree is for
 * @param branchStrategy branching strategy (dictates how many branches to create at each depth)
 * @param bucketStrategy bucket strategy (dictates k-bucket parameters for each k-bucket)
 * @throws NullPointerException if any argument is {@code null}
 * @throws IllegalStateException if either {@code branchStrategy} or {@code bucketStrategy} generates invalid data (see interfaces for
 * restrictions)/*from   w  w w.j a v a  2s  .  c om*/
 */
public RouteTree(Id baseId, // because id's are always > 0 in size -- it isn't possible for tree creation to mess up
        RouteTreeBranchStrategy branchStrategy, RouteTreeBucketStrategy bucketStrategy) {
    Validate.notNull(baseId);
    Validate.notNull(branchStrategy);
    Validate.notNull(bucketStrategy);

    this.baseId = baseId; // must be set before creating RouteTreeLevels
    this.bucketUpdateTimes = new TimeSet<>();

    root = createRoot(branchStrategy, bucketStrategy);
    RouteTreeNode child = root;
    while (child != null) {
        child = growParent(child, branchStrategy, bucketStrategy);
    }

    // Special case: the routing tree has a bucket for baseId. Nothing can ever access that bucket (calls to
    // touch/stale/find with your own ID will result an exception) and it'll always be empty, so remove it from bucketUpdateTimes.
    bucketUpdateTimes.remove(baseId.getBitString());

    this.lastTouchTime = Instant.MIN;
}

From source file:org.openhab.binding.dwdunwetter.internal.data.DwdWarningsData.java

private Instant getTimestampValue(XMLEventReader eventReader) throws XMLStreamException {
    XMLEvent event = eventReader.nextEvent();
    String dateTimeString = event.asCharacters().getData();
    try {/*from  w  w w . j  av a 2  s  . c  o m*/
        OffsetDateTime dateTime = OffsetDateTime.parse(dateTimeString, formatter);
        return dateTime.toInstant();
    } catch (DateTimeParseException e) {
        logger.debug("Exception while parsing a DateTime", e);
        return Instant.MIN;
    }
}

From source file:se.curity.examples.oauth.jwt.JwkManager.java

private void ensureCacheIsFresh() {
    _logger.info("Called ensureCacheIsFresh");
    Instant lastLoading = _jsonWebKeyByKID.getLastReloadInstant().orElseGet(() -> Instant.MIN);
    boolean cacheIsNotFresh = lastLoading
            .isBefore(Instant.now().minus(_jsonWebKeyByKID.getMinTimeBetweenReloads()));

    if (cacheIsNotFresh) {
        _logger.info("Invalidating JSON WebKeyID cache");
        _jsonWebKeyByKID.clear();//from  w  w w. j av  a  2s .  com
    }
}

From source file:com.offbynull.voip.kademlia.model.KBucket.java

/**
 * Constructs a {@link KBucket} object.//w ww .  j  a va2 s. c  o m
 * @param baseId ID of the node this k-bucket belongs to
 * @param prefix prefix that nodes stored in this k-bucket must have
 * @param maxBucketSize maximum number of nodes allowed in this k-bucket (the k value)
 * @param maxCacheSize maximum number of nodes allowed in this k-bucket's replacement cache
 * @throws NullPointerException if any argument is {@code null}
 * @throws IllegalArgumentException if {@code prefix.getBitLength() > baseId.getBitLength()}, or if any numeric argument is less than
 * {@code 0}
 */
public KBucket(Id baseId, BitString prefix, int maxBucketSize, int maxCacheSize) {
    Validate.notNull(baseId);
    Validate.isTrue(prefix.getBitLength() <= baseId.getBitLength());
    // Let this thru anyways, because without it bucket splitting logic will become slightly more convolouted. That is, in a certain
    // case a bucket would be split such that one of the new buckets may == baseId.
    //        Validate.isTrue(!baseId.getBitString().equals(prefix)); // baseId cannot == prefix, because then you'd have an empty bucket that
    //                                                                // you can't add anything to ... no point in having a bucket with your
    //                                                                // own ID in it
    Validate.isTrue(maxBucketSize >= 0); // what's the point of a 0 size kbucket? let it thru anyways
    Validate.isTrue(maxCacheSize >= 0); // a cache size of 0 is not worthless...  may not care about having a replacement cache of nodes

    this.baseId = baseId;
    this.prefix = prefix;
    this.bucket = new NodeLeastRecentSet(baseId, maxBucketSize);
    this.cache = new NodeMostRecentSet(baseId, maxCacheSize);
    this.staleSet = new LinkedHashSet<>(); // maintain order they're added, when replacing we want to replace oldest stale first
    this.lockSet = new HashSet<>();

    lastTouchAttemptTime = Instant.MIN;
}

From source file:eu.hansolo.fx.weatherfx.darksky.DarkSky.java

public DarkSky(final double LATITUDE, final double LONGITUDE) {
    latitude = LATITUDE;/*ww  w  .j  ava  2s.c  o  m*/
    longitude = LONGITUDE;
    language = Language.ENGLISH;
    unit = Unit.CA;
    timeZone = TimeZone.getDefault();
    today = new DataPoint();
    forecast = new LinkedList<>();
    alerts = new LinkedList<>();
    lastUpdate = Instant.MIN;
}