Package org.opensaml.saml.saml1.binding.encoding.impl

# Class HTTPArtifactEncoder

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.encoder.AbstractMessageEncoder
org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder
org.opensaml.messaging.encoder.servlet.BaseHttpServletResponseXMLMessageEncoder
org.opensaml.saml.common.binding.impl.BaseSAMLHttpServletResponseEncoder
org.opensaml.saml.saml1.binding.encoding.impl.BaseSAML1MessageEncoder
org.opensaml.saml.saml1.binding.encoding.impl.HTTPArtifactEncoder

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `UnmodifiableComponent`, `MessageEncoder`, `HttpServletResponseMessageEncoder`, `SAMLMessageEncoder`

public class HTTPArtifactEncoder extends BaseSAML1MessageEncoder
SAML 1.X HTTP Artifact message encoder.

## Field Summary

Fields
Modifier and Type
Field
Description
`private SAMLArtifactMap`
`artifactMap`
SAML artifact map used to store created artifacts for later retrival.
`private byte[]`
`defaultArtifactType`
Default artifact type to use when encoding messages.
`private final org.slf4j.Logger`
`log`
Class logger.

### Fields inherited from class org.opensaml.messaging.encoder.AbstractMessageEncoder

`BASE_PROTOCOL_MESSAGE_LOGGER_CATEGORY`

## Constructor Summary

Constructors
Constructor
Description
`HTTPArtifactEncoder()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doEncode()`
Performs the encoding logic.
`protected void`
`doInitialize()`
`SAMLArtifactMap`
`getArtifactMap()`
Get the SAML artifact map to use.
`String`
`getBindingURI()`
Gets the SAML binding URI supported by this encoder.
`private String`
`getInboundMessageIssuer(MessageContext messageContext)`
Get the requester.
`private String`
`getOutboundMessageIssuer(MessageContext messageContext)`
Get the outbound message issuer.
`private byte[]`
`getSAMLArtifactType(MessageContext messageContext)`
Get the SAML artifact type from the message context.
`void`
`setArtifactMap(SAMLArtifactMap newArtifactMap)`
Set the SAML artifact map to use.
`private void`
`storeSAMLArtifactType(MessageContext messageContext, byte[] artifactType)`
Store the SAML artifact type in the message context.

### Methods inherited from class org.opensaml.saml.saml1.binding.encoding.impl.BaseSAML1MessageEncoder

`getEndpointURL`

### Methods inherited from class org.opensaml.messaging.encoder.servlet.BaseHttpServletResponseXMLMessageEncoder

`encode, marshallMessage, serializeMessageForLogging`

### Methods inherited from class org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder

`getHttpServletResponse, getHttpServletResponseSupplier, setHttpServletResponseSupplier`

### Methods inherited from class org.opensaml.messaging.encoder.AbstractMessageEncoder

`getMessageContext, getMessageToLog, getProtocolMessageLogger, getProtocolMessageLoggerSubCategory, logEncodedMessage, prepareContext, setMessageContext, setProtocolMessageLoggerSubCategory`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, 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.shared.component.DestructableComponent

`destroy, isDestroyed`

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

### Methods inherited from interface org.opensaml.messaging.encoder.MessageEncoder

`encode, prepareContext, setMessageContext`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### artifactMap

@NonnullAfterInit private SAMLArtifactMap artifactMap
SAML artifact map used to store created artifacts for later retrival.

### defaultArtifactType

@Nonnull @NotEmpty private byte[] defaultArtifactType
Default artifact type to use when encoding messages.

## Constructor Details

### HTTPArtifactEncoder

public HTTPArtifactEncoder()
Constructor.

## Method Details

### getBindingURI

@Nonnull public String getBindingURI()
Gets the SAML binding URI supported by this encoder.

Returns:
  SAML binding URI supported by this encoder

### getArtifactMap

@NonnullAfterInit public SAMLArtifactMap getArtifactMap()
Get the SAML artifact map to use.

Returns:
  the artifactMap.

### setArtifactMap

public void setArtifactMap(@Nonnull SAMLArtifactMap newArtifactMap)
Set the SAML artifact map to use.

Parameters:
  `newArtifactMap` - the new artifactMap

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractHttpServletResponseMessageEncoder`
Throws:
  `ComponentInitializationException`

### doEncode

protected void doEncode() throws MessageEncodingException
Performs the encoding logic. By the time this is called, this encoder has already been initialized and checked to ensure that it has not been destroyed.

Specified by:
  `doEncode` in class `AbstractMessageEncoder`
Throws:
  `MessageEncodingException` - thrown if there is a problem encoding the message

### getOutboundMessageIssuer

@Nullable private String getOutboundMessageIssuer(@Nonnull MessageContext messageContext)
Get the outbound message issuer.

Parameters:
  `messageContext` - the message context
Returns:
  the outbound message issuer

### getInboundMessageIssuer

@Nullable private String getInboundMessageIssuer(@Nonnull MessageContext messageContext)
Get the requester.

Parameters:
  `messageContext` - the message context
Returns:
  the requester

### storeSAMLArtifactType

private void storeSAMLArtifactType(@Nonnull MessageContext messageContext, @Nonnull @NotEmpty byte[] artifactType)
Store the SAML artifact type in the message context.

Parameters:
  `messageContext` - the message context
  `artifactType` - the artifact type to store

### getSAMLArtifactType

@Nullable private byte[] getSAMLArtifactType(@Nonnull MessageContext messageContext)
Get the SAML artifact type from the message context.

Parameters:
  `messageContext` - the message context
Returns:
  the artifact type