public class StsPropertiesStorageManager extends Object implements StsStorageManager
Constructor and Description |
---|
StsPropertiesStorageManager(@NonNull Path filePath)
Simple implementation of STSStorageManager which uses a properties file.
|
Modifier and Type | Method and Description |
---|---|
void |
addEntry(@NonNull String hostname,
long duration,
@NonNull StsPolicy policy)
Adds an entry to the store, storing data in the backing properties file.
|
@NonNull Optional<StsPolicy> |
getEntry(@NonNull String hostname)
Gets an STS policy from the store, looking it up via hostname.
|
boolean |
hasEntry(@NonNull String hostname)
Checks if a policy has been stored for the hostname.
|
void |
removeEntry(@NonNull String hostname)
Deletes an entry from the store (used for 0 duration policies).
|
public StsPropertiesStorageManager(@NonNull Path filePath)
filePath
- the path to the properties file used to persist the datapublic void addEntry(@NonNull String hostname, long duration, @NonNull StsPolicy policy)
addEntry
in interface StsStorageManager
hostname
- the hostname (as sent in the SNI by the client)duration
- the length (in seconds) until the expiry of this stored policypolicy
- the STS policy instance, including all data sent from the serverpublic @NonNull Optional<StsPolicy> getEntry(@NonNull String hostname)
getEntry
in interface StsStorageManager
hostname
- the hostname (as sent in the SNI by the client)public boolean hasEntry(@NonNull String hostname)
hasEntry
in interface StsStorageManager
hostname
- the hostname to checkpublic void removeEntry(@NonNull String hostname)
Implementers MUST ignore requests to remove entries that do not exist.
removeEntry
in interface StsStorageManager
hostname
- the hostname to remove the policy forCopyright © 2013–2021 Kitteh. All rights reserved.