Examples of InsufficientResourcesException


Examples of javax.naming.InsufficientResourcesException

           *  added amount / set it to the not added amount
           */
          shop.setAmount(notAdded);
         
          // not enough room in the inventory
          cause = new InsufficientResourcesException(Term.ERROR_INSUFFICIENT_ROOM.get());
        }
      }
     
      if (cause != null) {
        scre.setCancelled(true);
View Full Code Here

Examples of javax.naming.InsufficientResourcesException

       
      }
     
      // insufficient money
      else if (!scs.getBalanceHandler().hasEnough(player.getName(), amount*price)) {
        cause = new InsufficientResourcesException(Term.ERROR_INSUFFICIENT_MONEY_YOU.get());
      }
 
      if (cause != null) {
        scpbe.setCancelled(true);
        scpbe.setCause(cause);
View Full Code Here

Examples of javax.naming.InsufficientResourcesException

       
      }
     
      // insufficient money
      else if (!scs.getBalanceHandler().hasEnough(shop.getOwner(), amount*price)) {
        cause = new InsufficientResourcesException(Term.ERROR_INSUFFICIENT_MONEY_COSTUMER.get());
      }
 
      if (cause != null) {
        scpse.setCancelled(true);
        scpse.setCause(cause);
View Full Code Here

Examples of org.jclouds.rest.InsufficientResourcesException

      message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(),
               response.getStatusLine());
      switch (response.getStatusCode()) {
         case 400:
            if (message.contains("quota exceeded"))
               exception = new InsufficientResourcesException(message, exception);
            break;
         case 401:
         case 403:
            exception = new AuthorizationException(message, exception);
            break;
         case 404:
            if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
               exception = new ResourceNotFoundException(message, exception);
            }
            break;
         case 413:
            exception = new InsufficientResourcesException(message, exception);
            break;
      }
      command.setException(exception);
   }
View Full Code Here

Examples of org.jclouds.rest.InsufficientResourcesException

               exception = new IllegalStateException(message, exception);
            }
            break;
         case 534:
            if (message.contains("Maximum number of resources of type")) {
               exception = new InsufficientResourcesException(message, exception);
            }
            break;
         case 537:
            exception = new IllegalStateException(message, exception);
            break;
View Full Code Here

Examples of org.jclouds.rest.InsufficientResourcesException

      switch (response.getStatusCode()) {
         case 400:
            if ("UnsupportedOperation".equals(errorCode))
               exception = new UnsupportedOperationException(message, exception);
            else if ("AddressLimitExceeded".equals(errorCode))
               exception = new InsufficientResourcesException(message, exception);
            else if ("TooManyBuckets".equals(errorCode))
               exception = new InsufficientResourcesException(message, exception);
            else if (errorCode != null && (errorCode.indexOf("NotFound") != -1 || errorCode.endsWith(".Unknown")))
               exception = new ResourceNotFoundException(message, exception);
            else if ("IncorrectState".equals(errorCode)
                     || (errorCode != null && (error.getCode().endsWith(".Duplicate") || error.getCode().endsWith(
                              ".InUse")))
View Full Code Here

Examples of org.jclouds.rest.InsufficientResourcesException

               ip = existingIp;
               break;
            }
         }
         if (ip == null)
            throw new InsufficientResourcesException(
                     "no more ip addresses available and existing ips all have services attached: " + publicIps, e
                              .getCause());
      }
      is = client.addInternetServiceToExistingIp(ip.getId(), vApp.getName() + "-" + port, protocol, port,
               withDescription(String.format("port %d access to serverId: %s name: %s", port, vApp.getName(), vApp
View Full Code Here

Examples of org.jclouds.rest.InsufficientResourcesException

                           || (response.getMessage().indexOf("because it is already powered off") != -1)
                           || (response.getMessage().indexOf("exists") != -1)))
            exception = new IllegalStateException(response.getMessage(), exception);
         else if (response.getMessage() != null
                  && ((response.getMessage().indexOf("There are no additional Public IPs available") != -1)))
            exception = new  InsufficientResourcesException(response.getMessage(), exception);
         else
            switch (response.getStatusCode()) {
               case 400:
                  exception = new IllegalArgumentException(response.getMessage(), exception);
                  break;
View Full Code Here

Examples of org.jclouds.rest.InsufficientResourcesException

      if ("AccessDeniedException".equals(error.getCode())) {
         return new AuthorizationException(error.getMessage(), exception);
      } else if ("InvalidParameterValueException".equals(error.getCode())) {
         return new IllegalArgumentException(error.getMessage(), exception);
      } else if ("LimitExceededException".equals(error.getCode())) {
         return new InsufficientResourcesException(error.getMessage(), exception);
      } else if ("ResourceNotFoundException".equals(error.getCode())) {
         return new ResourceNotFoundException(error.getMessage(), exception);
      }
      return exception;
   }
View Full Code Here

Examples of org.jclouds.rest.InsufficientResourcesException

      String errorCode = in.getError().getCode();
      String message = in.getError().getMessage();

      if (statusCode == 400) {
         if ("LimitExceeded".equals(errorCode)) {
            return new InsufficientResourcesException(message, in);
         } else if ("InvalidFormat".equals(errorCode)) {
            return new IllegalArgumentException(message, in);
         }
      }
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.