public class ForwardingCredentials extends java.lang.Object implements Credentials
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
targetScheme |
private XenonEngine |
xenonEngine |
Constructor and Description |
---|
ForwardingCredentials(XenonEngine xenonEngine,
java.lang.String targetScheme) |
Modifier and Type | Method and Description |
---|---|
void |
close(Credential credential)
Close a Credential
|
Credential |
getDefaultCredential(java.lang.String scheme)
Creates a default credential for the given scheme.
|
boolean |
isOpen(Credential credential)
Test if a Credential is open.
|
Credential |
newCertificateCredential(java.lang.String scheme,
java.lang.String certfile,
java.lang.String username,
char[] password,
java.util.Map<java.lang.String,java.lang.String> properties)
Constructs a certificate Credential.
|
Credential |
newPasswordCredential(java.lang.String scheme,
java.lang.String username,
char[] password,
java.util.Map<java.lang.String,java.lang.String> properties)
Constructs a password credential out of a
username and a
password . |
private final XenonEngine xenonEngine
private final java.lang.String targetScheme
public ForwardingCredentials(XenonEngine xenonEngine, java.lang.String targetScheme)
public Credential newCertificateCredential(java.lang.String scheme, java.lang.String certfile, java.lang.String username, char[] password, java.util.Map<java.lang.String,java.lang.String> properties) throws XenonException
Credentials
close()
when you no longer need them,
otherwise their associated resources remain allocated.newCertificateCredential
in interface Credentials
scheme
- the scheme for which to create a credential.certfile
- the certificate file (for example userkey.pem or id_dsa).username
- the user name.password
- the password or pass phrase belonging to the certificate.properties
- (optional) properties used to configure the credential.UnknownPropertyException
- If an unknown property was passed.InvalidPropertyException
- If a known property was passed with an illegal value.CertificateNotFoundException
- If the certificate file could not be found.XenonException
- If the Credential could not be created.public Credential newPasswordCredential(java.lang.String scheme, java.lang.String username, char[] password, java.util.Map<java.lang.String,java.lang.String> properties) throws XenonException
Credentials
username
and a
password
. Make sure to always close Credential instances
by calling close()
when you no longer need them, otherwise their
associated resources remain allocated.newPasswordCredential
in interface Credentials
scheme
- the scheme for which to create a credential.username
- the user name.password
- the password.properties
- (optional) properties used to configure the credential.UnknownPropertyException
- If an unknown property was passed.InvalidPropertyException
- If a known property was passed with an illegal value.XenonException
- If the Credential could not be created.public Credential getDefaultCredential(java.lang.String scheme) throws XenonException
Credentials
getDefaultCredential
in interface Credentials
scheme
- the scheme for which to create a certificate.UnknownPropertyException
- If an unknown property was passed.InvalidPropertyException
- If a known property was passed with an illegal value.InvalidCredentialException
- If a valid credential cannot be created.XenonException
- If the Credential could not be created.public void close(Credential credential) throws XenonException
Credentials
close
in interface Credentials
credential
- the Credential to close.XenonException
- If the Credential failed to close.public boolean isOpen(Credential credential) throws XenonException
Credentials
isOpen
in interface Credentials
credential
- the Credential to test.XenonException
- If the test failed.