Class FilePersistenceStrategy
- java.lang.Object
-
- org.jboss.security.identity.plugins.FilePersistenceStrategy
-
- All Implemented Interfaces:
PersistenceStrategy
public class FilePersistenceStrategy extends Object implements PersistenceStrategy
An implementation ofPersistenceStrategythat serializes theIdentityto 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 IdentitygetIdentity(String name)Retrieves anIdentityfrom the backend.IdentitypersistIdentity(Identity identity)Persists theIdentityin the backend.booleanremoveIdentity(Identity identity)Removes anIdentityfrom the backend.IdentityupdateIdentity(Identity identity)Updates theIdentityin 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:PersistenceStrategyPersists theIdentityin the backend.- Specified by:
persistIdentityin interfacePersistenceStrategy- Parameters:
identity-Identityto be persisted.- Returns:
- the persisted
Identityornullif persistence failed.
-
getIdentity
public Identity getIdentity(String name)
Description copied from interface:PersistenceStrategyRetrieves anIdentityfrom the backend.- Specified by:
getIdentityin interfacePersistenceStrategy- Parameters:
name- unique name of theIdentity.- Returns:
- the
Identityornullif not found.
-
removeIdentity
public boolean removeIdentity(Identity identity)
Description copied from interface:PersistenceStrategyRemoves anIdentityfrom the backend.- Specified by:
removeIdentityin interfacePersistenceStrategy- Parameters:
identity-Identityto be removed.- Returns:
trueif successfully removed,falseotherwise.
-
updateIdentity
public Identity updateIdentity(Identity identity)
Description copied from interface:PersistenceStrategyUpdates theIdentityin the backend.- Specified by:
updateIdentityin interfacePersistenceStrategy- Parameters:
identity-Identityto be updated.- Returns:
- the updated
Identityornullif the update was not successful.
-
-