Examples of MsgQosData


Examples of org.xmlBlaster.util.qos.MsgQosData

      qos.addClientProperty("threeKey", new Integer(55));
      String literal = qos.toXml();
     
      MsgQosSaxFactory factory = new MsgQosSaxFactory(this.glob);
      try {
         MsgQosData data = factory.readObject(literal);
         checkValues(data.getClientProperties());
      }
      catch (XmlBlasterException ex) {
         assertTrue("Exeption occured : " + ex.getMessage(), false);
      }
   }
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

               continue;
            }

            MsgUnit mu = msgUnitWrapper.getMsgUnit();
            //MsgUnit mu = entry.getMsgUnit(); throws unwanted exception if meat==null (forceDestroy)
            MsgQosData msgQosData = (MsgQosData)mu.getQosData().clone();
            msgQosData.setTopicProperty(null);
            msgQosData.setState(entry.getState());
            msgQosData.setSubscriptionId(entry.getSubscriptionId());
            msgQosData.setQueueIndex(i);
            msgQosData.setQueueSize(connectionsHandler.getDispatchManager().getQueue().getNumOfEntries());
            if (msgQosData.getNumRouteNodes() == 1) {
               msgQosData.clearRoutes();
            }

            // Convert oid to original again for erased events fired by TopicHandler.java notifySubscribersAboutErase()
            if (mu.getKeyOid().equals(Constants.EVENT_OID_ERASEDTOPIC)) {
               mu = new MsgUnit(mu, (MsgKeyData)mu.getKeyData().clone(), null, msgQosData);
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

         publishKey.setClientTags("<org.xmlBlaster><event/></org.xmlBlaster>");
         return publishKey.getData();
      }
      MsgQosData getPublishQos(String summary, String description,
            String eventType, String errorCode, SessionName sessionName) throws XmlBlasterException {
         MsgQosData msgQosData = null;
         if (this.qos != null) {
            msgQosData = engineGlob.getMsgQosFactory().readObject(this.qos);
         }
         else {
            PublishQos publishQos = new PublishQos(engineGlob);
            publishQos.setLifeTime(-1L);
            publishQos.setForceUpdate(true);
            // TODO: Configure history depth to 0 only on first publish
            TopicProperty topicProperty = new TopicProperty(engineGlob);
            HistoryQueueProperty historyQueueProperty = new HistoryQueueProperty(engineGlob, engineGlob.getId());
            historyQueueProperty.setMaxEntriesCache(2);
            historyQueueProperty.setMaxEntries(2);
            topicProperty.setHistoryQueueProperty(historyQueueProperty);
            publishQos.setTopicProperty(topicProperty);
            msgQosData = publishQos.getData();
         }
         if (summary != null && summary.length() > 0)
            msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_SUMMARY, summary); // "_summary"
         if (description != null && description.length() > 0)
            msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_DESCRIPTION, description);
         if (eventType != null && eventType.length() > 0)
            msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_EVENTTYPE, eventType);
         if (errorCode != null && errorCode.length() > 0)
            msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_ERRORCODE, errorCode);
         if (sessionName != null) {
            msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_PUBSESSIONID,
                  sessionName.getPublicSessionId());
            msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_SUBJECTID,
                  sessionName.getLoginName());
            msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_ABSOLUTENAME,
                  sessionName.getAbsoluteName());
            /*
            // To be backwards compatible with loginEvent=true setting:
            // deprecated:
            msgQosData.addClientProperty("__publicSessionId",
                  sessionName.getPublicSessionId());
            msgQosData.addClientProperty("__subjectId",
                  sessionName.getLoginName());
            msgQosData.addClientProperty("__absoluteName",
                  sessionName.getAbsoluteName());
            // TODO: backwards compatible?
            //msgUnit.setContent(sessionName.getLoginName().getBytes());
            // To be backwards compatible with loginEvent=true setting:
            */
         }
         msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_NODEID, engineGlob.getId());

         return msgQosData;
      }
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

public class GetReturnQosServer
{
   private final MsgQosData msgQosData;

   public GetReturnQosServer(Global glob, MsgQosData msgQosData, String state) {
      this.msgQosData = (msgQosData == null) ? new MsgQosData(glob, MethodName.GET) : msgQosData;
      this.msgQosData.setState((state == null) ? Constants.STATE_OK : state);
   }
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

