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

nl.tweeenveertig.openstack.command.identity.access.ServiceCatalog Maven / Gradle / Ivy

There is a newer version: 0.7.0
Show newest version
package nl.tweeenveertig.openstack.command.identity.access;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import java.util.ArrayList;
import java.util.List;

@JsonIgnoreProperties(ignoreUnknown = true)
public class ServiceCatalog {

    public List endpoints = new ArrayList();

//    @JsonProperty(value = "endpoints_links")
//    public List endpointsLinks = new ArrayList();

    public String type;

    public String name;

    public EndPoint getRegion(String regionName) {
        EndPoint firstEndPoint = null;
        for (EndPoint endPoint : endpoints) {
            if (regionName == null) { // If no region is passed, return the first region
                return endPoint;
            }
            if (firstEndPoint == null) { // If the requested region was not found, return the first region -- show must go on
                firstEndPoint = endPoint;
            }
            if (regionName.equals(endPoint.region)) {
                return endPoint;
            }
        }
        return firstEndPoint;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy