org.gcube.common.scope.impl
Class ScopedServiceMap

java.lang.Object
  extended by org.gcube.common.scope.impl.ScopedServiceMap
All Implemented Interfaces:
ServiceMap

public class ScopedServiceMap
extends Object
implements ServiceMap

A ServiceMap that forwards requests to ServiceMaps associated with the current scope.

At construction time, it configures itself with all the service maps found in the classpath (excluding URLs available to primordial and extension classloader). Recognises service maps as resources whose names match a ServiceMapScanner.mapConfigPattern.

Author:
Fabio Simeoni

Field Summary
 
Fields inherited from interface org.gcube.common.scope.api.ServiceMap
instance
 
Constructor Summary
ScopedServiceMap()
           
 
Method Summary
 String endpoint(String service)
          Returns the endpoint of a given service.
 String scope()
          Returns the associated scope.
 String version()
          Returns the release version of the map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScopedServiceMap

public ScopedServiceMap()
Method Detail

scope

public String scope()
Description copied from interface: ServiceMap
Returns the associated scope.

Specified by:
scope in interface ServiceMap
Returns:
the scope

version

public String version()
Description copied from interface: ServiceMap
Returns the release version of the map.

Specified by:
version in interface ServiceMap
Returns:
the version

endpoint

public String endpoint(String service)
                throws IllegalArgumentException,
                       IllegalStateException
Description copied from interface: ServiceMap
Returns the endpoint of a given service.

Specified by:
endpoint in interface ServiceMap
Parameters:
service - the service
Returns:
the endpoint
Throws:
IllegalArgumentException - if the service has no endpoint in the map
IllegalStateException - if the service endpoint cannot be returned


Copyright © 2013. All Rights Reserved.