Examples of toEpochMilli()


Examples of org.threeten.bp.Instant.toEpochMilli()

        Message msg = msgIter.next();
        if (isValidMessage(msg)) {
          String securityDes = (String) msg.correlationID().object();
          MutableFudgeMsg tickMsg = s_fudgeContext.newMessage();
          Instant instant = Clock.systemUTC().instant();
          long epochMillis = instant.toEpochMilli();
          tickMsg.add(RECEIVED_TS_KEY, epochMillis);
          tickMsg.add(SECURITY_KEY, securityDes);
          tickMsg.add(FIELDS_KEY, BloombergDataUtils.parseElement(msg.asElement()));
          s_logger.debug("{}: {} - {}", new Object[]{_dateFormat
              .format(Calendar.getInstance().getTime()), securityDes, msg.messageType()});
View Full Code Here

Examples of org.threeten.bp.Instant.toEpochMilli()

        throw new OpenGammaRuntimeException("Result for " + bloombergKey + " was not found");
      }
     
      MutableFudgeMsg tickMsg = s_fudgeContext.newMessage();
      Instant instant = Clock.systemUTC().instant();
      long epochMillis = instant.toEpochMilli();
      tickMsg.add(RECEIVED_TS_KEY, epochMillis);
      tickMsg.add(SECURITY_KEY, bloombergKey);
      tickMsg.add(FIELDS_KEY, result);
      tickMsg.add(BUID_KEY, ticker2Buid.get(bloombergKey));
      try {
View Full Code Here

Examples of org.threeten.bp.Instant.toEpochMilli()

      int msgSize = _messageSizeGenerator.nextInt(MAX_MESSAGE_SIZE);
      for (int i = 0; i < msgSize; i++) {
        try {
          MutableFudgeMsg msg = getRandomMessage();
          Instant instant = Clock.systemUTC().instant();
          long epochMillis = instant.toEpochMilli();
          msg.add(RECEIVED_TS_KEY, epochMillis);
          msg.add(SECURITY_KEY, security);
          s_logger.debug("generating {}", msg);
          _writerQueue.put(msg);
        } catch (InterruptedException e) {
View Full Code Here

Examples of org.threeten.bp.Instant.toEpochMilli()

  //-------------------------------------------------------------------------
  public void test_toSqlTimestamp() {
    Instant instant = Instant.now();
    Timestamp ts = DbDateUtils.toSqlTimestamp(instant);
    assertEquals(instant.toEpochMilli(), ts.getTime());
    assertEquals(instant.getNano(), ts.getNanos());
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void test_toSqlTimestamp_LocalTime_null() {
View Full Code Here

Examples of org.threeten.bp.Instant.toEpochMilli()

  public void test_fromSqlTimestamp() {
    Timestamp ts = new Timestamp(123456789L);
    ts.setNanos(789654321);
    Instant instant = DbDateUtils.fromSqlTimestamp(ts);
    assertEquals(ts.getTime(), instant.toEpochMilli());
    assertEquals(ts.getNanos(), instant.getNano());
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void test_fromSqlTimestamp_null() {
View Full Code Here

Examples of org.threeten.bp.Instant.toEpochMilli()

  public void test_fromSqlTimestampNullFarFuture() {
    Timestamp ts = new Timestamp(123456789L);
    ts.setNanos(789654321);
    Instant instant = DbDateUtils.fromSqlTimestampNullFarFuture(ts);
    assertEquals(ts.getTime(), instant.toEpochMilli());
    assertEquals(ts.getNanos(), instant.getNano());
  }

  public void test_fromSqlTimestampNullFarFuture_max() {
    assertNull(DbDateUtils.fromSqlTimestampNullFarFuture(DbDateUtils.MAX_SQL_TIMESTAMP));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.