/*
- * Copyright 2001-2007 Internet2
+ * Copyright 2001-2010 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <saml/base.h>
-#include <istream>
-#include <xmltooling/XMLObject.h>
-#include <xmltooling/io/GenericResponse.h>
-#include <xmltooling/security/Credential.h>
+namespace xmltooling {
+ class XMLTOOL_API Credential;
+ class XMLTOOL_API GenericResponse;
+ class XMLTOOL_API XMLObject;
+};
namespace opensaml {
{
MAKE_NONCOPYABLE(MessageEncoder);
public:
- virtual ~MessageEncoder() {}
+ virtual ~MessageEncoder();
/**
* Indicates whether the encoding format requires that messages be as compact as possible.
*
* @return true iff the encoding has size constraints
*/
- virtual bool isCompact() const {
- return false;
- }
+ virtual bool isCompact() const;
+
+ /**
+ * Indicates whether a web browser or similar user agent will receive the message.
+ *
+ * @return true iff the message will be handled by a user agent
+ */
+ virtual bool isUserAgentPresent() const;
+
+ /**
+ * Returns identifier for the protocol family associated with the encoder.
+ *
+ * @return a protocol family identifier, or nullptr
+ */
+ virtual const XMLCh* getProtocolFamily() const;
+
+ /**
+ * Returns a shorthand name for the binding/encoding supported by the encoder.
+ *
+ * @return a short name for the binding/encoding, or nullptr
+ */
+ virtual const char* getShortName() const;
/**
* Interface to caller-supplied artifact generation mechanism.
class SAML_API ArtifactGenerator {
MAKE_NONCOPYABLE(ArtifactGenerator);
protected:
- ArtifactGenerator() {}
+ ArtifactGenerator();
public:
- virtual ~ArtifactGenerator() {}
+ virtual ~ArtifactGenerator();
/**
* Generate a SAML 1.x artifact suitable for consumption by the relying party.
};
/**
- * Provides an ArtifactGenerator implementation for the MessageEncoder to use.
- * The implementation's lifetime must be longer than the lifetime of this object.
- * This method must be externally synchronized.
- *
- * @param artifactGenerator an ArtifactGenerator implementation to use
- */
- void setArtifactGenerator(ArtifactGenerator* artifactGenerator) {
- m_artifactGenerator = artifactGenerator;
- }
-
- /**
* Encodes an XML object/message into a binding- and transport-specific response.
* The XML content cannot have a parent object, and any existing references to
* the content will be invalidated if the encode method returns successfully.
* @param destination destination URL for message
* @param recipient optional message recipient
* @param relayState optional RelayState value to accompany message
+ * @param artifactGenerator optional interface for generation of artifacts
* @param credential optional Credential to supply signing key
* @param signatureAlg optional signature algorithm identifier
* @param digestAlg optional reference digest algorithm identifier
xmltooling::GenericResponse& genericResponse,
xmltooling::XMLObject* xmlObject,
const char* destination,
- const saml2md::EntityDescriptor* recipient=NULL,
- const char* relayState=NULL,
- const xmltooling::Credential* credential=NULL,
- const XMLCh* signatureAlg=NULL,
- const XMLCh* digestAlg=NULL
+ const saml2md::EntityDescriptor* recipient=nullptr,
+ const char* relayState=nullptr,
+ const ArtifactGenerator* artifactGenerator=nullptr,
+ const xmltooling::Credential* credential=nullptr,
+ const XMLCh* signatureAlg=nullptr,
+ const XMLCh* digestAlg=nullptr
) const=0;
protected:
- MessageEncoder() : m_artifactGenerator(NULL) {}
-
- /** Pointer to an ArtifactGenerator implementation. */
- const ArtifactGenerator* m_artifactGenerator;
+ MessageEncoder();
};
/**