Class NameIDPrincipalSerializer
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.authn.principal.AbstractPrincipalSerializer<String>
-
- net.shibboleth.idp.saml.authn.principal.impl.NameIDPrincipalSerializer
-
- All Implemented Interfaces:
PrincipalSerializer<String>,Component,DestructableComponent,InitializableComponent
@ThreadSafe public class NameIDPrincipalSerializer extends AbstractPrincipalSerializer<String>
Principal serializer forNameIDPrincipal.
-
-
Field Summary
Fields Modifier and Type Field Description private static StringFORMAT_FIELDField name of Format attribute.private static PatternJSON_PATTERNPattern used to determine if input is supported.private org.slf4j.LoggerlogClass logger.private static StringNAME_QUALIFIER_FIELDField name of NameQualifier attribute.private SAMLObjectBuilder<NameID>nameIDBuilderNameID builder.private javax.json.JsonBuilderFactoryobjectBuilderFactoryJSON object bulder factory.private static StringPRINCIPAL_NAME_FIELDField name of principal name.private static StringSP_NAME_QUALIFIER_FIELDField name of SPNameQualifier attribute.private static StringSP_PROVIDED_ID_FIELDField name of SPProvidedID attribute.
-
Constructor Summary
Constructors Constructor Description NameIDPrincipalSerializer()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NameIDPrincipaldeserialize(String value)Deserialize the supplied value.Stringserialize(Principal principal)Serialize the supplied principal.booleansupports(String value)Whether the supplied value can be deserialized.booleansupports(Principal principal)Whether the supplied principal can be serialized.-
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
-
FORMAT_FIELD
@Nonnull @NotEmpty private static final String FORMAT_FIELD
Field name of Format attribute.- See Also:
- Constant Field Values
-
NAME_QUALIFIER_FIELD
@Nonnull @NotEmpty private static final String NAME_QUALIFIER_FIELD
Field name of NameQualifier attribute.- See Also:
- Constant Field Values
-
SP_NAME_QUALIFIER_FIELD
@Nonnull @NotEmpty private static final String SP_NAME_QUALIFIER_FIELD
Field name of SPNameQualifier attribute.- See Also:
- Constant Field Values
-
SP_PROVIDED_ID_FIELD
@Nonnull @NotEmpty private static final String SP_PROVIDED_ID_FIELD
Field name of SPProvidedID attribute.- 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.
-
nameIDBuilder
@Nonnull private final SAMLObjectBuilder<NameID> nameIDBuilder
NameID builder.
-
-
Method Detail
-
supports
public boolean supports(@Nonnull Principal principal)Whether the supplied principal can be serialized.- Parameters:
principal- to examine- Returns:
- whether principal can be serialized
-
serialize
@Nonnull @NotEmpty public String serialize(@Nonnull Principal principal) throws IOException
Serialize the supplied principal.- Parameters:
principal- to serialize- Returns:
- serialized value
- Throws:
IOException- if an error occurs during serialization
-
supports
public boolean supports(@Nonnull @NotEmpty String value)
Whether the supplied value can be deserialized.- Parameters:
value- to examine- Returns:
- whether value can be deserialized
-
deserialize
@Nullable public NameIDPrincipal deserialize(@Nonnull @NotEmpty String value) throws IOException
Deserialize the supplied value.- Parameters:
value- to deserialize- Returns:
- principal
- Throws:
IOException- if an error occurs during deserialization
-
-