Interface TuleapClient


  • public interface TuleapClient
    Defines a Tuleap REST client and its behaviours given some configurations. Translates Tuleap api response from api php object to api java object and populate these objects to be used by the SCM api.
    See Also:
    API Tuleap
    • Field Detail

      • DEFAULT_GIT_HTTPS_PATH

        static final String DEFAULT_GIT_HTTPS_PATH
        Git URL as default configured in /etc/tuleap/plugins/git/etc/config.inc https://tuleap.net/pipermail/tuleap-devel/2015-December/004425.html http://tuleap-documentation.readthedocs.io/en/latest/installation-guide/advanced-configuration.html#tuleap-configuration
        See Also:
        Constant Field Values
      • DEFAULT_TULEAP_API_PATH

        static final String DEFAULT_TULEAP_API_PATH
        The api path according to api v1
        See Also:
        Constant Field Values
      • TULEAP_API_EXPLORER_PATH

        static final String TULEAP_API_EXPLORER_PATH
        The api explorer path according to api v1
        See Also:
        Constant Field Values
      • TULEAP_API_PROJECT_PATH

        static final String TULEAP_API_PROJECT_PATH
        The projects api path according to api v1
        See Also:
        Constant Field Values
      • TULEAP_API_USER_PATH

        static final String TULEAP_API_USER_PATH
        The users api path according to api v1
        See Also:
        Constant Field Values
      • QUERY_OBJECT_PARAM

        static final String QUERY_OBJECT_PARAM
        The query param syntax according to api v1
        See Also:
        Constant Field Values
      • BY_USERNAME_QUERY_OBJECT_PATTERN

        static final String BY_USERNAME_QUERY_OBJECT_PATTERN
        The query object to fetch users by username according to api v1
        See Also:
        Constant Field Values
      • IS_MEMBER_OF_QUERY_OBJECT_PATTERN

        static final String IS_MEMBER_OF_QUERY_OBJECT_PATTERN
        The query object to fetch projects current user is member of according to api v1
        See Also:
        Constant Field Values
      • COLLECTION_LENGTH_HEADER

        static final String COLLECTION_LENGTH_HEADER
        When a collection is returned by Tuleap, the size is advertized by this header.
        See Also:
        Constant Field Values
    • Method Detail

      • isCredentialValid

        boolean isCredentialValid()
                           throws IOException
        A means to tell we did a successful http call to a Tuleap server with correct registered credentials From Tuleap docs : Note that when accessing this route without authentication certain properties will not be returned in the response.
        Returns:
        true(false) if http call is (un)successful and (does not )contains appropriate user data i.e. email + status
        Throws:
        IOException
      • isServerUrlValid

        boolean isServerUrlValid()
                          throws IOException
        A means to tell we did a successful http call to a Tuleap server From Tuleap docs : Note that when accessing this route without authentication certain properties will not be returned in the response.
        Returns:
        true(false) if http call is (un)successful and (does not )contains appropriate user data
        Throws:
        IOException
      • allUserProjects

        Stream<TuleapProject> allUserProjects​(boolean isMemberOf)
                                       throws IOException
        Return projects current user has access. Using param object ?query={"is_member_of": true} of Tuleap api it returns only projects user is member of From docs https://tuleap.net/api/explorer/#!/projects/retrieve : Please note that {"is_member_of": false} is not supported and will result in a 400 Bad Request error.
        Parameters:
        isMemberOf - if return only projects user is member of
        Returns:
        list of projects current user has access
        Throws:
        IOException - in case HTTP errors occurs or parsing of response fail
      • allProjectRepositories

        Stream<TuleapGitRepository> allProjectRepositories​(String projectId)
                                                    throws IOException
        Get a list of git repositories of the project identified by a projectIf
        Parameters:
        projectId - the id of project to inspect
        Returns:
        the list of repositories
        Throws:
        IOException - in case HTTP errors occurs or parsing of response fail
      • projectById

        Optional<TuleapProject> projectById​(String projectId)
                                     throws IOException
        Get the project identified by the projectId
        Parameters:
        projectId - the id of the requested project
        Returns:
        An optional wrapper of the project
        Throws:
        IOException - in case HTTP errors occurs or parsing of response fail