Class UriResolverManager
- java.lang.Object
-
- org.gcube.portlets.user.uriresolvermanager.UriResolverManager
-
public class UriResolverManager extends Object
The Class UriResolverManager.- Author:
- Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Sep 6, 2016
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.LoggerLOG
-
Constructor Summary
Constructors Constructor Description UriResolverManager()Instantiates a new uri resolver manager.UriResolverManager(String applicationType)Instance a UriResolverManager Precondition: set the scope provider {@link ScopeProvider.instance.get()} The scope is used to look up the generic resourceUriResolverMapReader#URI_RESOLVER_MAPavailable in the infrastructure to map ApplicationType with its Resolver
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancelTimerUriResolverReader()Cancel timer uri resolver reader.intcountReaders()Count readers.List<ServiceParameter>discoveryServiceParameters(Resolver resolver)Discovery service parameters.Set<String>getApplicationTypes()Gets the application types.Map<String,Resolver>getCapabilities()Gets the capabilities.StringgetLink(String applicationType, Map<String,String> parameters, boolean shortLink)Gets the link.StringgetLink(Map<String,String> parameters, boolean shortLink)Gets the link.ResolvergetResolver(String applicationType)Gets the resolver.voidinvalidUriResolverReader()Invalid uri resolver reader.voidlockReader()Lock reader.voidreleaseReader()Release reader.voidsetApplicationType(String applicationType)Sets the application type.voidsetTimerUriResolverReader(long delay, long period)Sets the timer uri resolver reader.
-
-
-
Constructor Detail
-
UriResolverManager
public UriResolverManager() throws UriResolverMapException, IllegalArgumentExceptionInstantiates a new uri resolver manager. Precondition: set the scope into ScopeProviderScopeProvider.get()The scope is used to look up the generic resource with name:UriResolverMapReader.URI_RESOLVER_MAP_RESOURCE_NAME, secondary type:UriResolverMapReader.URIRESOLVERMAP_SECONDARY_TYPEfrom IS to map ApplicationType with its Resolver- Throws:
UriResolverMapException- the uri resolver map exceptionIllegalArgumentException- the illegal argument exception
-
UriResolverManager
public UriResolverManager(String applicationType) throws UriResolverMapException, IllegalArgumentException
Instance a UriResolverManager Precondition: set the scope provider {@link ScopeProvider.instance.get()} The scope is used to look up the generic resourceUriResolverMapReader#URI_RESOLVER_MAPavailable in the infrastructure to map ApplicationType with its Resolver- Parameters:
applicationType- a (valid) key Application TypegetApplicationTypes()- Throws:
UriResolverMapException- the uri resolver map exceptionIllegalArgumentException- the illegal argument exception
-
-
Method Detail
-
lockReader
public void lockReader()
Lock reader.
-
releaseReader
public void releaseReader()
Release reader.
-
countReaders
public int countReaders()
Count readers.- Returns:
- the int
-
setApplicationType
public void setApplicationType(String applicationType) throws IllegalArgumentException
Sets the application type.- Parameters:
applicationType- the applicationType to set- Throws:
IllegalArgumentException- the illegal argument exception
-
getLink
public String getLink(String applicationType, Map<String,String> parameters, boolean shortLink) throws IllegalArgumentException, UriResolverMapException
Gets the link.- Parameters:
applicationType- the application typeparameters- the map of the parameters sent as HTTP query stringshortLink- if true the link is shorted otherwise none- Returns:
- the link
- Throws:
IllegalArgumentException- the illegal argument exceptionUriResolverMapException- the uri resolver map exception
-
getLink
public String getLink(Map<String,String> parameters, boolean shortLink) throws IllegalArgumentException, UriResolverMapException
Gets the link.- Parameters:
parameters- the map of the parameters sent as HTTP query stringqueryStringParameters- the query string parametersshortLink- if true the link is shortened otherwise none- Returns:
- the link
- Throws:
IllegalArgumentException- the illegal argument exceptionUriResolverMapException- the uri resolver map exception
-
getApplicationTypes
public Set<String> getApplicationTypes()
Gets the application types.- Returns:
- the Application Types available
-
discoveryServiceParameters
public List<ServiceParameter> discoveryServiceParameters(Resolver resolver) throws IllegalArgumentException, Exception
Discovery service parameters.- Parameters:
resolver- the resolver- Returns:
- the list
- Throws:
IllegalArgumentException- the illegal argument exceptionException- the exception
-
getResolver
public Resolver getResolver(String applicationType)
Gets the resolver.- Parameters:
applicationType- the application type- Returns:
- the resolver
-
getCapabilities
public Map<String,Resolver> getCapabilities()
Gets the capabilities.- Returns:
- a map Application Type - Resolver
-
setTimerUriResolverReader
public void setTimerUriResolverReader(long delay, long period)Sets the timer uri resolver reader.- Parameters:
delay- the delayperiod- the period
-
cancelTimerUriResolverReader
public void cancelTimerUriResolverReader()
Cancel timer uri resolver reader.
-
invalidUriResolverReader
public void invalidUriResolverReader()
Invalid uri resolver reader.
-
-