Package org.xmlBlaster.contrib

Examples of org.xmlBlaster.contrib.ClientPropertiesInfo


      if (propKeysToAdd.length() > 0) {
         if ("*".equals(propKeysToAdd)) { // then all properties are added to the connectQos
            if (hardConnectQos != null)
               log.warning("The property '" + MOM_PROPS_TO_ADD_TO_CONNECT + "' was is set to '*' and and '" + MOM_CONNECT_QOS + "' was set too (some of the properties could be overwritten");
            // fill the client properties of the connectQos with the info object
            new ClientPropertiesInfo(this.connectQos.getData().getClientProperties(), info);
         }
         else {
            StringTokenizer tokenizer = new StringTokenizer(propKeysToAdd, ",");
            while (tokenizer.hasMoreTokens()) {
               String key = tokenizer.nextToken().trim();
View Full Code Here


         }
         else
            qos = new PublishQos(this.glob);
         qos.setSubscribable(true);
         // to force to fill the client properties map !!
         ClientPropertiesInfo tmpInfo = new ClientPropertiesInfo(attrMap);
         new ClientPropertiesInfo(qos.getData().getClientProperties(), tmpInfo);
         addStringPropToQos(attrMap, qos.getData());

         PublishKey key = null;
         if (changeKey != null && changeKey.length() > 0)
            key = new PublishKey(this.glob, changeKey);
         else
            key = new PublishKey(this.glob, "dbWatcherUnspecified");
         key.setContentMime("text/xml");
         MsgUnit msg = new MsgUnit(key, out, qos);
         PublishReturnQos prq = this.con.publish(msg);
         String id = (prq.getRcvTimestamp()!=null)?prq.getRcvTimestamp().toString():"queued";
         if (log.isLoggable(Level.FINE)) log.fine("Published '" + prq.getKeyOid() + "' '" + id + "'");
         return id;
      }
      if (this.eraseOnDrop && "DROP".equals(command)) {
         String oid = this.glob.getMsgKeyFactory().readObject(pk).getOid();
         EraseKey ek = new EraseKey(glob, oid);
         EraseQos eq = new EraseQos(glob);
         con.erase(ek, eq);
         log.info("Topic '" + pk + "' is erased:" + out);
         return "0";
      }
      if (this.eraseOnDelete && "DELETE".equals(command)) {
         String oid = this.glob.getMsgKeyFactory().readObject(pk).getOid();
         EraseKey ek = new EraseKey(glob, oid);
         EraseQos eq = new EraseQos(glob);
         con.erase(ek, eq);
         log.info("Topic '" + pk + "' is erased:" + out);
         return "0";
      }
      if (log.isLoggable(Level.FINER))
         log.finer("Topic '" + pk + "' is published: " + out);
      try {
         String oid = (String)attrMap.remove(ContribConstants.TOPIC_NAME); // consume it since only used to inform this method
         if (destination != null) {
            pk = this.adminKey;
         }
         if (oid != null)
            pk = "<key oid='" + oid + "'/>";
         MsgUnit msgUnit = new MsgUnit(pk, out, this.publishQos);
         String tmp = msgUnit.getKeyData().getContentMime();
         // FIXME pass this in the map and set only if explicitly set in the map
         if (tmp == null || tmp.equals("text/plain")) {
            msgUnit.getKeyData().setContentMime("text/xml");
         }
         if (destination != null)
            ((MsgQosData)msgUnit.getQosData()).addDestination(destination);
         // to force to fill the client properties map !!
         ClientPropertiesInfo tmpInfo = new ClientPropertiesInfo(attrMap);
         new ClientPropertiesInfo(msgUnit.getQosData().getClientProperties(), tmpInfo);
         addStringPropToQos(attrMap, (MsgQosData)msgUnit.getQosData());

         PublishReturnQos prq = this.con.publish(msgUnit);
         String id = (prq.getRcvTimestamp()!=null)?prq.getRcvTimestamp().toString():"queued";
         if (log.isLoggable(Level.FINE))
View Full Code Here

      // code for the DbWatchers here
      String replId = connQos.getData().getClientProperty(REPL_PREFIX_KEY, (String)null);
      if (replId == null || replId.length() < 1)
         log.fine("the client property '" + REPL_PREFIX_KEY + "' must be defined but is empty");
      else { // then it is a DbWatcher which is used for replication
         I_Info info = new ClientPropertiesInfo(connQos.getData().getClientProperties());
         String relativeName = e.getSessionInfo().getSessionName().getRelativeName();
         register(relativeName, replId, info);
      }
      // code for DbWatchers ends here
     
View Full Code Here

      }

      if (slave != null) {
         Map clientProperties = e.getSubscriptionInfo().getSubscribeQosServer().getData().getClientProperties();
         try {
            slave.init(new ClientPropertiesInfo(clientProperties));
         }
         catch (Exception ex) {
            throw new XmlBlasterException(this.global, ErrorCode.INTERNAL_UNKNOWN, "ReplManagerPlugin.subscriptionAdd", "", ex);
         }
      }
View Full Code Here

   public void testRemoveEntry() {
      I_Info[] infos = {
                         new Info("id"),
                         new PropertiesInfo(new Properties()),
                         new ClientPropertiesInfo(new HashMap()),
                         /* new DbInfo(new HashMap()), */
                         new OwnGlobalInfo()
                       };
      String[] names = new String[] {"Info", "PropertiesInfo", "ClientPropertiesInfo", /*.*/ "GlobalInfo"};
     
View Full Code Here

      SubscribeQos subQos = new SubscribeQos(this.global);
      subQos.setMultiSubscribe(false);
      subQos.setWantInitialUpdate(false);
      subQos.setPersistent(true);
      // this fills the client properties with the contents of the individualInfo object.
      new ClientPropertiesInfo(subQos.getData().getClientProperties(), individualInfo);
      session.subscribe(this.dataTopic, subQos.toXml());
      synchronized(this.initSync) {
         setStatus(STATUS_INITIAL);
      }
   }
View Full Code Here

    *               and instance (here "connection") e.g. "plugin/socket/SOLingerTimeout"
    *               and with higher precedence "dispatch/connection/plugin/socket/SOLingerTimeout"
    * @param value  The value, e.g. "10000"
    */
   public void setPluginProperty(String key, String value) {
      if (this.pluginAttributes == null) this.pluginAttributes = new ClientPropertiesInfo(null);
      this.pluginAttributes.put(key, value);
      // refresh compressType or minSize: Those attributes are double used:
      // Once SOCKET specific and again as a common setting in <address ...>
      // TODO: clean up this mess: no SOCKET specific code in here!
      if ("compress/type".equals(key) || "compress/minSize".equals(key)) {
View Full Code Here

         initialize();
      }
   }
  
   public void addClientProperty(ClientProperty clientProperty) {
      if (this.pluginAttributes == null) this.pluginAttributes = new ClientPropertiesInfo(null);
      this.pluginAttributes.put(clientProperty.getName(), clientProperty);
   }
View Full Code Here

   /**
    * @return never null
    */
   public ClientProperty[] getRemotePropertyArr() {
      ClientPropertiesInfo tmp = this.remoteProperties;
      if (tmp == null) return new ClientProperty[0];
      return tmp.getClientPropertyArr();
   }
View Full Code Here

    */
   public synchronized void setRemoteProperties(Map map) {
      if (map == null)
         this.remoteProperties = null;
      else
         this.remoteProperties = new ClientPropertiesInfo(map);
   }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.contrib.ClientPropertiesInfo

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.