Examples of SessionName


Examples of org.xmlBlaster.util.SessionName

      try {
         String id = "";
         if (sub != null) id = sub.getSessionInfo().getId();
         String exTxt = "";
         if (e != null) exTxt = e.toString();
         SessionName publisherName = msgUnitWrapper.getMsgQosData().getSender();
         if (log.isLoggable(Level.FINE)) log.fine("Sending of message from " + publisherName + " to " +
                            id + " failed: " + exTxt);
              
         if (sub != null && e != null)
            sub.getSessionInfo().getDispatchManager().internalError(e); // calls MsgErrorHandler
View Full Code Here

Examples of org.xmlBlaster.util.SessionName

    * @return
    */
   public String getInfoWithoutMeat() {
      StringBuffer buf = new StringBuffer(1024);
      buf.append("topicId=").append(keyOid);
      SessionName sn = receiver;
      if (sn != null)
         buf.append(" receiver=").append(sn.getAbsoluteName());
      if (msgUnitWrapperUniqueId > 0)
         buf.append(" msgUnitWrapperUniqueId=").append(msgUnitWrapperUniqueId);
      StorageId si = super.storageId;
      if (si != null)
         buf.append(" storageId=").append(si.getId());
View Full Code Here

Examples of org.xmlBlaster.util.SessionName

    * The sender of this PtP message is the loginName of the plugin itself -
    * to avoid looping we check the sender name in our plugin
    * </p>
    */
   public final void sendPtPMessage(MsgQueueEntry entry, String pluginName, String action, String currStatus) throws XmlBlasterException {
      SessionName receiver = entry.getSender()// Send back (receiver==sender)
      if (log.isLoggable(Level.FINE)) log.fine("Sending PtP notification about special message treatment in plugin, dispatcher state=" + currStatus + " receiver '" + receiver + "' ...");
      PublishQos pq = new PublishQos(glob);
      pq.addDestination(new Destination(receiver));
      pq.setSender(new SessionName(glob, getLoginName())); // Set ourself as sender
      pq.setSubscribable(false); // For the time being we don't allow others to subscribe on the PtP notification
      pq.setState(action);
      pq.setStateInfo("Notification about special message treatment in plugin " + pluginName + ", dispatcher state=" + currStatus);
      MsgUnit msgUnit = new MsgUnit(glob, "<key oid='" + entry.getKeyOid() + "'/>", "", pq.toXml());
      //xmlBlasterImpl.publish(sessionId, msgUnit);
View Full Code Here

Examples of org.xmlBlaster.util.SessionName

         clearSessions(glob.getProperty().get("session.clearSessions["+nodeId+"]", clearSessions()));
         setReconnectSameClientOnly(glob.getProperty().get("session.reconnectSameClientOnly["+nodeId+"]", reconnectSameClientOnly()));
         setSecretSessionId(glob.getProperty().get("session.secretSessionId["+nodeId+"]", getSecretSessionId()));
      }

      this.sessionName = new SessionName(glob, nodeId, sessionNameStr);
      //if (log.isLoggable(Level.FINE)) log.trace(ME, "sessionName =" + sessionName.getRelativeName() + " absolute=" + sessionName.getAbsoluteName());

      {
         // user warning for the old style loginName
         String loginName = glob.getProperty().get("loginName", (String)null);
View Full Code Here

Examples of org.xmlBlaster.util.SessionName

    */
   public static void main( String[] args ) throws XmlBlasterException
   {
      Global glob = new Global(args);
      {
         PublishQos qos =new PublishQos(new Global(args), new Destination(new SessionName(glob, "joe")));
         qos.addDestination(new Destination(new SessionName(glob, "Tim")));
         qos.setPriority(PriorityEnum.HIGH_PRIORITY);
         qos.setPersistent(true);
         qos.setForceUpdate(true);
         qos.setReadonly(true);
         qos.setLifeTime(60000);
View Full Code Here

Examples of org.xmlBlaster.util.SessionName

      if (registerKey.equals(ContextNode.SUBJECT_MARKER_TAG) || registerKey.equals("DEFAULT")) {  // "client"
         String loginName = cmd.getUserNameLevel();
         if (loginName == null || loginName.length() < 1 || loginName.startsWith("?"))
            throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "Please pass a command which has a valid client name in '" + cmd.getCommand() + "' with '" + loginName + "' is invalid");

         I_AdminSubject subjectInfo = glob.getAuthenticate().getSubjectInfoByName(new SessionName(glob, loginName));
         if (subjectInfo == null)
            throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "Please pass a command which has a valid client name in '" + cmd.getCommand() + "' client '" + loginName + "' is unknown");

         String pubSessionId = cmd.getSessionIdLevel();
         if (pubSessionId == null || pubSessionId.length() < 1)
View Full Code Here

Examples of org.xmlBlaster.util.SessionName

      String loginName = cmd.getUserNameLevel();
      if (loginName == null || loginName.length() < 1 || loginName.startsWith("?"))
         throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "Please pass a command which has a valid client name in '" + cmd.getCommand() + "' with '" + loginName + "' is invalid");

      I_AdminSubject subjectInfo = glob.getAuthenticate().getSubjectInfoByName(new SessionName(glob, loginName));
      if (subjectInfo == null)
         throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "Please pass a command which has a valid client name in '" + cmd.getCommand() + "' client '" + loginName + "' is unknown");

      String pubSessionId = cmd.getSessionIdLevel();
      if (pubSessionId == null || pubSessionId.length() < 1)
View Full Code Here

Examples of org.xmlBlaster.util.SessionName

      XmlBuffer sb = new XmlBuffer(2048);
      if (extraOffset == null) extraOffset = "";
      String offset = Constants.OFFSET + extraOffset;

      sb.append(offset).append("<subscription id='").appendAttributeEscaped(getSubscriptionId()).append("'");
      SessionName sessionName = getSessionInfo().getSessionName();
      if (sessionName != null)
         sb.append(" sessionName='").appendAttributeEscaped(sessionName.toString()).append("'");
      if (topicHandler != null) {
         sb.append(" oid='").appendAttributeEscaped(topicHandler.getUniqueKey()).append("'");
      }
      if (querySub != null) {
         sb.append(" parent='").appendAttributeEscaped(querySub.getSubscriptionId()).append("'");
View Full Code Here

Examples of org.xmlBlaster.util.SessionName

      if (msgErrorInfo.getMsgUnit() != null) {
         // No queue involved, a XmlBlasterImpl.publish() has failed
         // (a publish call from a client inside xmlBlaster server)
         // We end up here if the client does not want to get exception back:
         // ConnectQosServer.allowExcpetionsThrownToClient=false
         SessionName sessionName = msgErrorInfo.getSessionName();
         org.xmlBlaster.util.MsgUnit msgUnit = msgErrorInfo.getMsgUnit();
         XmlBlasterException e = msgErrorInfo.getXmlBlasterException();
         try {
            if (msgUnit.getQosData().getRcvTimestamp() == null)
               msgUnit.getQosData().touchRcvTimestamp();
            String clientPropertyKey = "__isErrorHandled" + msgUnit.getLogId();
            SessionName receiver = null; // !!!!! msgUnit.getQosData().getDestination();
            if (msgUnit.getQosData() instanceof MsgQosData) {
               MsgQosData mq = (MsgQosData)msgUnit.getQosData();
               if (mq.getDestinationArr().length > 0) {
                  receiver = mq.getDestinationArr()[0].getDestination();
               }
View Full Code Here

Examples of org.xmlBlaster.util.SessionName

      log.info("testPtSession() ...");
      long sleep = 1000L;

      {
         log.info("TEST #1: Sending PtP message to all sessions of client " + name);
         SessionName[] sessionNameArr = { new SessionName(glob, name) };
         publish(this.conHolderArr[0], this.msgOid, sessionNameArr);
         for(int ii=0; ii<this.conHolderArr.length; ii++) {
            assertEquals("", 1, this.conHolderArr[ii].update.waitOnUpdate(sleep, msgOid, Constants.STATE_OK));
            this.conHolderArr[ii].update.clear();
         }
      }

      {
         SessionName sessionName3 = this.conHolderArr[3].connectReturnQos.getSessionName();
         log.info("TEST #2: Sending PtP message to session " + sessionName3.getAbsoluteName());
         SessionName[] sessionNameArr = { sessionName3 };
         publish(this.conHolderArr[0], this.msgOid, sessionNameArr);
         for(int ii=0; ii<this.conHolderArr.length; ii++) {
            int numExpected = (ii==3) ? 1 : 0;
            assertEquals("ii="+ii, numExpected, this.conHolderArr[ii].update.waitOnUpdate(sleep, msgOid, Constants.STATE_OK));
            this.conHolderArr[ii].update.clear();
         }
      }

      {
         SessionName sessionName1 = this.conHolderArr[1].connectReturnQos.getSessionName();
         SessionName sessionName3 = this.conHolderArr[3].connectReturnQos.getSessionName();
         log.info("TEST #3: Sending PtP message to session " + sessionName3.getAbsoluteName() + " and " + sessionName1.getAbsoluteName());
         SessionName[] sessionNameArr = { sessionName3, sessionName1 };
         publish(this.conHolderArr[0], this.msgOid, sessionNameArr);
         for(int ii=0; ii<this.conHolderArr.length; ii++) {
            int numExpected = (ii==1 || ii==3) ? 1 : 0;
            assertEquals("ii="+ii, numExpected, this.conHolderArr[ii].update.waitOnUpdate(sleep, msgOid, Constants.STATE_OK));
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.