Package eu.clarin.sru.server.fcs.utils
Class SimpleEndpointDescription
- java.lang.Object
-
- eu.clarin.sru.server.fcs.utils.AbstractEndpointDescriptionBase
-
- eu.clarin.sru.server.fcs.utils.SimpleEndpointDescription
-
- All Implemented Interfaces:
EndpointDescription
public class SimpleEndpointDescription extends AbstractEndpointDescriptionBase
A very simple implementation of an endpoint description that is initialized from static information supplied at construction time. Mostly used together withSimpleEndpointDescriptionParser
, but it is agnostic how the static list of resource info records is generated.
-
-
Field Summary
-
Fields inherited from class eu.clarin.sru.server.fcs.utils.AbstractEndpointDescriptionBase
capabilities, supportedDataViews, supportedLayers, version
-
Fields inherited from interface eu.clarin.sru.server.fcs.EndpointDescription
PID_ROOT, VERSION_1, VERSION_2
-
-
Constructor Summary
Constructors Constructor Description SimpleEndpointDescription(int version, List<URI> capabilities, List<DataView> supportedDataViews, List<Layer> supportedLayers, List<ResourceInfo> resources, boolean pidCaseSensitive)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Destroy the resource info inventory.ResourceInfo
getResource(String pid)
Get the resources identified by a given persistent identifier.List<ResourceInfo>
getResourceList(String pid)
Get a list of all resources sub-ordinate to a resource identified by a given persistent identifier.List<String>
getResourcePids(String pid)
-
Methods inherited from class eu.clarin.sru.server.fcs.utils.AbstractEndpointDescriptionBase
getCapabilities, getSupportedDataViews, getSupportedLayers, getVersion, isVersion
-
-
-
-
Constructor Detail
-
SimpleEndpointDescription
public SimpleEndpointDescription(int version, List<URI> capabilities, List<DataView> supportedDataViews, List<Layer> supportedLayers, List<ResourceInfo> resources, boolean pidCaseSensitive)
Constructor.- Parameters:
version
- version of this endpoint descriptioncapabilities
- a list of capabilities supported by this endpointsupportedDataViews
- a list of data views that are supported by this endpointsupportedLayers
- a list of layers supported for Advanced Search by this endpoint ornull
resources
- a static list of resource info recordspidCaseSensitive
-true
if comparison of persistent identifiers should be performed case-sensitive,false
otherwise
-
-
Method Detail
-
destroy
public void destroy()
Description copied from interface:EndpointDescription
Destroy the resource info inventory. Use this method for any cleanup the resource info inventory needs to perform upon termination, i.e. closing of persistent database connections, etc.
-
getResourceList
public List<ResourceInfo> getResourceList(String pid) throws SRUException
Description copied from interface:EndpointDescription
Get a list of all resources sub-ordinate to a resource identified by a given persistent identifier.The implementation of this method must be thread-safe.
- Parameters:
pid
- the persistent identifier of the superior resource- Returns:
- a list of all sub-ordinate ResourceInfo or
null
if not applicable - Throws:
SRUException
- if an error occurred
-
getResource
public ResourceInfo getResource(String pid) throws SRUException
Description copied from interface:EndpointDescription
Get the resources identified by a given persistent identifier.The implementation of this method must be thread-safe.
- Parameters:
pid
- the persistent identifier of the resource- Returns:
- a ResourceInfo or
null
if not applicable - Throws:
SRUException
- if an error occurred
-
getResourcePids
public List<String> getResourcePids(String pid) throws SRUException
- Throws:
SRUException
-
-