From 2e984294ac28c6f2ede290c38164c5d536ccaf4a Mon Sep 17 00:00:00 2001 From: ChrisC Date: Tue, 31 Jan 2017 13:57:24 +0100 Subject: Initial OpenECOMP MSO OpenStack SDK lib commit Change-Id: Ieaacb2b2c0dcc469669880e73f0cda9fa59a6c5a Signed-off-by: ChrisC --- openstack-client/pom.xml | 12 ++ .../com/woorea/openstack/base/client/Entity.java | 54 ++++++++ .../woorea/openstack/base/client/HttpMethod.java | 5 + .../base/client/OpenStackBaseException.java | 46 +++++++ .../openstack/base/client/OpenStackClient.java | 90 +++++++++++++ .../base/client/OpenStackClientConnector.java | 8 ++ .../openstack/base/client/OpenStackCommand.java | 8 ++ .../base/client/OpenStackConnectException.java | 42 ++++++ .../openstack/base/client/OpenStackRequest.java | 142 +++++++++++++++++++++ .../openstack/base/client/OpenStackResponse.java | 22 ++++ .../base/client/OpenStackResponseException.java | 42 ++++++ .../base/client/OpenStackResponseStatus.java | 11 ++ .../base/client/OpenStackSimpleTokenProvider.java | 20 +++ .../base/client/OpenStackTokenProvider.java | 9 ++ .../common/client/AbstractOpenStackClient.java | 125 ++++++++++++++++++ .../openstack/common/session/OpenStackSession.java | 107 ++++++++++++++++ .../common/session/OpenStackSessionHolder.java | 16 +++ 17 files changed, 759 insertions(+) create mode 100644 openstack-client/pom.xml create mode 100644 openstack-client/src/main/java/com/woorea/openstack/base/client/Entity.java create mode 100644 openstack-client/src/main/java/com/woorea/openstack/base/client/HttpMethod.java create mode 100644 openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackBaseException.java create mode 100644 openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClient.java create mode 100644 openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClientConnector.java create mode 100644 openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackCommand.java create mode 100644 openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackConnectException.java create mode 100644 openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackRequest.java create mode 100644 openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponse.java create mode 100644 openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseException.java create mode 100644 openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseStatus.java create mode 100644 openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackSimpleTokenProvider.java create mode 100644 openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackTokenProvider.java create mode 100644 openstack-client/src/main/java/com/woorea/openstack/common/client/AbstractOpenStackClient.java create mode 100644 openstack-client/src/main/java/com/woorea/openstack/common/session/OpenStackSession.java create mode 100644 openstack-client/src/main/java/com/woorea/openstack/common/session/OpenStackSessionHolder.java (limited to 'openstack-client') diff --git a/openstack-client/pom.xml b/openstack-client/pom.xml new file mode 100644 index 0000000..ac668b0 --- /dev/null +++ b/openstack-client/pom.xml @@ -0,0 +1,12 @@ + + 4.0.0 + + org.openecomp.mso.libs + openstack-java-sdk + 1.0.0-SNAPSHOT + + org.openecomp.mso.libs.openstack-java-sdk + openstack-client + OpenStack Client + OpenStack Client + \ No newline at end of file diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/Entity.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/Entity.java new file mode 100644 index 0000000..42eb5fd --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/Entity.java @@ -0,0 +1,54 @@ +package com.woorea.openstack.base.client; + +import java.io.InputStream; + + +public class Entity { + + private T entity; + + private String contentType; + + public static Entity json(T entity) { + return new Entity(entity, "application/json"); + } + + public static Entity stream(T entity) { + return new Entity(entity, "application/octet-stream"); + } + + public Entity(T entity, String contentType) { + super(); + this.entity = entity; + this.contentType = contentType; + } + + /** + * @return the entity + */ + public T getEntity() { + return entity; + } + + /** + * @param entity the entity to set + */ + public void setEntity(T entity) { + this.entity = entity; + } + + /** + * @return the contentType + */ + public String getContentType() { + return contentType; + } + + /** + * @param contentType the contentType to set + */ + public void setContentType(String contentType) { + this.contentType = contentType; + } + +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/HttpMethod.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/HttpMethod.java new file mode 100644 index 0000000..6c62ffb --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/HttpMethod.java @@ -0,0 +1,5 @@ +package com.woorea.openstack.base.client; + +public enum HttpMethod { + HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS, TRACE +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackBaseException.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackBaseException.java new file mode 100644 index 0000000..1827ae1 --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackBaseException.java @@ -0,0 +1,46 @@ +/* + * ============LICENSE_START========================================== + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END============================================ + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + * + */ + +package com.woorea.openstack.base.client; + +/** + * A common abstract parent of all Openstack Exception types, allowing + * calling classes the choice to catch all error exceptions together. + */ +public abstract class OpenStackBaseException extends RuntimeException +{ + private static final long serialVersionUID = 1L; + + /* + * Implement only the basic constructors + */ + public OpenStackBaseException () {} + + public OpenStackBaseException(String message) { + super(message); + } + + public OpenStackBaseException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClient.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClient.java new file mode 100644 index 0000000..57a6628 --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClient.java @@ -0,0 +1,90 @@ +package com.woorea.openstack.base.client; + +/* + * Modifications copyright (c) 2017 AT&T Intellectual Property + */ + +import java.util.Properties; +import java.util.ServiceLoader; + +public class OpenStackClient { + + protected String endpoint; + + protected OpenStackTokenProvider tokenProvider; + + protected static int AUTHENTICATION_RETRIES = 1; + + protected OpenStackClientConnector connector; + + protected Properties properties = new Properties(); + + protected static OpenStackClientConnector DEFAULT_CONNECTOR; + + static { + ServiceLoader connectorLoader; + connectorLoader = ServiceLoader.load(OpenStackClientConnector.class); + + for (OpenStackClientConnector clientConnector : connectorLoader) { + DEFAULT_CONNECTOR = clientConnector; + break; + } + } + + public OpenStackClient(String endpoint) { + this.endpoint = endpoint; + this.connector = DEFAULT_CONNECTOR; + } + + public OpenStackClient(String endpoint, OpenStackClientConnector connector) { + this.endpoint = endpoint; + this.connector = (connector == null) ? DEFAULT_CONNECTOR : connector; + } + + public OpenStackResponse request(OpenStackRequest 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 execute(OpenStackRequest request) { + OpenStackResponse response = request(request); + return (request.returnType() != null && request.returnType() != Void.class) ? response.getEntity(request.returnType()) : null; + } + + public void property(String property, String value) { + properties.put(property, value); + } + + public void setTokenProvider(OpenStackTokenProvider tokenProvider) { + this.tokenProvider = tokenProvider; + } + + public void token(String token) { + setTokenProvider(new OpenStackSimpleTokenProvider(token)); + } + + public OpenStackRequest get(String path, Class returnType) { + return new OpenStackRequest(this, HttpMethod.GET, path, null, returnType); + } + +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClientConnector.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClientConnector.java new file mode 100644 index 0000000..417b844 --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClientConnector.java @@ -0,0 +1,8 @@ +package com.woorea.openstack.base.client; + + +public interface OpenStackClientConnector { + + public OpenStackResponse request(OpenStackRequest request); + +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackCommand.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackCommand.java new file mode 100644 index 0000000..5ef291f --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackCommand.java @@ -0,0 +1,8 @@ +package com.woorea.openstack.base.client; +//package org.openstack.base.client; +// +//public interface OpenStackCommand { +// +// OpenStackRequest createRequest(OpenStackClient connector); +// +//} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackConnectException.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackConnectException.java new file mode 100644 index 0000000..aabcd1f --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackConnectException.java @@ -0,0 +1,42 @@ +/* + * ============LICENSE_START========================================== + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END============================================ + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + * + */ + +package com.woorea.openstack.base.client; + +/** + * Custom RuntimeException to report connection errors to Openstack endpoints. + * Must be a RuntimeException to conform with OpenstackClient interface, which + * does not declare specific Exceptions. + */ +public class OpenStackConnectException extends OpenStackBaseException { + + private static final long serialVersionUID = 7294957362769575271L; + + public OpenStackConnectException(String message) { + super(message); + } + + public OpenStackConnectException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackRequest.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackRequest.java new file mode 100644 index 0000000..94a545f --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackRequest.java @@ -0,0 +1,142 @@ +package com.woorea.openstack.base.client; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; + +public class OpenStackRequest { + + private OpenStackClient client; + + public OpenStackRequest() { + + } + + public OpenStackRequest(OpenStackClient client, HttpMethod method, CharSequence path, Entity entity, Class returnType) { + this.client = client; + this.method = method; + this.path = new StringBuilder(path); + this.entity = entity; + this.returnType = returnType; + header("Accept", "application/json"); + } + + private String endpoint; + + private HttpMethod method; + + private StringBuilder path = new StringBuilder(); + + private Map> headers = new HashMap>(); + + private Entity entity; + + private Class returnType; + + public OpenStackRequest endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + public String endpoint() { + return endpoint; + } + + public OpenStackRequest method(HttpMethod method) { + this.method = method; + return this; + } + + public HttpMethod method() { + return method; + } + + public OpenStackRequest path(String path) { + this.path.append(path); + return this; + } + + public String path() { + return path.toString(); + } + + public OpenStackRequest header(String name, Object value) { + if(value != null) { + headers.put(name, Arrays.asList(value)); + } + return this; + } + + public Map> headers() { + return headers; + } + + public Entity entity(T entity, String contentType) { + return new Entity(entity, contentType); + } + + public Entity entity() { + return entity; + } + + public Entity json(T entity) { + return entity(entity, "application/json"); + } + + public void returnType(Class returnType) { + this.returnType = returnType; + } + + public Class returnType() { + return returnType; + } + + public R execute() { + return client.execute(this); + } + + public OpenStackResponse request() { + return client.request(this); + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "OpenStackRequest [endpoint=" + endpoint + ", method=" + method + + ", path=" + path + ", headers=" + headers + ", entity=" + + entity + ", returnType=" + returnType + "]"; + } + + private Map > queryParams = new LinkedHashMap >(); + + public Map > queryParams() { + return queryParams; + } + + public OpenStackRequest queryParam(String key, Object value) { + if (queryParams.containsKey(key)) { + List values = queryParams.get(key); + values.add(value); + } else { + List values = new ArrayList(); + values.add(value); + queryParams.put(key, values); + } + + return this; + } + + protected static String buildPath(String ... elements) { + StringBuilder stringBuilder = new StringBuilder(); + for (String element : elements) { + stringBuilder.append(element); + } + + return stringBuilder.toString(); + } +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponse.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponse.java new file mode 100644 index 0000000..1e09320 --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponse.java @@ -0,0 +1,22 @@ +package com.woorea.openstack.base.client; + +/* + * Modifications copyright (c) 2017 AT&T Intellectual Property + */ + +import java.io.InputStream; +import java.util.Map; + +public interface OpenStackResponse { + + public T getEntity(Class returnType); + + public T getErrorEntity(Class returnType); + + public InputStream getInputStream(); + + public String header(String name); + + public Map headers(); + +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseException.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseException.java new file mode 100644 index 0000000..355c300 --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseException.java @@ -0,0 +1,42 @@ +package com.woorea.openstack.base.client; + +/* + * Modifications copyright (c) 2017 AT&T Intellectual Property + */ + +public class OpenStackResponseException extends OpenStackBaseException { + + private static final long serialVersionUID = 7294957362769575271L; + + protected String message; + + protected int status; + + // Make the response available for exception handling (includes body) + protected OpenStackResponse response; + + public OpenStackResponseException(String message, int status) { + this.message = message; + this.status = status; + this.response = null; + } + + public OpenStackResponseException(String message, int status, OpenStackResponse response) { + this.message = message; + this.status = status; + this.response = response; + } + + public String getMessage() { + return message; + } + + public int getStatus() { + return status; + } + + public OpenStackResponse getResponse() { + return response; + } + +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseStatus.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseStatus.java new file mode 100644 index 0000000..032a511 --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseStatus.java @@ -0,0 +1,11 @@ +package com.woorea.openstack.base.client; + +public class OpenStackResponseStatus { + + public static final int OK = 200; + + public static final int NOT_AUTHORIZED = 401; + + public static final int CONFLICT = 409; + +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackSimpleTokenProvider.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackSimpleTokenProvider.java new file mode 100644 index 0000000..5ea8d76 --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackSimpleTokenProvider.java @@ -0,0 +1,20 @@ +package com.woorea.openstack.base.client; + +public class OpenStackSimpleTokenProvider implements OpenStackTokenProvider { + + String token; + + public OpenStackSimpleTokenProvider(String token) { + this.token = token; + } + + @Override + public String getToken() { + return this.token; + } + + @Override + public void expireToken() { + } + +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackTokenProvider.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackTokenProvider.java new file mode 100644 index 0000000..0a8f1bf --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackTokenProvider.java @@ -0,0 +1,9 @@ +package com.woorea.openstack.base.client; + +public interface OpenStackTokenProvider { + + String getToken(); + + void expireToken(); + +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/common/client/AbstractOpenStackClient.java b/openstack-client/src/main/java/com/woorea/openstack/common/client/AbstractOpenStackClient.java new file mode 100644 index 0000000..e48ec0b --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/common/client/AbstractOpenStackClient.java @@ -0,0 +1,125 @@ +package com.woorea.openstack.common.client; +//package org.openstack.common.client; +// +//import java.io.IOException; +//import java.util.logging.Logger; +// +//import javax.ws.rs.client.ClientRequestContext; +//import javax.ws.rs.client.ClientRequestFilter; +//import javax.ws.rs.client.Entity; +//import javax.ws.rs.client.Invocation.Builder; +//import javax.ws.rs.client.WebTarget; +//import javax.ws.rs.core.MediaType; +// +//import org.glassfish.jersey.filter.LoggingFilter; +//import org.openstack.connector.OpenStack; +// +//public class AbstractOpenStackClient { +// +// protected String endpointURL; +// +// protected String token; +// +// protected LoggingFilter loggingFilter; +// +// protected ClientRequestFilter tokenFilter = new ClientRequestFilter() { +// +// @Override +// public void filter(ClientRequestContext requestContext) throws IOException { +// requestContext.getHeaders().putSingle("X-Auth-Token", token); +// } +// }; +// +// public AbstractOpenStackClient(String endpointURL, String token) { +// this.endpointURL = endpointURL; +// this.token = token; +// } +// +// public AbstractOpenStackClient(String endpointURL) { +// this(endpointURL, null); +// } +// +// /** +// * @param token the token to set +// */ +// public void setToken(String token) { +// this.token = token; +// } +// +// public OpenStackRequest request(String uri, String... mediaTypes) { +// WebTarget endpoint = OpenStack.CLIENT.target(endpointURL); +// if(token != null) { +// endpoint.register(tokenFilter); +// } +// return new OpenStackRequest(endpoint.path(uri).request(mediaTypes)); +// } +// +// public OpenStackRequest request(String uri) { +// return request(uri, MediaType.APPLICATION_JSON); +// } +// +// protected WebTarget create(String endpoint) { +// WebTarget target = OpenStack.CLIENT.target(endpoint); +// if(loggingFilter != null) { +// target.register(loggingFilter); +// } +// if(token != null) { +// target.register(tokenFilter); +// } +// return target; +// } +// +// public void enableLogging(Logger logger, int entitySize) { +// loggingFilter = new LoggingFilter(logger, entitySize); +// } +// +// public void disableLogging() { +// loggingFilter = null; +// } +// +// public static class OpenStackRequest { +// +// private Builder builder; +// +// private OpenStackRequest(Builder builder) { +// this.builder = builder; +// } +// +// public ResponseType execute(String method, Class type) { +// return builder.method(method, type); +// } +// +// public ResponseType execute(String method, Entity data, Class type) { +// return builder.method(method, data, type); +// } +// +// public void execute(String method) { +// builder.method(method); +// } +// +// public void execute(String method, Entity data) { +// builder.method(method, data, Void.class); +// } +// +// public ResponseType get(Class type) { +// return execute("GET", type); +// } +// +// public ResponseType postJson(Object data, Class type) { +// return execute("POST", Entity.json(data), type); +// } +// +// public ResponseType putJson(Object data, Class type) { +// return execute("PUT", Entity.json(data), type); +// } +// +// public ResponseType patchJson(Object data, Class type) { +// return execute("PATCH", Entity.json(data), type); +// } +// +// public void delete() { +// execute("DELETE", Void.class); +// } +// } +// +//} diff --git a/openstack-client/src/main/java/com/woorea/openstack/common/session/OpenStackSession.java b/openstack-client/src/main/java/com/woorea/openstack/common/session/OpenStackSession.java new file mode 100644 index 0000000..a56a3af --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/common/session/OpenStackSession.java @@ -0,0 +1,107 @@ +package com.woorea.openstack.common.session; +//package org.openstack.common.session; +// +//import java.io.Serializable; +// +//import org.openstack.keystone.model.Access; +//import org.openstack.keystone.model.Authentication; +// +//public class OpenStackSession implements Serializable { +// +// private String authenticationURL; +// +// private Authentication authentication; +// +// private String identityAdministrationURL; +// +// private String identityAdministrationToken; +// +// private Access access; +// +// private boolean admin; +// +// /** +// * @return the authenticationURL +// */ +// public String getAuthenticationURL() { +// return authenticationURL; +// } +// +// /** +// * @param authenticationURL the authenticationURL to set +// */ +// public void setAuthenticationURL(String authenticationURL) { +// this.authenticationURL = authenticationURL; +// } +// +// /** +// * @return the authentication +// */ +// public Authentication getAuthentication() { +// return authentication; +// } +// +// /** +// * @param authentication the authentication to set +// */ +// public void setAuthentication(Authentication authentication) { +// this.authentication = authentication; +// } +// +// /** +// * @return the identityAdministrationURL +// */ +// public String getIdentityAdministrationURL() { +// return identityAdministrationURL; +// } +// +// /** +// * @param identityAdministrationURL the identityAdministrationURL to set +// */ +// public void setIdentityAdministrationURL(String identityAdministrationURL) { +// this.identityAdministrationURL = identityAdministrationURL; +// } +// +// /** +// * @return the identityAdministrationToken +// */ +// public String getIdentityAdministrationToken() { +// return identityAdministrationToken; +// } +// +// /** +// * @param identityAdministrationToken the identityAdministrationToken to set +// */ +// public void setIdentityAdministrationToken(String identityAdministrationToken) { +// this.identityAdministrationToken = identityAdministrationToken; +// } +// +// /** +// * @return the access +// */ +// public Access getAccess() { +// return access; +// } +// +// /** +// * @param access the access to set +// */ +// public void setAccess(Access access) { +// this.access = access; +// } +// +// /** +// * @return the admin +// */ +// public boolean isAdmin() { +// return admin; +// } +// +// /** +// * @param admin the admin to set +// */ +// public void setAdmin(boolean admin) { +// this.admin = admin; +// } +// +//} diff --git a/openstack-client/src/main/java/com/woorea/openstack/common/session/OpenStackSessionHolder.java b/openstack-client/src/main/java/com/woorea/openstack/common/session/OpenStackSessionHolder.java new file mode 100644 index 0000000..ea81f7c --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/common/session/OpenStackSessionHolder.java @@ -0,0 +1,16 @@ +package com.woorea.openstack.common.session; +//package org.openstack.common.session; +// +//public class OpenStackSessionHolder { +// +// private static final ThreadLocal HOLDER = new ThreadLocal(); +// +// public static OpenStackSession getSession() { +// return HOLDER.get(); +// } +// +// public static void setSession(OpenStackSession session) { +// HOLDER.set(session); +// } +// +//} -- cgit 1.2.3-korg