Class LinkDAO

    • Constructor Detail

      • LinkDAO

        protected LinkDAO()
        Hide constructor of utility class
    • Method Detail

      • get

        protected static LinkDAO get()
      • deleteComponentInstanceData

        public void deleteComponentInstanceData​(String componentInstanceId)
                                         throws SQLException
        Deletes all links about the component instance represented by the given identifier.
        Parameters:
        componentInstanceId - the identifier of the component instance for which the resources must be deleted.
        Throws:
        SQLException - on SQL problem
      • getLinkIdsByComponentInstance

        protected List<Integer> getLinkIdsByComponentInstance​(String componentInstanceId)
                                                       throws SQLException
        Gets all the link identifier which references the identifier of a component instance (url, instanceId, etc.).

        It is not the same behavior as getAllLinksByInstance(String) method which is searching for data only against instanceId field.

        Parameters:
        componentInstanceId - the identifier of the component instance for which the resources must be deleted.
        Throws:
        SQLException - on SQL problem
      • deleteUserData

        public void deleteUserData​(String userId)
                            throws SQLException
        Delete all
        Parameters:
        userId - the identifier of the user for which the resources must be deleted
        Throws:
        SQLException - on SQL problem
      • getAllLinksByUser

        public List<LinkDetail> getAllLinksByUser​(String userId)
                                           throws SQLException
        Retrieve user links
        Parameters:
        userId - the user identifier
        Returns:
        list of user links
        Throws:
        SQLException - on SQL problem
      • getAllLinksByInstance

        public List<LinkDetail> getAllLinksByInstance​(String instanceId)
                                               throws SQLException
        Retrieve all links about a component instance id.
        Parameters:
        instanceId - the component instance identifier
        Returns:
        list of LinkDetail
        Throws:
        SQLException - on SQL problem
      • getAllLinksByObject

        public List<LinkDetail> getAllLinksByObject​(String instanceId,
                                                    String objectId)
                                             throws SQLException
        Retrieve all links about an object id on a component instance id
        Parameters:
        instanceId - the component instance identifier which hosts the object
        objectId - the identifier of the object
        Returns:
        list of LinkDetail
        Throws:
        SQLException - on SQL problem
      • getLink

        public LinkDetail getLink​(int linkId)
                           throws SQLException
        Retrieve link from identifier
        Parameters:
        linkId - the link identifier
        Returns:
        the link detail
        Throws:
        SQLException - on SQL problem
      • deleteLink

        public void deleteLink​(String linkId)
                        throws SQLException
        Remove a link
        Parameters:
        linkId - the link identifier to remove
        Throws:
        SQLException - on SQL problem