Package org.xmlBlaster.util.qos

Examples of org.xmlBlaster.util.qos.ClientProperty


      if (obj == null) {
         log.fine("The client property '" + DbWatcherConstants._COMPRESSION_TYPE + "' was not found. Will not expand");
         return buffer;
      }
      if (obj instanceof String)
         obj = new ClientProperty(DbWatcherConstants._COMPRESSION_TYPE, null, null, (String)obj);
      ClientProperty prop = (ClientProperty)obj;
      String compressionType = prop.getStringValue().trim();
      if (DbWatcherConstants.COMPRESSION_TYPE_GZIP.equals(compressionType)) {
         obj = clientProperties.get(DbWatcherConstants._UNCOMPRESSED_SIZE);
         if (obj == null) {
            log.severe("Can not expand message since no uncompressed size defined (will return it unexpanded)");
            return buffer;
         }
         if (obj instanceof String)
            obj = new ClientProperty(DbWatcherConstants._UNCOMPRESSED_SIZE, null, null, (String)obj);
         prop = (ClientProperty)obj;
        
         ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
         byte[] ret = null;
         try {
View Full Code Here


      if (obj == null) {
         log.fine("The client property '" + DbWatcherConstants._COMPRESSION_TYPE + "' was not found. Will not expand");
         return is;
      }
      if (obj instanceof String)
         obj = new ClientProperty(DbWatcherConstants._COMPRESSION_TYPE, null, null, (String)obj);
      ClientProperty prop = (ClientProperty)obj;
      String compressionType = prop.getStringValue().trim();
      if (DbWatcherConstants.COMPRESSION_TYPE_GZIP.equals(compressionType)) {
         obj = clientProperties.get(DbWatcherConstants._UNCOMPRESSED_SIZE);
         if (obj == null) {
            log.severe("Can not expand message since no uncompressed size defined (will return it unexpanded)");
            return is;
         }
         if (obj instanceof String)
            obj = new ClientProperty(DbWatcherConstants._UNCOMPRESSED_SIZE, null, null, (String)obj);
         prop = (ClientProperty)obj;
        
         try {
            GZIPInputStream ret = new GZIPInputStream(is);
            clientProperties.remove(DbWatcherConstants._COMPRESSION_TYPE);
View Full Code Here

      boolean isLastMsg = true;
      String exMsg = null;
      long chunkCount = 0L;

      if (attrMap != null) {
         ClientProperty prop = (ClientProperty)attrMap.get(FILENAME_ATTR);
         if (prop == null) {
            prop = (ClientProperty)attrMap.get(FILENAME_ATTR_OLD_FASHION);
         }
         if (prop != null)
            filename = prop.getStringValue();
         if (filename == null || filename.length() < 1) {
            prop = (ClientProperty)attrMap.get(TIMESTAMP_ATTR);
            if (prop != null) {
               String timestamp = prop.getStringValue();
               filename = "xbl" + timestamp + ".msg";
            }
            else
               throw new Exception("update: the message '" + topic + "' should contain either the filename or the timestamp in the properties, but none was found. Can not create a filename to store the data on.");
         }
         prop = (ClientProperty)attrMap.get(SUBDIR_ATTR);
         if (prop != null) {
            subDir = prop.getStringValue();
         }

         prop = XBMessage.get(XBConnectionMetaData.JMSX_GROUP_SEQ, attrMap);
         if (prop != null) {
            isLastMsg = false;
            chunkCount = prop.getLongValue();
            prop = XBMessage.get(XBConnectionMetaData.JMSX_GROUP_EOF, attrMap);
            if (prop != null) {
               isLastMsg = prop.getBooleanValue();
               prop = XBMessage.get(XBConnectionMetaData.JMSX_GROUP_EX, attrMap);
               if (prop != null)
                  exMsg = prop.getStringValue();
            }
         }
         else
            isLastMsg = true;
      }
View Full Code Here

         if (is != null)
            msg = new String(ReplManagerPlugin.getContent(is));
         // this comes from the requesting ReplSlave
         log.info("update for '" + topic + "' and msg='" + msg + "'");
         if (REPL_REQUEST_UPDATE.equals(msg)) {
            ClientProperty prop = (ClientProperty)attrMap.get("_sender");
            if (prop == null)
               throw new Exception("update for '" + msg + "' failed since no '_sender' specified");
            String replManagerAddress = prop.getStringValue();

            String replTopic = source.getTopic();
            if (replTopic == null)
               throw new Exception("update for '" + msg + "' failed since the property 'mom.topicName' has not been defined. Check your DbWatcher Configuration file");

            prop = (ClientProperty)attrMap.get(SLAVE_NAME);
            if (prop == null)
               throw new Exception("update for '" + msg + "' failed since no '_slaveName' specified");
            String slaveName = prop.getStringValue();
           
            prop = (ClientProperty)attrMap.get(REPL_VERSION);
            String requestedVersion = null;
            if (prop != null)
               requestedVersion = prop.getStringValue();
            // this.dbSpecific.initiateUpdate(replTopic, destination, slaveName);
            prop = (ClientProperty)attrMap.get(INITIAL_FILES_LOCATION);
            String initialFilesLocation = null;
            if (prop != null)
               initialFilesLocation = prop.getStringValue();
           
            prop = (ClientProperty)attrMap.get(INITIAL_UPDATE_ONLY_REGISTER);
            boolean onlyRegister = false;
            if (prop != null)
               onlyRegister = prop.getBooleanValue();
           
            // String slaveName, String replVersion, String initialFilesLocation, boolean onlyRegister
            source.initialUpdate(replTopic, replManagerAddress, slaveName, requestedVersion, initialFilesLocation, onlyRegister);
           
         }
         else if (REPL_REQUEST_CANCEL_UPDATE.equals(msg)) {
            // do cancel
            ClientProperty prop = (ClientProperty)attrMap.get(SLAVE_NAME);
            if (prop == null)
               throw new Exception("update for '" + msg + "' failed since no '_slaveName' specified");
            String slaveName = prop.getStringValue();
            source.cancelUpdate(slaveName);
         }
         else if (REPL_REQUEST_RECREATE_TRIGGERS.equals(msg)) {
            source.recreateTriggers();
         }
View Full Code Here

      return qosData;
   }
  
   private void prepareQosMap(Map props) {
      messageSeq++;
      ClientProperty prop = new ClientProperty(MESSAGE_SEQ, Constants.TYPE_LONG, null, "" + messageSeq);
      props.put(MESSAGE_SEQ, prop);
      prop = new ClientProperty(REPL_KEY_ATTR, Constants.TYPE_LONG, null, "" + messageSeq);
      props.put(REPL_KEY_ATTR, prop);
      prop = new ClientProperty(TRANSACTION_SEQ, Constants.TYPE_LONG, null, "" + messageSeq);
      props.put(TRANSACTION_SEQ, prop);
      prop = new ClientProperty(ABSOLUTE_COUNT, Constants.TYPE_BOOLEAN, null, "true");
      props.put(ABSOLUTE_COUNT, prop);
   }
View Full Code Here

            // do connect
            SubscribeEntry entry = (SubscribeEntry)entries[i];
            String qos = entry.getQos();
            QueryQosData qosData = global.getQueryQosFactory().readObject(qos);

            ClientProperty clientProperty = qosData.getClientProperty(Constants.PERSISTENCE_ID);
            if (clientProperty == null) {
               log.severe("SubscribeQos with missing " + Constants.PERSISTENCE_ID + ": " + qosData.toXml());
               long uniqueId = new Timestamp().getTimestamp();
               qosData.getClientProperties().put(Constants.PERSISTENCE_ID, new ClientProperty(Constants.PERSISTENCE_ID, "long", null, "" + uniqueId));
            }

            boolean initialUpdates = qosData.getInitialUpdateProp().getValue();
            if (initialUpdates) {
               qosData.getClientProperties().put(ORIGINAL_INITIAL_UPDATES, new ClientProperty(ORIGINAL_INITIAL_UPDATES, "boolean", null, "true"));
            }
            SessionName sessionName = new SessionName(this.global, entry.getSessionName());
            String sessionId = (String)sessionIds.get(sessionName.getAbsoluteName());
            if (sessionId == null) {
               log.severe("The persistent session '" + sessionName.getAbsoluteName() + "' is not found, removing persistent subscription " + entry.getLogId());
View Full Code Here

         sessionInfo.getConnectQos().getData().setPersistent(true);
         this.addOrUpdateSession(sessionInfo);
      }

      // 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());
         SubscribeEntry entry = new SubscribeEntry(subscribeKeyData.toXml(), subscribeQosData.toXml(), sessionInfo
               .getConnectQos().getSessionName().getAbsoluteName(), uniqueId, 0L, null);
         if (log.isLoggable(Level.FINE)) log.fine("subscriptionAdd: putting to persistence NEW entry '" + entry.getUniqueId() + "' key='" + subscribeKeyData.toXml() + "' qos='" + subscribeQosData.toXml() + "' secretSessionId='" + sessionInfo.getSecretSessionId() + "'");
         subscriptionInfo.setPersistenceId(uniqueId);
         this.subscribeStore.put(entry);
      }
      else  {    // ... or from a recovery ?
         // TODO handle by recoverSubscriptions(..)
         // No remove: To avoid danger of looping we keep the marker (Marcel 2005-08-08)
         //   subscribeQosData.getClientProperties().remove(Constants.PERSISTENCE_ID);

         long uniqueId = clientProperty.getLongValue();
         if (log.isLoggable(Level.FINE)) log.fine("subscriptionAdd: filling OLD uniqueId into subscriptionInfo '" + uniqueId + "'");
         subscriptionInfo.setPersistenceId(uniqueId);
         ClientProperty prop = subscribeQosData.getClientProperty(ORIGINAL_INITIAL_UPDATES);
         if (prop != null) {
            if (subscriptionInfo.getSubscribeQosServer() != null) {
               subscriptionInfo.getSubscribeQosServer().inhibitInitalUpdates(true);
               subscribeQosData.getClientProperties().remove(ORIGINAL_INITIAL_UPDATES);
            }
View Full Code Here

            return null; // then no entry found.
         // we don't need context and string.
         String value = rs.getString(3);
         String type = rs.getString(4);
         String encoding = rs.getString(5);
         return new ClientProperty(key, type, encoding, value);
      }
      finally {
         if (st != null) {
            try {
               st.close();
View Full Code Here

      if (obj == null)
         return null;
      if (!(obj instanceof ClientProperty))
         return null;
     
      ClientProperty prop = (ClientProperty)obj;
      return prop.getStringValue();
   }
View Full Code Here

      if (obj == null)
         return null;
      if (!(obj instanceof ClientProperty))
         return null;
     
      ClientProperty prop = (ClientProperty)obj;
      String ret = prop.getStringValue();
      if (ret != null) {
         return this.helper.replace(ret);
      }
      return null;
   }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.qos.ClientProperty

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.