Examples of QosData


Examples of org.xmlBlaster.util.qos.QosData

         log.fine("topic='" + topicName + "'");
         String replPrefix = (String)this.topicToPrefixMap.get(topicName);
         if (replPrefix == null) {
            // check if it is initial data
            if (this.initialDataTopicSet.contains(topicName)) {
               QosData qosData = msgUnit.getQosData();
               Destination[] destinations = ((MsgQosData)qosData).getDestinationArr();
               if (destinations != null) {
                  long numOfTransactions = qosData.getClientProperty(NUM_OF_TRANSACTIONS, 1L);
                  // negative amount of transactions means ptp entries
                  qosData.addClientProperty(NUM_OF_TRANSACTIONS, -numOfTransactions);
                  for (int i=0; i < destinations.length; i++) {
                     String sessionId = destinations[i].getDestination().getRelativeName();
                     I_ReplSlave slave = (I_ReplSlave)this.replSlaveMap.get(sessionId);
                     if (slave != null) {
                        slave.incrementPtPEntries(numOfTransactions);
                     }
                     else
                        log.warning("Slave '" + sessionId + "' not found in slave map");
                  }
               }
            }
            return null;
         }
         Counter counter = (Counter)this.counterMap.get(replPrefix);
         if (counter != null) {
            QosData qosData = msgUnit.getQosData();
            long messageSeq = qosData.getClientProperty(MESSAGE_SEQ, 0L);
            long numOfTransactions = qosData.getClientProperty(NUM_OF_TRANSACTIONS, 1L);
            int prio = ((MsgQosData)qosData).getPriority().getInt();

            long transactionSeq = counter.trans[prio] + numOfTransactions;
            qosData.addClientProperty(TRANSACTION_SEQ, transactionSeq);
            if (messageSeq > 0L)
               counter.msg = messageSeq;
            if (transactionSeq > 0L)
               counter.trans[prio] = transactionSeq;
            if (messageSeq != 0L && transactionSeq != 0L) {
View Full Code Here

Examples of org.xmlBlaster.util.qos.QosData

             // e.g. if a dumb device (phone) can't cope with exception, handle it server side
             MsgErrorInfo msgErrorInfo = new MsgErrorInfo(glob, sessionInfo.getSessionName(), msgUnitRaw, e);
             sessionInfo.getMsgErrorHandler().handleError(msgErrorInfo);
        }
      }
      QosData qosData = msgUnit.getQosData();

      // Currently we have misused used the clientProperty to transport this information
      if (qosData.getClientProperty(Constants.PERSISTENCE_ID) != null)
         qosData.isFromPersistenceRecovery(true);

      // Check if server is ready (throws XmlBlasterException otherwise)
      this.availabilityChecker.checkServerIsReady(sessionInfo.getSessionName(), addressServer, msgUnit, action);

      // Protect against faked sender name
      if (sessionInfo.getConnectQos().isClusterNode()) {
         if (qosData.getSender() == null) // In cluster routing don't overwrite the original sender
            qosData.setSender(sessionInfo.getSessionName());
      }
      else {
         if (qosData.getSender() == null) {
            qosData.setSender(sessionInfo.getSessionName());
         }
         else if (!sessionInfo.getSessionName().equalsAbsolute(qosData.getSender())) {
            //if (! publishQos.isFromPersistenceStore()) {
            if (!this.authenticate.isAcceptWrongSenderAddress(sessionInfo)) {
               log.warning(sessionInfo.getId() + " sends message '" + msgUnit.getKeyOid() + "' with invalid sender name '" + qosData.getSender() + "', we fix this");
               qosData.setSender(sessionInfo.getSessionName());
            }
            else {
               log.info(sessionInfo.getId() + " sends message '" + msgUnit.getKeyOid() + "' with invalid sender name '" + qosData.getSender() + "', we accept it");
            }
         }
      }

      /*
 
View Full Code Here

Examples of org.xmlBlaster.util.qos.QosData

              "Rejecting cluster message from '" + msgUnit.getQosData().getSender().getAbsoluteName()
              + "' as destination cluster '" + clusterNode.getId()
              + "' is sender cluster (circular loop)");
      }

      QosData publishQos = msgUnit.getQosData();
      if (nodeMasterInfo.isDirtyRead() == true) {
         // mark QoS of published message that we dirty read the message:
         RouteInfo[] ris = publishQos.getRouteNodes();
         if (ris == null || ris.length < 1) {
            log.severe("The route info for '" + msgUnit.getLogId() + "' is missing");
            Thread.dumpStack();
         }
         else {
View Full Code Here

Examples of org.xmlBlaster.util.qos.QosData

      Set masterSet = new TreeSet(); // Contains the NodeMasterInfo objects which match this message
                                     // Sorted by stratum (0 is the first entry) -> see NodeMasterInfo.compareTo
      int numRulesFound = 0;                             // For nicer logging of warnings

      QosData publishQos = msgUnit.getQosData();
      if (publishQos.count(glob.getNodeId()) > 1) { // Checked in RequestBroker as well with warning
         log.warning("Warning, message '" + msgUnit.getLogId() +
            "' passed my node id='" + glob.getId() + "' before, we have a circular routing problem, keeping message locally");
         return null;
      }

      ClusterNode[] clusterNodes = getClusterNodes();
      for (int ic=0; ic<clusterNodes.length; ic++) {
         ClusterNode clusterNode = clusterNodes[ic];
         NodeMasterInfo[] nodeMasterInfos = clusterNode.getNodeMasterInfos();

         if (nodeMasterInfos.length < 1)
            continue;
         if (clusterNode.isAllowed() == false) {
            if (log.isLoggable(Level.FINE)) log.fine("Ignoring master node id='" + clusterNode.getId() + "' because it is not available");
            continue;
         }
         if (!clusterNode.isLocalNode() && publishQos.count(clusterNode.getNodeId()) > 0) {
            if (log.isLoggable(Level.FINE)) log.fine("Ignoring node id='" + clusterNode.getId() + "' for routing, message '" +
                            msgUnit.getLogId() + "' has been there already");
            continue;
         }
         if (log.isLoggable(Level.FINE)) log.fine("Testing " + nodeMasterInfos.length + " domains rules of node " +
View Full Code Here

Examples of org.xmlBlaster.util.qos.QosData

   /**
    * Convenience method to access PtP destination
    * @return null if no PtP publish message
    */
   public Destination getDestination() {
      final QosData qosData = getQosData();
      final MethodName m = qosData.getMethod();
      if (MethodName.PUBLISH.equals(m) || MethodName.PUBLISH_ARR.equals(m) || MethodName.PUBLISH_ONEWAY.equals(m)
       || MethodName.UPDATE.equals(m) || MethodName.UPDATE_ONEWAY.equals(m)) {
         if (qosData instanceof MsgQosData) {
            MsgQosData msgQosData = (MsgQosData)qosData;
            return (msgQosData.getDestinationArr().length > 0) ? msgQosData
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.