diff options
24 files changed, 48 insertions, 34 deletions
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainUserRolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainUserRolesResource.java index 76ebb4c..af0f7e1 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainUserRolesResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainUserRolesResource.java @@ -30,11 +30,11 @@ public class DomainUserRolesResource extends GenericResource<Role, Roles> { } public OpenStackRequest<Void> add(String roleId) { - return new OpenStackRequest<Void>(CLIENT, HttpMethod.PUT, new StringBuilder(path).append("/").append(roleId).toString(), Entity.json(""), Void.class); + return new OpenStackRequest<>(CLIENT, HttpMethod.PUT, new StringBuilder(path).append("/").append(roleId).toString(), Entity.json(""), Void.class); } public OpenStackRequest<Void> remove(String roleId) { - return new OpenStackRequest<Void>(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(roleId).toString(), null, Void.class); + return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(roleId).toString(), null, Void.class); } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java index b353816..30c915c 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java @@ -38,23 +38,23 @@ public class GenericResource<One, Many> { } public OpenStackRequest<Many> list() { - return new OpenStackRequest<Many>(CLIENT, HttpMethod.GET, path, null, manyClass); + return new OpenStackRequest<>(CLIENT, HttpMethod.GET, path, null, manyClass); } public OpenStackRequest<One> create(One one) { - return new OpenStackRequest<One>(CLIENT, HttpMethod.POST, path, Entity.json(one), oneClass); + return new OpenStackRequest<>(CLIENT, HttpMethod.POST, path, Entity.json(one), oneClass); } public OpenStackRequest<One> show(String id) { - return new OpenStackRequest<One>(CLIENT, HttpMethod.GET, new StringBuilder(path).append("/").append(id).toString(), null, oneClass); + return new OpenStackRequest<>(CLIENT, HttpMethod.GET, new StringBuilder(path).append("/").append(id).toString(), null, oneClass); } public OpenStackRequest<One> update(String id, One one) { - return new OpenStackRequest<One>(CLIENT, HttpMethod.PATCH, new StringBuilder(path).append("/").append(id).toString(), Entity.json(one), oneClass); + return new OpenStackRequest<>(CLIENT, HttpMethod.PATCH, new StringBuilder(path).append("/").append(id).toString(), Entity.json(one), oneClass); } public OpenStackRequest<One> delete(String id) { - return new OpenStackRequest<One>(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(id).toString(), null, oneClass); + return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(id).toString(), null, oneClass); } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResource.java index 758d3c3..9902826 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResource.java @@ -33,11 +33,11 @@ public class ProjectRolesResource { } public OpenStackRequest<Void> add(String roleId) { - return new OpenStackRequest<Void>(CLIENT, HttpMethod.PUT, new StringBuilder(PATH).append("/").append(roleId).toString(), Entity.json(""), Void.class); + return new OpenStackRequest<>(CLIENT, HttpMethod.PUT, new StringBuilder(PATH).append("/").append(roleId).toString(), Entity.json(""), Void.class); } public OpenStackRequest<Void> remove(String roleId) { - return new OpenStackRequest<Void>(CLIENT, HttpMethod.DELETE, new StringBuilder(PATH).append("/").append(roleId).toString(), null, Void.class); + return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, new StringBuilder(PATH).append("/").append(roleId).toString(), null, Void.class); } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResource.java index c9e9d65..255dfc1 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResource.java @@ -30,11 +30,11 @@ public class ProjectUserRolesResource extends GenericResource<Role, Roles> { } public OpenStackRequest<Void> add(String roleId) { - return new OpenStackRequest<Void>(CLIENT, HttpMethod.PUT, new StringBuilder(path).append("/").append(roleId).toString(), Entity.json(""), Void.class); + return new OpenStackRequest<>(CLIENT, HttpMethod.PUT, new StringBuilder(path).append("/").append(roleId).toString(), Entity.json(""), Void.class); } public OpenStackRequest<Void> remove(String roleId) { - return new OpenStackRequest<Void>(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(roleId).toString(), null, Void.class); + return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(roleId).toString(), null, Void.class); } } diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Authentication.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Authentication.java index b6bb9fc..66d2854 100644 --- a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Authentication.java +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Authentication.java @@ -59,7 +59,7 @@ public class Authentication implements Serializable { return identity; } - private List<String> methods = new ArrayList<String>(); + private List<String> methods = new ArrayList<>(); public static final class Password { diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Credential.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Credential.java index 782e209..b3fc00f 100644 --- a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Credential.java +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Credential.java @@ -32,7 +32,7 @@ public class Credential { private String userId; - private Map<String, String> blob = new HashMap<String, String>(); + private Map<String, String> blob = new HashMap<>(); public String getId() { return id; diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Policy.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Policy.java index 1345ac2..f14a004 100644 --- a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Policy.java +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Policy.java @@ -32,7 +32,7 @@ public class Policy { private String userId; - private Map<String, String> blob = new HashMap<String, String>(); + private Map<String, String> blob = new HashMap<>(); public String getId() { return id; diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SecurityGroupsExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SecurityGroupsExtension.java index 2bfa748..ebfea43 100644 --- a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SecurityGroupsExtension.java +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SecurityGroupsExtension.java @@ -59,6 +59,7 @@ public class SecurityGroupsExtension { * @deprecated * @param id */ + @Deprecated public Show(Integer id) { super(CLIENT, HttpMethod.GET, new StringBuilder("/os-security-groups/").append(id).toString(), null, SecurityGroup.class); } @@ -75,6 +76,7 @@ public class SecurityGroupsExtension { * @param id * @deprecated */ + @Deprecated public Delete(Integer id) { super(CLIENT, HttpMethod.DELETE, new StringBuilder("/os-security-groups/").append(String.valueOf(id)).toString(), null, Void.class); } @@ -101,6 +103,7 @@ public class SecurityGroupsExtension { * @param id * @deprecated */ + @Deprecated public DeleteRule(Integer id) { super(CLIENT, HttpMethod.DELETE, new StringBuilder("/os-security-group-rules/").append(String.valueOf(id)).toString(), null, Void.class); } @@ -148,6 +151,7 @@ public class SecurityGroupsExtension { * @return * @deprecated Use {@link #createSecurityGroupRule(String, String, Integer, Integer, String)} */ + @Deprecated public CreateRule createSecurityGroupRule( Integer parentSecurityGroupId, String ipProtocol, Integer fromPort, Integer toPort, String cidr) { @@ -165,6 +169,7 @@ public class SecurityGroupsExtension { * @return * @deprecated Use {@link #createSecurityGroupRule(String, String, String, Integer, Integer)} */ + @Deprecated public CreateRule createSecurityGroupRule( Integer parentSecurityGroupId, String ipProtocol, Integer fromPort, Integer toPort, Integer sourceGroupId) { diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/KeyPairs.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/KeyPairs.java index 0398bf3..db24f8d 100644 --- a/nova-model/src/main/java/com/woorea/openstack/nova/model/KeyPairs.java +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/KeyPairs.java @@ -39,11 +39,11 @@ public class KeyPairs implements Iterable<KeyPair>, Serializable { * @return the list */ public List<KeyPair> getList() { - List<KeyPair> list = new ArrayList<KeyPair>(); + List<KeyPair> keyPairList = new ArrayList<>(); for(KeyPairWrapper wrapper : this.list) { - list.add(wrapper.keypair); + keyPairList.add(wrapper.keypair); } - return list; + return keyPairList; } @Override diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroupRuleForCreate.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroupRuleForCreate.java index d5ff7b3..d1a3ec0 100644 --- a/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroupRuleForCreate.java +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroupRuleForCreate.java @@ -111,6 +111,7 @@ public class SecurityGroupRuleForCreate implements Serializable { * @param parentGroupId the parentGroupId to set * @deprecated Use {@link #setParentGroupId(String)} */ + @Deprecated public void setParentGroupId(Integer parentGroupId) { this.parentGroupId = String.valueOf(parentGroupId); } @@ -189,6 +190,7 @@ public class SecurityGroupRuleForCreate implements Serializable { * @param groupId the groupId to set * @deprecated Use {@link #setGroupId(String)} */ + @Deprecated public void setGroupId(Integer groupId) { this.groupId = String.valueOf(groupId); } diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java index 938fc2b..20ab039 100644 --- a/nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java @@ -102,7 +102,7 @@ public class Server implements Serializable { } } - private Map<String, List<Address>> addresses = new HashMap<String, List<Address>>(); + private Map<String, List<Address>> addresses = new HashMap<>(); @JsonAnySetter public void add(String key, List<Address> value) { diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/ServerAction.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/ServerAction.java index 9ccc43b..80793a7 100644 --- a/nova-model/src/main/java/com/woorea/openstack/nova/model/ServerAction.java +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/ServerAction.java @@ -91,9 +91,9 @@ public interface ServerAction extends Serializable { private String accessIPv6; - private Map<String, String> metadata = new HashMap<String, String>(); + private Map<String, String> metadata = new HashMap<>(); - private List<PersonalityFile> personality = new ArrayList<PersonalityFile>(); + private List<PersonalityFile> personality = new ArrayList<>(); @JsonProperty("OS-DCF:diskConfig") private String diskConfig; diff --git a/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientConnector.java b/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientConnector.java index dc03f9e..f7fa30b 100644 --- a/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientConnector.java +++ b/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientConnector.java @@ -104,6 +104,7 @@ public class HttpClientConnector implements OpenStackClientConnector { return type.getAnnotation(JsonRootName.class) == null ? DEFAULT_MAPPER : WRAPPED_MAPPER; } + @Override public <T> OpenStackResponse request(OpenStackRequest<T> request) { CloseableHttpClient httpClient = null; //HttpClients.createDefault(); @@ -136,8 +137,8 @@ public class HttpClientConnector implements OpenStackClientConnector { String entityJson = mapper.writeValueAsString (request.entity().getEntity()); entity = new StringEntity(entityJson, ContentType.create(request.entity().getContentType())); - - System.out.println("Openstack query JSON:"+entityJson); + + LOGGER.debug("Openstack query JSON:"+entityJson); LOGGER.debug ("Request JSON Body: " + entityJson.replaceAll("\"password\":\"[^\"]*\"", "\"password\":\"***\"")); } catch (JsonProcessingException e) { diff --git a/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientRedirectStrategy.java b/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientRedirectStrategy.java index 6264589..2ba17fb 100644 --- a/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientRedirectStrategy.java +++ b/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientRedirectStrategy.java @@ -113,7 +113,7 @@ public class HttpClientRedirectStrategy extends DefaultRedirectStrategy { final int status = response.getStatusLine().getStatusCode();
- HttpUriRequest newRequest = null;
+ HttpUriRequest newRequest;
if (status == HttpStatus.SC_TEMPORARY_REDIRECT || status == HttpStatus.SC_MOVED_TEMPORARILY) {
newRequest = RequestBuilder.copy(request).setUri(uri).build();
} else {
diff --git a/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyConnector.java b/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyConnector.java index e621910..eb1b3d5 100644 --- a/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyConnector.java +++ b/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyConnector.java @@ -78,7 +78,7 @@ public class JerseyConnector implements OpenStackClientConnector { headers.add("Content-Type", "application/json"); } try { - ClientResponse response = null; + ClientResponse response; if (request.entity() != null && request.entity().getEntity() != null) { response = target.getHeadHandler().handle(new ClientRequestImpl(target.getURI(), request.method().name(), request.entity().getEntity(), headers)); } else { diff --git a/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyLoggingFilter.java b/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyLoggingFilter.java index 7c8cdc6..18f0d84 100644 --- a/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyLoggingFilter.java +++ b/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyLoggingFilter.java @@ -100,6 +100,7 @@ public class JerseyLoggingFilter extends ClientFilter { this.b = b; } + @Override public OutputStream adapt(ClientRequest request, OutputStream out) throws IOException { return new LoggingOutputStream(getAdapter().adapt(request, out), b); } @@ -292,4 +293,4 @@ public class JerseyLoggingFilter extends ClientFilter { entityString = entityString.replaceAll(PASSWORD_PATTERN, "\"password\" : \"******\""); b.append(entityString).append("\n"); } -}
\ No newline at end of file +} diff --git a/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyResponse.java b/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyResponse.java index a2ca2c2..b6ccd04 100644 --- a/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyResponse.java +++ b/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyResponse.java @@ -73,7 +73,7 @@ public class JerseyResponse implements OpenStackResponse { @Override
public Map<String, String> headers() {
- Map<String, String> headers = new HashMap<String, String>();
+ Map<String, String> headers = new HashMap<>();
for(String k : response.getHeaders().keySet()) {
headers.put(k, response.getHeaders().getFirst(k));
}
diff --git a/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/JaxRs20Response.java b/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/JaxRs20Response.java index a89bdf9..b51c833 100644 --- a/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/JaxRs20Response.java +++ b/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/JaxRs20Response.java @@ -67,7 +67,7 @@ public class JaxRs20Response implements OpenStackResponse { @Override public Map<String, String> headers() { - Map<String, String> headers = new HashMap<String, String>(); + Map<String, String> headers = new HashMap<>(); for(String k : response.getHeaders().keySet()) { headers.put(k, response.getHeaderString(k)); } diff --git a/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/OpenStack.java b/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/OpenStack.java index 4add865..2ec564c 100644 --- a/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/OpenStack.java +++ b/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/OpenStack.java @@ -67,7 +67,7 @@ public class OpenStack { try { - SSLContext context = null; + SSLContext context; context = SSLContext.getInstance("SSL"); context.init(null, null, null); @@ -103,6 +103,7 @@ public class OpenStack { CLIENT.register(new JacksonFeature()).register(new ContextResolver<ObjectMapper>() { + @Override public ObjectMapper getContext(Class<?> type) { return type.getAnnotation(JsonRootName.class) == null ? DEFAULT_MAPPER : WRAPPED_MAPPER; } @@ -111,6 +112,7 @@ public class OpenStack { CLIENT.register(new ClientRequestFilter() { + @Override public void filter(ClientRequestContext requestContext) throws IOException { requestContext.getHeaders().remove("Content-Language"); requestContext.getHeaders().remove("Content-Encoding"); diff --git a/quantum-client/src/main/java/com/woorea/openstack/quantum/api/query/AbsOpenStackCmd.java b/quantum-client/src/main/java/com/woorea/openstack/quantum/api/query/AbsOpenStackCmd.java index 90f5bb5..2511b0c 100644 --- a/quantum-client/src/main/java/com/woorea/openstack/quantum/api/query/AbsOpenStackCmd.java +++ b/quantum-client/src/main/java/com/woorea/openstack/quantum/api/query/AbsOpenStackCmd.java @@ -62,7 +62,7 @@ public class AbsOpenStackCmd<T> extends OpenStackRequest<T> { private Map<String, String> getObjectParamMap(T target) { - Map<String, String> resultMap = new HashMap<String, String>(); + Map<String, String> resultMap = new HashMap<>(); if (target == null) return resultMap; diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Network.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Network.java index 29870a3..6c21b00 100644 --- a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Network.java +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Network.java @@ -319,7 +319,7 @@ public class Network implements Serializable { */ @Override public String toString() { - StringBuffer buf = new StringBuffer("Network [id=" + id + ", name=" + name + ", subnets=" + StringBuilder buf = new StringBuilder("Network [id=" + id + ", name=" + name + ", subnets=" + subnets + ", status=" + status + ", admin_state_up=" + adminStateUp + ", tenant_id=" + tenantId + ", shared=" + shared + ", router:external=" + routerExternal); if (getNetworkType() == NetworkType.PROVIDER) diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/NetworkForCreate.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/NetworkForCreate.java index 1a2bb67..d5f3393 100644 --- a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/NetworkForCreate.java +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/NetworkForCreate.java @@ -18,6 +18,9 @@ package com.woorea.openstack.quantum.model; import org.codehaus.jackson.map.annotate.JsonRootName; +/** + * @deprecated + */ @SuppressWarnings("serial") @JsonRootName("network") @Deprecated diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Networks.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Networks.java index 88e72e6..84e45ca 100644 --- a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Networks.java +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Networks.java @@ -41,12 +41,12 @@ public class Networks implements Iterable<Network>, Serializable{ this.list = list; } - + @Override public String toString() { return "Networks [list=" + list + "]"; } - + @Override public Iterator<Network> iterator() { return list.iterator(); } diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Routers.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Routers.java index a2dbd8e..038bdb4 100644 --- a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Routers.java +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Routers.java @@ -41,12 +41,12 @@ public class Routers implements Iterable<Router>, Serializable{ this.list = list; } - + @Override public String toString() { return "Routers [list=" + list + "]"; } - + @Override public Iterator<Router> iterator() { return list.iterator(); } |