Package com.authlete.common.api
Class AuthleteApiBasicImpl
- java.lang.Object
-
- com.authlete.common.api.AuthleteApiBasicImpl
-
- All Implemented Interfaces:
AuthleteApi
- Direct Known Subclasses:
AuthleteApiImplV3
public abstract class AuthleteApiBasicImpl extends Object implements AuthleteApi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
AuthleteApiBasicImpl.AuthleteApiCall<TResponse>
protected static class
AuthleteApiBasicImpl.ClientErrorHandling
Strategy for handling client error responses (4xx)protected static class
AuthleteApiBasicImpl.HttpMethod
HTTP methods used in this source code.protected static class
AuthleteApiBasicImpl.NotFoundHandling
Strategy for handling 404 responses
-
Constructor Summary
Constructors Modifier Constructor Description protected
AuthleteApiBasicImpl(AuthleteConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <TResponse>
TResponsecallApi(AuthleteApiBasicImpl.HttpMethod method, String auth, String path, Map<String,Object[]> queryParams, Object requestBody, Class<TResponse> responseClass, Options options)
Call an API with centralized context handling.protected <TResponse>
TResponsecallApiWith4xxHandling(AuthleteApiBasicImpl.HttpMethod method, String auth, String path, Map<String,Object[]> queryParams, Object requestBody, Class<TResponse> responseClass, Options options, AuthleteApiBasicImpl.NotFoundHandling notFoundHandling, AuthleteApiBasicImpl.ClientErrorHandling clientErrorHandling)
Call an API with centralized context handling and specified 4xx handling strategies.protected <TResponse>
TResponsecallApiWithNotFoundHandling(AuthleteApiBasicImpl.HttpMethod method, String auth, String path, Map<String,Object[]> queryParams, Object requestBody, Class<TResponse> responseClass, Options options, AuthleteApiBasicImpl.NotFoundHandling notFoundHandling)
Call an API with centralized context handling and specified 404 handling strategy.protected void
callDeleteApi(String auth, String path, Options options)
Call an API with HTTP DELETE method.protected Map<String,String>
callEcho(String path, Map<String,String> parameters, Options options)
protected <TResponse>
TResponsecallGetApi(String auth, String path, Class<TResponse> responseClass, Map<String,Object[]> queryParams, Options options)
Call an API with HTTP GET method.protected ClientListResponse
callGetClientList(String auth, String path, String developer, int start, int end, boolean rangeGiven, Options options)
protected ServiceListResponse
callGetServiceList(String auth, String path, int start, int end, boolean rangeGiven, Options options)
protected TokenListResponse
callGetTokenList(String auth, String path, String clientIdentifier, String subject, int start, int end, boolean rangeGiven, TokenStatus tokenStatus, Options options)
protected <TResponse>
TResponsecallPostApi(String auth, String path, Object requestBody, Class<TResponse> responseClass, Options options)
Call an API with HTTP POST method.ApiResponse
deleteApiResponse(String auth, String path, Options options)
Perform a DELETE and return the ApiResponse (business result), treating 404 as success and other 4xx with graceful handling for empty bodies.protected <TResponse>
TResponseexecuteApiCall(AuthleteApiBasicImpl.AuthleteApiCall<TResponse> apiCall)
Execute an Authlete API call.Settings
getSettings()
Get the reference to the settings of thisAuthleteApi
implementation.protected boolean
isDpopEnabled()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.authlete.common.api.AuthleteApi
authorization, authorization, authorizationFail, authorizationFail, authorizationIssue, authorizationIssue, authorizationTicketInfo, authorizationTicketInfo, authorizationTicketUpdate, authorizationTicketUpdate, backchannelAuthentication, backchannelAuthentication, backchannelAuthenticationComplete, backchannelAuthenticationComplete, backchannelAuthenticationFail, backchannelAuthenticationFail, backchannelAuthenticationIssue, backchannelAuthenticationIssue, createClient, createClient, createService, createService, createServie, credentialBatchIssue, credentialBatchIssue, credentialBatchParse, credentialBatchParse, credentialDeferredIssue, credentialDeferredIssue, credentialDeferredParse, credentialDeferredParse, credentialIssuerJwks, credentialIssuerJwks, credentialIssuerMetadata, credentialIssuerMetadata, credentialJwtIssuerMetadata, credentialJwtIssuerMetadata, credentialOfferCreate, credentialOfferCreate, credentialOfferInfo, credentialOfferInfo, credentialSingleIssue, credentialSingleIssue, credentialSingleParse, credentialSingleParse, deleteClient, deleteClient, deleteClient, deleteClient, deleteClientAuthorization, deleteClientAuthorization, deleteGrantedScopes, deleteGrantedScopes, deleteRequestableScopes, deleteRequestableScopes, deleteService, deleteService, deviceAuthorization, deviceAuthorization, deviceComplete, deviceComplete, deviceVerification, deviceVerification, dynamicClientDelete, dynamicClientDelete, dynamicClientGet, dynamicClientGet, dynamicClientRegister, dynamicClientRegister, dynamicClientUpdate, dynamicClientUpdate, echo, echo, federationConfiguration, federationConfiguration, federationRegistration, federationRegistration, getClient, getClient, getClient, getClient, getClientAuthorizationList, getClientAuthorizationList, getClientList, getClientList, getClientList, getClientList, getClientList, getClientList, getClientList, getClientList, getGrantedScopes, getGrantedScopes, getRequestableScopes, getRequestableScopes, getService, getService, getServiceConfiguration, getServiceConfiguration, getServiceConfiguration, getServiceConfiguration, getServiceConfiguration, getServiceConfiguration, getServiceJwks, getServiceJwks, getServiceJwks, getServiceJwks, getServiceList, getServiceList, getServiceList, getServiceList, getTokenCreateBatchStatus, getTokenCreateBatchStatus, getTokenList, getTokenList, getTokenList, getTokenList, getTokenList, getTokenList, getTokenList, getTokenList, getTokenList, getTokenList, getTokenList, getTokenList, getTokenList, getTokenList, getTokenList, getTokenList, gm, gm, hskCreate, hskCreate, hskDelete, hskDelete, hskGet, hskGet, hskGetList, hskGetList, idTokenReissue, idTokenReissue, introspection, introspection, nativeSso, nativeSsoLogout, pushAuthorizationRequest, pushAuthorizationRequest, refreshClientSecret, refreshClientSecret, refreshClientSecret, refreshClientSecret, revocation, revocation, setRequestableScopes, setRequestableScopes, standardIntrospection, standardIntrospection, token, token, tokenCreate, tokenCreate, tokenCreateBatch, tokenCreateBatch, tokenDelete, tokenDelete, tokenFail, tokenFail, tokenIssue, tokenIssue, tokenRevoke, tokenRevoke, tokenUpdate, tokenUpdate, updateClient, updateClient, updateClientAuthorization, updateClientAuthorization, updateClientLockFlag, updateClientLockFlag, updateClientSecret, updateClientSecret, updateClientSecret, updateClientSecret, updateService, updateService, userinfo, userinfo, userinfoIssue, userinfoIssue, verifyJose, verifyJose
-
-
-
-
Constructor Detail
-
AuthleteApiBasicImpl
protected AuthleteApiBasicImpl(AuthleteConfiguration configuration)
-
-
Method Detail
-
callGetApi
protected <TResponse> TResponse callGetApi(String auth, String path, Class<TResponse> responseClass, Map<String,Object[]> queryParams, Options options) throws AuthleteApiException
Call an API with HTTP GET method.- Throws:
AuthleteApiException
-
callPostApi
protected <TResponse> TResponse callPostApi(String auth, String path, Object requestBody, Class<TResponse> responseClass, Options options) throws AuthleteApiException
Call an API with HTTP POST method.- Throws:
AuthleteApiException
-
callDeleteApi
protected void callDeleteApi(String auth, String path, Options options) throws AuthleteApiException
Call an API with HTTP DELETE method.- Throws:
AuthleteApiException
-
executeApiCall
protected <TResponse> TResponse executeApiCall(AuthleteApiBasicImpl.AuthleteApiCall<TResponse> apiCall) throws AuthleteApiException
Execute an Authlete API call. Note: All context handling (creation, exception wrapping, cleanup) is now centralized in the callApi method, eliminating the need for ThreadLocal context.- Throws:
AuthleteApiException
-
callApi
protected <TResponse> TResponse callApi(AuthleteApiBasicImpl.HttpMethod method, String auth, String path, Map<String,Object[]> queryParams, Object requestBody, Class<TResponse> responseClass, Options options) throws AuthleteApiException
Call an API with centralized context handling.- Throws:
AuthleteApiException
-
callApiWithNotFoundHandling
protected <TResponse> TResponse callApiWithNotFoundHandling(AuthleteApiBasicImpl.HttpMethod method, String auth, String path, Map<String,Object[]> queryParams, Object requestBody, Class<TResponse> responseClass, Options options, AuthleteApiBasicImpl.NotFoundHandling notFoundHandling) throws AuthleteApiException
Call an API with centralized context handling and specified 404 handling strategy.- Throws:
AuthleteApiException
-
callApiWith4xxHandling
protected <TResponse> TResponse callApiWith4xxHandling(AuthleteApiBasicImpl.HttpMethod method, String auth, String path, Map<String,Object[]> queryParams, Object requestBody, Class<TResponse> responseClass, Options options, AuthleteApiBasicImpl.NotFoundHandling notFoundHandling, AuthleteApiBasicImpl.ClientErrorHandling clientErrorHandling) throws AuthleteApiException
Call an API with centralized context handling and specified 4xx handling strategies.- Throws:
AuthleteApiException
-
callGetTokenList
protected TokenListResponse callGetTokenList(String auth, String path, String clientIdentifier, String subject, int start, int end, boolean rangeGiven, TokenStatus tokenStatus, Options options)
-
callGetServiceList
protected ServiceListResponse callGetServiceList(String auth, String path, int start, int end, boolean rangeGiven, Options options)
-
callGetClientList
protected ClientListResponse callGetClientList(String auth, String path, String developer, int start, int end, boolean rangeGiven, Options options)
-
callEcho
protected Map<String,String> callEcho(String path, Map<String,String> parameters, Options options)
-
getSettings
public Settings getSettings()
Description copied from interface:AuthleteApi
Get the reference to the settings of thisAuthleteApi
implementation.- Specified by:
getSettings
in interfaceAuthleteApi
- Returns:
- The reference to the settings of this
AuthleteApi
implementation.
-
isDpopEnabled
protected boolean isDpopEnabled()
-
deleteApiResponse
public ApiResponse deleteApiResponse(String auth, String path, Options options) throws AuthleteApiException
Perform a DELETE and return the ApiResponse (business result), treating 404 as success and other 4xx with graceful handling for empty bodies.- Throws:
AuthleteApiException
-
-