Package org.xmlBlaster.util

Examples of org.xmlBlaster.util.SessionName


   /**
    * Create a descriptive ME, for logging only
    * @return e.g. "/node/heron/client/joe/3" or "UNKNOWN_SESSION" if connect() was not successful
    */
   public String getId() {
      SessionName sessionName = getSessionName();
      return (sessionName == null) ? "UNKNOWN_SESSION" : sessionName.getAbsoluteName();
   }
View Full Code Here


   /**
    * Useful as a logging prefix.
    * @return For example "client/TheDesperate/-6: "
    */
   public String getLogId() {
      SessionName sessionName = getSessionName();
      return (sessionName == null) ? "" : sessionName.getRelativeName() + ": ";
   }
View Full Code Here

    */
   public SessionName getSessionName() {
      if (this.connectReturnQos != null)
         return this.connectReturnQos.getSessionName();
      if (this.connectQos != null) {
         SessionName sessionName = this.connectQos.getSessionName();
         if (sessionName != null && sessionName.getNodeIdStr() == null && this.serverNodeId != null) {
            // In cluster setup the remote cluster node id is forced
            SessionName sn = new SessionName(glob, new NodeId(this.serverNodeId), sessionName.getLoginName(),
                  sessionName.getPublicSessionId());
            // log.info("Using sessionName=" + sn.getAbsoluteName());
            this.connectQos.setSessionName(sn);
            return sn;
         }
View Full Code Here

   /**
    * Access the login name.
    * @return your login name or null if you are not logged in
    */
   public synchronized final String getLoginName() {
      SessionName sn = getSessionName();
      if (sn == null) return "xmlBlasterClient";
      return sn.getLoginName();
      /*
      //if (this.connectReturnQos != null)
      //   return this.connectReturnQos.getLoginName();
      //try {
         if (connectQos != null && connectQos.getSecurityQos() != null) {
View Full Code Here

      java.sql.Timestamp tt = new java.sql.Timestamp(ll);
      return tt.toString();
   }

   public synchronized final long getPublicSessionId() {
      SessionName sn = getSessionName();
      if (sn == null) return 0;
      return sn.getPublicSessionId();
   }
View Full Code Here

      if (dest != null) {
         XBDestination xbDest = (XBDestination)dest;
         String ptpCompleteName = xbDest.getQueueName();
         if (ptpCompleteName != null) {
            String[] ptpNames = StringPairTokenizer.parseLine(ptpCompleteName, ',');
            org.xmlBlaster.util.qos.address.Destination ptpDest = new org.xmlBlaster.util.qos.address.Destination(global, new SessionName(global, ptpNames[0]));

            if (xbDest.getForceQueuing())
               ptpDest.forceQueuing(true);
            qos = new PublishQos(global, ptpDest);
            for (int i=1; i < ptpNames.length; i++) {
               org.xmlBlaster.util.qos.address.Destination additionalDest = new org.xmlBlaster.util.qos.address.Destination(global, new SessionName(global, ptpNames[i]));
               qos.addDestination(additionalDest);
            }
         }
         else {
            qos = new PublishQos(global);
View Full Code Here

                     ClientProperty cp = msgUnit.getQosData().getClientProperty(this.filterKeys[i]);
                     if (cp != null)
                        append(buf, this.filterKeys[i], cp.getStringValue());
                  }
               }
               SessionName sender = msgUnit.getQosData().getSender();
               if (sender != null)
                  append(buf, "sender", (isClusterEnvironment()) ? sender.getAbsoluteName() : sender.getRelativeName());
               if (destination == null) {
                   if (msgUnit.getQosData() instanceof MsgQosData) {
                       MsgQosData msgQosData = (MsgQosData)msgUnit.getQosData();
                       destination = (msgQosData.getDestinationArr().length > 0) ? msgQosData
                          .getDestinationArr()[0].getDestination()
View Full Code Here

      glob.getRunlevelManager().addRunlevelListener(this);

      //this.burstModeTimer = new Timeout("BurstmodeTimer");

      myselfLoginName = new SessionName(glob, glob.getNodeId(), internalLoginNamePrefix + "[" + glob.getId() + "]/1");

      initHelperQos();

      org.xmlBlaster.client.qos.ConnectQos connectQos = new org.xmlBlaster.client.qos.ConnectQos(glob);
      connectQos.setSessionName(myselfLoginName);
View Full Code Here

         if (xmlKey.isRemoteProperties()) { // "__sys__remoteProperties"
            // Example usage
            //java javaclients.HelloWorldPublish -oid __sys__remoteProperties -connect/qos/clientProperty[__remoteProperties] true -connect/qos/clientProperty[myProperty] AAAAAA -session.name OTHER/1
            //java javaclients.HelloWorldGet -clientProperty[__sessionName] OTHER/1 -oid __sys__remoteProperties
            String sessionName = getQos.getData().getClientProperty("__sessionName", (String)null);
            SessionInfo otherSessionInfo = (sessionName == null) ? sessionInfo : getAuthenticate().getSessionInfo(new SessionName(glob, sessionName));
            if (otherSessionInfo == null) {
              log.warning(xmlKey.getOid() + " failed, sessionName not known: " + sessionName);
              return new MsgUnit[0];
            }
            //if (sessionName != null) getQos.getData().getClientProperties().remove("__sessionName");
View Full Code Here

            String str = msgUnit.getContentStr().trim();
            // clear sessionName="" prefix=""
          String[] cmdArr = ReplaceVariable.toArray(str, " ");
          String command = (cmdArr.length > 0) ? cmdArr[0] : "";
          boolean isForOtherClusterNode = false;
            SessionName otherSessionName = publishQos.getFirstDestination();
          // __sessionName is deprecated, pls use PtP destination to name the session for remoteProperty changes
            String __sessionNameStr = publishQos.getData().getClientProperty("__sessionName", (String)null);
            if (__sessionNameStr != null) {
                otherSessionName = new SessionName(glob, __sessionNameStr);
            }
            if (glob.useCluster() && otherSessionName != null && otherSessionName.getNodeId() != null && !glob.getNodeId().equals(otherSessionName.getNodeId())) {
               isForOtherClusterNode = true; // TODO: Create a PtP destination which routes to node
            }
            if (!isForOtherClusterNode) {
               SessionInfo otherSessionInfo = (otherSessionName == null) ? sessionInfo : getAuthenticate().getSessionInfo(otherSessionName);
               if (otherSessionInfo == null) {
                  if ("clearLastError".equals(command) || "clearLastWarning".equals(command)) {
                     otherSessionInfo = sessionInfo; // global action, just use the login sessionInf
                  }
                  else {
                     log.warning(msgKeyData.getOid() + " failed, sessionName not known: " + (otherSessionName == null ? "" : otherSessionName.getAbsoluteName()));
                     return Constants.RET_WARN;
                  }
               }
               if (__sessionNameStr != null) publishQos.getData().getClientProperties().remove("__sessionName");
               String prefix = publishQos.getData().getClientProperty("__prefix", (String)null);
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.SessionName

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.