public class AuthleteApiFactory extends Object
AuthleteApi instance.| Modifier and Type | Method and Description |
|---|---|
static AuthleteApi |
create(AuthleteConfiguration configuration)
Create an instance of
AuthleteApi. |
static AuthleteApi |
create(AuthleteConfiguration configuration,
String className)
Create an instance of
AuthleteApi from the specified class. |
static AuthleteApi |
getDefaultApi()
Get the default instance of
AuthleteApi. |
public static AuthleteApi create(AuthleteConfiguration configuration)
AuthleteApi.
This method repeats to call create(AuthleteConfiguration, String)
until one of the known classes is successfully instantiated.
The classes listed below are the ones that the current implementation knows.
com.authlete.jaxrs.api.AuthleteApiImplcom.authlete:authlete-java-jaxrs)
com.authlete.common.api.AuthleteApiImplHttpURLConnection, contained in com.authlete:authlete-java-common since version 2.0)
configuration - Authlete configuration.AuthleteApi. If none of the known classes
that implement AuthleteApi interface was successfully
instantiated, null is returned.public static AuthleteApi create(AuthleteConfiguration configuration, String className)
AuthleteApi from the specified class.configuration - Authlete configuration.className - The name of a class that implements AuthleteApi
interface. The class must have a constructor which takes
one argument of type AuthleteConfiguration.IllegalArgumentException - configuration is null.
className is null.
AuthleteApi interface.
AuthleteConfiguration.
IllegalStateException - The constructor of the specified class threw an exception.public static AuthleteApi getDefaultApi()
AuthleteApi.
This method loads a configuration file (using AuthletePropertiesConfiguration) on the first call, creates
an instance of AuthleteApi and caches the instance.
The second and subsequent calls return the cached instance.
The default name of the configuration file is authlete.properties, but it can be changed by a system property
authlete.configuration.file. The current directory and
the classpath are searched for the configuration file in this order.
AuthleteApi.Copyright © 2017. All rights reserved.