|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.teiid.connector.api.CredentialMap
public class CredentialMap
Allows credentials to be passed on a per user basis to a connector.
A CredentialsMap object is produced based on information provided in the JDBC
URL. The static method parseCredentials() is used for this purpose.
This CredentialMap serves as the session "trusted payload".
It is the responsibility of a Connector to call
ExecutionContext.getTrustedPayload()
to retrieve the CredentialMap.
The system name should be the same as the Connector Binding Name retrieved from
ConnectorEnvironment.getConnectorName()
.
To get the keyword/value pairs use getSystemCredentials(systemName), this will
return a Map that contains the properties for the specified system.
Specific user and password values can be retrieved with
getUser(systemName) and getPassword(systemName)
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_SYSTEM
|
static java.lang.String |
ESCAPE_CHAR
|
static short |
MODE_IGNORE_DEFAULTS
In this mode, the CredentialMap will ignore the default credentials and only credentials set for a system will be exposed. |
static short |
MODE_USE_DEFAULTS_GLOBALLY
In this mode, the default credentials will be returned for any system, overlaid with any system-specific credentials. |
static short |
MODE_USE_DEFAULTS_ON_EXISTING
In this mode, the default credentials will be returned for any system, overlaid with any system-specific credentials. |
static java.lang.String |
PASSWORD_KEYWORD
|
static java.lang.String |
SYSTEM_KEYWORD
|
static java.lang.String |
USER_KEYWORD
|
Constructor Summary | |
---|---|
CredentialMap()
|
Method Summary | |
---|---|
void |
addSystemCredentials(java.lang.String system,
java.util.Map credentials)
Method to add a user name and credentials (e.g. |
java.lang.String |
getPassword(java.lang.String systemName)
Get the password property for the specified system, if it exists. |
java.util.Map |
getSystemCredentials(java.lang.String systemName)
Method to return the credentials map for a system |
java.lang.String[] |
getSystems()
Method to return an array of systems that have been added to this CredentialMap. |
java.lang.String |
getUser(java.lang.String systemName)
Get the user property for the specified system, if it exists. |
static CredentialMap |
parseCredentials(java.lang.String inputStr)
Method to parse a credentials substring extracted from a JDBC URL. |
void |
setDefaultCredentialMode(short mode)
Set the default credential mode to determine when default credentials should be returned. |
void |
setDefaultCredentials(java.util.Map defaultCredentials)
Set the default credentials to use with this credential map. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SYSTEM_KEYWORD
public static final java.lang.String USER_KEYWORD
public static final java.lang.String PASSWORD_KEYWORD
public static final java.lang.String ESCAPE_CHAR
public static final java.lang.String DEFAULT_SYSTEM
public static final short MODE_IGNORE_DEFAULTS
public static final short MODE_USE_DEFAULTS_GLOBALLY
public static final short MODE_USE_DEFAULTS_ON_EXISTING
Constructor Detail |
---|
public CredentialMap()
Method Detail |
---|
public static CredentialMap parseCredentials(java.lang.String inputStr) throws ConnectorException
inputStr
- the string to be parsed; first non-blank must be a '(', last non-blank must be a ')'
ConnectorException
- upon any syntax error; descriptive text includedpublic java.lang.String[] getSystems()
public void addSystemCredentials(java.lang.String system, java.util.Map credentials)
system
- system name corresponding to the user and credentialscredentials
- Map containing name/val pairspublic void setDefaultCredentials(java.util.Map defaultCredentials)
defaultCredentials
- Map of credentialspublic void setDefaultCredentialMode(short mode)
mode
- The modeMODE_IGNORE_DEFAULTS
,
MODE_USE_DEFAULTS_GLOBALLY
,
MODE_USE_DEFAULTS_ON_EXISTING
public java.util.Map getSystemCredentials(java.lang.String systemName)
systemName
- system name
public java.lang.String getUser(java.lang.String systemName)
USER_KEYWORD
.
systemName
- The system to look up (case insensitive)
public java.lang.String getPassword(java.lang.String systemName)
PASSWORD_KEYWORD
.
systemName
- The system to look up (case insensitive)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |