All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xlcloud.openstack.model.identity.keystone.KeystoneAccess Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2012 AMG.lab, a Bull Group Company
 * 
 * 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.
 */
package org.xlcloud.openstack.model.identity.keystone;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonDeserialize;
import org.codehaus.jackson.map.annotate.JsonRootName;
import org.xlcloud.openstack.model.identity.Access;
import org.xlcloud.openstack.model.identity.ServiceCatalogEntry;
import org.xlcloud.openstack.model.identity.ServiceEndpoint;
import org.xlcloud.openstack.model.identity.Token;
import org.xlcloud.openstack.model.identity.User;

@XmlRootElement( name = "access" )
@XmlAccessorType( XmlAccessType.NONE )
@JsonRootName( "access" )
public class KeystoneAccess implements Serializable, Access {


    @XmlElement
    private Map metadata;

    @XmlElement( type = KeystoneToken.class )
    private KeystoneToken token;

    @XmlElementWrapper( name = "serviceCatalog" )
    @XmlElement( name = "service", type = KeystoneService.class )
    @JsonProperty( "serviceCatalog" )
    @JsonDeserialize( as = List.class, contentAs = KeystoneServiceCatalogEntry.class )
    private List services = new ArrayList();

    @XmlElement( type = KeystoneUser.class )
    private KeystoneUser user;

    /*
     * (non-Javadoc)
     * @see org.openstack.model.identity.glance.Access#getToken()
     */
    @Override
    public Token getToken() {
        return token;
    }

    public void setToken(KeystoneToken token) {
        this.token = (KeystoneToken) token;
    }

    /*
     * (non-Javadoc)
     * @see org.openstack.model.identity.glance.Access#getServices()
     */
    @Override
    public List getServices() {
        return services;
    }

    public void setServices(List services) {
        this.services = services;
    }

    /*
     * (non-Javadoc)
     * @see org.openstack.model.identity.glance.Access#getUser()
     */
    @Override
    public User getUser() {
        return user;
    }

    public void setUser(KeystoneUser user) {
        this.user = user;
    }

    @Override
    public ServiceEndpoint getEndpoint(final String type, final String region) {
        throw new UnsupportedOperationException("not implemented");
    }

    @Override
    public Map getMetadata() {
        return metadata;
    }

    public void setMetadata(Map metadata) {
        this.metadata = metadata;
    }

    @Override
    public String toString() {
        return "KeystoneAccess [metadata=" + metadata + ", token=" + token + ", services=" + services + ", user=" + user + "]";
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy