Examples of Timestamp


Examples of oracle.sql.TIMESTAMP

  public static String convertDate(Object date) {
    String result = null;
    if (date!=null) {
      if (date instanceof TIMESTAMP){
        try {
           TIMESTAMP ts = (TIMESTAMP)date;
           Date dateTemp =   new Date(ts.timestampValue().getTime());
           result = dfyyyyMMddHHMMSS.format(dateTemp);
            
        } catch (SQLException e) {
          e.printStackTrace();
        }
View Full Code Here

Examples of org.apache.commons.net.ntp.TimeStamp

        if (refName != null && refName.length() > 1) {
            refAddr += " (" + refName + ")";
        }
        System.out.println(" Reference Identifier:\t" + refAddr);

        TimeStamp refNtpTime = message.getReferenceTimeStamp();
        System.out.println(" Reference Timestamp:\t" + refNtpTime + "  " + refNtpTime.toDateString());

        // Originate Time is time request sent by client (t1)
        TimeStamp origNtpTime = message.getOriginateTimeStamp();
        System.out.println(" Originate Timestamp:\t" + origNtpTime + "  " + origNtpTime.toDateString());

        long destTime = info.getReturnTime();
        // Receive Time is time request received by server (t2)
        TimeStamp rcvNtpTime = message.getReceiveTimeStamp();
        System.out.println(" Receive Timestamp:\t" + rcvNtpTime + "  " + rcvNtpTime.toDateString());

        // Transmit time is time reply sent by server (t3)
        TimeStamp xmitNtpTime = message.getTransmitTimeStamp();
        System.out.println(" Transmit Timestamp:\t" + xmitNtpTime + "  " + xmitNtpTime.toDateString());

        // Destination time is time reply received by client (t4)
        TimeStamp destNtpTime = TimeStamp.getNtpTime(destTime);
        System.out.println(" Destination Timestamp:\t" + destNtpTime + "  " + destNtpTime.toDateString());

        info.computeDetails(); // compute offset/delay if not already done
        Long offsetValue = info.getOffset();
        Long delayValue = info.getDelay();
        String delay = (delayValue == null) ? "N/A" : delayValue.toString();
View Full Code Here

Examples of org.apache.isis.applib.value.TimeStamp

                will(returnValue(null));
            }
        });

        TestClock.initialize();
        timestamp = new TimeStamp(0);
        holder = new FacetHolderImpl();
        setValue(adapter = new TimeStampValueSemanticsProvider(holder, mockConfiguration, mockContext));
    }
View Full Code Here

