@Override public <T> T getEntity(Class<T> returnType) { if(response.getStatus() >= 400) { throw new OpenStackResponseException(response.getStatusInfo().getReasonPhrase(), response.getStatusInfo().getStatusCode()); } return response.readEntity(returnType); }
@Override public <T> T getEntity(Class<T> returnType) { if(response.getStatus() >= 400) { throw new OpenStackResponseException(response.getStatusInfo().getReasonPhrase(), response.getStatusInfo().getStatusCode()); } return response.readEntity(returnType); }
throw new OpenStackResponseException(e.getMessage(), e.getStatusCode()); throw new OpenStackResponseException(httpResponse.getStatusLine().getReasonPhrase(), httpResponse.getStatusLine().getStatusCode(), httpClientResponse);
@Override public <T> T getEntity(Class<T> returnType) { if(response.getStatus() >= 400) { throw new OpenStackResponseException(response.getClientResponseStatus().getReasonPhrase(), response.getStatus()); } if(response.hasEntity() && returnType != null && Void.class != returnType) { return response.getEntity(returnType); } else { return null; } }
throw new OpenStackResponseException(e.getResponse() .getStatusInfo().toString(), e.getResponse().getStatus());
int status = response.getStatus(); if ( status >= 400) { throw new OpenStackResponseException("Unexpected status received from Openstack", status, response);
@Override public <T> T getEntity(Class<T> returnType) { if(response.getStatus() >= 400) { throw new OpenStackResponseException(response.getClientResponseStatus().getReasonPhrase(), response.getStatus()); } if(response.hasEntity() && returnType != null && Void.class != returnType) { return response.getEntity(returnType); } else { return null; } }
throw new OpenStackResponseException(e.getResponse() .getStatusInfo().toString(), e.getResponse().getStatus());
/** * @see com.woorea.openstack.base.client.OpenStackResponse#getEntity(java.lang.Class) */ @Override public <T> T getEntity(Class<T> returnType) throws OpenStackResponseException { if(response.getStatus() >= 400) { throw new OpenStackResponseException(response.getClientResponseStatus().getReasonPhrase(), response.getStatus(), this); } if(response.hasEntity() && returnType != null && Void.class != returnType) { return response.getEntity(returnType); } return null; }
throw new OpenStackResponseException(response.getResponseStatus() .getReasonPhrase(), response.getStatus());
public <T> OpenStackResponse request(OpenStackRequest<T> request) { OpenStackResponseException authException = null; System.out.println("Openstack query:"+request.toString()); for (int i = 0; i <= AUTHENTICATION_RETRIES; i++) { request.endpoint(endpoint); if (tokenProvider != null) { request.header("X-Auth-Token", tokenProvider.getToken()); } try { return connector.request(request); } catch (OpenStackResponseException e) { if (e.getStatus() != OpenStackResponseStatus.NOT_AUTHORIZED || tokenProvider == null) { throw e; } authException = e; tokenProvider.expireToken(); } } if(null == authException){ authException = new OpenStackResponseException("Unknown issue",500); } throw authException; }
throw new OpenStackResponseException(e.getResponse().getClientResponseStatus().getReasonPhrase(), e.getResponse().getStatus());
throw new OpenStackResponseException(e.getResponse().getClientResponseStatus().getReasonPhrase(), e.getResponse().getStatus());
throw new OpenStackConnectException(e.getMessage(), e); } catch (UniformInterfaceException e) { throw new OpenStackResponseException(e.getResponse().getClientResponseStatus().getReasonPhrase(), e .getResponse().getStatus());