public OpenStackRequest(OpenStackClient client, HttpMethod method, CharSequence path, Entity<?> entity, Class<R> returnType) { this.client = client; this.method = method; this.path = new StringBuilder(path); this.entity = entity; this.returnType = returnType; header("Accept", "application/json"); }
public OpenStackRequest(OpenStackClient client, HttpMethod method, CharSequence path, Entity<?> entity, Class<R> returnType) { this.client = client; this.method = method; this.path = new StringBuilder(path); this.entity = entity; this.returnType = returnType; header("Accept", "application/json"); }
public OpenStackRequest(OpenStackClient client, HttpMethod method, CharSequence path, Entity<?> entity, Class<R> returnType) { this.client = client; this.method = method; this.path = new StringBuilder(path); this.entity = entity; this.returnType = returnType; header("Accept", "application/json"); }
public OpenStackRequest(OpenStackClient client, HttpMethod method, CharSequence path, Entity<?> entity, Class<R> returnType) { this.client = client; this.method = method; this.path = new StringBuilder(path); this.entity = entity; this.returnType = returnType; header("Accept", "application/json"); }
public OpenStackRequest(OpenStackClient client, HttpMethod method, CharSequence path, Entity<?> entity, Class<R> returnType) { this.client = client; this.method = method; this.path = new StringBuilder(path); this.entity = entity; this.returnType = returnType; header("Accept", "application/json"); }
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(); } } throw authException; }
public <T> OpenStackResponse request(OpenStackRequest<T> request) { OpenStackResponseException authException = null; 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(); } } throw authException; }
public <T> OpenStackResponse request(OpenStackRequest<T> request) { OpenStackResponseException authException = null; 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(); } } throw authException; }
request.header("X-Auth-Token", tokenProvider.getToken());
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; }