diff options
author | ChrisC <cc697w@intl.att.com> | 2017-01-31 13:57:24 +0100 |
---|---|---|
committer | ChrisC <cc697w@intl.att.com> | 2017-01-31 14:55:11 +0100 |
commit | 2e984294ac28c6f2ede290c38164c5d536ccaf4a (patch) | |
tree | 5eba5a929b7a961c98749fa69e03cfea58e1a724 /keystone-model/src/main/java | |
parent | 86c0f28c8ed469486b64d6422dc53e3a7bcc8adb (diff) |
Initial OpenECOMP MSO OpenStack SDK lib commit
Change-Id: Ieaacb2b2c0dcc469669880e73f0cda9fa59a6c5a
Signed-off-by: ChrisC <cc697w@intl.att.com>
Diffstat (limited to 'keystone-model/src/main/java')
40 files changed, 2955 insertions, 0 deletions
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<Endpoint> endpoints; + + @JsonProperty("endpoints_links") + private List<Link> endpointsLinks; + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @return the endpoints + */ + public List<Endpoint> getEndpoints() { + return endpoints; + } + + /** + * @return the endpointsLinks + */ + public List<Link> 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<Role> roles; + + @JsonProperty("roles_links") + private List<Link> 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<Role> getRoles() { + return roles; + } + + /** + * @return the rolesLinks + */ + public List<Link> 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<Service> serviceCatalog; + + private User user; + + private Map<String, Object> metadata; + + /** + * @return the token + */ + public Token getToken() { + return token; + } + + /** + * @return the serviceCatalog + */ + public List<Service> getServiceCatalog() { + return serviceCatalog; + } + + /** + * @return the user + */ + public User getUser() { + return user; + } + + /** + * @return the metadata + */ + public Map<String, Object> 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<Endpoint>, Serializable { + + @JsonProperty("endpoints") + private List<Endpoint> list; + + /** + * @return the list + */ + public List<Endpoint> getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Endpoints [list=" + list + "]"; + } + + @Override + public Iterator<Endpoint> 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<String, String> metadata; + + /** + * @return the metadata + */ + public Map<String, String> getMetadata() { + return metadata; + } + + /** + * Set the metadata + * @param metadata + */ + public void setMetadata(Map<String, String> 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<Role>, Serializable { + + @JsonProperty("roles") + private List<Role> list; + + /** + * @return the list + */ + public List<Role> getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Roles [list=" + list + "]"; + } + + @Override + public Iterator<Role> 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<Service>, Serializable { + + @JsonProperty("OS-KSADM:services") + private List<Service> list; + + /** + * @return the list + */ + public List<Service> getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Services [list=" + list + "]"; + } + + @Override + public Iterator<Service> 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<Tenant>, Serializable { + + @JsonProperty("tenants") + private List<Tenant> list; + + @JsonProperty("tenants_links") + private List<Link> links; + + /** + * @return the list + */ + public List<Tenant> getList() { + return list; + } + + /** + * @return the links + */ + public List<Link> getLinks() { + return links; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Tenants [list=" + list + ", links=" + links + "]"; + } + + @Override + public Iterator<Tenant> 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<User>, Serializable { + + @JsonProperty("users") + private List<User> list; + + /** + * @return the list + */ + public List<User> getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Users [list=" + list + "]"; + } + + @Override + public Iterator<User> 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; + } + +} 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 new file mode 100644 index 0000000..7caffb0 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Authentication.java @@ -0,0 +1,284 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("auth") +public class Authentication implements Serializable { + + public static final class Identity { + + public static final Identity password(String userId, String password) { + Identity identity = new Identity(); + identity.getMethods().add("password"); + Password method = new Password(); + method.getUser().setId(userId); + method.getUser().setPassword(password); + identity.setPassword(method); + return identity; + } + + public static final Identity password(String domainName, String username, String password) { + Identity identity = new Identity(); + identity.getMethods().add("password"); + Password method = new Password(); + com.woorea.openstack.keystone.v3.model.Authentication.Identity.Password.User.Domain domain = new com.woorea.openstack.keystone.v3.model.Authentication.Identity.Password.User.Domain(); + domain.setName(domainName); + method.getUser().setDomain(domain); + method.getUser().setName(username); + method.getUser().setPassword(password); + identity.setPassword(method); + return identity; + } + + public static final Identity token(String token) { + Identity identity = new Identity(); + identity.getMethods().add("token"); + Token method = new Token(); + method.setId(token); + identity.setToken(method); + return identity; + } + + private List<String> methods = new ArrayList<String>(); + + public static final class Password { + + public static final class User { + + public static final class Domain { + + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + + private Domain domain; + + private String id; + + private String name; + + private String password; + + public Domain getDomain() { + return domain; + } + + public void setDomain(Domain domain) { + this.domain = domain; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + } + + private User user = new User(); + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + } + + private Password password; + + public static final class Token { + + private String id; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + } + + private Token token; + + public List<String> getMethods() { + return methods; + } + + public void setMethods(List<String> methods) { + this.methods = methods; + } + + public Password getPassword() { + return password; + } + + public void setPassword(Password password) { + this.password = password; + } + + public Token getToken() { + return token; + } + + public void setToken(Token token) { + this.token = token; + } + + } + + private Identity identity; + + public static final class Scope { + + public static Scope project(String id) { + Scope scope = new Scope(); + Project project = new Project(); + project.setId(id); + scope.setProject(project); + return scope; + } + + public static Scope project(String domainName, String projectName) { + Scope scope = new Scope(); + com.woorea.openstack.keystone.v3.model.Authentication.Scope.Project.Domain domain = new com.woorea.openstack.keystone.v3.model.Authentication.Scope.Project.Domain(); + domain.setName(domainName); + Project project = new Project(); + project.setDomain(domain); + project.setName(projectName); + scope.setProject(project); + return scope; + } + + public static final class Project { + + public static final class Domain { + + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + + private String id; + + private Domain domain; + + private String name; + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Domain getDomain() { + return domain; + } + + public void setDomain(Domain domain) { + this.domain = domain; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + } + + private Project project; + + public Project getProject() { + return project; + } + + public void setProject(Project project) { + this.project = project; + } + + } + + private Scope scope; + + public Identity getIdentity() { + return identity; + } + + public void setIdentity(Identity identity) { + this.identity = identity; + } + + public Scope getScope() { + return scope; + } + + public void setScope(Scope scope) { + this.scope = scope; + } + +} 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 new file mode 100644 index 0000000..ef40a2a --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Credential.java @@ -0,0 +1,61 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.util.HashMap; +import java.util.Map; + +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("credential") +public class Credential { + + private String id; + + private String projectId; + + private String type; + + private String userId; + + private Map<String, String> blob = new HashMap<String, String>(); + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public Map<String, String> getBlob() { + return blob; + } + + public void setBlob(Map<String, String> blob) { + this.blob = blob; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Credentials.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Credentials.java new file mode 100644 index 0000000..36eeda6 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Credentials.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonProperty; + +public class Credentials implements Iterable<Credential>, Serializable { + + @JsonProperty("credentials") + private List<Credential> list; + + /** + * @return the list + */ + public List<Credential> getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Credentials [list=" + list + "]"; + } + + @Override + public Iterator<Credential> iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Domain.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Domain.java new file mode 100644 index 0000000..9df4fe2 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Domain.java @@ -0,0 +1,48 @@ +package com.woorea.openstack.keystone.v3.model; + +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("domain") +public class Domain { + + private String id; + + private String name; + + private String description; + + private Boolean enabled; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Domains.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Domains.java new file mode 100644 index 0000000..e42a6c4 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Domains.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonProperty; + +public class Domains implements Iterable<Domain>, Serializable { + + @JsonProperty("domains") + private List<Domain> list; + + /** + * @return the list + */ + public List<Domain> getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Domains [list=" + list + "]"; + } + + @Override + public Iterator<Domain> iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Endpoint.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Endpoint.java new file mode 100644 index 0000000..213e690 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Endpoint.java @@ -0,0 +1,51 @@ +package com.woorea.openstack.keystone.v3.model; + +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("endpoint") +public class Endpoint { + + private String id; + + @JsonProperty("interface") + private String iface; + + private String name; + + @JsonProperty("service_id") + private String serviceId; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getInterface() { + return iface; + } + + public void setInterface(String iface) { + this.iface = iface; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getServiceId() { + return serviceId; + } + + public void setServiceId(String serviceId) { + this.serviceId = serviceId; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Endpoints.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Endpoints.java new file mode 100644 index 0000000..146e88b --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Endpoints.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonProperty; + +public class Endpoints implements Iterable<Endpoint>, Serializable { + + @JsonProperty("endpoints") + private List<Endpoint> list; + + /** + * @return the list + */ + public List<Endpoint> getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Endpoints [list=" + list + "]"; + } + + @Override + public Iterator<Endpoint> iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Group.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Group.java new file mode 100644 index 0000000..5e718b5 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Group.java @@ -0,0 +1,50 @@ +package com.woorea.openstack.keystone.v3.model; + +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("group") +public class Group { + + private String id; + + @JsonProperty("domain_id") + private String domainId; + + private String name; + + private String description; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getDomainId() { + return domainId; + } + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Groups.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Groups.java new file mode 100644 index 0000000..cc7b276 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Groups.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonProperty; + +public class Groups implements Iterable<Group>, Serializable { + + @JsonProperty("groups") + private List<Group> list; + + /** + * @return the list + */ + public List<Group> getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Groups [list=" + list + "]"; + } + + @Override + public Iterator<Group> iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Policies.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Policies.java new file mode 100644 index 0000000..42da856 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Policies.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonProperty; + +public class Policies implements Iterable<Policy>, Serializable { + + @JsonProperty("policies") + private List<Policy> list; + + /** + * @return the list + */ + public List<Policy> getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Policies [list=" + list + "]"; + } + + @Override + public Iterator<Policy> iterator() { + return list.iterator(); + } + +} 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 new file mode 100644 index 0000000..5abf844 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Policy.java @@ -0,0 +1,61 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.util.HashMap; +import java.util.Map; + +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("policy") +public class Policy { + + private String id; + + private String projectId; + + private String type; + + private String userId; + + private Map<String, String> blob = new HashMap<String, String>(); + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public Map<String, String> getBlob() { + return blob; + } + + public void setBlob(Map<String, String> blob) { + this.blob = blob; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Project.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Project.java new file mode 100644 index 0000000..070336e --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Project.java @@ -0,0 +1,50 @@ +package com.woorea.openstack.keystone.v3.model; + +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("project") +public class Project { + + private String id; + + @JsonProperty("domain_id") + private String domainId; + + private String name; + + private Boolean enabled; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getDomainId() { + return domainId; + } + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Projects.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Projects.java new file mode 100644 index 0000000..fa39064 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Projects.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonProperty; + +public class Projects implements Iterable<Project>, Serializable { + + @JsonProperty("projects") + private List<Project> list; + + /** + * @return the list + */ + public List<Project> getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Projects [list=" + list + "]"; + } + + @Override + public Iterator<Project> iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Role.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Role.java new file mode 100644 index 0000000..09d47a1 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Role.java @@ -0,0 +1,67 @@ +package com.woorea.openstack.keystone.v3.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/v3/model/Roles.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Roles.java new file mode 100644 index 0000000..5a4e3b4 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Roles.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonProperty; + +public class Roles implements Iterable<Role>, Serializable { + + @JsonProperty("roles") + private List<Role> list; + + /** + * @return the list + */ + public List<Role> getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Roles [list=" + list + "]"; + } + + @Override + public Iterator<Role> iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Service.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Service.java new file mode 100644 index 0000000..578f2c1 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Service.java @@ -0,0 +1,48 @@ +package com.woorea.openstack.keystone.v3.model; + +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("service") +public class Service { + + private String id; + + private String type; + + private String name; + + private String description; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Services.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Services.java new file mode 100644 index 0000000..4383aec --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Services.java @@ -0,0 +1,36 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonProperty; + +import com.woorea.openstack.keystone.model.Service; + +public class Services implements Iterable<Service>, Serializable { + + @JsonProperty("services") + private List<Service> list; + + /** + * @return the list + */ + public List<Service> getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Services [list=" + list + "]"; + } + + @Override + public Iterator<Service> iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Token.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Token.java new file mode 100644 index 0000000..aee6fe5 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Token.java @@ -0,0 +1,370 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Calendar; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonIgnoreProperties; +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("token") +@JsonIgnoreProperties(ignoreUnknown=true) +public class Token implements Serializable { + + private String id; + + @JsonProperty("expires_at") + private Calendar expiresAt; + + @JsonProperty("issued_at") + private Calendar issuedAt; + + private List<String> methods; + + @JsonIgnoreProperties(ignoreUnknown=true) + public static final class Domain { + + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + } + + private Domain domain; + + @JsonIgnoreProperties(ignoreUnknown=true) + public static final class Project { + + private Domain domain; + + private String id; + + private String name; + + public Domain getDomain() { + return domain; + } + + public void setDomain(Domain domain) { + this.domain = domain; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + } + + private Project project; + + @JsonIgnoreProperties(ignoreUnknown=true) + public static final class User { + + @JsonIgnoreProperties(ignoreUnknown=true) + private static final class Domain { + + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + } + + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + } + + private User user; + + @JsonIgnoreProperties(ignoreUnknown=true) + public static final class Role { + + private String id; + + private String name; + + } + + private List<Role> roles; + + public static final class Service { + + public static final class Endpoint { + + private String id; + + private String url; + + private String region; + + private Boolean enabled; + + @JsonProperty("legacy_endpoint_id") + private String legacyEndpointId; + + @JsonProperty("interface") + private String iface; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getLegacyEndpointId() { + return legacyEndpointId; + } + + public void setLegacyEndpointId(String legacyEndpointId) { + this.legacyEndpointId = legacyEndpointId; + } + + public String getInterface() { + return iface; + } + + public void setInterface(String iface) { + this.iface = iface; + } + + } + + private String id; + + private String type; + + private List<Endpoint> endpoints; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public List<Endpoint> getEndpoints() { + return endpoints; + } + + public void setEndpoints(List<Endpoint> endpoints) { + this.endpoints = endpoints; + } + + } + + private List<Service> catalog; + + + public String getId() { + return id; + } + + + + public void setId(String id) { + this.id = id; + } + + + + public Calendar getExpiresAt() { + return expiresAt; + } + + + + public void setExpiresAt(Calendar expiresAt) { + this.expiresAt = expiresAt; + } + + + + public Calendar getIssuedAt() { + return issuedAt; + } + + + + public void setIssuedAt(Calendar issuedAt) { + this.issuedAt = issuedAt; + } + + + + public List<String> getMethods() { + return methods; + } + + + + public void setMethods(List<String> methods) { + this.methods = methods; + } + + + + public Domain getDomain() { + return domain; + } + + + + public void setDomain(Domain domain) { + this.domain = domain; + } + + + + public Project getProject() { + return project; + } + + + + public void setProject(Project project) { + this.project = project; + } + + + + public User getUser() { + return user; + } + + + + public void setUser(User user) { + this.user = user; + } + + + + public List<Role> getRoles() { + return roles; + } + + + + public void setRoles(List<Role> roles) { + this.roles = roles; + } + + + + public List<Service> getCatalog() { + return catalog; + } + + + + public void setCatalog(List<Service> catalog) { + this.catalog = catalog; + } + + + @Override + public String toString() { + return "Token [id=" + id + ", expiresAt=" + expiresAt + ", issuedAt=" + + issuedAt + ", methods=" + methods + ", domain=" + domain + + ", project=" + project + ", user=" + user + ", roles=" + + roles + ", catalog=" + catalog + "]"; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/User.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/User.java new file mode 100644 index 0000000..3b1787b --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/User.java @@ -0,0 +1,91 @@ +package com.woorea.openstack.keystone.v3.model; + +import org.codehaus.jackson.annotate.JsonProperty; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("user") +public class User { + + private String id; + + @JsonProperty("domain_id") + private String domainId; + + @JsonProperty("default_project_id") + private String defaultProjectId; + + private String name; + + private String password; + + private String email; + + private String description; + + private Boolean enabled; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getDomainId() { + return domainId; + } + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + public String getDefaultProjectId() { + return defaultProjectId; + } + + public void setDefaultProjectId(String defaultProjectId) { + this.defaultProjectId = defaultProjectId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Users.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Users.java new file mode 100644 index 0000000..fa3c6d4 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Users.java @@ -0,0 +1,36 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonProperty; + +import com.woorea.openstack.keystone.model.User; + +public class Users implements Iterable<User>, Serializable { + + @JsonProperty("users") + private List<User> list; + + /** + * @return the list + */ + public List<User> getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Users [list=" + list + "]"; + } + + @Override + public Iterator<User> iterator() { + return list.iterator(); + } + +} |