Class AbstractOpenstackRequest<R>
- java.lang.Object
-
- com.elastisys.scale.cloudpool.openstack.requests.AbstractOpenstackRequest<R>
-
- Type Parameters:
R- the response type
- All Implemented Interfaces:
java.util.concurrent.Callable<R>
- Direct Known Subclasses:
AssignFloatingIpRequest,CreateServerRequest,DeleteServerMetadataRequest,DeleteServerRequest,GetServerRequest,ListImagesRequest,ListNetworksRequest,ListServersWithTagRequest,ListSizesRequest,ServerExistsRequest,UpdateServerMetadataRequest
public abstract class AbstractOpenstackRequest<R> extends java.lang.Object implements java.util.concurrent.Callable<R>An abstract base class for implementing OpenStack request clients. Sub-classes need to implementdoRequest(OSClient).
-
-
Constructor Summary
Constructors Constructor Description AbstractOpenstackRequest(com.elastisys.scale.commons.openstack.OSClientFactory clientFactory)Constructs a newAbstractOpenstackRequestwith a givenOSClientFactory.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Rcall()abstract RdoRequest(org.openstack4j.api.OSClient api)Carries out the request and returns the response.com.elastisys.scale.commons.openstack.ApiAccessConfiggetApiAccessConfig()Returns the API access configuration that describes how to authenticate with and communicate over the OpenStack API.com.elastisys.scale.commons.openstack.OSClientFactorygetClientFactory()Returns the OpenStack API client factory.
-
-
-
Constructor Detail
-
AbstractOpenstackRequest
public AbstractOpenstackRequest(com.elastisys.scale.commons.openstack.OSClientFactory clientFactory)
Constructs a newAbstractOpenstackRequestwith a givenOSClientFactory.- Parameters:
clientFactory- OpenStack API client factory
-
-
Method Detail
-
call
public R call() throws org.openstack4j.api.exceptions.ResponseException
- Specified by:
callin interfacejava.util.concurrent.Callable<R>- Throws:
org.openstack4j.api.exceptions.ResponseException
-
getClientFactory
public com.elastisys.scale.commons.openstack.OSClientFactory getClientFactory()
Returns the OpenStack API client factory.- Returns:
-
getApiAccessConfig
public com.elastisys.scale.commons.openstack.ApiAccessConfig getApiAccessConfig()
Returns the API access configuration that describes how to authenticate with and communicate over the OpenStack API.- Returns:
-
doRequest
public abstract R doRequest(org.openstack4j.api.OSClient api) throws org.openstack4j.api.exceptions.ResponseException
Carries out the request and returns the response.- Parameters:
api- An authenticated OpenStack API client that is instructed to operate against the configured region.- Returns:
- The response.
- Throws:
org.openstack4j.api.exceptions.ResponseException- if the request failed.
-
-