Examples of org.apache.tomcat.util.buf.TimeStamp

      session.setState( ServerSession.STATE_INVALID );
  }
    }

    public int sessionState( Request req, ServerSession session, int state ) {
  TimeStamp ts=session.getTimeStamp();

  if( state==ServerSession.STATE_INVALID ) {
      // session moved to expire state - remove all attributes from
      // storage
      SimpleSessionManager ssm=(SimpleSessionManager)session.getManager();
View Full Code Here

Examples of org.apache.ws.security.message.token.Timestamp

       
        // At this point we received a (required) Timestamp. Now check that it is integrity protected.
        if (transportBinding) {
            return true;
        } else if (!signedResults.isEmpty()) {
            Timestamp timestamp =
                (Timestamp)timestampResults.get(0).get(WSSecurityEngineResult.TAG_TIMESTAMP);
            for (WSSecurityEngineResult signedResult : signedResults) {
                List<WSDataRef> dataRefs =
                    CastUtils.cast((List<?>)signedResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS));
                for (WSDataRef dataRef : dataRefs) {
                    if (timestamp.getElement() == dataRef.getProtectedElement()) {
                        return true;
                    }
                }
            }
        }
View Full Code Here

Examples of org.apache.wss4j.dom.message.token.Timestamp

            return;
        }
       
        // Find the Timestamp
        List<WSSecurityEngineResult> foundResults = wsDocInfo.getResultsByTag(WSConstants.TS);
        Timestamp timeStamp = null;
        if (foundResults.isEmpty()) {
            // Search for a Timestamp below the Signature
            Node sibling = signatureElement.getNextSibling();
            while (sibling != null) {
                if (sibling instanceof Element
                    && WSConstants.TIMESTAMP_TOKEN_LN.equals(sibling.getLocalName())
                    && WSConstants.WSU_NS.equals(sibling.getNamespaceURI())) {
                    timeStamp = new Timestamp((Element)sibling, requestData.getBSPEnforcer());
                    break;
                }
                sibling = sibling.getNextSibling();
            }
        } else {
            timeStamp = (Timestamp)foundResults.get(0).get(WSSecurityEngineResult.TAG_TIMESTAMP);
        }
        if (timeStamp == null) {
            return;
        }
       
        // Test for replay attacks
        Date created = timeStamp.getCreated();
        DateFormat zulu = new XmlSchemaDateFormat();
        String identifier = zulu.format(created) + "" + Arrays.hashCode(signatureValue);

        if (replayCache.contains(identifier)) {
            throw new WSSecurityException(
                WSSecurityException.ErrorCode.INVALID_SECURITY,
                "invalidTimestamp",
                "A replay attack has been detected");
        }

        // Store the Timestamp/SignatureValue combination in the cache
        Date expires = timeStamp.getExpires();
        if (expires != null) {
            Date rightNow = new Date();
            long currentTime = rightNow.getTime();
            long expiresTime = expires.getTime();
            replayCache.add(identifier, 1L + (expiresTime - currentTime) / 1000L);
View Full Code Here

Examples of org.archive.wayback.core.Timestamp

    req.setRequestUrl(url.toString());
    req.put(WaybackConstants.REQUEST_TYPE,
        WaybackConstants.REQUEST_CLOSEST_QUERY);
    req.put(WaybackConstants.REQUEST_EXACT_DATE,
        Timestamp.currentTimestamp().getDateStr());
    Timestamp earliest = null;
    if(bUseOlder) {
      earliest = Timestamp.earliestTimestamp();
    } else {
      Date d = new Date(System.currentTimeMillis() - maxCacheMS);
      earliest = new Timestamp(d);
    }
    req.put(WaybackConstants.REQUEST_START_DATE,earliest.getDateStr());
    // for now, assume all live web requests are only satisfiable by the
    // exact host -- no massaging.
    req.put(WaybackConstants.REQUEST_EXACT_HOST_ONLY,
        WaybackConstants.REQUEST_YES);
    return req;
View Full Code Here

Examples of org.archive.wayback.util.Timestamp

    } else {
      data.remove(key);
    }
  }
  protected String dateToTS(Date date) {
    return new Timestamp(date).getDateStr();
  }
View Full Code Here

Examples of org.ardverk.lang.TimeStamp

 
  public DHTFuture<QuickenEntity> quicken(QuickenConfig config) {
   
    QuickenConfig cfg = configProvider.get(config);
   
    TimeStamp creationTime = TimeStamp.now();
   
    List<DHTFuture<PingEntity>> pingFutures = new ArrayList<>();
    List<DHTFuture<NodeEntity>> discoveryFutures = new ArrayList<>();
   
    synchronized (routeTable) {
      int pingCount = (int)(routeTable.getK() * cfg.getPingCount());
     
      Contact localhost = routeTable.getIdentity();
      KUID localhostId = localhost.getId();

      if (0 < pingCount) {
        PingConfig pingConfig = cfg.getPingConfig();
        long contactTimeout = cfg.getContactTimeoutInMillis();
       
        Contact[] contacts = routeTable.select(localhostId, pingCount);
        for (Contact contact : contacts) {
          // Don't send PINGs to the localhost!
          if (contact.equals(localhost)) {
            continue;
          }
         
          if (contact.isTimeout(contactTimeout, TimeUnit.MILLISECONDS)) {
            DHTFuture<PingEntity> future
              = pingManager.ping(contact, pingConfig);
            pingFutures.add(future);
          }
        }
      }
     
      NodeConfig lookupConfig = cfg.getLookupConfig();
      long bucketTimeout = cfg.getBucketTimeoutInMillis();
     
      Bucket[] buckets = routeTable.getBuckets();
      IdentifierUtils.byXor(buckets, localhostId);
     
      for (Bucket bucket : buckets) {
        if (bucket.contains(localhostId)) {
          continue;
        }
       
        TimeStamp timeStamp = bucket.getTimeStamp();
        if (timeStamp.getAgeInMillis() < bucketTimeout) {
          continue;
        }
       
        // Select a random ID with this prefix
        KUID randomId = KUID.createWithPrefix(
View Full Code Here

Examples of org.dmg.pmml.Timestamp

   */
  public static PMML buildSkeletonPMML() {
    String formattedDate =
        new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZZ", Locale.ENGLISH).format(new Date());
    Header header = new Header();
    header.setTimestamp(new Timestamp().withContent(formattedDate));
    header.setApplication(new Application("Oryx"));
    return new PMML(header, null, "4.2.1");
  }
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.