org.springframework.extensions.webscripts.connector
Class XMLCredentialVault

java.lang.Object
  extended by org.springframework.extensions.webscripts.connector.SimpleCredentialVault
      extended by org.springframework.extensions.webscripts.connector.AbstractPersistentCredentialVault
          extended by org.springframework.extensions.webscripts.connector.XMLCredentialVault
All Implemented Interfaces:
Serializable, CredentialVault

public class XMLCredentialVault
extends AbstractPersistentCredentialVault

A basic implementation of a persistent credential vault where credentials are stored in XML on disk. Note: You should never use anything like this in production. Rather, it is suitable for test suites (locally and within test frameworks). It also is a useful example of another kind of credential vault

Author:
muzquiano
See Also:
Serialized Form

Field Summary
protected  String location
           
 
Fields inherited from class org.springframework.extensions.webscripts.connector.AbstractPersistentCredentialVault
configService
 
Fields inherited from class org.springframework.extensions.webscripts.connector.SimpleCredentialVault
credentialsMap, id
 
Constructor Summary
XMLCredentialVault(String id)
          Instantiates a new XML credential vault.
 
Method Summary
protected  void deserialize(String xml)
          Deserialize.
 String getLocation()
           
 boolean load()
          Tells the Credential Vault to load state from persisted store
 boolean save()
          Tells the Credential Vault to write state to persisted store
protected  String serialize()
          Serialize.
 void setLocation(String location)
           
 String toString()
           
static String toXML(org.dom4j.Document document, boolean pretty)
          Converts the document to XML.
 
Methods inherited from class org.springframework.extensions.webscripts.connector.AbstractPersistentCredentialVault
getRemoteConfig, setConfigService, store
 
Methods inherited from class org.springframework.extensions.webscripts.connector.SimpleCredentialVault
getStoredIds, hasCredentials, newCredentials, remove, retrieve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

location

protected String location
Constructor Detail

XMLCredentialVault

public XMLCredentialVault(String id)
Instantiates a new XML credential vault.

Parameters:
id - the id
Method Detail

setLocation

public void setLocation(String location)

getLocation

public String getLocation()

load

public boolean load()
Description copied from interface: CredentialVault
Tells the Credential Vault to load state from persisted store

Specified by:
load in interface CredentialVault
Overrides:
load in class SimpleCredentialVault
Returns:
whether the credential vault successfully loaded

save

public boolean save()
Description copied from interface: CredentialVault
Tells the Credential Vault to write state to persisted store

Specified by:
save in interface CredentialVault
Overrides:
save in class SimpleCredentialVault
Returns:
whether the credential vault successfully saved

serialize

protected String serialize()
Serialize.

Returns:
the string

deserialize

protected void deserialize(String xml)
Deserialize.

Parameters:
xml - the xml

toString

public String toString()
Overrides:
toString in class AbstractPersistentCredentialVault

toXML

public static String toXML(org.dom4j.Document document,
                           boolean pretty)
Converts the document to XML. The pretty switch can be used to produce human readable, or pretty, XML.

Parameters:
document - the document
pretty - whether to produce human readable XML
Returns:
the string


Copyright © 2009 SpringSource, Inc. All Rights Reserved.