Class CedarlingAdapter
-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
public class CedarlingAdapter implements AutoCloseable
-
-
Constructor Summary
Constructors Constructor Description CedarlingAdapter()
-
Method Summary
Modifier and Type Method Description CedarlinggetCedarling()voidloadFromJson(String bootstrapConfigJson)voidloadFromFile(String path)AuthorizeResultauthorize(Map<String, String> tokens, String action, JSONObject resource, JSONObject context)AuthorizeResultauthorizeUnsigned(List<EntityData> principals, String action, JSONObject resource, JSONObject context)MultiIssuerAuthorizeResultauthorizeMultiIssuer(List<TokenInput> tokens, String action, JSONObject resource, JSONObject context)StringgetLogById(String id)List<String>getLogIds()List<String>getLogsByRequestId(String requestId)List<String>getLogsByRequestIdAndTag(String requestId, String tag)List<String>getLogsByTag(String tag)List<String>popLogs()voidpushDataCtx(String key, JSONObject value, Long ttlSecs)Push a value into the data store with an optional TTL. voidpushDataCtx(String key, String value, Long ttlSecs)Push a value into the data store with an optional TTL. voidpushDataCtx(String key, JSONObject value)Push a value into the data store without TTL (uses default from config). voidpushDataCtx(String key, String value)Push a value into the data store without TTL (uses default from config). ObjectgetDataCtx(String key)Get a value from the data store by key. DataEntrygetDataEntryCtx(String key)Get a data entry with full metadata by key. booleanremoveDataCtx(String key)Remove a value from the data store by key. voidclearDataCtx()Clear all entries from the data store. List<DataEntry>listDataCtx()List all entries with their metadata. DataStoreStatsgetStatsCtx()Get statistics about the data store. voidclose()-
-
Method Detail
-
getCedarling
Cedarling getCedarling()
-
loadFromJson
void loadFromJson(String bootstrapConfigJson)
-
loadFromFile
void loadFromFile(String path)
-
authorize
AuthorizeResult authorize(Map<String, String> tokens, String action, JSONObject resource, JSONObject context)
-
authorizeUnsigned
AuthorizeResult authorizeUnsigned(List<EntityData> principals, String action, JSONObject resource, JSONObject context)
-
authorizeMultiIssuer
MultiIssuerAuthorizeResult authorizeMultiIssuer(List<TokenInput> tokens, String action, JSONObject resource, JSONObject context)
-
getLogById
String getLogById(String id)
-
getLogsByRequestId
List<String> getLogsByRequestId(String requestId)
-
getLogsByRequestIdAndTag
List<String> getLogsByRequestIdAndTag(String requestId, String tag)
-
getLogsByTag
List<String> getLogsByTag(String tag)
-
pushDataCtx
void pushDataCtx(String key, JSONObject value, Long ttlSecs)
Push a value into the data store with an optional TTL. If the key already exists, the value will be replaced. If TTL is not provided, the default TTL from configuration is used.
- Parameters:
key- The key for the data entryvalue- The value to store (as JSONObject)ttlSecs- Optional TTL in seconds (null uses default from config)
-
pushDataCtx
void pushDataCtx(String key, String value, Long ttlSecs)
Push a value into the data store with an optional TTL. If the key already exists, the value will be replaced. If TTL is not provided, the default TTL from configuration is used.
- Parameters:
key- The key for the data entryvalue- The value to store (as JSON string)ttlSecs- Optional TTL in seconds (null uses default from config)
-
pushDataCtx
void pushDataCtx(String key, JSONObject value)
Push a value into the data store without TTL (uses default from config).
- Parameters:
key- The key for the data entryvalue- The value to store (as JSONObject)
-
pushDataCtx
void pushDataCtx(String key, String value)
Push a value into the data store without TTL (uses default from config).
- Parameters:
key- The key for the data entryvalue- The value to store (as JSON string)
-
getDataCtx
Object getDataCtx(String key)
Get a value from the data store by key. Returns null if the key doesn't exist or the entry has expired.
- Parameters:
key- The key to retrieve- Returns:
The value as an Object (JSONObject, JSONArray, String, Number, Boolean, or null), or null if not found
-
getDataEntryCtx
DataEntry getDataEntryCtx(String key)
Get a data entry with full metadata by key. Returns null if the key doesn't exist or the entry has expired.
- Parameters:
key- The key to retrieve- Returns:
A DataEntry object with metadata, or null if not found
-
removeDataCtx
boolean removeDataCtx(String key)
Remove a value from the data store by key.
- Parameters:
key- The key to remove- Returns:
True if the key existed and was removed, False otherwise
-
clearDataCtx
void clearDataCtx()
Clear all entries from the data store.
-
listDataCtx
List<DataEntry> listDataCtx()
List all entries with their metadata.
- Returns:
A list of DataEntry objects
-
getStatsCtx
DataStoreStats getStatsCtx()
Get statistics about the data store.
- Returns:
A DataStoreStats object
-
close
void close()
-
-
-
-