               for (int i=0; i<buf.length;i++)
                  buf[i] = tmpBuf[i];
            }
           
            // We do not need to clone the key since it will not change, but the qos must be cloned
            MsgQosData chunkQosData = (MsgQosData)qosData.clone();
           
            if (contentReplacer != null)
               buf = contentReplacer.replace(buf, chunkQosData.getClientProperties());
            boolean isLastChunk = buf.length < bufSize;
            pubRetQos = publishSingleChunk(keyData, chunkQosData, buf, length, isLastChunk, count, null);
            count++;
            if (length < bufSize)
               return new PublishReturnQos[] { pubRetQos };
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

         return 0;
      List<I_Entry> list = this.queue.peek(-1, -1L);
      for (int i=0; i < list.size(); i++) {
         MsgQueuePublishEntry entry = (MsgQueuePublishEntry)list.get(i);
         MsgKeyData key = entry.getMsgKeyData();
         MsgQosData qos =(MsgQosData)entry.getMsgUnit().getQosData();
         byte[] cont = entry.getMsgUnit().getContent();
         String entryCbSessionId = qos.getClientProperty(ENTRY_CB_SESSION_ID, (String)null);
         qos.getClientProperties().remove(ENTRY_CB_SESSION_ID);
         final boolean isExternal = false; // we don't want to store these entries since already here
         updateInternal(entryCbSessionId, new UpdateKey(key), cont, new UpdateQos(this.global, qos), isExternal);
      }
      this.queue.clear();
      return list.size();
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

      this.glob.sendNotification(this, "Client '" + sessionInfo.getSessionName().getAbsoluteName() + "' logged in",
         "clientNew", "java.lang.String", "", sessionInfo.getSessionName().getAbsoluteName());

      if (this.publishLoginEvent) {
         this.publishQosLoginEvent.clearRoutes();
         MsgQosData msgQosData = (MsgQosData)this.publishQosLoginEvent.getData().clone();
         // __sessionId is deprecated, please use __publicSessionId
         msgQosData.addClientProperty("__sessionId", sessionInfo.getPublicSessionId());
         msgQosData.addClientProperty("__publicSessionId", sessionInfo.getPublicSessionId());
         msgQosData.addClientProperty("__absoluteName", sessionInfo.getSessionName().getAbsoluteName());

         MsgUnit msgUnit = new MsgUnit(this.xmlKeyLoginEvent,
                                  sessionInfo.getLoginName().getBytes(),
                                  msgQosData);
         publish(this.unsecureSessionInfo, msgUnit); // publish that this client has logged in
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

      if (this.publishLogoutEvent) {
         if (log.isLoggable(Level.FINE)) log.fine("Logout event for client " + sessionInfo.toString());
         this.publishQosLogoutEvent.clearRoutes();

         MsgQosData msgQosData = (MsgQosData)this.publishQosLogoutEvent.getData().clone();
         // __sessionId is deprecated, please use __publicSessionId
         msgQosData.addClientProperty("__sessionId", sessionInfo.getPublicSessionId());
         msgQosData.addClientProperty("__publicSessionId", sessionInfo.getPublicSessionId());
         msgQosData.addClientProperty("__absoluteName", sessionInfo.getSessionName().getAbsoluteName());

         MsgUnit msgUnit = new MsgUnit(this.xmlKeyLogoutEvent, sessionInfo.getLoginName().getBytes(), msgQosData);
         publish(this.unsecureSessionInfo, msgUnit); // publish that this client logged out
         this.publishQosLogoutEvent.getData().setTopicProperty(null); // only the first publish needs to configure the topic
      }
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

                  "Expected 3 entries in serialized object '" + type + "' but got " + obj.length + " for priority=" + priority + " timestamp=" + timestamp + ". Could be a version incompatibility.");
            }
            String qos = (String)obj[0];
            String key = (String)obj[1];
            byte[] content = (byte[])obj[2];
            MsgQosData msgQosData = glob.getMsgQosFactory().readObject(qos);
            MsgKeyData msgKeyData = glob.getMsgKeyFactory().readObject(key);
            MsgUnit msgUnit = new MsgUnit(msgKeyData, content, msgQosData);
            return new MsgQueuePublishEntry(glob, methodName, PriorityEnum.toPriorityEnum(priority), storageId,
                                            new Timestamp(timestamp), sizeInBytes, msgUnit);
         }
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

         // MethodName.UPDATE
         // MethodName.UPDATE_ONEWAY
         // MethodName.EXCEPTION
         if (methodName == MethodName.PUBLISH_ONEWAY || methodName == MethodName.PUBLISH
               || methodName == MethodName.PUBLISH_ARR) {
            MsgQosData msgQosData = glob.getMsgQosFactory().readObject(qos);
            MsgKeyData msgKeyData = glob.getMsgKeyFactory().readObject(key);
            MsgUnit msgUnit = new MsgUnit(msgKeyData, content, msgQosData);
            return new MsgQueuePublishEntry(glob, methodName, PriorityEnum.toPriorityEnum(priority), storageId,
                                            new Timestamp(timestamp), sizeInBytes, msgUnit);
         }
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.