Interface OpenProjectConfiguration
@Role
public interface OpenProjectConfiguration
Provides methods for retrieving OpenProject configuration properties and access tokens.
- Version:
- $Id$
-
Method Summary
Modifier and TypeMethodDescriptionvoidClean the various caches used by the application, such as the entities retrieved from the configured Open Project instances.voidcreateNewToken(String connectionName, String redirectUrl) Creates a new OAuth token using the specified connection name and redirect URL.getAccessTokenForConfiguration(String connectionName) Retrieves the server URL associated with a given connection name.getConnection(String connectionName) Retrieves the server URL associated with a given connection name.getOpenProjectApiClient(String connectionName) Provides an instance ofOpenProjectApiClientfor interacting with the OpenProject API.Retrieves a list of available OpenProject connections.
-
Method Details
-
getOpenProjectConnections
List<OpenProjectConnection> getOpenProjectConnections()Retrieves a list of available OpenProject connections.- Returns:
- a list of
OpenProjectConnectioninstances;
-
getConnection
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
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
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 tokenredirectUrl- 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
Provides an instance ofOpenProjectApiClientfor interacting with the OpenProject API.- Parameters:
connectionName- the name of the connection from which to obtain data- Returns:
- a configured
OpenProjectApiClientready for use
-
cleanCache
void cleanCache()Clean the various caches used by the application, such as the entities retrieved from the configured Open Project instances.
-