Package org.jclouds.rest

Examples of org.jclouds.rest.ResourceNotFoundException


      } 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


               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 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 413:
            exception = new InsufficientResourcesException(message, exception);
            break;
View Full Code Here

         if (ImmutableSet.of("InvalidAction", "AccessDenied").contains(errorCode))
            return new UnsupportedOperationException(message, in);
         else if ("Throttling".equals(errorCode))
            return new InsufficientResourcesException(message, in);
         else if (message.indexOf("not found") != -1)
            return new ResourceNotFoundException(message, in);
         return new IllegalArgumentException(message, in);
      }
      return in;
   }
View Full Code Here

            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")))
                     || (message != null && (message.indexOf("already exists") != -1 || message.indexOf("is in use") != -1)))
               exception = new IllegalStateException(message, exception);
            else if (errorCode != null && errorCode.indexOf("AuthFailure") != -1)
               exception = new AuthorizationException(message, exception);
            else if (message != null
                     && (message.indexOf("Invalid id") != -1 || message.indexOf("Failed to bind") != -1))
               exception = new IllegalArgumentException(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 409:
            exception = new IllegalStateException(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 413:
            if (content == null) {
               exception = new InsufficientResourcesException(message, exception);
View Full Code Here

         case 403:
            exception = new AuthorizationException(message, exception);
            break;
         case 400:
            if (message.indexOf("not find") != -1) {
               exception = new ResourceNotFoundException(message, exception);
            }
            break;
         case 404:
            if (message.indexOf("Not supported") != -1) {
               exception = new UnsupportedOperationException(message, exception);
            } else {
               exception = new ResourceNotFoundException(message, exception);
            }
            break;
         case 500:
            if (message.indexOf("Locked") != -1) {
               exception = new IllegalStateException(message, exception);
View Full Code Here

            case 401:
               throw new AuthorizationException(responseException);
            case 403:
               throw new AuthorizationException(responseException);
            case 404:
               throw new ResourceNotFoundException(responseException);
            case 409:
               throw new IllegalStateException(responseException);
            }
      }
      throw propagate(t);
View Full Code Here

         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;
         case 409:
         case 431:
            if (message.contains("does not exist")) {
               exception = new ResourceNotFoundException(message, exception);
            } else {
               exception = new IllegalStateException(message, exception);
            }
            break;
         case 534:
View Full Code Here

         case 401:
            exception = new AuthorizationException(message, exception);
            break;
         case 404:
            if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
               exception = new ResourceNotFoundException(message, exception);
            }
            break;
         case 411:
            exception = new IllegalArgumentException(message);
            break;
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.