Package org.xmlBlaster.util

Examples of org.xmlBlaster.util.Timestamp


      }

      // is it a remote connect ?
      ClientProperty clientProperty = subscribeQosData.getClientProperty(Constants.PERSISTENCE_ID);
      if (clientProperty == null) {
         long uniqueId = new Timestamp().getTimestamp();
         subscribeQosData.getClientProperties().put(Constants.PERSISTENCE_ID, new ClientProperty(Constants.PERSISTENCE_ID, "long", null, "" + uniqueId));
         QueryKeyData subscribeKeyData = (QueryKeyData)data;

         // to be found when the client usubscribes after a server crash ...
         subscribeQosData.setSubscriptionId(subscriptionInfo.getSubscriptionId());
View Full Code Here


            xml = FileLocator.readAsciiFile(inFile);
         }
         String content = (!isQos) ? xml : "";
         String qos = (isQos) ? xml : "<qos/>";
         MsgUnit msgUnit = new MsgUnit("<key oid='Hello'/>", content, qos);
         msgUnit.getQosData().setRcvTimestamp(new Timestamp());
         SessionInfo sessionInfo = null;

         PluginInfo info = new PluginInfo(glob, null, "XPathFilter", "1.0");
         info.getParameters().put(MATCH_AGAINST_QOS, ""+isQos);
         if (xslFile != null)
View Full Code Here

   /**
    * @return .e.g "HelloWorld-2002-02-10 10:52:40.879456789"
    */
   public String createFileName(String oid, long timestamp) {
      //return oid + "-" + timestamp;
      Timestamp ts = new Timestamp(timestamp);
      return Global.getStrippedString(oid + "-" + ts.toString());
   }
View Full Code Here

    * @param storageId TODO
    */
   public SessionEntry(String qos, long uniqueId, long size, StorageId storageId) {
      if (size < 1L) this.size = qos.length();
      else this.size = size;
      if (uniqueId < 1L) this.uniqueId = new Timestamp().getTimestamp()
      this.qos = qos;
      this.uniqueId = uniqueId;
      this.uniqueIdStr = "" + this.uniqueId;
      this.storageId = storageId;
   }
View Full Code Here

      if (emailData.isExpired(msgIdFileName))
         return DISCARD;

      if (this.holdbackExpireTimeout > 0) {
         Timestamp timestamp = new Timestamp();
         this.holdbackMap.put(new Long(timestamp.getTimestamp()), emailData);
         log.warning("None of our registered listeners '" + getListeners()
               + "' matches for key=" + key + ", email '"
               + emailData.extractMessageId(EmailData.METHODNAME_TAG, msgIdFileName)
               + "' is holdback in RAM, we try later again");
      }
View Full Code Here

    * after the responseTimeout.
    */
   private void tryToDeliverHoldbackMails(String msgIdFileName) {
      if (this.holdbackExpireTimeout > 0 && getNumberOfHoldbackEmails() > 0) {
         Long[] keys = getHoldbackTimestamps();
         Timestamp now = new Timestamp();
         for (int i = 0; i < keys.length; i++) {
            long tt = new Timestamp(keys[i].longValue()).getMillis();
            EmailData emailData = (EmailData)this.holdbackMap.get(keys[i]);
            if ((tt + this.holdbackExpireTimeout) < now.getMillis()) {
               log.warning("Can't deliver holdback email, we discard it now: " + emailData.toString());
               this.holdbackMap.remove(keys[i]);
               handleLostEmail(emailData);
            } else {
               String listenerKey = notify(emailData, true, msgIdFileName);
View Full Code Here

   /**
    * This constructor takes all parameters needed
    */
   public PluginConfig(Global glob, String id, boolean create, String className, String jar, Properties attributes, Vector actions) {
      this.uniqueTimestamp = new Timestamp();
      this.glob = glob;

      //if (log.isLoggable(Level.FINER)) this.log.call(ME, "constructor");
      //if (log.isLoggable(Level.FINE))
      //   log.trace(ME, "constructor id='" + id + "', className='" + className + "'");
View Full Code Here

    */
   private void initSubscriptionId() throws XmlBlasterException {
      if (this.uniqueKey == null) {
         if (this.querySub != null) {
            StringBuffer buf = new StringBuffer(126);
            Timestamp tt = new Timestamp();
            // Using prefix of my parent XPATH subscription object:
            buf.append(this.querySub.getSubscriptionId()).append(":").append(String.valueOf(tt.getTimestamp()));
            this.uniqueKey = buf.toString();
            if (log.isLoggable(Level.FINE)) log.fine("Generated child subscription ID=" + this.uniqueKey);
         }
         else {
            this.uniqueKey = SubscriptionInfo.generateUniqueKey(keyData, this.subscribeQos.getData(), this.glob.useCluster());
View Full Code Here

      if (clusterWideUnique) { // needs to be accepted by other cluster nodes
         buf.append(keyData.getGlobal().getNodeId().getId()).append("-");
      }
      if (keyData.isQuery())
         buf.append(keyData.getQueryType());
      Timestamp tt = new Timestamp();
      buf.append(String.valueOf(tt.getTimestamp()));
      return buf.toString();
   }
View Full Code Here

         this.size = size;
      this.key = key;
      this.qos = qos;
      this.sessionName = sessionName;
      if (uniqueId < 1L)
         this.uniqueId = new Timestamp().getTimestamp();
      else
         this.uniqueId = uniqueId;
      this.uniqueIdStr = "" + this.uniqueId;
      this.storageId = storageId;
   }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.Timestamp

Copyright © 2018 www.massapicom. 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.