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, supportedLexFields, version
-
Fields inherited from interface eu.clarin.sru.server.fcs.EndpointDescription
PID_ROOT, VERSION_1, VERSION_2
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Destroy the resource info inventory.ResourceInfogetResource(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, getSupportedLexFields, getVersion, isVersion
-
-
-
-
Constructor Detail
-
SimpleEndpointDescription
public SimpleEndpointDescription(int version, List<URI> capabilities, List<DataView> supportedDataViews, List<Layer> supportedLayers, List<LexField> supportedLexFields, 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 ornullsupportedLexFields- a list of lex fields supported for Lexical Search by this endpoint ornullresources- a static list of resource info recordspidCaseSensitive-trueif comparison of persistent identifiers should be performed case-sensitive,falseotherwise
-
-
Method Detail
-
destroy
public void destroy()
Description copied from interface:EndpointDescriptionDestroy 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:EndpointDescriptionGet 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
nullif not applicable - Throws:
SRUException- if an error occurred
-
getResource
public ResourceInfo getResource(String pid) throws SRUException
Description copied from interface:EndpointDescriptionGet 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
nullif not applicable - Throws:
SRUException- if an error occurred
-
getResourcePids
public List<String> getResourcePids(String pid) throws SRUException
- Throws:
SRUException
-
-