Package rs.baselib.security
Class XmlFileAuthorizationCallback
java.lang.Object
rs.baselib.security.AbstractAuthorizationCallback
rs.baselib.security.SimpleAuthorizationCallback
rs.baselib.security.DefaultAuthorizationCallback
rs.baselib.security.XmlFileAuthorizationCallback
- All Implemented Interfaces:
IConfigurable,AuthorizationCallback
public class XmlFileAuthorizationCallback extends DefaultAuthorizationCallback
Implements authorization information retrieval from a XML file.
Configuration:
<AuthorizationCallback class="rs.baselib.security.XmlFileAuthorizationCallback">
<!-- The XML file name. -->
<File>/path/to/file.xml</File>
</AuthorizationCallback>
The XML file itself shall look like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<authorization>
<login>your-login</login>
<password>your-password</password>
</authorization>
- Author:
- Ralph Schuster
-
Constructor Summary
Constructors Constructor Description XmlFileAuthorizationCallback()Default Constructor. -
Method Summary
Modifier and Type Method Description voidconfigure(java.io.File file)Configures the callback from the XML file.voidconfigure(java.lang.String file)Configures the callback from the XML file.voidconfigure(Configuration config)Configures the callback.Methods inherited from class rs.baselib.security.AbstractAuthorizationCallback
getName, getPassword, setName, setPassword
-
Constructor Details
-
XmlFileAuthorizationCallback
public XmlFileAuthorizationCallback()Default Constructor.
-
-
Method Details
-
configure
Configures the callback. Configuration takes place from a XML file whose path is contained within element <File>. The XML file itself must contain two elements <login> and <password>.- Specified by:
configurein interfaceIConfigurable- Overrides:
configurein classDefaultAuthorizationCallback- Parameters:
config- - configuration object- Throws:
ConfigurationException- - when configuration fails
-
configure
Configures the callback from the XML file.- Parameters:
file- filename- Throws:
ConfigurationException- when object cannot be configured from file
-
configure
Configures the callback from the XML file.- Parameters:
file- file- Throws:
ConfigurationException- when object cannot be configured from file
-