Package org.jclouds.rest

Examples of org.jclouds.rest.ResourceNotFoundException


               response.getStatusLine());
         switch (response.getStatusCode()) {
         case 400:
            if ((command.getCurrentRequest().getEndpoint().getPath().endsWith("/info"))
                  || (message != null && message.indexOf("could not be found") != -1))
               exception = new ResourceNotFoundException(message, exception);
            else
               exception = new IllegalArgumentException(message, exception);
            break;
         case 401:
            exception = new AuthorizationException(message, exception);
            break;
         case 404:
            if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
               exception = new ResourceNotFoundException(message, exception);
            }
            break;
         case 405:
            exception = new IllegalArgumentException(message, exception);
            break;
View Full Code Here


            case 403:
               exception = new AuthorizationException(message, exception);
               break;
            case 404:
               if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
                  exception = new ResourceNotFoundException(message, exception);
               }
               break;
            case 500:
               if (message != null ) {
                  if (message.indexOf("Unable to determine package for") != -1) {
                     exception = new ResourceNotFoundException(message, exception);
                  } else if (message.indexOf("currently an active transaction") != -1) {
                     exception = new IllegalStateException(message, exception);
                  } else if (message.indexOf("SoftLayer_Exception_Order_Item_Duplicate") != -1) {
                     exception = new SoftLayerOrderItemDuplicateException(command, response, message);
                  }
View Full Code Here

      case ErrorCodes.POOL_NOT_FOUND:
      case ErrorCodes.DIRECTIONALPOOL_NOT_FOUND:
      case ErrorCodes.DIRECTIONALPOOL_RECORD_NOT_FOUND:
      case ErrorCodes.POOL_RECORD_NOT_FOUND:
      case ErrorCodes.GROUP_NOT_FOUND:
         return new ResourceNotFoundException(message, exception);
      case ErrorCodes.ZONE_ALREADY_EXISTS:
      case ErrorCodes.RESOURCE_RECORD_ALREADY_EXISTS:
      case ErrorCodes.POOL_ALREADY_EXISTS:
      case ErrorCodes.POOL_RECORD_ALREADY_EXISTS:
         return new ResourceAlreadyExistsException(message, exception);
View Full Code Here

            case 403:
               exception = new AuthorizationException(message, exception);
               break;
            case 404:
               if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
                  exception = new ResourceNotFoundException(message, exception);
               }
               break;
            case 500:
               if (message != null ){
                  if (message.indexOf("Unable to determine package for") != -1) {
                     exception = new ResourceNotFoundException(message, exception);
                  } else if (message.indexOf("currently an active transaction") != -1) {
                     exception = new IllegalStateException(message, exception);
                  }
               }
         }
View Full Code Here

                  if (matcher.find()) {
                     message = String.format("%s %s not found", matcher.group(1), matcher.group(2));
                  } else {
                     message = path;
                  }
                  exception = new ResourceNotFoundException(message, exception);
                  break;
               case 405:
                  exception = new UnsupportedOperationException(response.getMessage(), exception);
                  break;
               case 501:
View Full Code Here

   public URI apply(Object from) {
      try {
         return orgVDCMap.get().get(from == null ? defaultVDC.get().getHref() : from).getInternetServices().getHref();
      } catch (NullPointerException e) {
         throw new ResourceNotFoundException("vdc " + from + " not found in " + orgVDCMap.get());
      }
   }
View Full Code Here

      // Create custom exception for error codes we know about
      if (response.getStatusCode() == 401) {
         exception = new AuthorizationException(message, exception);
      } else if (response.getStatusCode() == 403 || response.getStatusCode() == 404) {
         exception = new ResourceNotFoundException(message, exception);
      }

      command.setException(exception);
   }
View Full Code Here

         switch (response.getStatusCode()) {
            case 401:
               exception = new AuthorizationException(response.getMessage(), exception);
               break;
            case 404:
               exception = new ResourceNotFoundException(response.getMessage(), exception);
               break;
            default:
               exception = new HttpResponseException(response.getMessage(), command, response);
               break;
         }
View Full Code Here

                 response.getStatusLine());
         switch (response.getStatusCode()) {
            case 400:
               if ((command.getCurrentRequest().getEndpoint().getPath().endsWith("/info"))
                       || (message != null && message.indexOf("could not be found") != -1))
                  exception = new ResourceNotFoundException(message, exception);
               else if (message != null && message.indexOf("currently in use") != -1)
                  exception = new IllegalStateException(message, exception);
               else
                  exception = new IllegalArgumentException(message, exception);
               break;
            case 401:
               exception = new AuthorizationException(message, exception);
               break;
            case 402:
               exception = new IllegalStateException(message, exception);
               break;
            case 404:
               if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
                  exception = new ResourceNotFoundException(message, exception);
               }
               break;
            case 405:
               exception = new IllegalArgumentException(message, exception);
               break;
View Full Code Here

         case 403:
            exception = new AuthorizationException(message, exception);
            break;
         case 404:
            if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
               exception = new ResourceNotFoundException(message, exception);
            }
            break;
      }
      command.setException(exception);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.rest.ResourceNotFoundException

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.