Package org.hisp.dhis

Class Dhis2Config

java.lang.Object
org.hisp.dhis.Dhis2Config

public class Dhis2Config extends Object
Configuration information about a DHIS 2 instance.
Author:
Lars Helge Overland
  • Constructor Details

    • Dhis2Config

      public Dhis2Config(String url, String username, String password)
      Constructor. Uses basic authentication.
      Parameters:
      url - the URL to the DHIS 2 instance, do not include the /api part or a trailing /.
      username - the DHIS 2 account username.
      password - the DHIS 2 account password.
    • Dhis2Config

      public Dhis2Config(String url, Authentication authentication)
      Constructor. Uses basic authentication.
      Parameters:
      url - the URL to the DHIS 2 instance, do not include the /api part or a trailing /.
      authentication - the Authentication, can be BasicAuthentication, AccessTokenAuthentication or CookieAuthentication.
  • Method Details

    • getResolvedUrl

      public URI getResolvedUrl(String path)
      Provides a fully qualified URI to the DHIS 2 instance API.
      Parameters:
      path - the URL path (the URL part after /api/.
      Returns:
      a fully qualified URI to the DHIS 2 instance API.
    • getResolvedUriBuilder

      public org.apache.hc.core5.net.URIBuilder getResolvedUriBuilder()
      Provides a URIBuilder which is resolved to the DHIS 2 instance API.
      Returns:
      a URIBuilder.