org.jboss.security.identity.plugins
Class FilePersistenceStrategy

java.lang.Object
  extended by org.jboss.security.identity.plugins.FilePersistenceStrategy
All Implemented Interfaces:
PersistenceStrategy

public class FilePersistenceStrategy
extends Object
implements PersistenceStrategy

An implementation of PersistenceStrategy that serializes the Identity to a file.

Version:
$Revision: 1.1 $
Author:
Marcus Moyses

Constructor Summary
FilePersistenceStrategy(String path)
          Create a new FilePersistenceStrategy.
 
Method Summary
 org.jboss.security.identity.Identity getIdentity(String name)
          Retrieves an Identity from the backend.
 org.jboss.security.identity.Identity persistIdentity(org.jboss.security.identity.Identity identity)
          Persists the Identity in the backend.
 boolean removeIdentity(org.jboss.security.identity.Identity identity)
          Removes an Identity from the backend.
 org.jboss.security.identity.Identity updateIdentity(org.jboss.security.identity.Identity identity)
          Updates the Identity in the backend.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilePersistenceStrategy

public FilePersistenceStrategy(String path)
Create a new FilePersistenceStrategy.

Parameters:
path - directory where the files will be stored.
Method Detail

persistIdentity

public org.jboss.security.identity.Identity persistIdentity(org.jboss.security.identity.Identity identity)
Description copied from interface: PersistenceStrategy
Persists the Identity in the backend.

Specified by:
persistIdentity in interface PersistenceStrategy
Parameters:
identity - Identity to be persisted.
Returns:
the persisted Identity or null if persistence failed.
See Also:
PersistenceStrategy.persistIdentity(Identity).

getIdentity

public org.jboss.security.identity.Identity getIdentity(String name)
Description copied from interface: PersistenceStrategy
Retrieves an Identity from the backend.

Specified by:
getIdentity in interface PersistenceStrategy
Parameters:
name - unique name of the Identity.
Returns:
the Identity or null if not found.
See Also:
PersistenceStrategy.getIdentity(String).

removeIdentity

public boolean removeIdentity(org.jboss.security.identity.Identity identity)
Description copied from interface: PersistenceStrategy
Removes an Identity from the backend.

Specified by:
removeIdentity in interface PersistenceStrategy
Parameters:
identity - Identity to be removed.
Returns:
true if successfully removed, false otherwise.
See Also:
PersistenceStrategy.removeIdentity(Identity).

updateIdentity

public org.jboss.security.identity.Identity updateIdentity(org.jboss.security.identity.Identity identity)
Description copied from interface: PersistenceStrategy
Updates the Identity in the backend.

Specified by:
updateIdentity in interface PersistenceStrategy
Parameters:
identity - Identity to be updated.
Returns:
the updated Identity or null if the update was not successful.
See Also:
PersistenceStrategy.updateIdentity(Identity).


Copyright © 2009 JBoss Inc.. All Rights Reserved.