@Override
public void setServiceState(String machineId, ServiceState serviceState) throws NotFoundException {
checkState(isConfigured(), "attempt to use unconfigured driver");
getMachineOrFail(machineId);
try {
LOG.debug("service state {} reported for {}", serviceState.name(), machineId);
Map<String, String> tags = ImmutableMap.of(Constants.SERVICE_STATE_TAG, serviceState.name());
this.client.tagServer(machineId, tags);
} catch (Exception e) {
Throwables.throwIfInstanceOf(e, CloudPoolDriverException.class);
String message = format("failed to tag service state on server \"%s\": %s", machineId, e.getMessage());
throw new CloudPoolDriverException(message, e);
}
}