Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,31 @@ public ICacheRecord save(final @NonNull AccountRecord accountRecord,
return result;
}

/**
* Saves account data to the cache, including AccountRecord, IdTokenRecord, AccessTokenRecord,
* and optionally RefreshTokenRecord and familyId.
*
* @param accountRecord The AccountRecord to store. Must not be null.
* @param idTokenRecord The IdTokenRecord to store. Must not be null.
* @param accessTokenRecord The AccessTokenRecord to store. Must not be null.
* @param refreshTokenRecord The RefreshTokenRecord to store, or null if not applicable.
* @param familyId The family_id or null, if not applicable.
* @throws ClientException If the supplied Accounts or Credentials are schema invalid.
*/
public synchronized void saveAccountData(final @NonNull AccountRecord accountRecord,
final @NonNull IdTokenRecord idTokenRecord,
final @NonNull AccessTokenRecord accessTokenRecord,
final @Nullable RefreshTokenRecord refreshTokenRecord,
final @Nullable String familyId) throws ClientException {
save(
accountRecord,
idTokenRecord,
accessTokenRecord,
refreshTokenRecord,
familyId
);
}

/**
* Broker-only API to persist WPJ's Accounts and their associated credentials.
*
Expand Down Expand Up @@ -342,8 +367,20 @@ public synchronized List<ICacheRecord> saveAndLoadAggregatedAccountData(
}
}

/**
* Loads aggregated account data for the specified authentication scheme and cache record.
* This method retrieves cache records from the appropriate token cache (FOCI or app-specific)
* based on the client ID and environment from the provided cache record.
*
* @param authScheme The authentication scheme to use for loading tokens.
* @param cacheRecord The cache record containing the access token with client ID, environment,
* and other metadata needed to locate the appropriate cache.
* @return A list of cache records with aggregated account data, or null if the cache is not found.
* @throws NullPointerException if either {@code authScheme} or {@code cacheRecord} is null.
* @note This method is synchronized and thread-safe.
*/
@SuppressWarnings("unchecked")
private List<ICacheRecord> loadAggregatedAccountData(final @NonNull AbstractAuthenticationScheme authScheme,
public synchronized List<ICacheRecord> loadAggregatedAccountData(final @NonNull AbstractAuthenticationScheme authScheme,
final @NonNull ICacheRecord cacheRecord) {
final String methodName = ":loadAggregatedAccountData";

Expand Down