Interface OpenProjectConfiguration


  • @Role
    public interface OpenProjectConfiguration
    Provides methods for retrieving OpenProject configuration properties and access tokens.
    Version:
    $Id$
    • Method Detail

      • getOpenProjectConnections

        List<OpenProjectConnection> getOpenProjectConnections()
        Retrieves a list of available OpenProject connections.
        Returns:
        a list of OpenProjectConnection instances;
      • getConnection

        OpenProjectConnection getConnection​(String connectionName)
        Retrieves the server URL associated with a given connection name.
        Parameters:
        connectionName - the name of the OpenProject connection configuration
        Returns:
        the server URL associated with the given connection
      • getAccessTokenForConfiguration

        String getAccessTokenForConfiguration​(String connectionName)
        Retrieves the server URL associated with a given connection name.
        Parameters:
        connectionName - the name of the OpenProject connection configuration
        Returns:
        the server URL associated with the given connection
      • createNewToken

        void createNewToken​(String connectionName,
                            String redirectUrl)
                     throws AuthenticationException
        Creates a new OAuth token using the specified connection name and redirect URL.
        Parameters:
        connectionName - the name of the connection to use for creating the OAuth token
        redirectUrl - the URL to which the OAuth provider will redirect after authorization
        Throws:
        AuthenticationException - when the OAuth2 protocol between xwiki and the configured Open Project instance failed.
      • getOpenProjectApiClient

        OpenProjectApiClient getOpenProjectApiClient​(String connectionName)
        Provides an instance of OpenProjectApiClient for interacting with the OpenProject API.
        Parameters:
        connectionName - the name of the connection from which to obtain data
        Returns:
        a configured OpenProjectApiClient ready for use
      • cleanCache

        void cleanCache()
        Clean the various caches used by the application, such as the entities retrieved from the configured Open Project instances.