Package org.xmlBlaster.util

Examples of org.xmlBlaster.util.SessionName


   private Client doConnect(String loginName, I_Callback cb) {
      try {
         Client client = new Client();
         Global gg = this.glob.getClone(null);
         ConnectQos connectQos = new ConnectQos(gg);
         SessionName sessionName = new SessionName(gg, loginName);
         connectQos.setSessionName(sessionName);
         client.con = gg.getXmlBlasterAccess();
         client.con.registerConnectionListener(this);
         client.updateInterceptor = new MsgInterceptor(gg, log, cb); // Collect received msgs
         client.con.connect(connectQos, client.updateInterceptor); // Login to xmlBlaster
View Full Code Here


      if (oid != null) key.setOid(oid);
      key.setClientTags("<airport/>");
      PublishQos qos = new PublishQos(glob);
      qos.setPersistent(true);
      qos.setVolatile(true);
      qos.addDestination(new Destination(new SessionName(this.glob, "joe")));
      MsgUnit msgUnit = new MsgUnit(key, content, qos);

      this.glob.getXmlBlasterAccess().publish(msgUnit);
      if (doGc) Util.gc(2);
      try {
View Full Code Here

    * <p />
    * You will receive the result set wrapped in XML with a asynchronous update().
    */
   public MsgUnit toMessage() throws XmlBlasterException
   {
      PublishQos qos = new PublishQos(glob, new Destination(new SessionName(Global.instance(), "__sys__jdbc")));
      PublishKey key = new PublishKey(glob, "", "text/xml", "SQL_QUERY");
      return new MsgUnit(key, toXml().getBytes(), qos);
   }
View Full Code Here

   public final boolean isDestroyed() {
      return false;
   }

   public final SessionName getSender() {
      return new SessionName(glob, "theSender");
   }
View Full Code Here

   public final SessionName getSender() {
      return new SessionName(glob, "theSender");
   }

   public final SessionName getReceiver() {
      return new SessionName(glob, "theReceiver");
   }
View Full Code Here

    * given/default security plugin and does a lookup in the environment.
    */
   public void setSecurityQos(I_SecurityQos securityQos) {
      this.securityQos = securityQos;
      if (!this.sessionQos.isSessionNameModified()) {
         SessionName sessionName = new SessionName(glob, this.securityQos.getUserId()); // parse it and strip it if user has given an absolute name
         this.sessionQos.setSessionName(sessionName, false);
      }
   }
View Full Code Here

      if (this.securityQos == null) {
         this.securityQos = getClientPlugin().createSecurityQos();
         this.securityQos.setCredential(accessPassword(null));
      }

      SessionName sessionName = new SessionName(glob, userId); // parse it and strip it if user has given an absolute name
      this.securityQos.setUserId(sessionName.getLoginName());

      if (!this.sessionQos.isSessionNameModified()) {
         this.sessionQos.setSessionName(sessionName, false);
      }
   }
View Full Code Here

    * <p />
    * @return The unique SessionName (never null)
    */
   public SessionName getSessionName() {
      if (this.sessionQos.getSessionName() == null && getSecurityQos() != null) {
         this.sessionQos.setSessionName(new SessionName(glob, getSecurityQos().getUserId()), false);
      }
      return this.sessionQos.getSessionName();
   }
View Full Code Here

            int ii=0;
            SessionQos sessionQos = this.connectQosData.getSessionQos();
            for (ii = 0; ii < len; ii++) {
               if (attrs.getQName(ii).equalsIgnoreCase("name")) {
                  if (glob.isServerSide()) { // Force the server node ID on connect
                     sessionQos.setSessionName(new SessionName(glob, glob.getNodeId(), attrs.getValue(ii).trim()));
                  }
                  else {
                     sessionQos.setSessionName(new SessionName(glob, attrs.getValue(ii).trim()));
                  }
               }
               else if (attrs.getQName(ii).equalsIgnoreCase("timeout"))
                  sessionQos.setSessionTimeout((new Long(attrs.getValue(ii).trim())).longValue());
               else if (attrs.getQName(ii).equalsIgnoreCase("maxSessions"))
View Full Code Here

               // strip "event/connectionState"
               String name = event.substring(0, index);
               ClusterNode[] nodes = clusterManager.getClusterNodes();
               for (int ic=0; ic<nodes.length; ic++) {
                  ClusterNode node = nodes[ic];
                  SessionName destination = node.getSessionName();
                  if (destination != null && destination.matchRelativeName(name)) {
                     node.registerConnectionListener(this);
                  }
               }
            }
            else if (isCallbackStateEvent(event)) {
            //else if (event.endsWith("/event/callbackState") || event.endsWith("/event/callbackAlive") || event.endsWith("/event/callbackPolling") || event.endsWith("/event/callbackDead")) {
               // OK: "client/joe/session/1/event/callbackState"
               // Not yet supported: "client/joe/session/1/event/callbackAlive", "client/joe/session/1/event/callbackPolling"
               int index = event.lastIndexOf("/event/");
               if (index == -1) {
                  log.warning("Configuration of '" + event + "' is ignored, wrong syntax");
                  continue;
               }
               String name = event.substring(0, index);
               SessionName sessionName = new SessionName(this.engineGlob, name);
               this.requestBroker.getAuthenticate().addClientListener(this);
               if (this.callbackSessionStateSet == null) this.callbackSessionStateSet = new TreeSet();
               if (event.startsWith(ContextNode.SUBJECT_MARKER_TAG+ContextNode.SEP+"*"+ContextNode.SEP) ||
                   event.endsWith(ContextNode.SESSION_MARKER_TAG+ContextNode.SEP+"*"+"/event/callbackState")) {
                  // "client/*/session/1/event/callbackState" or "client/joe/session/*/event/callbackState"
                  if (this.pendingCallbackSessionInfoSet == null) this.pendingCallbackSessionInfoSet = new TreeSet();
                  this.pendingCallbackSessionInfoSet.add(name);
                  this.callbackSessionStateSet.add(name);
                  SubjectInfo[] subs = null;
                  log.fine("Register existing wildcard callback session state event = " + event);
                  if (event.startsWith(ContextNode.SUBJECT_MARKER_TAG+ContextNode.SEP+"*"+ContextNode.SEP) &&
                      !event.endsWith(ContextNode.SESSION_MARKER_TAG+ContextNode.SEP+"*"+"/event/callbackState")) {
                    subs = this.requestBroker.getAuthenticate().getSubjectInfoArr();
                    for (int sj=0; sj<subs.length; sj++) {
                      SubjectInfo subjectInfo = subs[sj];
                      if (!wildcardMatch(sessionName.getLoginName(), subjectInfo.getLoginName()))
                        continue;
                      SessionInfo[] ses = subjectInfo.getSessions();
                      for (int se=0; se<ses.length; se++) {
                        if (!wildcardMatch(sessionName.getPublicSessionId(), ses[se].getPublicSessionId()))
                          continue;
                        DispatchManager mgr = ses[se].getDispatchManager();
                            if (mgr != null) {
                                mgr.addConnectionStatusListener(this);
                             }
                      }
                    }
                  }
               }
               else {
                  log.fine("Register callback session state event = " + event);
                  SessionInfo sessionInfo = this.requestBroker.getAuthenticate().getSessionInfo(sessionName);
                  DispatchManager mgr = null;
                  if (sessionInfo != null)
                     mgr = sessionInfo.getDispatchManager();
                  if (mgr != null) {
                     mgr.addConnectionStatusListener(this);
                  }
                  else {
                     if (this.pendingCallbackSessionInfoSet == null) this.pendingCallbackSessionInfoSet = new TreeSet();
                     this.pendingCallbackSessionInfoSet.add(sessionName.getAbsoluteName());
                  }
                  this.callbackSessionStateSet.add(sessionName.getRelativeName());
               }
            }
            else if (isConnectionQueueEvent(event)) {
               // client/[subjectId]/session/[publicSessionId]/queue/connection/event/threshold.90%
               // TODO: register in xmlBlasterAccess of each ClusterNode client
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.