Class UriResolverManager
java.lang.Object
org.gcube.portlets.user.uriresolvermanager.UriResolverManager
The Class UriResolverManager.
- Author:
- Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Sep 6, 2016
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new uri resolver manager.UriResolverManager(String applicationType) Instance a UriResolverManager. -
Method Summary
Modifier and TypeMethodDescriptionvoidCancel timer uri resolver reader.intCount readers.discoveryServiceParameters(Resolver resolver) Discovery service parameters.Gets the application types.Gets the capabilities.Gets the link.Gets the link.getResolver(String applicationType) Gets the resolver.voidInvalid uri resolver reader.voidLock reader.voidRelease reader.voidsetApplicationType(String applicationType) Sets the application type.voidsetTimerUriResolverReader(long delay, long period) Sets the timer uri resolver reader.
-
Field Details
-
LOG
public static final org.slf4j.Logger LOGLogger for this class.
-
-
Constructor Details
-
UriResolverManager
Instantiates a new uri resolver manager. Precondition: invoke inside AuthorizedTasks with a proprer secret. 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 (seeSecretManagerProvider.get().getContext()). The scope is used to look up the generic resourceUriResolverMapReader.URI_RESOLVER_MAP_RESOURCE_NAMEavailable in the infrastructure to map ApplicationType with its Resolver- Parameters:
applicationType- a (valid) key Application Type, seegetApplicationTypes()- Throws:
UriResolverMapException- the uri resolver map exceptionIllegalArgumentException- the illegal argument exception
-
-
Method Details
-
lockReader
public void lockReader()Lock reader. -
releaseReader
public void releaseReader()Release reader. -
countReaders
public int countReaders()Count readers.- Returns:
- the int
-
setApplicationType
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, UriResolverMapExceptionGets 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, UriResolverMapExceptionGets the link.- Parameters:
parameters- the map of the parameters sent as HTTP query stringshortLink- if true the link is shortened otherwise none- Returns:
- the link
- Throws:
IllegalArgumentException- the illegal argument exceptionUriResolverMapException- the uri resolver map exception
-
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
Gets the resolver.- Parameters:
applicationType- the application type- Returns:
- the 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.
-