Interface OpenProjectConfiguration
-
@Role public interface OpenProjectConfigurationProvides methods for retrieving OpenProject configuration properties and access tokens.- Version:
- $Id$
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcleanCache()Clean 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.StringgetAccessTokenForConfiguration(String connectionName)Retrieves the server URL associated with a given connection name.OpenProjectConnectiongetConnection(String connectionName)Retrieves the server URL associated with a given connection name.OpenProjectApiClientgetOpenProjectApiClient(String connectionName)Provides an instance ofOpenProjectApiClientfor interacting with the OpenProject API.List<OpenProjectConnection>getOpenProjectConnections()Retrieves a list of available OpenProject connections.
-
-
-
Method Detail
-
getOpenProjectConnections
List<OpenProjectConnection> getOpenProjectConnections()
Retrieves a list of available OpenProject connections.- Returns:
- a list of
OpenProjectConnectioninstances;
-
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 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
OpenProjectApiClient getOpenProjectApiClient(String connectionName)
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.
-
-