Class FilePersistenceStrategy
- java.lang.Object
-
- org.jboss.security.identity.plugins.FilePersistenceStrategy
-
- All Implemented Interfaces:
PersistenceStrategy
public class FilePersistenceStrategy extends Object implements PersistenceStrategy
An implementation ofPersistenceStrategy
that serializes theIdentity
to a file.- Version:
- $Revision: 1.1 $
- Author:
- Marcus Moyses
-
-
Constructor Summary
Constructors Constructor Description FilePersistenceStrategy(String path)
Create a new FilePersistenceStrategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Identity
getIdentity(String name)
Retrieves anIdentity
from the backend.Identity
persistIdentity(Identity identity)
Persists theIdentity
in the backend.boolean
removeIdentity(Identity identity)
Removes anIdentity
from the backend.Identity
updateIdentity(Identity identity)
Updates theIdentity
in the backend.
-
-
-
Constructor Detail
-
FilePersistenceStrategy
public FilePersistenceStrategy(String path)
Create a new FilePersistenceStrategy.- Parameters:
path
- directory where the files will be stored.
-
-
Method Detail
-
persistIdentity
public Identity persistIdentity(Identity identity)
Description copied from interface:PersistenceStrategy
Persists theIdentity
in the backend.- Specified by:
persistIdentity
in interfacePersistenceStrategy
- Parameters:
identity
-Identity
to be persisted.- Returns:
- the persisted
Identity
ornull
if persistence failed.
-
getIdentity
public Identity getIdentity(String name)
Description copied from interface:PersistenceStrategy
Retrieves anIdentity
from the backend.- Specified by:
getIdentity
in interfacePersistenceStrategy
- Parameters:
name
- unique name of theIdentity
.- Returns:
- the
Identity
ornull
if not found.
-
removeIdentity
public boolean removeIdentity(Identity identity)
Description copied from interface:PersistenceStrategy
Removes anIdentity
from the backend.- Specified by:
removeIdentity
in interfacePersistenceStrategy
- Parameters:
identity
-Identity
to be removed.- Returns:
true
if successfully removed,false
otherwise.
-
updateIdentity
public Identity updateIdentity(Identity identity)
Description copied from interface:PersistenceStrategy
Updates theIdentity
in the backend.- Specified by:
updateIdentity
in interfacePersistenceStrategy
- Parameters:
identity
-Identity
to be updated.- Returns:
- the updated
Identity
ornull
if the update was not successful.
-
-