Package org.hisp.dhis
Class Dhis2Config
java.lang.Object
org.hisp.dhis.Dhis2Config
Configuration information about a DHIS 2 instance.
- Author:
- Lars Helge Overland
-
Constructor Summary
ConstructorsConstructorDescriptionDhis2Config(String url, String username, String password) Constructor.Dhis2Config(String url, Authentication authentication) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hc.core5.net.URIBuilderProvides aURIBuilderwhich is resolved to the DHIS 2 instance API.getResolvedUrl(String path) Provides a fully qualifiedURIto the DHIS 2 instance API.
-
Constructor Details
-
Dhis2Config
Constructor. Uses basic authentication.- Parameters:
url- the URL to the DHIS 2 instance, do not include the/apipart or a trailing/.username- the DHIS 2 account username.password- the DHIS 2 account password.
-
Dhis2Config
Constructor. Uses basic authentication.- Parameters:
url- the URL to the DHIS 2 instance, do not include the/apipart or a trailing/.authentication- theAuthentication, can beBasicAuthentication,AccessTokenAuthenticationorCookieAuthentication.
-
-
Method Details
-
getResolvedUrl
Provides a fully qualifiedURIto the DHIS 2 instance API.- Parameters:
path- the URL path (the URL part after/api/.- Returns:
- a fully qualified
URIto the DHIS 2 instance API.
-
getResolvedUriBuilder
public org.apache.hc.core5.net.URIBuilder getResolvedUriBuilder()Provides aURIBuilderwhich is resolved to the DHIS 2 instance API.- Returns:
- a
URIBuilder.
-