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
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TuleapClient.MultipleUserMatchingCredentialsException
Multiple user represented by a given username passxord credentials is clearly a showstopperstatic class
TuleapClient.NoSingleRepoByPathException
If multpile git repo are represented by a path it is a show stopper as in Tuleap the discriminant is the git repo pathstatic class
TuleapClient.TuleapGitException
If some git errors occurs, it is not a showstopper though as it may be just temporary.
-
Field Summary
Fields Modifier and Type Field Description static String
BY_USERNAME_QUERY_OBJECT_PATTERN
The query object to fetch users by username according to api v1static String
COLLECTION_LENGTH_HEADER
When a collection is returned by Tuleap, the size is advertized by this header.static 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-configurationstatic String
DEFAULT_TULEAP_API_PATH
The api path according to api v1static String
DEFAULT_TULEAP_DOMAIN_URL
static String
IS_MEMBER_OF_QUERY_OBJECT_PATTERN
The query object to fetch projects current user is member of according to api v1static String
QUERY_OBJECT_PARAM
The query param syntax according to api v1static String
TULEAP_API_EXPLORER_PATH
The api explorer path according to api v1static String
TULEAP_API_GIT_PATH
The git api path according to api v1static String
TULEAP_API_PROJECT_PATH
The projects api path according to api v1static String
TULEAP_API_USER_PATH
The users api path according to api v1
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stream<TuleapBranches>
allBranches(int idRepo)
Stream<TuleapGitRepository>
allProjectRepositories(String projectId)
Get a list of git repositories of the project identified by a projectIfStream<TuleapProject>
allUserProjects(boolean isMemberOf)
Return projects current user has access.Optional<TuleapFileContent>
getJenkinsFile(int idRepo, String path_to_file, String ref)
boolean
isCredentialValid()
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.boolean
isServerUrlValid()
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.Optional<TuleapProject>
projectById(String projectId)
Get the project identified by the projectId
-
-
-
Field Detail
-
DEFAULT_TULEAP_DOMAIN_URL
static final String DEFAULT_TULEAP_DOMAIN_URL
- See Also:
- Constant Field Values
-
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
-
TULEAP_API_GIT_PATH
static final String TULEAP_API_GIT_PATH
The git 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
-
getJenkinsFile
Optional<TuleapFileContent> getJenkinsFile(int idRepo, String path_to_file, String ref) throws IOException
- Throws:
IOException
-
allBranches
Stream<TuleapBranches> allBranches(int idRepo) throws IOException
- Throws:
IOException
-
-