
nl.tweeenveertig.openstack.command.identity.access.ServiceCatalog Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of joss Show documentation
Show all versions of joss Show documentation
Java Client library for OpenStack Storage (Swift)
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;
}
}