Search in sources :

Example 1 with OpenStackContext

use of com.att.cdp.openstack.OpenStackContext in project AJSC by att.

the class OpenStackStackService method connect.

/**
 * This is a helper method used to construct the Nova service object and setup the environment to access the
 * OpenStack compute service (Nova).
 *
 * @throws NotLoggedInException
 *             If the user is not logged in
 * @throws ContextClosedException
 *             If the user attempts an operation after the context is closed
 */
private void connect() throws NotLoggedInException, ContextClosedException {
    checkLogin();
    checkOpen();
    Context context = getContext();
    OpenStackContext osContext = (OpenStackContext) context;
    connector = osContext.getHeatConnector();
    ((OpenStackContext) context).refreshIfStale(connector);
}
Also used : OpenStackContext(com.att.cdp.openstack.OpenStackContext) Context(com.att.cdp.zones.Context) OpenStackContext(com.att.cdp.openstack.OpenStackContext)

Example 2 with OpenStackContext

use of com.att.cdp.openstack.OpenStackContext in project AJSC by att.

the class OpenStackVolumeService method connect.

/**
 * This is a helper method used to construct the Nova service object and setup the environment to access the
 * OpenStack compute service (Nova).
 *
 * @throws NotLoggedInException
 *             If the user is not logged in
 * @throws ContextClosedException
 *             If the user attempts an operation after the context is closed
 */
private void connect() throws NotLoggedInException, ContextClosedException {
    checkLogin();
    checkOpen();
    Context context = getContext();
    OpenStackContext osContext = (OpenStackContext) context;
    nova = osContext.getNovaConnector();
    ((OpenStackContext) context).refreshIfStale(nova);
}
Also used : OpenStackContext(com.att.cdp.openstack.OpenStackContext) Context(com.att.cdp.zones.Context) OpenStackContext(com.att.cdp.openstack.OpenStackContext)

Example 3 with OpenStackContext

use of com.att.cdp.openstack.OpenStackContext in project AJSC by att.

the class OpenStackComputeService method connect.

/**
 * This is a helper method used to construct the Nova service object and setup the environment to access the
 * OpenStack compute service (Nova).
 *
 * @throws NotLoggedInException
 *             If the user is not logged in
 * @throws ContextClosedException
 *             If the user attempts an operation after the context is closed
 */
private void connect() throws NotLoggedInException, ContextClosedException {
    Context context = getContext();
    checkLogin();
    checkOpen();
    nova = ((OpenStackContext) context).getNovaConnector();
    ((OpenStackContext) context).refreshIfStale(nova);
}
Also used : Context(com.att.cdp.zones.Context) OpenStackContext(com.att.cdp.openstack.OpenStackContext) OpenStackContext(com.att.cdp.openstack.OpenStackContext)

Example 4 with OpenStackContext

use of com.att.cdp.openstack.OpenStackContext in project AJSC by att.

the class OpenStackImageService method connect.

/**
 * This is a helper method used to construct the Glance service object and setup the environment to access the
 * OpenStack image service (Glance).
 *
 * @throws NotLoggedInException
 *             If the user is not logged in
 * @throws ContextClosedException
 *             If the user attempts an operation after the context is closed
 */
private void connect() throws NotLoggedInException, ContextClosedException {
    checkLogin();
    checkOpen();
    Context context = getContext();
    OpenStackContext osContext = (OpenStackContext) context;
    glance = osContext.getGlanceConnector();
    ((OpenStackContext) context).refreshIfStale(glance);
}
Also used : OpenStackContext(com.att.cdp.openstack.OpenStackContext) Context(com.att.cdp.zones.Context) OpenStackContext(com.att.cdp.openstack.OpenStackContext)

Example 5 with OpenStackContext

use of com.att.cdp.openstack.OpenStackContext in project AJSC by att.

the class OpenStackImageService method connect.

/**
 * This is a helper method used to construct the Glance service object and setup the environment to access the
 * OpenStack image service (Glance).
 *
 * @throws NotLoggedInException
 *             If the user is not logged in
 * @throws ContextClosedException
 *             If the user attempts an operation after the context is closed
 */
private void connect() throws NotLoggedInException, ContextClosedException {
    checkLogin();
    checkOpen();
    Context context = getContext();
    OpenStackContext osContext = (OpenStackContext) context;
    // connector = osContext.getGlanceConnector();
    nova = osContext.getNovaConnector();
    ((OpenStackContext) context).refreshIfStale(nova);
}
Also used : OpenStackContext(com.att.cdp.openstack.OpenStackContext) Context(com.att.cdp.zones.Context) OpenStackContext(com.att.cdp.openstack.OpenStackContext)

Aggregations

OpenStackContext (com.att.cdp.openstack.OpenStackContext)28 Context (com.att.cdp.zones.Context)17 ContextConnectionException (com.att.cdp.exceptions.ContextConnectionException)7 ZoneException (com.att.cdp.exceptions.ZoneException)7 OpenStackConnectException (com.woorea.openstack.base.client.OpenStackConnectException)7 OpenStackResponseException (com.woorea.openstack.base.client.OpenStackResponseException)7 Ignore (org.junit.Ignore)7 Test (org.junit.Test)7 Access (com.woorea.openstack.keystone.model.Access)5 NovaConnector (com.att.cdp.openstack.connectors.NovaConnector)4 OpenStackKeyPair (com.att.cdp.openstack.model.OpenStackKeyPair)3 OpenStackTenant (com.att.cdp.openstack.model.OpenStackTenant)3 Keystone (com.woorea.openstack.keystone.Keystone)3 Tenants (com.woorea.openstack.keystone.model.Tenants)3 ComputeService (com.att.cdp.zones.ComputeService)2 Nova (com.woorea.openstack.nova.Nova)2 KeyPairs (com.woorea.openstack.nova.model.KeyPairs)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 Properties (java.util.Properties)2