Class UserCredentials
java.lang.Object
org.apache.guacamole.net.auth.credentials.CredentialsInfo
org.apache.guacamole.net.auth.credentials.UserCredentials
A fully-valid set of credentials and associated values. Each instance of
this object should describe a full set of parameter name/value pairs which
can be used to authenticate successfully, even if that success depends on
factors not described by this object.
-
Field Summary
Fields inherited from class org.apache.guacamole.net.auth.credentials.CredentialsInfo
EMPTY, PASSWORD, USERNAME, USERNAME_PASSWORD
-
Constructor Summary
ConstructorsConstructorDescriptionUserCredentials
(Collection<Field> fields) Creates a new UserCredentials object which requires the given fields but does not yet have any defined values.UserCredentials
(Collection<Field> fields, Map<String, String> values) Creates a new UserCredentials object which requires the given fields and values.Creates a new UserCredentials object which requires fields described by the given CredentialsInfo but does not yet have any defined values.UserCredentials
(CredentialsInfo info, Map<String, String> values) Creates a new UserCredentials object which requires fields described by the given CredentialsInfo. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value defined by this UserCrendentials object for the field having the given name.Returns the value defined by this UserCrendentials object for the given field.Returns a map of field names to values which backs this UserCredentials object.removeValue
(String name) Removes (undefines) the value of the field having the given name, returning its previous value.removeValue
(Field field) Removes (undefines) the value of the given field returning its previous value.Sets the value of the field having the given name.Sets the value of the given field.void
Replaces the map backing this UserCredentials object with the given map.Methods inherited from class org.apache.guacamole.net.auth.credentials.CredentialsInfo
getFields
-
Constructor Details
-
UserCredentials
Creates a new UserCredentials object which requires the given fields and values.- Parameters:
fields
- The fields to require.values
- The values required for each field, as a map of field name to correct value.
-
UserCredentials
Creates a new UserCredentials object which requires fields described by the given CredentialsInfo. The value required for each field in the CredentialsInfo is defined in the given Map.- Parameters:
info
- The CredentialsInfo object describing the fields to require.values
- The values required for each field, as a map of field name to correct value.
-
UserCredentials
Creates a new UserCredentials object which requires fields described by the given CredentialsInfo but does not yet have any defined values.- Parameters:
info
- The CredentialsInfo object describing the fields to require.
-
UserCredentials
Creates a new UserCredentials object which requires the given fields but does not yet have any defined values.- Parameters:
fields
- The fields to require.
-
-
Method Details
-
getValues
Returns a map of field names to values which backs this UserCredentials object. Modifications to the returned map will directly affect the associated name/value pairs.- Returns:
- A map of field names to their corresponding values which backs this UserCredentials object.
-
setValues
Replaces the map backing this UserCredentials object with the given map. All field name/value pairs described by the original map are replaced by the name/value pairs in the given map.- Parameters:
values
- The map of field names to their corresponding values which should be used to back this UserCredentials object.
-
getValue
Returns the value defined by this UserCrendentials object for the field having the given name.- Parameters:
name
- The name of the field whose value should be returned.- Returns:
- The value of the field having the given name, or null if no value is defined for that field.
-
getValue
Returns the value defined by this UserCrendentials object for the given field.- Parameters:
field
- The field whose value should be returned.- Returns:
- The value of the given field, or null if no value is defined for that field.
-
setValue
Sets the value of the field having the given name. Any existing value for that field is replaced.- Parameters:
name
- The name of the field whose value should be assigned.value
- The value to assign to the field having the given name.- Returns:
- The previous value of the field, or null if the value of the field was not previously defined.
-
setValue
Sets the value of the given field. Any existing value for that field is replaced.- Parameters:
field
- The field whose value should be assigned.value
- The value to assign to the given field.- Returns:
- The previous value of the field, or null if the value of the field was not previously defined.
-
removeValue
Removes (undefines) the value of the field having the given name, returning its previous value. If the field value was not defined, this function has no effect, and null is returned.- Parameters:
name
- The name of the field whose value should be removed.- Returns:
- The previous value of the field, or null if the value of the field was not previously defined.
-
removeValue
Removes (undefines) the value of the given field returning its previous value. If the field value was not defined, this function has no effect, and null is returned.- Parameters:
field
- The field whose value should be removed.- Returns:
- The previous value of the field, or null if the value of the field was not previously defined.
-