Package eu.clarin.sru.server.fcs
Class ResourceInfo
- java.lang.Object
-
- eu.clarin.sru.server.fcs.ResourceInfo
-
public class ResourceInfo extends Object
This class implements a resource info record, which provides supplementary information about a resource that is available at the endpoint.- See Also:
EndpointDescription
-
-
Constructor Summary
Constructors Constructor Description ResourceInfo(String pid, Map<String,String> title, Map<String,String> description, Map<String,String> institution, String landingPageURI, List<String> languages, List<DataView> availableDataViews, List<Layer> availableLayers, List<ResourceInfo> subResources)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<DataView>
getAvailableDataViews()
Get the list of data views that are available for this resource.List<Layer>
getAvailableLayers()
Get the list of layers that are available in Advanced Search for this resource.Map<String,String>
getDescription()
Get the description of this resource.String
getDescription(String language)
Get the description of the resource for a specific language code.Map<String,String>
getInstitution()
Get the institution of this resource.String
getInstitution(String language)
Get the institution of this resource for a specific language code.String
getLandingPageURI()
Get the landing page of this resource.List<String>
getLanguages()
Get the list of languages in this resource represented as ISO-632-3 three letter language code.String
getPid()
Get the persistent identifier of this resource.List<ResourceInfo>
getSubResources()
Get the direct sub-ordinate resources of this resource.Map<String,String>
getTitle()
Get the title of this resource.String
getTitle(String language)
Get the title of the resource for a specific language code.boolean
hasAvailableLayers()
Check if any layers are available for Advanced Searchboolean
hasSubResources()
Determine, if this resource has sub-resources.
-
-
-
Constructor Detail
-
ResourceInfo
public ResourceInfo(String pid, Map<String,String> title, Map<String,String> description, Map<String,String> institution, String landingPageURI, List<String> languages, List<DataView> availableDataViews, List<Layer> availableLayers, List<ResourceInfo> subResources)
Constructor.- Parameters:
pid
- the persistent identifier of the resourcetitle
- the title of the resource represented as a map with pairs of language code and titledescription
- the description of the resource represented as a map with pairs of language code and description ornull
if not applicableinstitution
- the institution of the resource represented as a map with pairs of language code and institution names ornull
if not applicablelandingPageURI
- a URI to the landing page of the resource ornull
if not applicablelanguages
- the languages represented within this resource represented as a list of ISO-632-3 three letter language codesavailableDataViews
- the list of available data views for this resourceavailableLayers
- the list if layers available for Advanced Search ornull
if not applicablesubResources
- a list of resource sub-ordinate to this resource ornull
if not applicable
-
-
Method Detail
-
getPid
public String getPid()
Get the persistent identifier of this resource.- Returns:
- a string representing the persistent identifier of this resource
-
hasSubResources
public boolean hasSubResources()
Determine, if this resource has sub-resources.- Returns:
true
if the resource has sub-resources,false
otherwise
-
getTitle
public Map<String,String> getTitle()
Get the title of this resource.- Returns:
- a Map of titles keyed by language code
-
getTitle
public String getTitle(String language)
Get the title of the resource for a specific language code.- Parameters:
language
- the language code- Returns:
- the title for the language code or
null
if no title for this language code exists
-
getDescription
public Map<String,String> getDescription()
Get the description of this resource.- Returns:
- a Map of descriptions keyed by language code
-
getDescription
public String getDescription(String language)
Get the description of the resource for a specific language code.- Parameters:
language
- the language code- Returns:
- the description for the language code or
null
if no title for this language code exists
-
getInstitution
public Map<String,String> getInstitution()
Get the institution of this resource. This is an optional attribute for endpoints that host resources from different institution but still want to bundle them in one endpoint. If not specified then it is the default institution that hosts the FCS endpoint.- Returns:
- the institution of this resource or
null
if not applicable or specified
-
getInstitution
public String getInstitution(String language)
Get the institution of this resource for a specific language code.- Parameters:
language
- the language code- Returns:
- the institution of this resource or
null
if not applicable or specified
-
getLandingPageURI
public String getLandingPageURI()
Get the landing page of this resource.- Returns:
- the landing page of this resource or
null
if not applicable
-
getLanguages
public List<String> getLanguages()
Get the list of languages in this resource represented as ISO-632-3 three letter language code.- Returns:
- the list of languages in this resource as a list of ISO-632-3 three letter language codes.
-
getAvailableDataViews
public List<DataView> getAvailableDataViews()
Get the list of data views that are available for this resource.- Returns:
- the list of data views
-
getAvailableLayers
public List<Layer> getAvailableLayers()
Get the list of layers that are available in Advanced Search for this resource.- Returns:
- the list of layers or
null
-
hasAvailableLayers
public boolean hasAvailableLayers()
Check if any layers are available for Advanced Search- Returns:
true
if any layer for Advanced Search is available,false
otherwise
-
getSubResources
public List<ResourceInfo> getSubResources()
Get the direct sub-ordinate resources of this resource.- Returns:
- a list of resources or
null
if this resource has no sub-ordinate resources
-
-