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 --- .../woorea/openstack/keystone/model/Access.java | 252 +++++++++++++++++++++ .../openstack/keystone/model/Authentication.java | 41 ++++ .../woorea/openstack/keystone/model/Endpoint.java | 121 ++++++++++ .../woorea/openstack/keystone/model/Endpoints.java | 34 +++ .../com/woorea/openstack/keystone/model/Error.java | 46 ++++ .../com/woorea/openstack/keystone/model/Link.java | 42 ++++ .../woorea/openstack/keystone/model/Metadata.java | 54 +++++ .../com/woorea/openstack/keystone/model/Role.java | 67 ++++++ .../com/woorea/openstack/keystone/model/Roles.java | 34 +++ .../woorea/openstack/keystone/model/Service.java | 76 +++++++ .../woorea/openstack/keystone/model/Services.java | 34 +++ .../woorea/openstack/keystone/model/Tenant.java | 102 +++++++++ .../woorea/openstack/keystone/model/Tenants.java | 44 ++++ .../com/woorea/openstack/keystone/model/Token.java | 52 +++++ .../com/woorea/openstack/keystone/model/User.java | 139 ++++++++++++ .../com/woorea/openstack/keystone/model/Users.java | 34 +++ .../keystone/model/authentication/AccessKey.java | 72 ++++++ .../authentication/RackspaceAuthentication.java | 99 ++++++++ .../model/authentication/TokenAuthentication.java | 50 ++++ .../model/authentication/UsernamePassword.java | 71 ++++++ 20 files changed, 1464 insertions(+) create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/Access.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/Authentication.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/Endpoint.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/Endpoints.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/Error.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/Link.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/Metadata.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/Role.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/Roles.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/Service.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/Services.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/Tenant.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/Tenants.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/Token.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/User.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/Users.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/AccessKey.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/RackspaceAuthentication.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/TokenAuthentication.java create mode 100644 keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/UsernamePassword.java (limited to 'keystone-model/src/main/java/com/woorea/openstack/keystone/model') diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Access.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Access.java new file mode 100644 index 0000000..a7968ff --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Access.java @@ -0,0 +1,252 @@ +package com.woorea.openstack.keystone.model; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("access") +public class Access implements Serializable { + + public static final class Service { + + @JsonIgnoreProperties(ignoreUnknown=true) + public static final class Endpoint { + + private String region; + + private String publicURL; + + private String internalURL; + + private String adminURL; + + /** + * @return the region + */ + public String getRegion() { + return region; + } + + /** + * @return the publicURL + */ + public String getPublicURL() { + return publicURL; + } + + /** + * @return the internalURL + */ + public String getInternalURL() { + return internalURL; + } + + /** + * @return the adminURL + */ + public String getAdminURL() { + return adminURL; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Endpoint [region=" + region + ", publicURL=" + + publicURL + ", internalURL=" + internalURL + + ", adminURL=" + adminURL + "]"; + } + + } + + private String type; + + private String name; + + private List endpoints; + + @JsonProperty("endpoints_links") + private List endpointsLinks; + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @return the endpoints + */ + public List getEndpoints() { + return endpoints; + } + + /** + * @return the endpointsLinks + */ + public List getEndpointsLinks() { + return endpointsLinks; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Service [type=" + type + ", name=" + name + ", endpoints=" + + endpoints + ", endpointsLinks=" + endpointsLinks + "]"; + } + + } + + @JsonIgnoreProperties(ignoreUnknown=true) + public static final class User { + + @JsonIgnoreProperties(ignoreUnknown=true) + public static final class Role { + + private String id; + + private String name; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Role [id=" + id + ", name=" + name + "]"; + } + + } + + private String id; + + private String name; + + private String username; + + private List roles; + + @JsonProperty("roles_links") + private List rolesLinks; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @return the username + */ + public String getUsername() { + return username; + } + + /** + * @return the roles + */ + public List getRoles() { + return roles; + } + + /** + * @return the rolesLinks + */ + public List getRolesLinks() { + return rolesLinks; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "User [id=" + id + ", name=" + name + ", username=" + + username + ", roles=" + roles + ", rolesLinks=" + + rolesLinks + "]"; + } + + } + + private Token token; + + private List serviceCatalog; + + private User user; + + private Map metadata; + + /** + * @return the token + */ + public Token getToken() { + return token; + } + + /** + * @return the serviceCatalog + */ + public List getServiceCatalog() { + return serviceCatalog; + } + + /** + * @return the user + */ + public User getUser() { + return user; + } + + /** + * @return the metadata + */ + public Map getMetadata() { + return metadata; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Access [token=" + token + ", serviceCatalog=" + serviceCatalog + + ", user=" + user + ", metadata=" + metadata + "]"; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Authentication.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Authentication.java new file mode 100644 index 0000000..f5c8f5c --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Authentication.java @@ -0,0 +1,41 @@ +package com.woorea.openstack.keystone.model; + +import java.io.Serializable; + +import org.codehaus.jackson.map.annotate.JsonRootName; + +public abstract class Authentication implements Serializable { + + private String tenantId; + + private String tenantName; + + /** + * @return the tenantId + */ + public String getTenantId() { + return tenantId; + } + + /** + * @param tenantId the tenantId to set + */ + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + /** + * @return the tenantName + */ + public String getTenantName() { + return tenantName; + } + + /** + * @param tenantName the tenantName to set + */ + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Endpoint.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Endpoint.java new file mode 100644 index 0000000..f179e25 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Endpoint.java @@ -0,0 +1,121 @@ +package com.woorea.openstack.keystone.model; + +import java.io.Serializable; + +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("endpoint") +public class Endpoint implements Serializable { + + private String id; + + @JsonProperty("service_id") + private String serviceId; + + private String region; + + @JsonProperty("publicurl") + private String publicURL; + + @JsonProperty("internalurl") + private String internalURL; + + @JsonProperty("adminurl") + private String adminURL; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the serviceId + */ + public String getServiceId() { + return serviceId; + } + + /** + * @param serviceId the serviceId to set + */ + public void setServiceId(String serviceId) { + this.serviceId = serviceId; + } + + /** + * @return the region + */ + public String getRegion() { + return region; + } + + /** + * @param region the region to set + */ + public void setRegion(String region) { + this.region = region; + } + + /** + * @return the publicURL + */ + public String getPublicURL() { + return publicURL; + } + + /** + * @param publicURL the publicURL to set + */ + public void setPublicURL(String publicURL) { + this.publicURL = publicURL; + } + + /** + * @return the internalURL + */ + public String getInternalURL() { + return internalURL; + } + + /** + * @param internalURL the internalURL to set + */ + public void setInternalURL(String internalURL) { + this.internalURL = internalURL; + } + + /** + * @return the adminURL + */ + public String getAdminURL() { + return adminURL; + } + + /** + * @param adminURL the adminURL to set + */ + public void setAdminURL(String adminURL) { + this.adminURL = adminURL; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Endpoint [id=" + id + ", serviceId=" + serviceId + ", region=" + + region + ", publicURL=" + publicURL + ", internalURL=" + + internalURL + ", adminURL=" + adminURL + "]"; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Endpoints.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Endpoints.java new file mode 100644 index 0000000..d7a5898 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Endpoints.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonProperty; + +public class Endpoints implements Iterable, Serializable { + + @JsonProperty("endpoints") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Endpoints [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Error.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Error.java new file mode 100644 index 0000000..5549f4c --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Error.java @@ -0,0 +1,46 @@ +package com.woorea.openstack.keystone.model; + +import java.io.Serializable; + +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("error") +public class Error implements Serializable { + + private Integer code; + + private String title; + + private String message; + + /** + * @return the code + */ + public Integer getCode() { + return code; + } + + /** + * @return the title + */ + public String getTitle() { + return title; + } + + /** + * @return the message + */ + public String getMessage() { + return message; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Error [code=" + code + ", title=" + title + ", message=" + + message + "]"; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Link.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Link.java new file mode 100644 index 0000000..a673bca --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Link.java @@ -0,0 +1,42 @@ +package com.woorea.openstack.keystone.model; + +import java.io.Serializable; + +public class Link implements Serializable { + + private String rel; + + private String href; + + private String type; + + /** + * @return the rel + */ + public String getRel() { + return rel; + } + + /** + * @return the href + */ + public String getHref() { + return href; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Link [rel=" + rel + ", href=" + href + ", type=" + type + "]"; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Metadata.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Metadata.java new file mode 100644 index 0000000..295f9cd --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Metadata.java @@ -0,0 +1,54 @@ +/* + * ============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.keystone.model; + +import java.util.Map; + +/** + * Metadata extension for Tenants as implemented by DCP/LCP. + * + * NOTE: This is NOT supported by native Openstack + */ +public class Metadata { + + private Map metadata; + + /** + * @return the metadata + */ + public Map getMetadata() { + return metadata; + } + + /** + * Set the metadata + * @param metadata + */ + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Role.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Role.java new file mode 100644 index 0000000..993b0d9 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Role.java @@ -0,0 +1,67 @@ +package com.woorea.openstack.keystone.model; + +import java.io.Serializable; + +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("role") +public class Role implements Serializable { + + private String id; + + private String name; + + private String description; + + private String enabled; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @param description the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * @return the enabled + */ + public String getEnabled() { + return enabled; + } + + /** + * @param enabled the enabled to set + */ + public void setEnabled(String enabled) { + this.enabled = enabled; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Roles.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Roles.java new file mode 100644 index 0000000..22e18ed --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Roles.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonProperty; + +public class Roles implements Iterable, Serializable { + + @JsonProperty("roles") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Roles [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Service.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Service.java new file mode 100644 index 0000000..ed9eb53 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Service.java @@ -0,0 +1,76 @@ +package com.woorea.openstack.keystone.model; + +import java.io.Serializable; + +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("OS-KSADM:service") +public class Service implements Serializable { + + private String id; + + private String type; + + private String name; + + private String description; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @param description the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Service [id=" + id + ", type=" + type + ", name=" + name + + ", description=" + description + "]"; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Services.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Services.java new file mode 100644 index 0000000..5c7958c --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Services.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonProperty; + +public class Services implements Iterable, Serializable { + + @JsonProperty("OS-KSADM:services") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Services [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Tenant.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Tenant.java new file mode 100644 index 0000000..a20b71b --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Tenant.java @@ -0,0 +1,102 @@ +package com.woorea.openstack.keystone.model; + +import java.io.Serializable; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("tenant") +@JsonIgnoreProperties(ignoreUnknown=true) +public class Tenant implements Serializable { + + private String id; + + private String name; + + private String description; + + private Boolean enabled; + + public Tenant(String name, String description, Boolean enabled) { + this.name = name; + this.description = description; + this.enabled = enabled; + } + + public Tenant(String name, String description) { + this(name, description, Boolean.TRUE); + } + + public Tenant(String name) { + this(name, null); + } + + public Tenant() { + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @param description the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * @return the enabled + */ + public Boolean getEnabled() { + return enabled; + } + + /** + * @param enabled the enabled to set + */ + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Tenant [id=" + id + ", name=" + name + ", description=" + + description + ", enabled=" + enabled + "]"; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Tenants.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Tenants.java new file mode 100644 index 0000000..51e370c --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Tenants.java @@ -0,0 +1,44 @@ +package com.woorea.openstack.keystone.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonProperty; + +public class Tenants implements Iterable, Serializable { + + @JsonProperty("tenants") + private List list; + + @JsonProperty("tenants_links") + private List links; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /** + * @return the links + */ + public List getLinks() { + return links; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Tenants [list=" + list + ", links=" + links + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Token.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Token.java new file mode 100644 index 0000000..92d34ee --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Token.java @@ -0,0 +1,52 @@ +package com.woorea.openstack.keystone.model; + +import java.util.Calendar; + +public final class Token { + + private String id; + + private Calendar issued_at; + + private Calendar expires; + + private Tenant tenant; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the issued_at + */ + public Calendar getIssued_at() { + return issued_at; + } + + /** + * @return the expires + */ + public Calendar getExpires() { + return expires; + } + + /** + * @return the tenant + */ + public Tenant getTenant() { + return tenant; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Token [id=" + id + ", Issued_at=" + issued_at + ", expires=" + expires + ", tenant=" + + tenant + "]"; + } + +} \ No newline at end of file diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/User.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/User.java new file mode 100644 index 0000000..ad0b788 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/User.java @@ -0,0 +1,139 @@ +package com.woorea.openstack.keystone.model; + +/* + * Modifications copyright (c) 2017 AT&T Intellectual Property + */ + +import java.io.Serializable; + +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("user") +public class User implements Serializable { + + private String id; + + private String username; + +// @JsonProperty("OS-KSADM:password") +// @JsonProperty("OS_KSADM_password") + private String password; + + private String tenantId; + + private String name; + + private String email; + + private Boolean enabled; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the username + */ + public String getUsername() { + return username; + } + + /** + * @param username the username to set + */ + public void setUsername(String username) { + this.username = username; + } + + /** + * @return the password + */ + public String getPassword() { + return password; + } + + /** + * @param password the password to set + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * @return the tenantId + */ + public String getTenantId() { + return tenantId; + } + + /** + * @param tenantId the tenantId to set + */ + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * @param email the email to set + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * @return the enabled + */ + public Boolean getEnabled() { + return enabled; + } + + /** + * @param enabled the enabled to set + */ + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "User [id=" + id + ", username=" + username + ", password=" + + password + ", tenantId=" + tenantId + ", name=" + name + + ", email=" + email + ", enabled=" + enabled + "]"; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Users.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Users.java new file mode 100644 index 0000000..c88aabc --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Users.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonProperty; + +public class Users implements Iterable, Serializable { + + @JsonProperty("users") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Users [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/AccessKey.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/AccessKey.java new file mode 100644 index 0000000..4767450 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/AccessKey.java @@ -0,0 +1,72 @@ +package com.woorea.openstack.keystone.model.authentication; + +import org.codehaus.jackson.map.annotate.JsonRootName; + +import com.woorea.openstack.keystone.model.Authentication; + +@JsonRootName("auth") +public class AccessKey extends Authentication { + + public static final class ApiAccessKeyCredentials { + + private String accessKey; + + private String secretKey; + + /** + * @return the accessKey + */ + public String getAccessKey() { + return accessKey; + } + + /** + * @param accessKey the accessKey to set + */ + public void setAccessKey(String accessKey) { + this.accessKey = accessKey; + } + + /** + * @return the secretKey + */ + public String getSecretKey() { + return secretKey; + } + + /** + * @param secretKey the secretKey to set + */ + public void setSecretKey(String secretKey) { + this.secretKey = secretKey; + } + + } + + private ApiAccessKeyCredentials apiAccessKeyCredentials = new ApiAccessKeyCredentials(); + + public AccessKey() { + + } + + public AccessKey(String accessKey, String secretKey) { + apiAccessKeyCredentials.setAccessKey(accessKey); + apiAccessKeyCredentials.setSecretKey(secretKey); + } + + /** + * @return the apiAccessKeyCredentials + */ + public ApiAccessKeyCredentials getApiAccessKeyCredentials() { + return apiAccessKeyCredentials; + } + + /** + * @param apiAccessKeyCredentials the apiAccessKeyCredentials to set + */ + public void setApiAccessKeyCredentials( + ApiAccessKeyCredentials apiAccessKeyCredentials) { + this.apiAccessKeyCredentials = apiAccessKeyCredentials; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/RackspaceAuthentication.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/RackspaceAuthentication.java new file mode 100644 index 0000000..7007d02 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/RackspaceAuthentication.java @@ -0,0 +1,99 @@ +/* + * ============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.keystone.model.authentication; + +import org.codehaus.jackson.annotate.JsonIgnore; +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.map.annotate.JsonRootName; +import com.woorea.openstack.keystone.model.Authentication; + +@JsonRootName("auth") +public class RackspaceAuthentication extends Authentication { + + /** + * + */ + private static final long serialVersionUID = 5451283386875662918L; + + @JsonIgnore + private String tenantId; + + @JsonIgnore + private String tenantName; + + public static final class Token { + + private String username; + private String apiKey; + + /** + * @return the username + */ + public String getUsername() { + return username; + } + /** + * @param username the username to set + */ + public void setUsername(String username) { + this.username = username; + } + /** + * @return the apiKey + */ + public String getApiKey() { + return apiKey; + } + /** + * @param apiKey the apiKey to set + */ + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + } + + @JsonProperty("RAX-KSKEY:apiKeyCredentials") + private Token token = new Token(); + + public RackspaceAuthentication (String username, String apiKey) { + this.token.username = username; + this.token.apiKey = apiKey; + + } + + /** + * @return the token + */ + public Token getToken() { + return token; + } + + /** + * @param token the token to set + */ + public void setToken(Token token) { + this.token = token; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/TokenAuthentication.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/TokenAuthentication.java new file mode 100644 index 0000000..68cfcd2 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/TokenAuthentication.java @@ -0,0 +1,50 @@ +package com.woorea.openstack.keystone.model.authentication; + +import org.codehaus.jackson.map.annotate.JsonRootName; + +import com.woorea.openstack.keystone.model.Authentication; + +@JsonRootName("auth") +public class TokenAuthentication extends Authentication { + + public static final class Token { + + private String id; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + } + + private Token token = new Token(); + + public TokenAuthentication(String token) { + this.token.id = token; + } + + /** + * @return the token + */ + public Token getToken() { + return token; + } + + /** + * @param token the token to set + */ + public void setToken(Token token) { + this.token = token; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/UsernamePassword.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/UsernamePassword.java new file mode 100644 index 0000000..ee94692 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/UsernamePassword.java @@ -0,0 +1,71 @@ +package com.woorea.openstack.keystone.model.authentication; + +import org.codehaus.jackson.map.annotate.JsonRootName; + +import com.woorea.openstack.keystone.model.Authentication; + +@JsonRootName("auth") +public class UsernamePassword extends Authentication { + + public static final class PasswordCredentials { + + private String username; + + private String password; + + /** + * @return the username + */ + public String getUsername() { + return username; + } + + /** + * @param username the username to set + */ + public void setUsername(String username) { + this.username = username; + } + + /** + * @return the password + */ + public String getPassword() { + return password; + } + + /** + * @param password the password to set + */ + public void setPassword(String password) { + this.password = password; + } + + } + + private PasswordCredentials passwordCredentials = new PasswordCredentials(); + + public UsernamePassword() { + + } + + public UsernamePassword(String username, String password) { + passwordCredentials.setUsername(username); + passwordCredentials.setPassword(password); + } + + /** + * @return the passwordCredentials + */ + public PasswordCredentials getPasswordCredentials() { + return passwordCredentials; + } + + /** + * @param passwordCredentials the passwordCredentials to set + */ + public void setPasswordCredentials(PasswordCredentials passwordCredentials) { + this.passwordCredentials = passwordCredentials; + } + +} -- cgit 1.2.3-korg