Interface IKeyStoreEntityDao
public interface IKeyStoreEntityDao
DAO for reading and writing
KeyStoreEntity entities.- Since:
- 8.5.0
- Author:
- XIMA Media GmbH
- See Also:
-
Method Summary
Modifier and TypeMethodDescription@NotNull KeyStoreEntitycreateCustomKeyStore(NewKeyStoreDefinition newKeyStoreDefinition) Creates a new custom keystore with the specified name, description, assignee type, and assignee ID.voiddelete(KeyStoreEntity entity) Deletes the specified keystore entity.@NotNull Optional<KeyStoreEntity> Retrieves aKeyStoreEntityby its ID.@NotNull Optional<KeyStoreEntity> findByName(String name, KeyStoreScope scope) Retrieves aKeyStoreEntityby its name and scope.@NotNull Set<KeyStoreEntity> getAllByAssigneeType(Set<EAssigneeType> assigneeTypes) Retrieves a list of all keystores assigned to the specified type of assignee.@NotNull Set<KeyStoreEntity> getAllByKeyStoreScopes(Set<KeyStoreScope> keyStoreScopes) Retrieves a set of all keystores for the given scopes.@NotNull KeyStoreEntitygetDefaultKeyStore(KeyStoreScope defaultScope) Retrieves the default keystore for the specified scope.
-
Method Details
-
createCustomKeyStore
@NotNull @NotNull KeyStoreEntity createCustomKeyStore(NewKeyStoreDefinition newKeyStoreDefinition) throws FcCertificateManagementException Creates a new custom keystore with the specified name, description, assignee type, and assignee ID.- Parameters:
newKeyStoreDefinition- the definition of the new keystore to be created, containing the name, description, and scope.- Returns:
- the created
KeyStoreEntity. - Throws:
IllegalArgumentException- if the provided name is blank, the provided keyStoreScope is invalid or the keystore scope is not supported, e.g., custom keystores are not supported for theUSERscope.FcCertificateManagementException- if the keystore already exists for the specified name and/or scope or if the keystore cannot be created for any other reason.
-
delete
Deletes the specified keystore entity.- Parameters:
entity- the keystore entity to delete.- Throws:
IllegalArgumentException- if the provided entity is nullIllegalStateException- if the entity is not managed by the current contextFcCertificateManagementException- if the keystore cannot be deleted
-
findById
Retrieves aKeyStoreEntityby its ID.- Parameters:
id- the ID of the keystore to retrieve.- Returns:
- an
Optionalcontaining theKeyStoreEntityif found, or an emptyOptionalif not
-
findByName
Retrieves aKeyStoreEntityby its name and scope.- Parameters:
name- the name of the keystore to retrieve.scope- the scope of the keystore to retrieve.- Returns:
- an
Optionalcontaining theKeyStoreEntityif found, or an emptyOptionalif not
-
getAllByAssigneeType
Retrieves a list of all keystores assigned to the specified type of assignee.- Parameters:
assigneeTypes- the types of the assignee (e.g., user, group).- Returns:
- a set of keystore entities containing information about the keystores assigned to the specified assignee if the user has permission to access them.
-
getAllByKeyStoreScopes
Retrieves a set of all keystores for the given scopes.Note: If the default keystore for a given scope does not exist, it will be created automatically and returned with the list of keystores.
- Parameters:
keyStoreScopes- the scopes of the keystores to retrieve.- Returns:
- a set of the
KeyStoreEntityobjects for the specified scopes. This set contains all keystores for the specified scopes, including the default keystore if it exists or was created. If no scopes are provided, an empty set is returned. - Throws:
IllegalArgumentException- if any of the provided keyStoreScopes are invalidIllegalStateException- if a default keystore cannot be created for any reason
-
getDefaultKeyStore
Retrieves the default keystore for the specified scope. If the default keystore does not exist, it will be created.Note: The default keystore is a special keystore that is automatically created for each scope. There can only be one default keystore per scope.
- Parameters:
defaultScope- the scope for which to retrieve the default keystore.- Returns:
- the default
KeyStoreEntityfor the specified scope. - Throws:
IllegalArgumentException- if the provided defaultScope is invalid.IllegalStateException- if the default keystore cannot be created for any other reason.
-