public final class CredentialReference extends Object implements Destroyable
CredentialStore
or holding simply char[] as a secret.
It defines credential reference attribute that other subsystems can use to reference external credentials of various
types.| Modifier and Type | Field and Description |
|---|---|
static String |
ALIAS
Definition of id used in model
|
static String |
CLEAR_TEXT
Definition of id used in model
|
static String |
CREDENTIAL_REFERENCE
Definition of id used in model
|
static String |
STORE
Definition of id used in model
|
static String |
TYPE
Definition of id used in model
|
| Modifier and Type | Method and Description |
|---|---|
static CredentialReference |
createCredentialReference(char[] secret)
Method to create new
CredentialReference based on secret attribute only. |
static CredentialReference |
createCredentialReference(String credentialStoreName,
String alias,
String credentialType)
Method to create new
CredentialReference based on params |
static String |
credentialReferencePartAsStringIfDefined(OperationContext context,
ObjectTypeAttributeDefinition attributeDefinition,
org.jboss.dmr.ModelNode model,
String name)
Utility method to return part of
ObjectTypeAttributeDefinition for credential reference attribute. |
void |
destroy()
Destroy the secret stored in this
Object. |
String |
getAlias()
Get the credential alias which denotes credential stored inside named credential store.
|
static ObjectTypeAttributeDefinition.Builder |
getAttributeBuilder(String name,
String xmlName,
boolean allowNull)
Get the attribute builder for credential-reference attribute with specified characteristics.
|
static ObjectTypeAttributeDefinition |
getAttributeDefinition()
Returns new definition for credential reference attribute.
|
String |
getCredentialStoreName()
Get the credential store name part of this reference.
|
String |
getCredentialType()
Get credential type which narrows selection of the credential stored under the alias in the credential store.
|
char[] |
getSecret()
Get the secret stored as clear text in this reference.
|
boolean |
isDestroyed()
Determine if this
Object has been destroyed. |
static void |
reinjectCredentialStoreClient(org.jboss.msc.value.InjectedValue<CredentialStoreClient> injectedCredentialStoreClient,
CredentialReference credentialReference)
Replace injection with new one referencing the same
CredentialStore but
based of new values of CredentialReference |
public static final String CREDENTIAL_REFERENCE
public static final String STORE
public static final String ALIAS
public static final String TYPE
public static final String CLEAR_TEXT
public String getCredentialStoreName()
nullpublic String getAlias()
nullpublic String getCredentialType()
nullpublic char[] getSecret()
nullpublic void destroy()
Object.destroy in interface Destroyablepublic boolean isDestroyed()
Object has been destroyed.isDestroyed in interface DestroyableObject has been destroyed,
false otherwise.public static CredentialReference createCredentialReference(char[] secret)
CredentialReference based on secret attribute only.secret - to referenceCredentialReferencepublic static CredentialReference createCredentialReference(String credentialStoreName, String alias, String credentialType)
CredentialReference based on paramscredentialStoreName - credential store namealias - denoting the credentialcredentialType - type of credential (can be null)CredentialReferencepublic static ObjectTypeAttributeDefinition getAttributeDefinition()
public static ObjectTypeAttributeDefinition.Builder getAttributeBuilder(String name, String xmlName, boolean allowNull)
name - name of attributexmlName - name of xml elementallowNull - whether the attribute is requiredObjectTypeAttributeDefinition.Builder which can be used to build attribute definitionpublic static String credentialReferencePartAsStringIfDefined(OperationContext context, ObjectTypeAttributeDefinition attributeDefinition, org.jboss.dmr.ModelNode model, String name) throws OperationFailedException
ObjectTypeAttributeDefinition for credential reference attribute.
getAttributeDefinition()context - operational contextattributeDefinition - attribute definitionmodel - modelname - name of part to return (supported names: STORE ALIAS TYPE
CLEAR_TEXTStringOperationFailedException - when something goes wrongpublic static void reinjectCredentialStoreClient(org.jboss.msc.value.InjectedValue<CredentialStoreClient> injectedCredentialStoreClient, CredentialReference credentialReference) throws ClassNotFoundException
CredentialStore but
based of new values of CredentialReferenceinjectedCredentialStoreClient - InjectedValue to replace the credential referencecredentialReference - new credential referenceClassNotFoundException - when credential reference holding credential type which cannot be resolved using current providersCopyright © 2017 JBoss by Red Hat. All rights reserved.