/** * {@inheritDoc} */ @Override public Set<? extends NodeMetadata> listNodesDetailsMatching(Predicate<ComputeMetadata> filter) { checkNotNull(filter, "filter"); logger.trace(">> listing node details matching(%s)", filter); Set<NodeMetadata> set = newLinkedHashSet(listNodesStrategy.listDetailsOnNodesMatching(filter)); logger.trace("<< list(%d)", set.size()); return set; }
private Function<HttpResponse, ?> getTransformer(String commandName, HttpCommand command) { HttpRequest request = command.getCurrentRequest(); Function<HttpResponse, ?> transformer = transformerForRequest.apply(request); logger.trace("<< response from %s is parsed by %s", commandName, transformer.getClass().getSimpleName()); return transformer; }
@Subscribe public void handleDeadEvent(DeadEvent deadEvent) { // NO_UCD logger.trace("detected dead event %s", deadEvent.getEvent()); } }
private Function<HttpResponse, ?> getTransformer(String commandName, HttpCommand command) { HttpRequest request = command.getCurrentRequest(); Function<HttpResponse, ?> transformer = transformerForRequest.apply(request); logger.trace("<< response from %s is parsed by %s", commandName, transformer.getClass().getSimpleName()); return transformer; }
public boolean apply(DriveInfo drive) { logger.trace("looking for claims on drive %s", checkNotNull(drive, "drive")); drive = refresh(drive); if (drive == null) return false; logger.trace("%s: looking for drive claims: currently: %s", drive.getUuid(), drive.getClaimed()); return drive.getClaimed().size() > 0; }
public boolean apply(VirtualMachine virtualMachine) { logger.trace("looking for state on virtualMachine %s", checkNotNull(virtualMachine, "virtualMachine")); virtualMachine = refresh(virtualMachine); if (virtualMachine == null) return true; logger.trace("%s: looking for virtualMachine state %s: currently: %s", virtualMachine.getId(), State.DESTROYED, virtualMachine.getState()); return virtualMachine.getState() == State.DESTROYED; }
private org.jclouds.Fallback<?> getFallback(String commandName, Invocation invocation, HttpCommand command) { HttpRequest request = command.getCurrentRequest(); org.jclouds.Fallback<?> fallback = config.getFallback(invocation); if (fallback instanceof InvocationContext) InvocationContext.class.cast(fallback).setContext(request); logger.trace("<< exceptions from %s are parsed by %s", commandName, fallback.getClass().getSimpleName()); return fallback; }
public boolean apply(Server server) { logger.trace("looking for state on server %s", checkNotNull(server, "server")); server = refresh(server); if (server == null) return true; logger.trace("%s: looking for server state %s: currently: %s", server.getId(), ServerStatus.DELETED, server.getStatus()); return server.getStatus() == ServerStatus.DELETED; }
private org.jclouds.Fallback<?> getFallback(String commandName, Invocation invocation, HttpCommand command) { HttpRequest request = command.getCurrentRequest(); org.jclouds.Fallback<?> fallback = config.getFallback(invocation); if (fallback instanceof InvocationContext) InvocationContext.class.cast(fallback).setContext(request); logger.trace("<< exceptions from %s are parsed by %s", commandName, fallback.getClass().getSimpleName()); return fallback; }
private org.jclouds.Fallback<?> getFallback(String commandName, Invocation invocation, HttpCommand command) { HttpRequest request = command.getCurrentRequest(); org.jclouds.Fallback<?> fallback = config.getFallback(invocation); if (fallback instanceof InvocationContext) InvocationContext.class.cast(fallback).setContext(request); logger.trace("<< exceptions from %s are parsed by %s", commandName, fallback.getClass().getSimpleName()); return fallback; }
public void awaitCompletion(Iterable<String> jobs) { logger.debug(">> awaiting completion of jobs(%s)", jobs); for (String job : jobs) awaitCompletion(job); logger.trace("<< completed jobs(%s)", jobs); }
public boolean apply(URI taskId) { logger.trace("looking for status on task %s", taskId); Task task = client.getTask(taskId); // perhaps task isn't available, yet if (task == null) return false; logger.trace("%s: looking for status %s: currently: %s", task, TaskStatus.SUCCESS, task.getStatus()); if (task.getStatus() == TaskStatus.ERROR) throw new RuntimeException("error on task: " + task.getHref() + " error: " + task.getError()); return task.getStatus() == TaskStatus.SUCCESS; }
public boolean apply(Volume volume) { logger.trace("looking for status on volume %s", volume.getId()); volume = Iterables.getOnlyElement(client.describeVolumesInRegion(volume.getRegion(), volume .getId())); logger.trace("%s: looking for status %s: currently: %s", volume, Volume.Status.AVAILABLE, volume.getStatus()); return volume.getStatus() == Volume.Status.AVAILABLE; }
public boolean apply(RegionAndName securityGroup) { logger.trace("looking for security group %s/%s", securityGroup.getRegion(), securityGroup.getName()); try { return refresh(securityGroup) != null; } catch (ResourceNotFoundException e) { return false; } catch (NoSuchElementException e) { return false; } }
public boolean apply(RunningInstance instance) { logger.trace("looking for ipAddress on instance %s", instance); try { instance = refresh(instance); return instance.getIpAddress() != null; } catch (AWSResponseException e) { if (e.getError().getCode().equals("InvalidInstanceID.NotFound")) return false; throw e; } }
@Override public boolean apply(CommandUsingClient commandUsingClient) { logger.trace("looking for [%s] state on %s@%s", commandUsingClient.command, commandUsingClient.client .getUsername(), commandUsingClient.client.getHostAddress()); ExecResponse response = refresh(commandUsingClient); while (response.getExitStatus() == -1) response = refresh(commandUsingClient); logger.trace("%s@%s: looking for exit code 0: currently: %s", commandUsingClient.client.getUsername(), commandUsingClient.client.getHostAddress(), response.getExitStatus()); return 0 == response.getExitStatus(); }