Class IdPAttributePrincipalSerializer
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.authn.principal.AbstractPrincipalSerializer<String>
-
- net.shibboleth.idp.authn.principal.impl.IdPAttributePrincipalSerializer
-
- All Implemented Interfaces:
PrincipalSerializer<String>,Component,DestructableComponent,InitializableComponent
@ThreadSafe public class IdPAttributePrincipalSerializer extends AbstractPrincipalSerializer<String>
Principal serializer forIdPAttributePrincipal.
-
-
Field Summary
Fields Modifier and Type Field Description private static StringEMPTY_VALUE_FIELDField name of type code of anEmptyAttributeValue.private static PatternJSON_PATTERNPattern used to determine if input is supported.private org.slf4j.LoggerlogClass logger.private javax.json.JsonBuilderFactoryobjectBuilderFactoryJSON object bulder factory.private static StringPRINCIPAL_ENTRY_FIELDField name of principal entry.private static StringPRINCIPAL_NAME_FIELDField name of principal name.private static StringSCOPED_VALUE_FIELDField name of type code of anScopedStringAttributeValue.private static StringSTRING_VALUE_FIELDField name of type code of anStringAttributeValue.
-
Constructor Summary
Constructors Constructor Description IdPAttributePrincipalSerializer()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IdPAttributePrincipaldeserialize(String value)protected IdPAttributeValuedeserializeValue(javax.json.JsonObject object)Deserialize an attribute value from aJsonObject.private javax.json.JsonArrayBuildergetJsonArrayBuilder()Get aJsonArrayBuilderin a thread-safe manner.private javax.json.JsonObjectBuildergetJsonObjectBuilder()Get aJsonObjectBuilderin a thread-safe manner.Stringserialize(Principal principal)protected javax.json.JsonObjectserializeValue(IdPAttributeValue value)Serialize an attribute value and produce aJsonObject.booleansupports(String value)booleansupports(Principal principal)-
Methods inherited from class net.shibboleth.idp.authn.principal.AbstractPrincipalSerializer
getJsonGenerator, getJsonReader
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
-
-
-
Field Detail
-
PRINCIPAL_NAME_FIELD
@Nonnull @NotEmpty private static final String PRINCIPAL_NAME_FIELD
Field name of principal name.- See Also:
- Constant Field Values
-
PRINCIPAL_ENTRY_FIELD
@Nonnull @NotEmpty private static final String PRINCIPAL_ENTRY_FIELD
Field name of principal entry.- See Also:
- Constant Field Values
-
EMPTY_VALUE_FIELD
@Nonnull @NotEmpty private static final String EMPTY_VALUE_FIELD
Field name of type code of anEmptyAttributeValue.- See Also:
- Constant Field Values
-
STRING_VALUE_FIELD
@Nonnull @NotEmpty private static final String STRING_VALUE_FIELD
Field name of type code of anStringAttributeValue.- See Also:
- Constant Field Values
-
SCOPED_VALUE_FIELD
@Nonnull @NotEmpty private static final String SCOPED_VALUE_FIELD
Field name of type code of anScopedStringAttributeValue.- See Also:
- Constant Field Values
-
JSON_PATTERN
private static final Pattern JSON_PATTERN
Pattern used to determine if input is supported.
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
objectBuilderFactory
@Nonnull private final javax.json.JsonBuilderFactory objectBuilderFactory
JSON object bulder factory.
-
-
Method Detail
-
supports
public boolean supports(@Nonnull Principal principal)
-
serialize
@Nonnull @NotEmpty public String serialize(@Nonnull Principal principal) throws IOException
- Throws:
IOException
-
deserialize
@Nullable public IdPAttributePrincipal deserialize(@Nonnull @NotEmpty String value) throws IOException
- Throws:
IOException
-
serializeValue
@Nonnull protected javax.json.JsonObject serializeValue(@Nonnull IdPAttributeValue value)Serialize an attribute value and produce aJsonObject.Override this method to support additional value types.
- Parameters:
value- the attribute value to serialize- Returns:
- the object
-
deserializeValue
@Nullable protected IdPAttributeValue deserializeValue(@Nonnull javax.json.JsonObject object)
Deserialize an attribute value from aJsonObject.Override this method to support additional value types.
- Parameters:
object- object to deserialize- Returns:
- the attribute value, or null
-
getJsonObjectBuilder
@Nonnull private javax.json.JsonObjectBuilder getJsonObjectBuilder()
Get aJsonObjectBuilderin a thread-safe manner.- Returns:
- an object builder
-
getJsonArrayBuilder
@Nonnull private javax.json.JsonArrayBuilder getJsonArrayBuilder()
Get aJsonArrayBuilderin a thread-safe manner.- Returns:
- an array builder
-
-