Package fi.tut.mei.resdescapi.rescatapi
Interface ResCatStorageInterface
-
- All Known Implementing Classes:
ResCatStoImpl
,ResCatStoImpl_LocalFileSystem
,ResCatStoImpl_TestWithDummyData
public interface ResCatStorageInterface
Interface for interacting with a Resource Catalogue Storing location. It can be a local file or database system, or it can be a web server based Resource Catalogue Platform, which provides services to interact with its Resource Catalogue.- Author:
- Niko Siltala
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ResCatStorageInterface.EnumSearchDomainForARD
Enumeration for which ARD's internal search domains is used for search.static class
ResCatStorageInterface.EnumSearchField
Enumeration for which search field is used.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<CapabilityInfo>
getAllStored_Capabilities_ARD()
Gets all stored capabilities for ARDs in this ResCatStorage.Set<CapabilityInfo>
getAllStored_Capabilities_RD()
Gets all stored capabilities for RDs in this ResCatStorage.Set<CategoryInfo>
getAllStored_Categories_ARD()
Gets all stored categories for ARDs in this ResCatStorageSet<CategoryInfo>
getAllStored_Categories_RD()
Gets all stored categories for RDs in this ResCatStorageSet<InterfaceStdInfo>
getAllStored_Interfaces_ARD()
Gets all stored interface standards for ARDs in this ResCatStorageSet<InterfaceStdInfo>
getAllStored_Interfaces_RD()
Gets all stored interface standards for RDs in this ResCatStorageSet<PropertyInfo>
getAllStored_Properties_ARD()
Gets all stored properties for ARDs in this ResCatStorageSet<PropertyInfo>
getAllStored_Properties_RD()
Gets all stored properties for RDs in this ResCatStorageAbstractResourceDesc
getARDStructureFromStorage(String ardId)
Gets Abstract Resource Description (ARD) by given ARD Id.int
getNumberOfArds()
Get number of ARDs in this repository.int
getNumberOfRds()
Get number of RDs in this repository.ResourceDescription
getRDSkeleton_ARDandProfile(String ARDId, String ProfileId)
Creates a RDSkeleton, which is a customised RDTemplate, by given ARD and Profile.ResourceDescription
getRDStructureFromStorage(String rdId)
Gets Resource Description (RD) by given RD Id.String
getRepositoryReport()
Creates and retrieves report of this repository storage.String
getResourceCatalogueId()
Gets the (primary) ID of the resource catalogue.String
getResourceCatalogueName()
Gets the name of the resource catalogue.boolean
hasARDAndProfile(String ardId, String profileId)
Has this repository a specific ARD (and Profile) or not?boolean
hasRD(String rdId)
Has this repository a specific RD or not?boolean
isWritable()
Is the catalogue writable.boolean
pushARDContentToStorage(String ardContentData, String filename, boolean overwrite)
Pushes given ARD to storage and updates the possible search index with this information.boolean
pushARDStructureToStorage(AbstractResourceDesc ardObj, String filename, boolean overwrite)
Pushes given ARD to storage and updates the possible search index with this information.boolean
pushRDContentToStorage(String rdContentData, String filename, boolean overwrite)
Pushes given RD to storage and updates the possible search index with this information.boolean
pushRDStructureToStorage(ResourceDescription rdObj, String filename, boolean overwrite)
Pushes given RD to storage and updates the possible search index with this information.void
setResourceCatalogueId(String resourceCatalogueId)
Sets the (primary) ID of the cataloguevoid
setResourceCatalogueName(String resourceCatalogueName)
Sets the name of the cataloguevoid
setWritable(boolean writable)
Sets writable flag.Set<ARDAndProfInfo>
viewARDAndProfiles_All()
Gets all ARDs in the storage by element's own descriptive data.Set<ARDAndProfInfo>
viewARDAndProfiles_Capability(String capability, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType, ResCatStorageInterface.EnumSearchDomainForARD searchDomain)
Searches matching ARDs or ARD's Profiles by capability data.Set<ARDAndProfInfo>
viewARDAndProfiles_CapabilityParameter(String capability, List<String> parameters, List<String> values, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType, ResCatStorageInterface.EnumSearchDomainForARD searchDomain)
Searches matching ARDs or ARD's Profiles by capability and its parameters data.Set<ARDAndProfInfo>
viewARDAndProfiles_Category(String category, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType, ResCatStorageInterface.EnumSearchDomainForARD searchDomain)
Searches matching ARDs or ARD's Profiles by category data.Set<ARDAndProfInfo>
viewARDAndProfiles_Description(String desc, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType, ResCatStorageInterface.EnumSearchDomainForARD searchDomain)
Searches matching ARDs or ARD's Profiles by element's own descriptive data.Set<ARDAndProfInfo>
viewARDAndProfiles_Interface(String ifStd, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType, ResCatStorageInterface.EnumSearchDomainForARD searchDomain)
Searches matching ARDs or ARD's Profiles by interface standard data.Set<ARDAndProfInfo>
viewARDAndProfiles_Property(String property, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType, ResCatStorageInterface.EnumSearchDomainForARD searchDomain)
Searches matching ARDs or ARD's Profiles by property data.Set<RDInfo>
viewRDs_All()
Gets all RDs in the storage by element's own descriptive data.Set<RDInfo>
viewRDs_Capability(String capability, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType)
Searches matching RDs by capability data.Set<RDInfo>
viewRDs_CapabilityParameter(String capability, List<String> parameters, List<String> values, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType)
Searches matching RDs by capability and its parameters data.Set<RDInfo>
viewRDs_Category(String category, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType)
Searches matching RDs by category data.Set<RDInfo>
viewRDs_Description(String desc, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType)
Searches matching RDs by element's own descriptive data.Set<RDInfo>
viewRDs_Interface(String ifStd, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType)
Searches matching RDs by interface standard data.Set<RDInfo>
viewRDs_Property(String property, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType)
Searches matching RDs by property data.
-
-
-
Method Detail
-
getResourceCatalogueId
String getResourceCatalogueId()
Gets the (primary) ID of the resource catalogue. It is used to uniquely identify the catalogue instance. Must be unique inside the application.- Returns:
- ID of the catalogue.
-
setResourceCatalogueId
void setResourceCatalogueId(String resourceCatalogueId)
Sets the (primary) ID of the catalogue- Parameters:
resourceCatalogueId
- the (primary)resourceCatalogueId to set
-
getResourceCatalogueName
String getResourceCatalogueName()
Gets the name of the resource catalogue. It is used at the same time to uniquely identify the catalogue instance. Must be unique inside the application.- Returns:
- name of the catalogue.
-
setResourceCatalogueName
void setResourceCatalogueName(String resourceCatalogueName)
Sets the name of the catalogue- Parameters:
resourceCatalogueName
- the resourceCatalogueName to set
-
isWritable
boolean isWritable()
Is the catalogue writable. Can new ARDs and RDs pushed through this API interface.- Returns:
- Is catalogue writable flag. True = can be written.
-
setWritable
void setWritable(boolean writable)
Sets writable flag.- Parameters:
writable
- sets is the catalogue writable or not
-
getRepositoryReport
String getRepositoryReport()
Creates and retrieves report of this repository storage. Should contain listings of available ARDs and RDs. Each of these is listed at least ID, name and description.- Returns:
- Report in plain text format.
-
getAllStored_Categories_ARD
Set<CategoryInfo> getAllStored_Categories_ARD()
Gets all stored categories for ARDs in this ResCatStorage- Returns:
- Set(CategoryInfo) contains a collection of Categories defined in ARDs.
-
getAllStored_Capabilities_ARD
Set<CapabilityInfo> getAllStored_Capabilities_ARD()
Gets all stored capabilities for ARDs in this ResCatStorage. Please note that Capability Query Library (CQL) should be used to get the full list of available capabilities and their properties!- Returns:
- Set(CapabilityInfo) contains a collection of capabilities defined in ARDs.
-
getAllStored_Interfaces_ARD
Set<InterfaceStdInfo> getAllStored_Interfaces_ARD()
Gets all stored interface standards for ARDs in this ResCatStorage- Returns:
- Set(InterfaceStdInfo) contains a collection of Interfaces standards defined in ARDs.
-
getAllStored_Properties_ARD
Set<PropertyInfo> getAllStored_Properties_ARD()
Gets all stored properties for ARDs in this ResCatStorage- Returns:
- Set(PropertyInfo) contains a collection of properties defined in ARDs.
-
getAllStored_Categories_RD
Set<CategoryInfo> getAllStored_Categories_RD()
Gets all stored categories for RDs in this ResCatStorage- Returns:
- Set(CategoryInfo) contains a collection of Categories defined in RDs.
-
getAllStored_Capabilities_RD
Set<CapabilityInfo> getAllStored_Capabilities_RD()
Gets all stored capabilities for RDs in this ResCatStorage. Please note that Capability Query Library (CQL) should be used to get the full list of available capabilities and their properties!- Returns:
- Set(CapabilityInfo) contains a collection of capabilities defined in RDs.
-
getAllStored_Interfaces_RD
Set<InterfaceStdInfo> getAllStored_Interfaces_RD()
Gets all stored interface standards for RDs in this ResCatStorage- Returns:
- Set(InterfaceStdInfo) contains a collection of Interfaces standards defined in RDs.
-
getAllStored_Properties_RD
Set<PropertyInfo> getAllStored_Properties_RD()
Gets all stored properties for RDs in this ResCatStorage- Returns:
- Set(PropertyInfo) contains a collection of properties defined in RDs.
-
getNumberOfArds
int getNumberOfArds()
Get number of ARDs in this repository.- Returns:
- Number of ARDs in the repository. 0 or larger. Returns also 0 if repository does not exist.
-
hasARDAndProfile
boolean hasARDAndProfile(String ardId, String profileId) throws ARDNotExistException, ProfileNotExistException
Has this repository a specific ARD (and Profile) or not?- Parameters:
ardId
- ID of an ARDprofileId
- ID of a Profile which is looked for. Can be null -> in this case check limits to only ARD ID.- Returns:
- true if ARD (or ARD and Profile) is found. false if not.
- Throws:
ARDNotExistException
- ARD was not found.ProfileNotExistException
- ARD and its specific Profile is not found.
-
viewARDAndProfiles_All
Set<ARDAndProfInfo> viewARDAndProfiles_All()
Gets all ARDs in the storage by element's own descriptive data.- Returns:
- Set(ARDAndProfInfo) contains a collection of found ARDs and its Profiles. null if no ARDs exist.
-
viewARDAndProfiles_Description
Set<ARDAndProfInfo> viewARDAndProfiles_Description(String desc, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType, ResCatStorageInterface.EnumSearchDomainForARD searchDomain)
Searches matching ARDs or ARD's Profiles by element's own descriptive data.- Parameters:
desc
- search string for descriptionssearchField
- What field is used for search?searchType
- Search type used for searchsearchDomain
- What is the ARD's internal search domain?- Returns:
- Set(ARDAndProfInfo) contains a collection of found ARDs and its matching Profiles. null if no matches are found.
-
viewARDAndProfiles_Category
Set<ARDAndProfInfo> viewARDAndProfiles_Category(String category, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType, ResCatStorageInterface.EnumSearchDomainForARD searchDomain)
Searches matching ARDs or ARD's Profiles by category data.- Parameters:
category
- search string for categoriessearchField
- What field is used for search?searchType
- Search type used for searchsearchDomain
- What is the ARD's internal search domain?- Returns:
- Set(ARDAndProfInfo) contains a collection of found ARDs and its matching Profiles. null if no matches are found.
-
viewARDAndProfiles_Capability
Set<ARDAndProfInfo> viewARDAndProfiles_Capability(String capability, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType, ResCatStorageInterface.EnumSearchDomainForARD searchDomain)
Searches matching ARDs or ARD's Profiles by capability data.- Parameters:
capability
- search string for capabilitysearchField
- What field is used for search?searchType
- Search type used for searchsearchDomain
- What is the ARD's internal search domain?- Returns:
- Set(ARDAndProfInfo) contains a collection of found ARDs and its matching Profiles. null if no matches are found.
-
viewARDAndProfiles_CapabilityParameter
Set<ARDAndProfInfo> viewARDAndProfiles_CapabilityParameter(String capability, List<String> parameters, List<String> values, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType, ResCatStorageInterface.EnumSearchDomainForARD searchDomain)
Searches matching ARDs or ARD's Profiles by capability and its parameters data.- Parameters:
capability
- search string for capabilityparameters
- List of parameter information. Meaning of this information depends on searchField.values
- Optional. Can be null. Links values to a parameter on the parameters list. Must be same size and index as parameters list.searchField
- What field is used for the search?searchType
- Search type used for search- Returns:
- Set(ARDAndProfInfo) contains a collection of found ARDs and its matching Profiles. null if no matches are found.
-
viewARDAndProfiles_Interface
Set<ARDAndProfInfo> viewARDAndProfiles_Interface(String ifStd, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType, ResCatStorageInterface.EnumSearchDomainForARD searchDomain)
Searches matching ARDs or ARD's Profiles by interface standard data.- Parameters:
ifStd
- search string for interface standardssearchField
- What field is used for search?searchType
- Search type used for searchsearchDomain
- What is the ARD's internal search domain?- Returns:
- Set(ARDAndProfInfo) contains a collection of found ARDs and its matching Profiles. null if no matches are found.
-
viewARDAndProfiles_Property
Set<ARDAndProfInfo> viewARDAndProfiles_Property(String property, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType, ResCatStorageInterface.EnumSearchDomainForARD searchDomain)
Searches matching ARDs or ARD's Profiles by property data.- Parameters:
property
- search string for propertiessearchField
- What field is used for search?searchType
- Search type used for searchsearchDomain
- What is the ARD's internal search domain?- Returns:
- Set(ARDAndProfInfo) contains a collection of found ARDs and its matching Profiles. null if no matches are found.
-
getARDStructureFromStorage
AbstractResourceDesc getARDStructureFromStorage(String ardId) throws ARDNotExistException, IOException, Exception
Gets Abstract Resource Description (ARD) by given ARD Id.- Parameters:
ardId
- Id of the ARD- Returns:
- Abstract Resource Description (ARD) (TODO TBD which object is returned. ARDmodel )
- Throws:
ARDNotExistException
IOException
Exception
-
pushARDContentToStorage
boolean pushARDContentToStorage(String ardContentData, String filename, boolean overwrite) throws UserAuthorisationException, UserHasNotRightsException, IOException, ARDAlreadyExistException
Pushes given ARD to storage and updates the possible search index with this information.- Parameters:
ardContentData
- ARD as Stringfilename
- Filename used for storing this resource. Can be null, when system decides the name.overwrite
- True = existing ARD is overwritten- Returns:
- true if ARD is successfully stored
- Throws:
UserAuthorisationException
UserHasNotRightsException
IOException
ARDAlreadyExistException
-
pushARDStructureToStorage
boolean pushARDStructureToStorage(AbstractResourceDesc ardObj, String filename, boolean overwrite) throws UserAuthorisationException, UserHasNotRightsException, IOException, ARDAlreadyExistException
Pushes given ARD to storage and updates the possible search index with this information.- Parameters:
ardObj
- ARD as Java object modelfilename
- Filename used for storing this resource. Can be null, when system decides the name.overwrite
- True = existing ARD is overwritten- Returns:
- true if ARD is successfully stored
- Throws:
UserAuthorisationException
UserHasNotRightsException
IOException
ARDAlreadyExistException
-
getRDSkeleton_ARDandProfile
ResourceDescription getRDSkeleton_ARDandProfile(String ARDId, String ProfileId) throws ARDNotExistException, ProfileNotExistException, IOException, Exception
Creates a RDSkeleton, which is a customised RDTemplate, by given ARD and Profile. This is a valid Resource Description (RD), which the user can start to modify and fill in.- Parameters:
ARDId
- Selected Abstract Resource Description(ARD)ProfileId
- Selected Profile inside ARD- Returns:
- Resource Description (RD)
- Throws:
ARDNotExistException
ProfileNotExistException
IOException
Exception
-
getNumberOfRds
int getNumberOfRds()
Get number of RDs in this repository.- Returns:
- Number of RDs in the repository. 0 or larger. Returns also 0 if repository does not exist.
-
hasRD
boolean hasRD(String rdId) throws RDNotExistException
Has this repository a specific RD or not?- Parameters:
rdId
- ID of an RD- Returns:
- true if RD is found. False if not.
- Throws:
RDNotExistException
- RD was not found.
-
viewRDs_All
Set<RDInfo> viewRDs_All()
Gets all RDs in the storage by element's own descriptive data.- Returns:
- Set(RDInfo) contains a collection of found RDs. null if RDs exists.
-
viewRDs_Description
Set<RDInfo> viewRDs_Description(String desc, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType)
Searches matching RDs by element's own descriptive data.- Parameters:
desc
- search string for descriptionssearchField
- What field is used for search?searchType
- Search type used for search- Returns:
- Set(RDInfo) contains a collection of found RDs. null if no matches are found.
-
viewRDs_Category
Set<RDInfo> viewRDs_Category(String category, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType)
Searches matching RDs by category data.- Parameters:
category
- search string for categoriessearchField
- What field is used for search?searchType
- Search type used for search- Returns:
- Set(RDInfo) contains a collection of found RDs. null if no matches are found.
-
viewRDs_Capability
Set<RDInfo> viewRDs_Capability(String capability, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType)
Searches matching RDs by capability data.- Parameters:
capability
- search string for capabilitysearchField
- What field is used for search?searchType
- Search type used for search- Returns:
- Set(RDInfo) contains a collection of found RDs. null if no matches are found.
-
viewRDs_CapabilityParameter
Set<RDInfo> viewRDs_CapabilityParameter(String capability, List<String> parameters, List<String> values, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType)
Searches matching RDs by capability and its parameters data.- Parameters:
capability
- search string for capabilityparameters
- List of parameter information. Meaning of this information depends on searchField.values
- Optional. Can be null. Links values to a parameter on the parameters list. Must be same size and index as parameters list.searchField
- What field is used for the search?searchType
- Search type used for search- Returns:
- Set(RDInfo) contains a collection of found RDs. null if no matches are found.
-
viewRDs_Interface
Set<RDInfo> viewRDs_Interface(String ifStd, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType)
Searches matching RDs by interface standard data.- Parameters:
ifStd
- search string for interface standardssearchField
- What field is used for search?searchType
- Search type used for search- Returns:
- Set(RDInfo) contains a collection of found RDs. null if no matches are found.
-
viewRDs_Property
Set<RDInfo> viewRDs_Property(String property, ResCatStorageInterface.EnumSearchField searchField, fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType)
Searches matching RDs by property data.- Parameters:
property
- search string for propertiessearchField
- What field is used for search?searchType
- Search type used for search- Returns:
- Set(RDInfo) contains a collection of found RDs. null if no matches are found.
-
getRDStructureFromStorage
ResourceDescription getRDStructureFromStorage(String rdId) throws RDNotExistException, IOException, Exception
Gets Resource Description (RD) by given RD Id.- Parameters:
rdId
- Id of the RD- Returns:
- Resource Description (RD)
- Throws:
RDNotExistException
IOException
Exception
-
pushRDContentToStorage
boolean pushRDContentToStorage(String rdContentData, String filename, boolean overwrite) throws UserAuthorisationException, UserHasNotRightsException, IOException, RDAlreadyExistException
Pushes given RD to storage and updates the possible search index with this information.- Parameters:
rdContentData
- RD as Stringfilename
- Filename used for storing this resource. Can be null, when system decides the name.overwrite
- True = existing RD is overwritten- Returns:
- true if RD is successfully stored
- Throws:
UserAuthorisationException
UserHasNotRightsException
IOException
RDAlreadyExistException
-
pushRDStructureToStorage
boolean pushRDStructureToStorage(ResourceDescription rdObj, String filename, boolean overwrite) throws UserAuthorisationException, UserHasNotRightsException, IOException, RDAlreadyExistException
Pushes given RD to storage and updates the possible search index with this information.- Parameters:
rdObj
- RD as Java object modelfilename
- Filename used for storing this resource. Can be null, when system decides the name.overwrite
- True = existing RD is overwritten- Returns:
- true if RD is successfully stored
- Throws:
UserAuthorisationException
UserHasNotRightsException
IOException
RDAlreadyExistException
-
-