public interface DataStore
DataStore
is the liaison between client SDK components and the raw Okta REST API. It is responsible
for converting SDK objects (Account, Directory, Group instances, etc) into REST HTTP requests, executing those
requests, and converting REST HTTP responses back into SDK objects.Modifier and Type | Method and Description |
---|---|
<T extends Resource> |
create(String parentHref,
T resource)
Creates a new resource and returns the instance as represented by the server.
|
<T extends Resource> |
delete(String href,
T resource)
Deleted a resource on the remote server.
|
CacheManager |
getCacheManager()
Returns the CacheManager used to improve data store performance.
|
ClientCredentials |
getClientCredentials()
Returns the ClientCredentials used to authenticate HTTPS requests sent to the Okta API server.
|
<T extends Resource> |
getResource(String href,
Class<T> clazz)
Looks up (retrieves) the resource at the specified
href URL and returns the resource as an instance of
the specified class . |
RequestBuilder |
http()
Returns an http request builder to help make requests to Okta endpoints that are NOT implemented by this SDK.
|
<T extends Resource> |
instantiate(Class<T> clazz)
Instantiates and returns a new instance of the specified Resource type.
|
boolean |
isReady(Supplier<? extends Resource> methodReference)
Check if Datastore is configured correctly and able to execute requests.
|
<T extends Resource> |
save(String href,
T resource)
Saves an exiting resource to the remote server.
|
<T extends Resource> T instantiate(Class<T> clazz)
This method effectively replaces the new
keyword that would have been used otherwise if the concrete implementation was known (Resource implementation
classes are intentionally not exposed to SDK end-users).
T
- the Resource sub-typeclazz
- the Resource class to instantiate.<T extends Resource> T getResource(String href, Class<T> clazz)
href
URL and returns the resource as an instance of
the specified class
. The Class
argument must represent an interface that is a sub-interface
of Resource
.
T
- type parameter indicating the returned value is a Resource
instance.href
- the resource URL of the resource to retrieveclazz
- the Resource
sub-interface to instantiatehref
URL.<T extends Resource> T create(String parentHref, T resource)
T
- type parameter indicating the returned value is a Resource
instance.parentHref
- the resource URL of the resource to retrieveresource
- the object payload to to send to the server<T extends Resource> void save(String href, T resource)
NOTE: this is typically done by using resource.save()
instead of this method.
T
- type parameter indicating the type of Resource
instance.href
- the resource URL of the resource to updatedresource
- the object payload to to send to the server<T extends Resource> void delete(String href, T resource)
NOTE: this is typically done by using resource.delete()
instead of this method.
T
- type parameter indicating the type of Resource
instance.href
- the resource URL of the resource to deletedresource
- the object payload to to send to the serverClientCredentials getClientCredentials()
CacheManager getCacheManager()
RequestBuilder http()
boolean isReady(Supplier<? extends Resource> methodReference)
methodReference
- a reference to the method based on which the ready state will be checkedtrue
if orgUrl and token are correct and Okta Core is available, otherwise false
.Copyright © 2017–2023 Okta. All rights reserved.