java.lang.Object
com.esri.arcgisruntime.security.Credential
- Direct Known Subclasses:
CertificateCredential
,OAuthTokenCredential
,UserCredential
Defines the concept of a Credential, allowing various different types of authenticating credentials
to be passed to network requests.
- Since:
- 100.0.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
An event which indicates that one or more properties of this Credential have changed.static interface
The listener interface to get notified when one or more properties of a Credential have changed. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a CredentialChangedListener to this Credential.abstract Credential
copy()
Creates a deep copy of this Credential instance.static Credential
Parses the specified json String into a Credential object.Gets the username of the credential.boolean
Removes a CredentialChangedListener from this Credential.toJson()
Writes this Credential object to a json String representation.
-
Constructor Details
-
Credential
public Credential()
-
-
Method Details
-
getUsername
Gets the username of the credential.- Returns:
- the username
- Since:
- 100.0.0
-
toJson
Writes this Credential object to a json String representation. This allows for persisting the credential to disk. It is imperative that this String is encrypted before being persisted to disk, or else it may pose a security vulnerability.- Returns:
- a json String representation of this Credential
- Since:
- 100.0.0
-
fromJson
Parses the specified json String into a Credential object. This allows for restoring a previously persisted Credential.- Parameters:
json
- a json String representation of a Credential- Returns:
- the Credential object parsed from the string or null if the string does not contain Credential json
- Throws:
IllegalArgumentException
- if json string is null or empty- Since:
- 100.0.0
-
copy
Creates a deep copy of this Credential instance.- Returns:
- a deep copy of this Credential instance
- Since:
- 100.1.0
-
addCredentialChangedListener
Adds a CredentialChangedListener to this Credential.- Parameters:
listener
- a CredentialChangedListener- Throws:
IllegalArgumentException
- if listener is null- Since:
- 100.8.0
-
removeCredentialChangedListener
Removes a CredentialChangedListener from this Credential.- Parameters:
listener
- a CredentialChangedListener- Returns:
- true if the CredentialChangedListener has been removed, otherwise false
- Throws:
IllegalArgumentException
- if listener is null- Since:
- 100.8.0
-