Package org.jclouds.rest

Examples of org.jclouds.rest.ResourceNotFoundException


            CacheBuilder.newBuilder().<String, Set<IPForwardingRule>> build(
                  new CacheLoader<String, Set<IPForwardingRule>>() {

                     @Override
                     public Set<IPForwardingRule> load(String arg0) throws Exception {
                        throw new ResourceNotFoundException("no ip forwarding rule for: " + arg0);
                     }

                  }), namingConvention);

      // notice if we've already parsed this properly here, we can rely on it.
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

         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

            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

   protected Exception refineException(HttpCommand command, HttpResponse response, Exception exception,
            AzureStorageError error, String message) {
      switch (response.getStatusCode()) {
         case 404:
            if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
               exception = new ResourceNotFoundException(message, exception);
               List<String> parts = Lists.newArrayList(Splitter.on('/').split(
                        command.getCurrentRequest().getEndpoint().getPath()));
               parts.remove("");
               if (parts.size() > 0) {
                  String container = parts.remove(0);
View Full Code Here

   @Override
   public void rebootNode(String id) {
      NodeMetadata node = nodes.get(id);
      if (node == null)
         throw new ResourceNotFoundException("node not found: " + id);
      setStateOnNode(Status.PENDING, node);
      setStateOnNodeAfterDelay(Status.RUNNING, node, 50);
   }
View Full Code Here

   @Override
   public void resumeNode(String id) {
      NodeMetadata node = nodes.get(id);
      if (node == null)
         throw new ResourceNotFoundException("node not found: " + id);
      if (node.getStatus() == Status.RUNNING)
         return;
      if (node.getStatus() != Status.SUSPENDED)
         throw new IllegalStateException("to resume a node, it must be in suspended status, not: " + formatStatus(node));
      setStateOnNode(Status.PENDING, node);
View Full Code Here

   @Override
   public void suspendNode(String id) {
      NodeMetadata node = nodes.get(id);
      if (node == null)
         throw new ResourceNotFoundException("node not found: " + id);
      if (node.getStatus() == Status.SUSPENDED)
         return;
      if (node.getStatus() != Status.RUNNING)
         throw new IllegalStateException("to suspend a node, it must be in running status, not: " + formatStatus(node));
      setStateOnNode(Status.PENDING, node);
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

                  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

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.