Package de.xima.fc.proma.manager
Class PromaManager
java.lang.Object
de.xima.fc.proma.manager.PromaManager
This class is used to manage PROMA API instances for interacting with the PROMA API.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic Durationstatic TimeUnitSame asdefaultBinaryTimeout(), but returns only the unit without the value.static longSame asdefaultBinaryTimeout(), but returns only the value without units, in the unit as returned bydefaultBinaryTimeoutUnit().static Durationstatic Durationstatic TimeUnitSame asdefaultTimeout(), but returns only the unit without the value.static longSame asdefaultTimeout(), but returns only the value without units, in the unit as returned bydefaultTimeoutUnit().static voidinit()Initializes the PROMA API.static <R> StageChain<Boolean,R> static <R> StageChain<Boolean,R> static booleanChecks whether the license server / PROMA was configured and initialized.static de.xima.proma.restclient.pub.gen.ApiBundlepublicPromaApi(EHttpClient client) This method returns theApiBundleof the cached public PROMA API.static voidshutdown()Shuts down the PROMA API, closing existing bundles.
-
Method Details
-
createPromaApiUrl
- Returns:
- The URL to the PROMA REST API, as configured for this application.
-
defaultBinaryTimeout
- Returns:
- The default timeout for operations that you expect to take a "long" time, such as downloads etc. For
simple requests with a small payload you should use
defaultTimeout().
-
defaultBinaryTimeoutUnit
Same asdefaultBinaryTimeout(), but returns only the unit without the value. This is useful when you are dealing with APIs that do not accept aDuration, such as theFutureAPI.- Returns:
- The default timeout unit.
-
defaultBinaryTimeoutValue
public static long defaultBinaryTimeoutValue()Same asdefaultBinaryTimeout(), but returns only the value without units, in the unit as returned bydefaultBinaryTimeoutUnit(). This is useful when you are dealing with APIs that do not accept aDuration, such as theFutureAPI.- Returns:
- The default timeout value.
-
defaultCombinedTimeout
- Returns:
- Combined timeout for multiple plain text requests or "small" requests which you do not expect to take a long time.
-
defaultTimeout
- Returns:
- The default timeout for simple operations that you do not expect to take a "long" time. For downloads
etc. you should use
defaultBinaryTimeout().
-
defaultTimeoutUnit
Same asdefaultTimeout(), but returns only the unit without the value. This is useful when you are dealing with APIs that do not accept aDuration, such as theFutureAPI.- Returns:
- The default timeout unit.
-
defaultTimeoutValue
public static long defaultTimeoutValue()Same asdefaultTimeout(), but returns only the value without units, in the unit as returned bydefaultTimeoutUnit(). This is useful when you are dealing with APIs that do not accept aDuration, such as theFutureAPI.- Returns:
- The default timeout value.
-
init
public static void init()Initializes the PROMA API. -
isPluginStoreAvailable
- Parameters:
pc- Context for accessing the PROMA API.- Returns:
- true when the proma rest api and the plugin store is available. false if proma or the plugin store is not available.
-
isPromaAvailable
-
isPromaConfigured
public static boolean isPromaConfigured()Checks whether the license server / PROMA was configured and initialized. When this returnsfalse,publicPromaApi(EHttpClient)should not be called,- Returns:
- Whether PROMA was
initializedand configured, e.g. whether a valid URL was set.
-
publicPromaApi
public static de.xima.proma.restclient.pub.gen.ApiBundle publicPromaApi(EHttpClient client) throws IllegalStateException This method returns theApiBundleof the cached public PROMA API.- Parameters:
client- The client with which the RESTEasy HTTP engine is created.- Returns:
- cached
ApiBundleof the current with current public PROMA API. Empty when e.g. no PROMA URL was configured. - Throws:
IllegalStateException- Wheninit()was not called yet or the API is alreadyshutdown(); or whenPROMA was not configured.
-
shutdown
public static void shutdown()Shuts down the PROMA API, closing existing bundles.
-