Package org.xmlBlaster.engine.admin

Examples of org.xmlBlaster.engine.admin.I_AdminSubject


   public I_AdminSession getSession(String sessionId) throws Exception {
      I_Authenticate auth = getEngineGlobal(this.global).getAuthenticate();
      if (auth == null)
         throw new Exception("prepareForRequest: could not retreive the Authenticator object. Can not continue.");
      SessionName sessionName = new SessionName(this.global, sessionId);
      I_AdminSubject subject = auth.getSubjectInfoByName(sessionName);
      if (subject == null)
         throw new Exception("prepareForRequest: no subject (slave) found with the session name '" + sessionId + "'");
      I_AdminSession session = subject.getSessionByPubSessionId(sessionName.getPublicSessionId());
      if (session == null)
         throw new Exception("prepareForRequest: no session '" + sessionId + "' found. Valid sessions for this user are '" + subject.getSessionList() + "'");
      return session;
   }
View Full Code Here


      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)
            throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "Please pass a command which has a valid public session ID in '" + cmd.getCommand() + "'.");

         if (pubSessionId.startsWith("?")) {
            // for example "/node/heron/joe/?uptime"
            return doGetInvoke(cmd, pubSessionId.substring(1), subjectInfo, I_AdminSubject.class);
         }

         String sessionAttr = cmd.getSessionAttrLevel();
         if (sessionAttr == null || sessionAttr.length() < 1 || sessionAttr.startsWith("?")==false)
            throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "Please pass a command which has a valid session attribute in '" + cmd.getCommand() + "'.");

         if (sessionAttr.startsWith("?")) {
            // for example "client/joe/ses17/?queue/callback/maxEntries"
            I_AdminSession sessionInfo = subjectInfo.getSessionByPubSessionId(Long.parseLong(pubSessionId));
            if (sessionInfo == null)
               throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "The public session ID '" + pubSessionId + "' in '" + cmd.getCommand() + "' is unknown.");
            return doGetInvoke(cmd, sessionAttr.substring(1), sessionInfo, I_AdminSession.class);
         }
      }
View Full Code Here

      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)
         throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "Please pass a command which has a valid public session ID in '" + cmd.getCommand() + "'.");

      if (pubSessionId.startsWith("?")) {
         // for example "/node/heron/joe/?uptime"
         /*String ret = ""+*/setInvoke(cmd.getKey(), subjectInfo, I_AdminSubject.class, cmd.getArgs());
         log.info("Set " + cmd.getCommandStripAssign() + "=" + cmd.getArgsString());
         return cmd.getArgsString();
      }

      String sessionAttr = cmd.getSessionAttrLevel();
      if (sessionAttr == null || sessionAttr.length() < 1 || sessionAttr.startsWith("?")==false)
         throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "Please pass a command which has a valid session attribute in '" + cmd.getCommand() + "'.");

      if (sessionAttr.startsWith("?")) {
         // for example "client/joe/ses17/?queue/callback/maxEntries"
         I_AdminSession sessionInfo = subjectInfo.getSessionByPubSessionId(Long.parseLong(pubSessionId));
         if (sessionInfo == null)
            throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "The public session ID '" + pubSessionId + "' in '" + cmd.getCommand() + "' is unknown.");
         /*String ret = ""+*/setInvoke(cmd.getKey(), sessionInfo, I_AdminSession.class, cmd.getArgs());
         log.info("Set " + cmd.getCommandStripAssign() + "=" + cmd.getArgsString());
         return cmd.getArgsString();
View Full Code Here

      super(glob, connectionsHandler, address);
      this.ME = connectionsHandler.getDispatchManager().getQueue().getStorageId().toString();

      sessionName = connectionsHandler.getDispatchManager().getSessionName();
      ServerScope serverScope = (ServerScope)glob;
      I_AdminSubject subject = serverScope.getAuthenticate().getSubjectInfoByName(sessionName);
      if (subject != null)
         this.session = subject.getSessionByPubSessionId(sessionName.getPublicSessionId());
     
      // This other side uses us as tunnel, we won't ping it
      this.useRemoteLoginAsTunnel = address.getEnv("useRemoteLoginAsTunnel", false).getValue(); //"heron".equals(qos.getSessionName().getLoginName());
      //this.acceptRemoteLoginAsTunnel = address.getEnv("acceptRemoteLoginAsTunnel", false).getValue();
   }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.engine.admin.I_AdminSubject

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.