Package org.xmlBlaster.util

Examples of org.xmlBlaster.util.XmlBlasterException


         try {
            return DriverManager.getConnection (dbUrl, dbUser, dbPasswd);
         }
         catch(Exception e) {
            //log.error(ME, "System Exception in connect(" + dbUrl + ", " + dbUser + "): " + e.toString());
            throw new XmlBlasterException(glob, ErrorCode.RESOURCE_DB_UNAVAILABLE, ME, "Couldn't open database connection dbUrl=" + dbUrl + " dbUser=" + dbUser + ": " + e.toString());
         }
      }
View Full Code Here


      /**
       * Use this method to get a JDBC connection.
       */
      Connection reserve() throws XmlBlasterException {
         if (poolManager == null) { throw new XmlBlasterException(glob, ErrorCode.INTERNAL_ILLEGALSTATE, ME+".Destroyed", "Pool is destroyed"); }
         if (log.isLoggable(Level.FINE)) log.fine("Entering reserve '" + dbUrl + "', '" + dbUser + "'");
         int ii=0;
         while (true) {
            try {
               synchronized(meetingPoint) {
View Full Code Here

      /**
       * Use this method to release a JDBC connection.
       */
      void release(Connection con) throws XmlBlasterException {
         if (poolManager == null) { throw new XmlBlasterException(glob, ErrorCode.INTERNAL_ILLEGALSTATE, ME+".Destroyed", "Pool is destroyed"); }
         if (log.isLoggable(Level.FINE)) log.fine("Entering release '" + dbUrl + "', '" + dbUser + "' conId=" + con);
         try {
            synchronized(meetingPoint) {
               poolManager.release(""+con);
            }
View Full Code Here

      /**
       * Destroy a JDBC connection (from busy or idle to undef).
       */
      void erase(Connection con) throws XmlBlasterException {
         if (poolManager == null) { throw new XmlBlasterException(glob, ErrorCode.INTERNAL_ILLEGALSTATE, ME+".Destroyed", "Pool is destroyed"); }
         if (log.isLoggable(Level.FINE)) log.fine("Entering erase '" + dbUrl + "', '" + dbUser + "' conId=" + con);
         synchronized(meetingPoint) {
            poolManager.erase(""+con);
         }
      }
View Full Code Here

      this.glob = glob;

      this.ME = "CommandWrapper-" + this.glob.getId();
      this.myStrippedClusterNodeId = getStrippedClusterNodeId();
      if (command == null)
         throw new XmlBlasterException(this.glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "Your command is null, aborted request");
      command = CommandWrapper.stripCommand(glob, command); // string "__cmd:" away
      if (!command.startsWith("/"))
         this.cmd = "/node/" + myStrippedClusterNodeId + "/" + command;
      else
         this.cmd = command;
View Full Code Here

            break;
         }
         ii++;
      }
      if (root == null || clusterNodeId == null || third == null) {
         throw new XmlBlasterException(this.glob, ErrorCode.USER_ILLEGALARGUMENT, ME + ".parse", "Your command is invalid, missing levels: '" + cmd + "'");
      }
      if (!"node".equals(root)) {
         throw new XmlBlasterException(this.glob, ErrorCode.USER_ILLEGALARGUMENT, ME + ".parse", "Your root node is invalid, only <node> is supported, sorry '" + cmd + "' rejected");
      }
      if (!glob.getId().equals(clusterNodeId) && !myStrippedClusterNodeId.equals(clusterNodeId)) {
         throw new XmlBlasterException(this.glob, ErrorCode.USER_ILLEGALARGUMENT, ME + ".parse", "Query of foreign cluster node '" + clusterNodeId + "' is not implemented, sorry '" + cmd + "' rejected");
      }

      int offset = root.length() + clusterNodeId.length() + third.length() + 4;
      if (cmd.length() > offset)
         tail = cmd.substring(offset);
View Full Code Here

    */
   private void parseKeyValue() throws XmlBlasterException {
      int qIndex = cmd.indexOf("?");
      if (qIndex < 1 || cmd.length() <= (qIndex+1)) {
         log.warning("parseKeyValue(): Invalid command '" + cmd + "', can't find '?'");
         throw new XmlBlasterException(this.glob, ErrorCode.USER_ILLEGALARGUMENT, ME + ".parseKeyValue", "Invalid command '" + cmd + "', can't find '?'");
      }
      // "addRemoteProperty=arg1&arg2"
      String propString = cmd.substring(qIndex+1);
      int equalsIndex = propString.indexOf("=");
      if (equalsIndex < 1 || propString.length() <= (equalsIndex+1)) {
         this.key = propString;
         this.args = null;
         return; // a getXy()
         //log.warn(ME, "parseKeyValue(): Invalid command '" + cmd + "', can't find '='");
         //throw new XmlBlasterException(this.glob, ErrorCode.USER_ILLEGALARGUMENT, ME + ".parseKeyValue", "Invalid command '" + cmd + "', can't find '='");
      }
     
      this.key = propString.substring(0, equalsIndex);

      // "arg1&arg2"
      this.argsString = propString.substring(equalsIndex+1).trim();
     
      this.args = StringPairTokenizer.parseLine(argsString, '&');
      if (this.args.length < 1) {
         log.warning("parseKeyValue(): Invalid command '" + cmd + "', can't find value behind '='");
         throw new XmlBlasterException(this.glob, ErrorCode.USER_ILLEGALARGUMENT, ME + ".parseKeyValue", "Invalid command '" + cmd + "', can't find value behind '='");
      }
      /*
      StringTokenizer tokenizer = new StringTokenizer(propString.trim(), PROP_SEPARATOR); // "&"

      boolean keyAlreadyAssigned = false;
View Full Code Here

    * @return
    * @throws XmlBlasterException
    */
   public static String stripCommand(ServerScope glob, String command) throws XmlBlasterException {
      if (command == null) {
         throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, "CommandWrapper.stripCommand", "Ignoring your empty command.");
      }
      command = command.trim();
      if (!command.startsWith("__cmd:") || command.length() < ("__cmd:".length() + 1)) {
         return command; //throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, "CommandWrapper.stripCommand", "Ignoring your empty command '" + command + "'.");
      }
View Full Code Here

               // TODO: crypt.importMessage(receiver.getQos()); see also ClientDispatchConnection.java:440
               Socket socket = this.sock;
               if (socket == null) return; // Is possible when EOF arrived inbetween
               ConnectQosServer conQos = new ConnectQosServer(driver.getGlobal(), receiver.getQos());
               if (conQos.getSecurityQos() == null)
                  throw new XmlBlasterException(glob, ErrorCode.USER_SECURITY_AUTHENTICATION_ILLEGALARGUMENT, ME, "connect() without securityQos");
               conQos.getSecurityQos().setClientIp (socket.getInetAddress().getHostAddress());

               conQos.setAddressServer(getAddressServer());
               setLoginName(conQos.getSessionName().getRelativeName());
               if (this.callCoreInSeparateThread) {
View Full Code Here

         return doc;

      }
      catch (Exception e) {
         log.warning("Error in scanning result set for '" + columnName + "': " + e.toString());
         throw new XmlBlasterException(Global.instance(),
                    ErrorCode.INTERNAL_UNKNOWN, ME,
                    "Error in scanning result set for '" + columnName + "'", e);
      }
   }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.XmlBlasterException

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.