Class ResCatAPI

    • Field Detail

      • searchType

        protected fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType
        Search type which is applied. Default is EXACT
      • resCatStoHandler

        protected ResCatStorageInterface resCatStoHandler
        Handler for Resource Catalogue Storage actions
    • Constructor Detail

      • ResCatAPI

        public ResCatAPI()
        Default constructor
      • ResCatAPI

        public ResCatAPI​(String configFileName)
        Constructor with explicit RD API related configuration file.
        Parameters:
        configFileName - path and filename for configuration file for RD_API
    • Method Detail

      • getNumberOfArds

        public int getNumberOfArds()
        Description copied from interface: ResCatAPIInterface
        Get number of ARDs in the currently selected repository.
        Specified by:
        getNumberOfArds in interface ResCatAPIInterface
        Returns:
        Number of ARDs in the repository. 0 or larger. Returns also 0 if repository does not exist.
      • viewARD_Description

        public Map<String,​String> viewARD_Description​(String ardDesc)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of ARD descriptions by an textual description
        Specified by:
        viewARD_Description in interface ResCatAPIInterface
        Parameters:
        ardDesc - string used to search from description. Meaning of this information depends on implementation.
        Returns:
        Map(ARDId as key, ARDName as value). null if no matches are found.
      • viewARD_Capability

        public Map<String,​String> viewARD_Capability​(String capability)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of ARD descriptions by an arbitrary capability
        Specified by:
        viewARD_Capability in interface ResCatAPIInterface
        Parameters:
        capability - Capability information string. Meaning of this information depends on implementation.
        Returns:
        Map(ARDId as key, ARDName as value). null if no matches are found.
      • viewARD_CapabilityParameter

        public Map<String,​String> viewARD_CapabilityParameter​(String capability,
                                                                    List<String> parameters,
                                                                    List<String> values)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of ARD descriptions by an arbitrary capability and associated parameters. In order to match with the ARD, all given parameters (and possible values) must match with the capability content. I.e. if even one of parameters is not found, the ARD will not be added on the list of matches.
        Specified by:
        viewARD_CapabilityParameter in interface ResCatAPIInterface
        Parameters:
        capability - Capability information string. Meaning of this information depends on implementation.
        parameters - List of parameter information. Meaning of this information depends on implementation.
        values - Optional. The list can be null. Links to a parameter on the parameters list. Must be same size and index as parameters list. Single item on the list can be null as well.
        Returns:
        Map(ARDId as key, ARDName as value). null if no matches are found.
      • viewARD_Category

        public Map<String,​String> viewARD_Category​(String category)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of ARD descriptions by an arbitrary category
        Specified by:
        viewARD_Category in interface ResCatAPIInterface
        Parameters:
        category - Category information string. Meaning of this information depends on implementation.
        Returns:
        Map(ARDId as key, ARDName as value). null if no matches are found.
      • viewARD_Interface

        public Map<String,​String> viewARD_Interface​(String interfaceStd)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of ARD descriptions by an arbitrary interface standard.
        Specified by:
        viewARD_Interface in interface ResCatAPIInterface
        Parameters:
        interfaceStd - Interface (standard) information string. Meaning of this information depends on implementation.
        Returns:
        Map(ARDId as key, ARDName as value). null if no matches are found.
      • viewARD_Property

        public Map<String,​String> viewARD_Property​(String property)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of ARD descriptions by an arbitrary property.
        Specified by:
        viewARD_Property in interface ResCatAPIInterface
        Parameters:
        property - Property information string. Meaning of this information depends on implementation.
        Returns:
        Map(ARDId as key, ARDName as value). null if no matches are found.
      • viewProfile_ARDandCapability

        public Map<String,​String> viewProfile_ARDandCapability​(String capability,
                                                                     String ARDId)
                                                              throws ARDNotExistException
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of Profiles descriptions of specific ARD containing an arbitrary capability
        Specified by:
        viewProfile_ARDandCapability in interface ResCatAPIInterface
        Parameters:
        capability - Capability information string. Meaning of this information depends on implementation.
        ARDId - Abstract Resource Description (ARD) Id
        Returns:
        Map(ProfileId as key, Name of Profile as value). null if no matches are found.
        Throws:
        ARDNotExistException
      • viewProfile_ARDandCapabilityParameter

        public Map<String,​String> viewProfile_ARDandCapabilityParameter​(String capability,
                                                                              String ARDId,
                                                                              List<String> parameters,
                                                                              List<String> values)
                                                                       throws ARDNotExistException
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of Profiles descriptions of specific ARD by an arbitrary capability and associated parameters. In order to match with the ARD and its Profile, all given parameters (and possible values) must match with the capability content. I.e. if even one of parameters is not found, the ARD's Profile will not be added on the list of matches.
        Specified by:
        viewProfile_ARDandCapabilityParameter in interface ResCatAPIInterface
        Parameters:
        capability - Capability information string. Meaning of this information depends on implementation.
        ARDId - Abstract Resource Description (ARD) Id
        parameters - List of parameter information. Meaning of this information depends on implementation.
        values - Optional. The list can be null. Links to a parameter on the parameters list. Must be same size and index as parameters list. Single item on the list can be null as well.
        Returns:
        Map(ProfileId as key, Name of Profile as value). null if no matches are found.
        Throws:
        ARDNotExistException
      • viewProfile_Capability

        public Map<String,​ARDAndProfInfo> viewProfile_Capability​(String capability)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of ARDs and their Profiles containing an arbitrary capability
        Specified by:
        viewProfile_Capability in interface ResCatAPIInterface
        Parameters:
        capability - Capability information string. Meaning of this information depends on implementation.
        Returns:
        Map(ARDId as key, ARDAndProfInfo as value>. null if no matches are found. (TODO Add link.)
      • viewProfile_CapabilityParameter

        public Map<String,​ARDAndProfInfo> viewProfile_CapabilityParameter​(String capability,
                                                                                List<String> parameters,
                                                                                List<String> values)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of ARDs and their Profiles by an arbitrary capability and associated parameters. In order to match with the ARD and its Profile, all given parameters (and possible values) must match with the capability content. I.e. if even one of parameters is not found, the ARD's Profile will not be added on the list of matches. An ARD is not added, if it does not have any matching Profile(s).
        Specified by:
        viewProfile_CapabilityParameter in interface ResCatAPIInterface
        Parameters:
        capability - Capability information string. Meaning of this information depends on implementation.
        parameters - List of parameter information. Meaning of this information depends on implementation.
        values - Optional. The list can be null. Links to a parameter on the parameters list. Must be same size and index as parameters list. Single item on the list can be null as well.
        Returns:
        Map(ARDId as key, ARDAndProfInfo as value). null if no matches are found.
      • viewProfile_Category

        public Map<String,​ARDAndProfInfo> viewProfile_Category​(String category)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of ARDs and their Profiles containing an arbitrary category
        Specified by:
        viewProfile_Category in interface ResCatAPIInterface
        Parameters:
        category - Category information string. Meaning of this information depends on implementation.
        Returns:
        Map(ARDId as key, ARDAndProfInfo as value>. null if no matches are found. (TODO Add link.)
      • viewProfile_Interface

        public Map<String,​ARDAndProfInfo> viewProfile_Interface​(String interfaceStd)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of ARDs and their Profiles containing an arbitrary interface standard
        Specified by:
        viewProfile_Interface in interface ResCatAPIInterface
        Parameters:
        interfaceStd - Interface (standard) information string. Meaning of this information depends on implementation.
        Returns:
        Map(ARDId as key, ARDAndProfInfo as value>. null if no matches are found. (TODO Add link.)
      • viewProfile_Property

        public Map<String,​ARDAndProfInfo> viewProfile_Property​(String property)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of ARDs and their Profiles containing an arbitrary property
        Specified by:
        viewProfile_Property in interface ResCatAPIInterface
        Parameters:
        property - Property information string. Meaning of this information depends on implementation.
        Returns:
        Map(ARDId as key, ARDAndProfInfo as value>. null if no matches are found. (TODO Add link.)
      • getNumberOfRds

        public int getNumberOfRds()
        Description copied from interface: ResCatAPIInterface
        Get number of RDs in the currently selected repository.
        Specified by:
        getNumberOfRds in interface ResCatAPIInterface
        Returns:
        Number of RDs in the repository. 0 or larger. Returns also 0 if repository does not exist.
      • viewRD_Description

        public Map<String,​String> viewRD_Description​(String rdDesc)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of RD descriptions by an arbitrary RD related description
        Specified by:
        viewRD_Description in interface ResCatAPIInterface
        Parameters:
        rdDesc - Description information string. Meaning of this information depends on implementation.
        Returns:
        Map(RDId as key, Name of RD as value). null if no matches are found.
      • viewRD_Capability

        public Map<String,​String> viewRD_Capability​(String capability)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of RD descriptions by an arbitrary capability
        Specified by:
        viewRD_Capability in interface ResCatAPIInterface
        Parameters:
        capability - Capability information string. Meaning of this information depends on implementation.
        Returns:
        Map(RDId as key, Name of RD as value). null if no matches are found.
      • viewRD_CapabilityParameter

        public Map<String,​String> viewRD_CapabilityParameter​(String capability,
                                                                   List<String> parameters,
                                                                   List<String> values)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of RD descriptions by an arbitrary capability and associated parameters. In order to match with the RD all given parameters (and possible values) must match with the capability content. I.e. if even one of parameters is not found, the RD will not be added on the list of matches.
        Specified by:
        viewRD_CapabilityParameter in interface ResCatAPIInterface
        Parameters:
        capability - Capability information string. Meaning of this information depends on implementation.
        parameters - List of parameter information. Meaning of this information depends on implementation.
        values - Optional. The list can be null. Links to a parameter on the parameters list. Must be same size and index as parameters list. Single item on the list can be null as well.
        Returns:
        Map(RDId as key, RDName as value). null if no matches are found.
      • viewRD_Category

        public Map<String,​String> viewRD_Category​(String category)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of RD descriptions by an arbitrary category
        Specified by:
        viewRD_Category in interface ResCatAPIInterface
        Parameters:
        category - Category information string. Meaning of this information depends on implementation.
        Returns:
        Map(RDId as key, RDName as value). null if no matches are found.
      • viewRD_Interface

        public Map<String,​String> viewRD_Interface​(String interfaceStd)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of RD descriptions by an arbitrary interface standard
        Specified by:
        viewRD_Interface in interface ResCatAPIInterface
        Parameters:
        interfaceStd - Interface (standard) information string. Meaning of this information depends on implementation.
        Returns:
        Map(RDId as key, Name of RD as value). null if no matches are found.
      • viewRD_Property

        public Map<String,​String> viewRD_Property​(String property)
        Description copied from interface: ResCatAPIInterface
        Retrieving the complete list of RD descriptions by an arbitrary property
        Specified by:
        viewRD_Property in interface ResCatAPIInterface
        Parameters:
        property - Property information string. Meaning of this information depends on implementation.
        Returns:
        Map(RDId as key, Name of RD as value). null if no matches are found.
      • getSearchType

        public fi.tut.mei.resdescapi.util.Util.EnumSearchType getSearchType()
        Returns:
        the searchType
      • setSearchType

        public void setSearchType​(fi.tut.mei.resdescapi.util.Util.EnumSearchType searchType)
        Parameters:
        searchType - the searchType to set
      • setResCatStoHandler

        public void setResCatStoHandler​(ResCatStorageInterface resCatStoHandler)
        Parameters:
        resCatStoHandler - the resCatStoHandler to set
      • getSearchField

        protected ResCatStorageInterface.EnumSearchField getSearchField()
        Gets the current search field used for searches. (Id, Gid, name, or description)
        Returns:
        the searchField
      • setSearchField

        protected void setSearchField​(ResCatStorageInterface.EnumSearchField searchField)
        Sets the search field used for searches. (Id, Gid, name, or description)
        Parameters:
        searchField - the searchField to set
      • createResultMapOutOfDescInfos

        protected Map<String,​String> createResultMapOutOfDescInfos​(Collection<? extends DescriptionInfo> infoItems,
                                                                         ResCatStorageInterface.EnumSearchField searchField)
        Process retrieved set of DescriptionInfo items (or its successors) and extracts collection (Map) according given searchFiled.
        Parameters:
        infoItems - Set of DescriptionInfos (or its successors) as result of search criteria
        searchField - which information was requested
        Returns:
        Map key:items Id as String; value: Data content defined by search field (e.g. ID, GUID, name, description) as String