40 lines
831 B
Java
40 lines
831 B
Java
package org.gcube.common.scope.impl;
|
|
|
|
import java.util.LinkedHashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
import javax.xml.bind.annotation.XmlAttribute;
|
|
import javax.xml.bind.annotation.XmlRootElement;
|
|
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
|
|
|
import org.gcube.common.scope.api.ServiceMap;
|
|
|
|
/**
|
|
* A {@link ServiceMap} with a standard XML binding.
|
|
*
|
|
* @author Fabio Simeoni
|
|
*
|
|
*/
|
|
@XmlRootElement(name="service-map")
|
|
public class DefaultServiceMap implements ServiceMap {
|
|
|
|
@XmlAttribute
|
|
private String scope;
|
|
|
|
@XmlJavaTypeAdapter(ServiceMapAdapter.class)
|
|
Map<String,List<String>> services = new LinkedHashMap<String,List<String>>();
|
|
|
|
@Override
|
|
public String scope() {
|
|
return scope;
|
|
}
|
|
|
|
@Override
|
|
public List<String> endpoint(String service) {
|
|
return services.get(service);
|
|
}
|
|
|
|
|
|
}
|