summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackBaseException.java26
-rw-r--r--openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClient.java26
-rw-r--r--openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackCommand.java7
3 files changed, 15 insertions, 44 deletions
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
index c852ecf..53d2595 100644
--- 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
@@ -14,28 +14,6 @@
* ============LICENSE_END=========================================================
*/
-/*
- * ============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;
@@ -51,7 +29,7 @@ public abstract class OpenStackBaseException extends RuntimeException
* Implement only the basic constructors
*/
public OpenStackBaseException () {}
-
+
public OpenStackBaseException(String message) {
super(message);
}
@@ -59,4 +37,4 @@ public abstract class OpenStackBaseException extends RuntimeException
public OpenStackBaseException(String message, Throwable cause) {
super(message, cause);
}
-}
+} \ No newline at end of file
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
index 03d2b5c..23ee8dc 100644
--- 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
@@ -24,17 +24,17 @@ 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 {
@@ -59,7 +59,7 @@ public class OpenStackClient {
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);
@@ -78,10 +78,10 @@ public class OpenStackClient {
tokenProvider.expireToken();
}
}
- if(null == authException){
- authException = new OpenStackResponseException("Unknown issue",500);
+ if(null == authException){
+ authException = new OpenStackResponseException("Unknown issue",500);
}
- throw authException;
+ throw authException;
}
public <T> T execute(OpenStackRequest<T> request) {
@@ -92,17 +92,17 @@ public class OpenStackClient {
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 <R> OpenStackRequest<R> get(String path, Class<R> returnType) {
return new OpenStackRequest<>(this, HttpMethod.GET, path, null, returnType);
}
-
-}
+
+} \ No newline at end of file
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
index c66b548..db87a3b 100644
--- 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
@@ -15,10 +15,3 @@
*/
package com.woorea.openstack.base.client;
-//package org.openstack.base.client;
-//
-//public interface OpenStackCommand<R> {
-//
-// OpenStackRequest createRequest(OpenStackClient connector);
-//
-//}