Index: 3rdParty_sources/opensaml/org/opensaml/Configuration.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/Configuration.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/Configuration.java 17 Aug 2012 15:04:55 -0000 1.1
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml;
+
+import org.joda.time.chrono.ISOChronology;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+import org.opensaml.saml1.binding.artifact.SAML1ArtifactBuilderFactory;
+import org.opensaml.saml2.binding.artifact.SAML2ArtifactBuilderFactory;
+
+/**
+ * OpenSAML configuration singleton.
+ *
+ * The library must be initialized with a set of configurations prior to usage. This is often done by invoking
+ * {@link DefaultBootstrap#bootstrap()} but may done in any manner so long as all the needed object providers and
+ * artifact factory are created and registered with the configuration.
+ */
+public class Configuration extends org.opensaml.xml.Configuration {
+
+ /** Date format in SAML object, default is yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. */
+ private static String defaultDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
+
+ /** Formatter used to write dates. */
+ private static DateTimeFormatter dateFormatter;
+
+ /** SAML 1 Artifact factory. */
+ private static SAML1ArtifactBuilderFactory saml1ArtifactBuilderFactory;
+
+ /** SAML 2 Artifact factory. */
+ private static SAML2ArtifactBuilderFactory saml2ArtifactBuilderFactory;
+
+ /**
+ * Gets the date format used to string'ify SAML's {@link org.joda.time.DateTime} objects.
+ *
+ * @return date format used to string'ify date objects
+ */
+ public static DateTimeFormatter getSAMLDateFormatter() {
+ if (dateFormatter == null) {
+ DateTimeFormatter formatter = DateTimeFormat.forPattern(defaultDateFormat);
+ dateFormatter = formatter.withChronology(ISOChronology.getInstanceUTC());
+ }
+
+ return dateFormatter;
+ }
+
+ /**
+ * Sets the date format used to string'ify SAML's date/time objects.
+ *
+ * See the
+ * {@link SimpleDateFormat}
+ * documentation for format syntax.
+ *
+ * @param format date format used to string'ify date objects
+ */
+ public static void setSAMLDateFormat(String format) {
+ DateTimeFormatter formatter = DateTimeFormat.forPattern(format);
+ dateFormatter = formatter.withChronology(ISOChronology.getInstanceUTC());
+ }
+
+ /**
+ * Gets the artifact factory for the library.
+ *
+ * @return artifact factory for the library
+ */
+ public static SAML1ArtifactBuilderFactory getSAML1ArtifactBuilderFactory() {
+ return saml1ArtifactBuilderFactory;
+ }
+
+ /**
+ * Sets the artifact factory for the library.
+ *
+ * @param factory artifact factory for the library
+ */
+ public static void setSAML1ArtifactBuilderFactory(SAML1ArtifactBuilderFactory factory) {
+ saml1ArtifactBuilderFactory = factory;
+ }
+
+ /**
+ * Gets the artifact factory for the library.
+ *
+ * @return artifact factory for the library
+ */
+ public static SAML2ArtifactBuilderFactory getSAML2ArtifactBuilderFactory() {
+ return saml2ArtifactBuilderFactory;
+ }
+
+ /**
+ * Sets the artifact factory for the library.
+ *
+ * @param factory artifact factory for the library
+ */
+ public static void setSAML2ArtifactBuilderFactory(SAML2ArtifactBuilderFactory factory) {
+ saml2ArtifactBuilderFactory = factory;
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/DefaultBootstrap.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/DefaultBootstrap.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/DefaultBootstrap.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,223 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml;
+
+import org.apache.velocity.app.Velocity;
+import org.apache.velocity.runtime.RuntimeConstants;
+import org.apache.xml.security.Init;
+import org.opensaml.saml1.binding.artifact.SAML1ArtifactBuilderFactory;
+import org.opensaml.saml2.binding.artifact.SAML2ArtifactBuilderFactory;
+import org.opensaml.xml.ConfigurationException;
+import org.opensaml.xml.XMLConfigurator;
+import org.opensaml.xml.parse.StaticBasicParserPool;
+import org.opensaml.xml.parse.XMLParserException;
+import org.opensaml.xml.security.DefaultSecurityConfigurationBootstrap;
+import org.owasp.esapi.ESAPI;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class can be used to bootstrap the OpenSAML library with the default configurations that ship with the library.
+ */
+public class DefaultBootstrap {
+
+ /** List of default XMLTooling configuration files. */
+ private static String[] xmlToolingConfigs = {
+ "/default-config.xml",
+ "/schema-config.xml",
+ "/signature-config.xml",
+ "/signature-validation-config.xml",
+ "/encryption-config.xml",
+ "/encryption-validation-config.xml",
+ "/soap11-config.xml",
+ "/wsfed11-protocol-config.xml",
+ "/saml1-assertion-config.xml",
+ "/saml1-protocol-config.xml",
+ "/saml1-core-validation-config.xml",
+ "/saml2-assertion-config.xml",
+ "/saml2-protocol-config.xml",
+ "/saml2-core-validation-config.xml",
+ "/saml1-metadata-config.xml",
+ "/saml2-metadata-config.xml",
+ "/saml2-metadata-validation-config.xml",
+ "/saml2-metadata-attr-config.xml",
+ "/saml2-metadata-idp-discovery-config.xml",
+ "/saml2-metadata-ui-config.xml",
+ "/saml2-protocol-thirdparty-config.xml",
+ "/saml2-metadata-query-config.xml",
+ "/saml2-assertion-delegation-restriction-config.xml",
+ "/saml2-ecp-config.xml",
+ "/xacml10-saml2-profile-config.xml",
+ "/xacml11-saml2-profile-config.xml",
+ "/xacml20-context-config.xml",
+ "/xacml20-policy-config.xml",
+ "/xacml2-saml2-profile-config.xml",
+ "/xacml3-saml2-profile-config.xml",
+ "/wsaddressing-config.xml",
+ "/wssecurity-config.xml",
+ };
+
+ /** Constructor. */
+ protected DefaultBootstrap() {
+
+ }
+
+ /**
+ * Initializes the OpenSAML library, loading default configurations.
+ *
+ * @throws ConfigurationException thrown if there is a problem initializing the OpenSAML library
+ */
+ public static synchronized void bootstrap() throws ConfigurationException {
+
+ initializeXMLSecurity();
+
+ initializeVelocity();
+
+ initializeXMLTooling(xmlToolingConfigs);
+
+ initializeArtifactBuilderFactories();
+
+ initializeGlobalSecurityConfiguration();
+
+ initializeParserPool();
+
+ initializeESAPI();
+ }
+
+ /**
+ * Initializes the OWASPI ESAPI library.
+ */
+ protected static void initializeESAPI() {
+ ESAPI.initialize("org.opensaml.ESAPISecurityConfig");
+ }
+
+ /**
+ * Initializes the default global parser pool instance.
+ *
+ *
+ * The ParserPool configured by default here is an instance of
+ * {@link StaticBasicParserPool}, with a maxPoolSize property of 50
+ * and all other properties with default values.
+ *
+ *
+ *
+ * If a deployment wishes to use a different parser pool implementation,
+ * or one configured with different characteristics, they may either override this method,
+ * or simply configure a different ParserPool after bootstrapping via
+ * {@link Configuration#setParserPool(org.opensaml.xml.parse.ParserPool)}.
+ *
+ *
+ * @throws ConfigurationException thrown if there is a problem initializing the parser pool
+ */
+ protected static void initializeParserPool() throws ConfigurationException {
+ StaticBasicParserPool pp = new StaticBasicParserPool();
+ pp.setMaxPoolSize(50);
+ try {
+ pp.initialize();
+ } catch (XMLParserException e) {
+ throw new ConfigurationException("Error initializing parser pool", e);
+ }
+ Configuration.setParserPool(pp);
+ }
+
+ /**
+ * Initializes the default global security configuration.
+ */
+ protected static void initializeGlobalSecurityConfiguration() {
+ Configuration.setGlobalSecurityConfiguration(DefaultSecurityConfigurationBootstrap.buildDefaultConfig());
+ }
+
+ /**
+ * Initializes the Apache XMLSecurity libary.
+ *
+ * @throws ConfigurationException thrown is there is a problem initializing the library
+ */
+ protected static void initializeXMLSecurity() throws ConfigurationException {
+ Logger log = getLogger();
+ String lineBreakPropName = "org.apache.xml.security.ignoreLineBreaks";
+ // Don't override if it was set explicitly
+ if (System.getProperty(lineBreakPropName) == null) {
+ System.setProperty(lineBreakPropName, "true");
+ }
+ if (!Init.isInitialized()) {
+ log.debug("Initializing Apache XMLSecurity library");
+ Init.init();
+ }
+ }
+
+ /**
+ * Intializes the Apache Velocity template engine.
+ *
+ * @throws ConfigurationException thrown if there is a problem initializing Velocity
+ */
+ protected static void initializeVelocity() throws ConfigurationException {
+ Logger log = getLogger();
+ try {
+ log.debug("Initializing Velocity template engine");
+ Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
+ "org.apache.velocity.runtime.log.NullLogChute");
+ Velocity.setProperty(RuntimeConstants.ENCODING_DEFAULT, "UTF-8");
+ Velocity.setProperty(RuntimeConstants.OUTPUT_ENCODING, "UTF-8");
+ Velocity.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath");
+ Velocity.setProperty("classpath.resource.loader.class",
+ "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
+ Velocity.init();
+ } catch (Exception e) {
+ throw new ConfigurationException("Unable to initialize Velocity template engine", e);
+ }
+ }
+
+ /**
+ * Initializes the XMLTooling library with a default set of object providers.
+ *
+ * @param providerConfigs list of provider configuration files located on the classpath
+ *
+ * @throws ConfigurationException thrown if there is a problem loading the configuration files
+ */
+ protected static void initializeXMLTooling(String[] providerConfigs) throws ConfigurationException {
+ Logger log = getLogger();
+ Class clazz = Configuration.class;
+ XMLConfigurator configurator = new XMLConfigurator();
+
+ for (String config : providerConfigs) {
+ log.debug("Loading XMLTooling configuration {}", config);
+ configurator.load(clazz.getResourceAsStream(config));
+ }
+ }
+
+ /**
+ * Initializes the artifact factories for SAML 1 and SAML 2 artifacts.
+ *
+ * @throws ConfigurationException thrown if there is a problem initializing the artifact factory
+ */
+ protected static void initializeArtifactBuilderFactories() throws ConfigurationException {
+ Logger log = getLogger();
+ log.debug("Initializing SAML Artifact builder factories");
+ Configuration.setSAML1ArtifactBuilderFactory(new SAML1ArtifactBuilderFactory());
+ Configuration.setSAML2ArtifactBuilderFactory(new SAML2ArtifactBuilderFactory());
+ }
+
+ /**
+ * Get an SLF4J Logger.
+ *
+ * @return a Logger instance
+ */
+ protected static Logger getLogger() {
+ return LoggerFactory.getLogger(DefaultBootstrap.class);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/ESAPISecurityConfig.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/ESAPISecurityConfig.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/ESAPISecurityConfig.java 17 Aug 2012 15:04:55 -0000 1.1
@@ -0,0 +1,372 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml;
+
+import java.io.File;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.regex.Pattern;
+
+import org.owasp.esapi.SecurityConfiguration;
+
+/**
+ * Minimal implementation of OWASP ESAPI {@link SecurityConfiguration}, providing the support used within OpenSAML.
+ */
+public class ESAPISecurityConfig implements SecurityConfiguration {
+
+ /** Constructor. */
+ public ESAPISecurityConfig() {
+ }
+
+ /** {@inheritDoc} */
+ public String getAccessControlImplementation() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public List getAdditionalAllowedCipherModes() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public List getAllowedExecutables() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public List getAllowedFileExtensions() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public int getAllowedFileUploadSize() {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ public int getAllowedLoginAttempts() {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ public boolean getAllowMixedEncoding() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public boolean getAllowMultipleEncoding() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public String getApplicationName() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getAuthenticationImplementation() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getCharacterEncoding() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getCipherTransformation() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public List getCombinedCipherModes() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public List getDefaultCanonicalizationCodecs() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getDigitalSignatureAlgorithm() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public int getDigitalSignatureKeyLength() {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ public boolean getDisableIntrusionDetection() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public String getEncoderImplementation() {
+ return "org.owasp.esapi.reference.DefaultEncoder";
+ }
+
+ /** {@inheritDoc} */
+ public String getEncryptionAlgorithm() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getEncryptionImplementation() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public int getEncryptionKeyLength() {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ public String getExecutorImplementation() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getFixedIV() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public boolean getForceHttpOnlyCookies() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public boolean getForceHttpOnlySession() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public boolean getForceSecureCookies() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public boolean getForceSecureSession() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public String getHashAlgorithm() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public int getHashIterations() {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ public String getHttpSessionIdName() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getHTTPUtilitiesImplementation() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getIntrusionDetectionImplementation() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getIVType() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getKDFPseudoRandomFunction() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public boolean getLenientDatesAccepted() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public boolean getLogApplicationName() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public boolean getLogEncodingRequired() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public String getLogFileName() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getLogImplementation() {
+ return "org.owasp.esapi.reference.JavaLogFactory";
+ }
+
+ /** {@inheritDoc} */
+ public int getLogLevel() {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ public boolean getLogServerIP() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public byte[] getMasterKey() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public byte[] getMasterSalt() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public int getMaxHttpHeaderSize() {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ public int getMaxLogFileSize() {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ public int getMaxOldPasswordHashes() {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ public String getPasswordParameterName() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getPreferredJCEProvider() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public Threshold getQuota(String eventName) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getRandomAlgorithm() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getRandomizerImplementation() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public long getRememberTokenDuration() {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ public File getResourceFile(String filename) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public InputStream getResourceStream(String filename) throws IOException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getResponseContentType() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public int getSessionAbsoluteTimeoutLength() {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ public int getSessionIdleTimeoutLength() {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ public File getUploadDirectory() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public File getUploadTempDirectory() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getUsernameParameterName() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public String getValidationImplementation() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public Pattern getValidationPattern(String typeName) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public File getWorkingDirectory() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public boolean overwritePlainText() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public String setCipherTransformation(String cipherXform) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public void setResourceDirectory(String dir) {
+ }
+
+ /** {@inheritDoc} */
+ public boolean useMACforCipherText() {
+ return false;
+ }
+
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/Version.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/Version.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/Version.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml;
+
+/** Class for printing the version of this library. */
+public final class Version {
+
+ /** Name of the library. */
+ private static final String NAME;
+
+ /** Library version. */
+ private static final String VERSION;
+
+ /** Library major version number. */
+ private static final int MAJOR_VERSION;
+
+ /** Library minor version number. */
+ private static final int MINOR_VERSION;
+
+ /** Library micro version number. */
+ private static final int MICRO_VERSION;
+
+ /** Constructor. */
+ private Version() {
+ }
+
+ /**
+ * Main entry point to program.
+ *
+ * @param args command line arguments
+ */
+ public static void main(String[] args) {
+ System.out.println(NAME + " version " + VERSION);
+ }
+
+ /**
+ * Gets the name of the library.
+ *
+ * @return name of the library
+ */
+ public static String getName() {
+ return NAME;
+ }
+
+ /**
+ * Gets the version of the library.
+ *
+ * @return version of the library
+ */
+ public static String getVersion() {
+ return VERSION;
+ }
+
+ /**
+ * Gets the major version number of the library.
+ *
+ * @return major version number of the library
+ */
+ public static int getMajorVersion() {
+ return MAJOR_VERSION;
+ }
+
+ /**
+ * Gets the minor version number of the library.
+ *
+ * @return minor version number of the library
+ */
+ public static int getMinorVersion() {
+ return MINOR_VERSION;
+ }
+
+ /**
+ * Gets the micro version number of the library.
+ *
+ * @return micro version number of the library
+ */
+ public static int getMicroVersion() {
+ return MICRO_VERSION;
+ }
+
+ static {
+ Package pkg = Version.class.getPackage();
+ NAME = pkg.getImplementationTitle().intern();
+ VERSION = pkg.getImplementationVersion().intern();
+ String[] versionParts = VERSION.split("\\.");
+ MAJOR_VERSION = Integer.parseInt(versionParts[0]);
+ MINOR_VERSION = Integer.parseInt(versionParts[1]);
+ MICRO_VERSION = Integer.parseInt(versionParts[2]);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/SourceID.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/SourceID.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/SourceID.java 17 Aug 2012 15:04:56 -0000 1.1
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml1md;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.xml.schema.XSString;
+
+/**
+ * SAML 1 Metadata extension SourceID
+ */
+public interface SourceID extends SAMLObject, XSString {
+
+ /** Element name, no namespace */
+ public final static String DEFAULT_ELEMENT_LOCAL_NAME = "SourceID";
+
+ /** Default element name */
+ public final static QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML1MD_NS, DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1MD_PREFIX);
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/package.html 17 Aug 2012 15:04:55 -0000 1.1
@@ -0,0 +1,12 @@
+
+
+Interfaces for SAML 1 metadata profile.
+
+Information on using this library can be found in the
+User's Manual and information
+on extending its functionality can be found in the
+Developer's Manual.
+
+@see OpenSAML Wiki
+
+
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/impl/SourceIDBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/impl/SourceIDBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/impl/SourceIDBuilder.java 17 Aug 2012 15:05:00 -0000 1.1
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml1md.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.samlext.saml1md.SourceID;
+
+/**
+ * Builder of {@link SourceIDImpl} objects.
+ */
+public class SourceIDBuilder extends AbstractSAMLObjectBuilder {
+
+ /** Constructor */
+ public SourceIDBuilder() {
+
+ }
+
+ /** {@inheritDoc} */
+ public SourceID buildObject() {
+ return buildObject(SAMLConstants.SAML1MD_NS, SourceID.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1MD_PREFIX);
+ }
+
+ /** {@inheritDoc} */
+ public SourceID buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new SourceIDImpl(namespaceURI, localName, namespacePrefix);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/impl/SourceIDImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/impl/SourceIDImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/impl/SourceIDImpl.java 17 Aug 2012 15:05:00 -0000 1.1
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml1md.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.samlext.saml1md.SourceID;
+import org.opensaml.xml.XMLObject;
+
+public class SourceIDImpl extends AbstractSAMLObject implements SourceID {
+
+ /** Source ID */
+ private String sourceID;
+
+ /**
+ * Constructor
+ *
+ * @param namespaceURI the namespace the element is in
+ * @param elementLocalName the local name of the XML element this Object represents
+ * @param namespacePrefix the prefix for the given namespace
+ */
+ protected SourceIDImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /** {@inheritDoc} */
+ public String getValue() {
+ return sourceID;
+ }
+
+ /** {@inheritDoc} */
+ public void setValue(String newSourceID) {
+ sourceID = prepareForAssignment(sourceID, newSourceID);
+ }
+
+ /** {@inheritDoc} */
+ public List getOrderedChildren() {
+ // no children
+ return null;
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/impl/SourceIDMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/impl/Attic/SourceIDMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/impl/SourceIDMarshaller.java 17 Aug 2012 15:05:00 -0000 1.1
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml1md.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.samlext.saml1md.SourceID;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.DatatypeHelper;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+/**
+ * Marshaller of {@link SourceID} objects.
+ */
+public class SourceIDMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /** {@inheritDoc} */
+ protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException {
+ SourceID sourceID = (SourceID) xmlObject;
+
+ if (!DatatypeHelper.isEmpty(sourceID.getValue())) {
+ XMLHelper.appendTextContent(domElement, sourceID.getValue());
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/impl/SourceIDUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/impl/Attic/SourceIDUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/impl/SourceIDUnmarshaller.java 17 Aug 2012 15:05:00 -0000 1.1
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml1md.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.samlext.saml1md.SourceID;
+import org.opensaml.xml.XMLObject;
+
+/**
+ * Unmarshaller for {@link SourceID} objects.
+ */
+public class SourceIDUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+ /** {@inheritDoc} */
+ protected void processElementContent(XMLObject samlObject, String elementContent) {
+ SourceID sourceID = (SourceID) samlObject;
+
+ sourceID.setValue(elementContent);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/impl/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/impl/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml1md/impl/package.html 17 Aug 2012 15:05:00 -0000 1.1
@@ -0,0 +1,12 @@
+
+
+Implementation of SAML 1 metadata profile objects.
+
+Information on using this library can be found in the
+User's Manual and information
+on extending its functionality can be found in the
+Developer's Manual.
+
+@see OpenSAML Wiki
+
+
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/Delegate.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/Delegate.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/Delegate.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2delrestrict;
+
+import javax.xml.namespace.QName;
+
+import org.joda.time.DateTime;
+import org.opensaml.common.SAMLObject;
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.core.BaseID;
+import org.opensaml.saml2.core.EncryptedID;
+import org.opensaml.saml2.core.NameID;
+
+/**
+ * SAML 2.0 Condition for Delegation Restriction - Delegate element.
+ */
+public interface Delegate extends SAMLObject {
+
+ /** Element local name. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Delegate";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME =
+ new QName(SAMLConstants.SAML20DEL_NS, DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20DEL_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "DelegateType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME =
+ new QName(SAMLConstants.SAML20DEL_NS, TYPE_LOCAL_NAME, SAMLConstants.SAML20DEL_PREFIX);
+
+ /** DelegationInstant attribute name. */
+ public static final String DELEGATION_INSTANT_ATTRIB_NAME = "DelegationInstant";
+
+ /** ConfirmationMethod attribute name. */
+ public static final String CONFIRMATION_METHOD_ATTRIB_NAME = "ConfirmationMethod";
+
+
+ /**
+ * Gets the BaseID child element of the delegate.
+ *
+ * @return the base identifier of the delegate
+ */
+ public BaseID getBaseID();
+
+ /**
+ * Sets the BaseID child element of the delegate.
+ *
+ * @param newBaseID the base identifier of the delegate
+ */
+ public void setBaseID(BaseID newBaseID);
+
+ /**
+ * Gets the NameID child element of the delegate.
+ *
+ * @return the name identifier of the principal for this request
+ */
+ public NameID getNameID();
+
+ /**
+ * Sets the NameID child element of the delegate.
+ *
+ * @param newNameID the name identifier of the delegate
+ */
+ public void setNameID(NameID newNameID);
+
+ /**
+ * Gets the EncryptedID child element of the delegate.
+ *
+ * @return the encrypted name identifier of the delegate
+ */
+ public EncryptedID getEncryptedID();
+
+ /**
+ * Sets the EncryptedID child element of the delegate.
+ *
+ * @param newEncryptedID the new encrypted name identifier of the delegate
+ */
+ public void setEncryptedID(EncryptedID newEncryptedID);
+
+ /**
+ * Get the delegation instant attribute value.
+ *
+ * @return the delegation instant
+ */
+ public DateTime getDelegationInstant();
+
+ /**
+ * Set the delegation instant attribute value.
+ *
+ * @param newInstant the new delegation instant
+ */
+ public void setDelegationInstant(DateTime newInstant);
+
+ /**
+ * Get the confirmation method attribute value.
+ *
+ * @return the confirmation method
+ */
+ public String getConfirmationMethod();
+
+ /**
+ * Set the confirmation method attribute value.
+ *
+ * @param newMethod the new confirmation method
+ */
+ public void setConfirmationMethod(String newMethod);
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/DelegationRestrictionType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/DelegationRestrictionType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/DelegationRestrictionType.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2delrestrict;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.core.Condition;
+
+/**
+ * SAML 2.0 Condition for Delegation Restriction - DelegationRestrictionType complex type.
+ */
+public interface DelegationRestrictionType extends Condition {
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "DelegationRestrictionType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME =
+ new QName(SAMLConstants.SAML20DEL_NS, TYPE_LOCAL_NAME, SAMLConstants.SAML20DEL_PREFIX);
+
+ /**
+ * Get the list of Delegate child elements.
+ *
+ * @return list of Delegate children
+ */
+ List getDelegates();
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/package.html 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,12 @@
+
+
+Interfaces for SAML 2 Condition for Delegation Restriction.
+
+Information on using this library can be found in the
+User's Manual and information
+on extending its functionality can be found in the
+Developer's Manual.
+
+@see OpenSAML Wiki
+
+
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegateBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegateBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegateBuilder.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ *
+ */
+
+package org.opensaml.samlext.saml2delrestrict.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+import org.opensaml.samlext.saml2delrestrict.Delegate;
+
+/**
+ * Builder of {@link Delegate}.
+ */
+public class DelegateBuilder extends AbstractSAMLObjectBuilder {
+
+ /**
+ * Constructor.
+ */
+ public DelegateBuilder() {
+
+ }
+
+ /** {@inheritDoc} */
+ public Delegate buildObject() {
+ return buildObject(Delegate.DEFAULT_ELEMENT_NAME);
+ }
+
+ /** {@inheritDoc} */
+ public Delegate buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new DelegateImpl(namespaceURI, localName, namespacePrefix);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegateImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegateImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegateImpl.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2delrestrict.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.joda.time.DateTime;
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.saml2.core.BaseID;
+import org.opensaml.saml2.core.EncryptedID;
+import org.opensaml.saml2.core.NameID;
+import org.opensaml.samlext.saml2delrestrict.Delegate;
+import org.opensaml.xml.XMLObject;
+
+/**
+ * Implementation of {@link Delegate}.
+ */
+public class DelegateImpl extends AbstractSAMLObject implements Delegate {
+
+ /** BaseID child element. */
+ private BaseID baseID;
+
+ /** NameID child element. */
+ private NameID nameID;
+
+ /** EncryptedID child element. */
+ private EncryptedID encryptedID;
+
+ /** DelegationInstant attribute. */
+ private DateTime delegationInstant;
+
+ /** ConfirmationMethod attribute. */
+ private String confirmationMethod;
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI the namespace the element is in
+ * @param elementLocalName the local name of the XML element this Object represents
+ * @param namespacePrefix the prefix for the given namespace
+ */
+ protected DelegateImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /** {@inheritDoc} */
+ public BaseID getBaseID() {
+ return baseID;
+ }
+
+ /** {@inheritDoc} */
+ public String getConfirmationMethod() {
+ return confirmationMethod;
+ }
+
+ /** {@inheritDoc} */
+ public DateTime getDelegationInstant() {
+ return delegationInstant;
+ }
+
+ /** {@inheritDoc} */
+ public EncryptedID getEncryptedID() {
+ return encryptedID;
+ }
+
+ /** {@inheritDoc} */
+ public NameID getNameID() {
+ return nameID;
+ }
+
+ /** {@inheritDoc} */
+ public void setBaseID(BaseID newBaseID) {
+ baseID = prepareForAssignment(baseID, newBaseID);
+ }
+
+ /** {@inheritDoc} */
+ public void setConfirmationMethod(String newMethod) {
+ confirmationMethod = prepareForAssignment(confirmationMethod, newMethod);
+ }
+
+ /** {@inheritDoc} */
+ public void setDelegationInstant(DateTime newInstant) {
+ delegationInstant = prepareForAssignment(delegationInstant, newInstant);
+ }
+
+ /** {@inheritDoc} */
+ public void setEncryptedID(EncryptedID newEncryptedID) {
+ encryptedID = prepareForAssignment(encryptedID, newEncryptedID);
+ }
+
+ /** {@inheritDoc} */
+ public void setNameID(NameID newNameID) {
+ nameID = prepareForAssignment(nameID, newNameID);
+ }
+
+ /** {@inheritDoc} */
+ public List getOrderedChildren() {
+ ArrayList children = new ArrayList();
+
+ if (baseID != null) {
+ children.add(baseID);
+ }
+ if (nameID != null) {
+ children.add(nameID);
+ }
+ if (encryptedID != null) {
+ children.add(encryptedID);
+ }
+ return Collections.unmodifiableList(children);
+ }
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegateMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegateMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegateMarshaller.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2delrestrict.impl;
+
+import org.opensaml.Configuration;
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.samlext.saml2delrestrict.Delegate;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.DatatypeHelper;
+import org.w3c.dom.Element;
+
+/**
+ * Marshaller for instances of {@link Delegate}.
+ */
+public class DelegateMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /** {@inheritDoc} */
+ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
+ Delegate delegate = (Delegate) xmlObject;
+
+ if (delegate.getDelegationInstant() != null) {
+ String delInstant = Configuration.getSAMLDateFormatter().print(delegate.getDelegationInstant());
+ domElement.setAttributeNS(null, Delegate.DELEGATION_INSTANT_ATTRIB_NAME, delInstant);
+ }
+ if (!DatatypeHelper.isEmpty(delegate.getConfirmationMethod())) {
+ domElement.setAttributeNS(null, Delegate.CONFIRMATION_METHOD_ATTRIB_NAME, delegate.getConfirmationMethod());
+ }
+
+ super.marshallAttributes(xmlObject, domElement);
+ }
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegateUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegateUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegateUnmarshaller.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2delrestrict.impl;
+
+import org.joda.time.DateTime;
+import org.joda.time.chrono.ISOChronology;
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.saml2.core.BaseID;
+import org.opensaml.saml2.core.EncryptedID;
+import org.opensaml.saml2.core.NameID;
+import org.opensaml.samlext.saml2delrestrict.Delegate;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.w3c.dom.Attr;
+
+/**
+ * Unmarshaller for instances of {@link Delegate}.
+ */
+public class DelegateUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+ /** {@inheritDoc} */
+ protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
+ Delegate delegate = (Delegate) samlObject;
+
+ String attrName = attribute.getLocalName();
+ if (Delegate.CONFIRMATION_METHOD_ATTRIB_NAME.equals(attrName)) {
+ delegate.setConfirmationMethod(attribute.getValue());
+ } else if (Delegate.DELEGATION_INSTANT_ATTRIB_NAME.equals(attrName)) {
+ delegate.setDelegationInstant(new DateTime(attribute.getValue(), ISOChronology.getInstanceUTC()));
+ } else {
+ super.processAttribute(samlObject, attribute);
+ }
+ }
+
+ /** {@inheritDoc} */
+ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
+ throws UnmarshallingException {
+ Delegate delegate = (Delegate) parentSAMLObject;
+
+ if (childSAMLObject instanceof BaseID) {
+ delegate.setBaseID((BaseID) childSAMLObject);
+ } else if (childSAMLObject instanceof NameID) {
+ delegate.setNameID((NameID) childSAMLObject);
+ } else if (childSAMLObject instanceof EncryptedID) {
+ delegate.setEncryptedID((EncryptedID) childSAMLObject);
+ } else {
+ super.processChildElement(parentSAMLObject, childSAMLObject);
+ }
+ }
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegationRestrictionTypeBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegationRestrictionTypeBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegationRestrictionTypeBuilder.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ *
+ */
+
+package org.opensaml.samlext.saml2delrestrict.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+import org.opensaml.samlext.saml2delrestrict.DelegationRestrictionType;
+
+/**
+ * Builder of {@link DelegationRestrictionType}.
+ */
+public class DelegationRestrictionTypeBuilder extends AbstractSAMLObjectBuilder {
+
+ /**
+ * Constructor.
+ */
+ public DelegationRestrictionTypeBuilder() {
+
+ }
+
+ /** {@inheritDoc} */
+ public DelegationRestrictionType buildObject() {
+ return buildObject(DelegationRestrictionType.DEFAULT_ELEMENT_NAME, DelegationRestrictionType.TYPE_NAME);
+ }
+
+ /** {@inheritDoc} */
+ public DelegationRestrictionType buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new DelegationRestrictionTypeImpl(namespaceURI, localName, namespacePrefix);
+ }
+
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegationRestrictionTypeImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegationRestrictionTypeImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegationRestrictionTypeImpl.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2delrestrict.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.samlext.saml2delrestrict.Delegate;
+import org.opensaml.samlext.saml2delrestrict.DelegationRestrictionType;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.util.XMLObjectChildrenList;
+
+/**
+ * Implementation of {@link DelegationRestrictionType}.
+ */
+public class DelegationRestrictionTypeImpl extends AbstractSAMLObject implements DelegationRestrictionType {
+
+ /** Delegate child elements. */
+ private XMLObjectChildrenList delegates;
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI the namespace the element is in
+ * @param elementLocalName the local name of the XML element this Object represents
+ * @param namespacePrefix the prefix for the given namespace
+ */
+ protected DelegationRestrictionTypeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ delegates = new XMLObjectChildrenList(this);
+ }
+
+ /** {@inheritDoc} */
+ public List getDelegates() {
+ return delegates;
+ }
+
+ /** {@inheritDoc} */
+ public List getOrderedChildren() {
+ ArrayList children = new ArrayList();
+ children.addAll(delegates);
+ return Collections.unmodifiableList(children);
+ }
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegationRestrictionTypeMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegationRestrictionTypeMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegationRestrictionTypeMarshaller.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2delrestrict.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.samlext.saml2delrestrict.DelegationRestrictionType;
+
+/**
+ * Marshaller for instances of {@link DelegationRestrictionType}.
+ */
+public class DelegationRestrictionTypeMarshaller extends AbstractSAMLObjectMarshaller {
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegationRestrictionTypeUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegationRestrictionTypeUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/DelegationRestrictionTypeUnmarshaller.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2delrestrict.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.samlext.saml2delrestrict.Delegate;
+import org.opensaml.samlext.saml2delrestrict.DelegationRestrictionType;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+
+/**
+ * Unmarshaller for instances of {@link DelegationRestrictionType}.
+ */
+public class DelegationRestrictionTypeUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+ /** {@inheritDoc} */
+ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
+ throws UnmarshallingException {
+ DelegationRestrictionType drt = (DelegationRestrictionType) parentSAMLObject;
+
+ if (childSAMLObject instanceof Delegate) {
+ drt.getDelegates().add((Delegate) childSAMLObject);
+ } else {
+ super.processChildElement(parentSAMLObject, childSAMLObject);
+ }
+ }
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2delrestrict/impl/package.html 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,12 @@
+
+
+Implementation for SAML 2 Condition for Delegation Restriction.
+
+Information on using this library can be found in the
+User's Manual and information
+on extending its functionality can be found in the
+Developer's Manual.
+
+@see OpenSAML Wiki
+
+
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdattr/impl/EntityAttributesBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdattr/impl/EntityAttributesBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdattr/impl/EntityAttributesBuilder.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdattr.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+import org.opensaml.samlext.saml2mdattr.EntityAttributes;
+
+/** Builder of {@link EntityAttributesImpl} objects. */
+public class EntityAttributesBuilder extends AbstractSAMLObjectBuilder {
+
+ /** Constructor. */
+ public EntityAttributesBuilder() {
+
+ }
+
+ /** {@inheritDoc} */
+ public EntityAttributes buildObject() {
+ return buildObject(EntityAttributes.DEFAULT_ELEMENT_NAME);
+ }
+
+ /** {@inheritDoc} */
+ public EntityAttributes buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new EntityAttributesImpl(namespaceURI, localName, namespacePrefix);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdattr/impl/EntityAttributesImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdattr/impl/EntityAttributesImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdattr/impl/EntityAttributesImpl.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdattr.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.common.SAMLObject;
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.saml2.core.Assertion;
+import org.opensaml.saml2.core.Attribute;
+import org.opensaml.saml2.core.Evidentiary;
+import org.opensaml.samlext.saml2mdattr.EntityAttributes;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.util.IndexedXMLObjectChildrenList;
+
+/** Concrete implementation of {@link EntityAttributes}. */
+public class EntityAttributesImpl extends AbstractSAMLObject implements EntityAttributes {
+
+ /** Assertion of the Evidence. */
+ private final IndexedXMLObjectChildrenList extends SAMLObject> attributeInfo;
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI the namespace the element is in
+ * @param elementLocalName the local name of the XML element this Object represents
+ * @param namespacePrefix the prefix for the given namespace
+ */
+ protected EntityAttributesImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ attributeInfo = new IndexedXMLObjectChildrenList(this);
+ }
+
+ /** {@inheritDoc} */
+ public List getAttributes() {
+ return (List) attributeInfo.subList(Attribute.DEFAULT_ELEMENT_NAME);
+ }
+
+ /** {@inheritDoc} */
+ public List getAssertions() {
+ return (List) attributeInfo.subList(Assertion.DEFAULT_ELEMENT_NAME);
+ }
+
+ /** {@inheritDoc} */
+ public List getOrderedChildren() {
+ ArrayList children = new ArrayList();
+
+ if (attributeInfo.size() == 0) {
+ return null;
+ }
+
+ children.addAll(attributeInfo);
+
+ return Collections.unmodifiableList(children);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdattr/impl/EntityAttributesMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdattr/impl/EntityAttributesMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdattr/impl/EntityAttributesMarshaller.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdattr.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+
+/** A thread-safe Marshaller for {@link org.opensaml.samlext.saml2mdattr.EntityAttributes}. */
+public class EntityAttributesMarshaller extends AbstractSAMLObjectMarshaller {
+
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdattr/impl/EntityAttributesUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdattr/impl/EntityAttributesUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdattr/impl/EntityAttributesUnmarshaller.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdattr.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.saml2.core.Assertion;
+import org.opensaml.saml2.core.Attribute;
+import org.opensaml.samlext.saml2mdattr.EntityAttributes;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+
+/** A thread-safe Unmarshaller for {@link org.opensaml.samlext.saml2mdattr.EntityAttributes}. */
+public class EntityAttributesUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+ /** {@inheritDoc} */
+ protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
+ EntityAttributes entityAttrs = (EntityAttributes) parentObject;
+
+ if (childObject instanceof Attribute) {
+ entityAttrs.getAttributes().add((Attribute) childObject);
+ } else if (childObject instanceof Assertion) {
+ entityAttrs.getAssertions().add((Assertion) childObject);
+ } else {
+ super.processChildElement(parentObject, childObject);
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/ActionNamespace.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/ActionNamespace.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/ActionNamespace.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdquery;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.xml.schema.XSURI;
+
+/**
+ * SAML 2.0 Metadata extension ActionNamespace
+ */
+public interface ActionNamespace extends XSURI, SAMLObject {
+
+ /** Element local name */
+ public final static String DEFAULT_ELEMENT_LOCAL_NAME = "ActionNamespace";
+
+ /** Default element name */
+ public final static QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20MDQUERY_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MDQUERY_PREFIX);
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/AttributeQueryDescriptorType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/AttributeQueryDescriptorType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/AttributeQueryDescriptorType.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdquery;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.metadata.AttributeConsumingService;
+
+/**
+ * SAML 2.0 Metadata extension AttributeQueryDescriptorType.
+ */
+public interface AttributeQueryDescriptorType extends QueryDescriptorType {
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "AttributeQueryDescriptorType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20MDQUERY_NS, TYPE_LOCAL_NAME,
+ SAMLConstants.SAML20MDQUERY_PREFIX);
+
+ /**
+ * Gets the list of attribute consuming service endpoints support by this role.
+ *
+ * @return the list of attribute consuming service endpoints support by this role
+ */
+ public List getAttributeConsumingServices();
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/AuthnQueryDescriptorType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/AuthnQueryDescriptorType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/AuthnQueryDescriptorType.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdquery;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.xml.SAMLConstants;
+
+/**
+ * SAML 2.0 Metadata extension AuthnQueryDescriptorType.
+ */
+public interface AuthnQueryDescriptorType extends QueryDescriptorType {
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "AuthnQueryDescriptorType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20MDQUERY_NS, TYPE_LOCAL_NAME,
+ SAMLConstants.SAML20MDQUERY_PREFIX);
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/AuthzDecisionQueryDescriptorType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/AuthzDecisionQueryDescriptorType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/AuthzDecisionQueryDescriptorType.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdquery;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.xml.SAMLConstants;
+
+/**
+ * SAML 2.0 Metadata extension AuthzDecisionQueryDescriptorType.
+ */
+public interface AuthzDecisionQueryDescriptorType extends QueryDescriptorType {
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "AuthzDecisionQueryDescriptorType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20MDQUERY_NS, TYPE_LOCAL_NAME,
+ SAMLConstants.SAML20MDQUERY_PREFIX);
+
+ /**
+ * Gets the list of action namespaces support by this role.
+ *
+ * @return the list of action namespaces support by this role
+ */
+ public List getActionNamespaces();
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/QueryDescriptorType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/QueryDescriptorType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/QueryDescriptorType.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdquery;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.metadata.NameIDFormat;
+import org.opensaml.saml2.metadata.RoleDescriptor;
+import org.opensaml.xml.schema.XSBooleanValue;
+
+/**
+ * SAML 2.0 Metadata extension QueryDescriptorType.
+ */
+public interface QueryDescriptorType extends RoleDescriptor {
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "QueryDescriptorType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20MDQUERY_NS, TYPE_LOCAL_NAME,
+ SAMLConstants.SAML20MDQUERY_PREFIX);
+
+ /** "WantAssertionSigned" attribute's local name. */
+ public static final String WANT_ASSERTIONS_SIGNED_ATTRIB_NAME = "WantAssertionsSigned";
+
+ /**
+ * Gets whether assertions to this endpoint should be signed.
+ *
+ * @return whether assertions to this endpoint should be signed
+ */
+ public Boolean getWantAssertionsSigned();
+
+ /**
+ * Gets whether assertions to this endpoint should be signed.
+ *
+ * @return whether assertions to this endpoint should be signed
+ */
+ public XSBooleanValue getWantAssertionsSignedXSBoolean();
+
+ /**
+ * Sets whether assertions to this endpoint should be signed.
+ *
+ * @param newWantAssertionsSigned whether assertions to this endpoint should be signed
+ */
+ public void setWantAssertionsSigned(Boolean newWantAssertionsSigned);
+
+ /**
+ * Sets whether assertions to this endpoint should be signed.
+ *
+ * @param newWantAssertionsSigned whether assertions to this endpoint should be signed
+ */
+ public void setWantAssertionsSigned(XSBooleanValue newWantAssertionsSigned);
+
+ /**
+ * Gets the list of name ID formats supported by this query service.
+ *
+ * @return the list of name ID formats supported by this query service
+ */
+ public List getNameIDFormat();
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdquery/package.html 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,12 @@
+
+
+Interfaces for SAML 2 metadata standalone query endpoints profile.
+
+Information on using this library can be found in the
+User's Manual and information
+on extending its functionality can be found in the
+Developer's Manual.
+
+@see OpenSAML Wiki
+
+
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/GeolocationHintImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/GeolocationHintImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/GeolocationHintImpl.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdui.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.samlext.saml2mdui.GeolocationHint;
+import org.opensaml.xml.XMLObject;
+
+/**
+ * Concrete implementation of {@link org.opensaml.samlext.saml2mdui.GeolocationHint}.
+ */
+public class GeolocationHintImpl extends AbstractSAMLObject implements GeolocationHint {
+
+ /**
+ * local storage.
+ */
+ private String hint;
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI the namespaceURI
+ * @param elementLocalName the elementLocalName
+ * @param namespacePrefix the namespacePrefix
+ */
+ protected GeolocationHintImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /** {@inheritDoc} */
+ public String getHint() {
+ return hint;
+ }
+
+ /** {@inheritDoc} */
+ public void setHint(String newHint) {
+ hint = prepareForAssignment(hint, newHint);
+ }
+
+ /** {@inheritDoc} */
+ public List getOrderedChildren() {
+ return null;
+ }
+
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/GeolocationHintUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/GeolocationHintUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/GeolocationHintUnmarshaller.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdui.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.samlext.saml2mdui.GeolocationHint;
+import org.opensaml.xml.XMLObject;
+
+/**
+ * A thread-safe unmarshaller for {@link org.opensaml.samlext.saml2mdui.GeolocationHint} objects.
+ */
+public class GeolocationHintUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+ /** {@inheritDoc} */
+ protected void processElementContent(XMLObject samlObject, String elementContent) {
+ GeolocationHint hint = (GeolocationHint) samlObject;
+
+ hint.setHint(elementContent);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/IPHintUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/IPHintUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/IPHintUnmarshaller.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdui.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.samlext.saml2mdui.IPHint;
+import org.opensaml.xml.XMLObject;
+
+/**
+ * A thread-safe unmarshaller for {@link org.opensaml.samlext.saml2mdui.IPHint} objects.
+ */
+public class IPHintUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+ /** {@inheritDoc} */
+ protected void processElementContent(XMLObject samlObject, String elementContent) {
+ IPHint hint = (IPHint) samlObject;
+
+ hint.setHint(elementContent);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/InformationURLMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/InformationURLMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/InformationURLMarshaller.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdui.impl;
+
+
+/**
+ * A thread safe Marshaller for {@link org.opensaml.samlext.saml2mdui.InformationURL} objects.
+ */
+public class InformationURLMarshaller extends LocalizedURIMarshaller {
+}
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/InformationURLUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/InformationURLUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/InformationURLUnmarshaller.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdui.impl;
+
+/**
+ * A thread-safe unmarshaller for {@link org.opensaml.samlext.saml2mdui.InformationURL} objects.
+ */
+public class InformationURLUnmarshaller extends LocalizedURIUnmarshaller {
+}
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/KeywordsBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/KeywordsBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/KeywordsBuilder.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdui.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+import org.opensaml.samlext.saml2mdui.Keywords;
+import org.opensaml.samlext.saml2mdui.UIInfo;
+
+/**
+ * Builder of {@link org.opensaml.samlext.saml2mdui.InformationURL} objects.
+ * @author Rod Widdowson
+ */
+public class KeywordsBuilder extends AbstractSAMLObjectBuilder {
+ /**
+ * Constructor.
+ */
+ public KeywordsBuilder() {
+
+ }
+
+ /** {@inheritDoc} */
+ public Keywords buildObject() {
+ return buildObject(UIInfo.MDUI_NS,
+ Keywords.DEFAULT_ELEMENT_LOCAL_NAME,
+ UIInfo.MDUI_PREFIX);
+ }
+
+ /** {@inheritDoc} */
+ public Keywords buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new KeywordsImpl(namespaceURI, localName, namespacePrefix);
+ }
+}
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/LocalizedNameMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/LocalizedNameMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/LocalizedNameMarshaller.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdui.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.samlext.saml2mdui.LocalizedName;
+import org.opensaml.xml.LangBearing;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+
+/**
+ * A thread safe Marshaller for {@link org.opensaml.samlext.saml2mdui.LocalizedName} objects.
+ */
+public class LocalizedNameMarshaller extends AbstractSAMLObjectMarshaller {
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
+ LocalizedName name = (LocalizedName) samlObject;
+
+ if (name.getName() != null) {
+ Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS,
+ LangBearing.XML_LANG_ATTR_LOCAL_NAME, SAMLConstants.XML_PREFIX);
+ attribute.setValue(name.getName().getLanguage());
+ domElement.setAttributeNodeNS(attribute);
+ }
+ }
+
+ /** {@inheritDoc} */
+ protected void marshallElementContent(XMLObject samlObject, Element domElement) throws MarshallingException {
+ LocalizedName name = (LocalizedName) samlObject;
+
+ if (name.getName() != null) {
+ XMLHelper.appendTextContent(domElement, name.getName().getLocalString());
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/LogoImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/LogoImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/LogoImpl.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdui.impl;
+
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.samlext.saml2mdui.Logo;
+import org.opensaml.xml.LangBearing;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.util.DatatypeHelper;
+
+/**
+ * Concrete implementation of {@link org.opensaml.samlext.saml2mdui.Logo}.
+ * @author rod widdowson
+ */
+public class LogoImpl extends AbstractSAMLObject implements Logo {
+
+ /** Logo URL. */
+ private String url;
+
+ /** Language. */
+ private String lang;
+
+ /** X-Dimension of the logo. */
+ private Integer width;
+
+ /** Y-Dimension of the logo. */
+ private Integer height;
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI namespaceURI
+ * @param elementLocalName elementLocalName
+ * @param namespacePrefix namespacePrefix
+ */
+ protected LogoImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+
+ /** {@inheritDoc} */
+ public Integer getHeight() {
+ return height;
+ }
+
+ /** {@inheritDoc} */
+ public void setHeight(Integer newHeight) {
+ height = prepareForAssignment(height, newHeight);
+ }
+
+ /** {@inheritDoc} */
+ public Integer getWidth() {
+ return width;
+ }
+
+ /** {@inheritDoc} */
+ public void setWidth(Integer newWidth) {
+ width = prepareForAssignment(width, newWidth);
+ }
+
+ /** {@inheritDoc} */
+ public String getURL() {
+ return url;
+ }
+
+ /** {@inheritDoc} */
+ public void setURL(String newURL) {
+ url = prepareForAssignment(url, newURL);
+ }
+
+ /** {@inheritDoc} */
+ public String getXMLLang() {
+ return lang;
+ }
+
+ /** {@inheritDoc} */
+ public void setXMLLang(String newLang) {
+ boolean hasValue = newLang != null && !DatatypeHelper.isEmpty(newLang);
+ lang = prepareForAssignment(lang, newLang);
+ manageQualifiedAttributeNamespace(LangBearing.XML_LANG_ATTR_NAME, hasValue);
+ }
+
+
+ /** {@inheritDoc} */
+ public List getOrderedChildren() {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int hashCode() {
+ int hash = url.hashCode();
+ hash = hash * 31 + lang.hashCode();
+ hash = hash * 31 + height;
+ hash = hash * 31 + width;
+ return hash;
+ }
+}
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/PrivacyStatementURLUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/PrivacyStatementURLUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/saml2mdui/impl/PrivacyStatementURLUnmarshaller.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.saml2mdui.impl;
+
+
+/**
+ * A thread-safe unmarshaller for {@link org.opensaml.samlext.saml2mdui.PrivacyStatementURL} objects.
+ */
+public class PrivacyStatementURLUnmarshaller extends LocalizedURIUnmarshaller {
+}
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/RespondTo.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/RespondTo.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/RespondTo.java 17 Aug 2012 15:04:59 -0000 1.1
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.samlpthrpty;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.common.SAMLObject;
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.saml2.core.NameIDType;
+
+/**
+ * SAML 2.0 Protocol Third-party extension RespondTo
+ */
+public interface RespondTo extends NameIDType, SAMLObject {
+
+ /** Element local name */
+ public final static String DEFAULT_ELEMENT_LOCAL_NAME = "RespondTo";
+
+ /** Default element name */
+ public final static QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20PTHRPTY_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20PTHRPTY_PREFIX);
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/package.html 17 Aug 2012 15:05:00 -0000 1.1
@@ -0,0 +1,12 @@
+
+
+Interfaces for SAML 2 protocol third-party response profile.
+
+Information on using this library can be found in the
+User's Manual and information
+on extending its functionality can be found in the
+Developer's Manual.
+
+@see OpenSAML Wiki
+
+
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/impl/RespondToBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/impl/RespondToBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/impl/RespondToBuilder.java 17 Aug 2012 15:04:55 -0000 1.1
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.samlpthrpty.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+import org.opensaml.common.xml.SAMLConstants;
+import org.opensaml.samlext.samlpthrpty.RespondTo;
+
+/**
+ * Builder of {@link RespondToImpl} objects.
+ */
+public class RespondToBuilder extends AbstractSAMLObjectBuilder {
+
+ /** {@inheritDoc} */
+ public RespondTo buildObject() {
+ return buildObject(SAMLConstants.SAML20PTHRPTY_NS, RespondTo.DEFAULT_ELEMENT_LOCAL_NAME,
+ SAMLConstants.SAML20PTHRPTY_PREFIX);
+ }
+
+ /** {@inheritDoc} */
+ public RespondTo buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new RespondToImpl(namespaceURI, localName, namespacePrefix);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/impl/RespondToImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/impl/RespondToImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/impl/RespondToImpl.java 17 Aug 2012 15:04:55 -0000 1.1
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.samlpthrpty.impl;
+
+import org.opensaml.saml2.core.impl.AbstractNameIDType;
+import org.opensaml.samlext.samlpthrpty.RespondTo;
+
+/**
+ * Concerte implementation of {@link RespondTo}.
+ */
+public class RespondToImpl extends AbstractNameIDType implements RespondTo {
+
+ /**
+ * Constructor
+ *
+ * @param namespaceURI the namespace the element is in
+ * @param elementLocalName the local name of the XML element this Object represents
+ * @param namespacePrefix the prefix for the given namespace
+ */
+ protected RespondToImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/impl/RespondToMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/impl/RespondToMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/impl/RespondToMarshaller.java 17 Aug 2012 15:04:55 -0000 1.1
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.samlpthrpty.impl;
+
+import org.opensaml.saml2.core.impl.AbstractNameIDTypeMarshaller;
+
+/**
+ * Marshaller of {@link org.opensaml.samlext.samlpthrpty.RespondTo} objects.
+ */
+public class RespondToMarshaller extends AbstractNameIDTypeMarshaller {
+
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/impl/RespondToUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/impl/RespondToUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/impl/RespondToUnmarshaller.java 17 Aug 2012 15:04:55 -0000 1.1
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.samlext.samlpthrpty.impl;
+
+import org.opensaml.saml2.core.impl.AbstractNameIDTypeUnmarshaller;
+
+/**
+ * Unmarshaller for {@link org.opensaml.samlext.samlpthrpty.RespondTo} objects.
+ */
+public class RespondToUnmarshaller extends AbstractNameIDTypeUnmarshaller {
+
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/impl/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/impl/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/samlext/samlpthrpty/impl/package.html 17 Aug 2012 15:04:55 -0000 1.1
@@ -0,0 +1,12 @@
+
+
+Implementation for SAML 2 protocol third-party response profile objects.
+
+Information on using this library can be found in the
+User's Manual and information
+on extending its functionality can be found in the
+Developer's Manual.
+
+@see OpenSAML Wiki
+
+
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/XACMLConstants.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/XACMLConstants.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/XACMLConstants.java 17 Aug 2012 15:04:55 -0000 1.1
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml;
+
+/** Defines the constants for the XACML providers. */
+public class XACMLConstants {
+
+ /** The prefix for the use of xacml policy. */
+ public static final String XACML_PREFIX = "xacml";
+
+ /** The prefix for the use of xacml context. */
+ public static final String XACMLCONTEXT_PREFIX = "xacml-context";
+
+ /** The namespaces for use of XACML 1.0 context. */
+ public static final String XACML10CTX_NS = "urn:oasis:names:tc:xacml:1.0:context";
+
+ /** The namespaces for use of XACML 1.0 policy. */
+ public static final String XACML10_NS = "urn:oasis:names:tc:xacml:1.0:policy";
+
+ /** The namespaces for use of XACML 2.0 context. */
+ public static final String XACML20CTX_NS = "urn:oasis:names:tc:xacml:2.0:context:schema:os";
+
+ /** The namespaces for use of XACML 2.0 policy. */
+ public static final String XACML20_NS = "urn:oasis:names:tc:xacml:2.0:policy:schema:os";
+
+ /** The namespaces for use of XACML 3.0. */
+ public static final String XACML30_NS = "urn:oasis:names:tc:xacml:3.0:schema:os";
+
+ /** X.500 Name datatype URI. */
+ public static final String X500_NAME_DATATYPE_URI = "urn:oasis:names:tc:xacml:1.0:data-type:x500Name";
+
+ /** RFC822 Name datatype URI. */
+ public static final String RFC822_NAME_DATATYPE_URI = "urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name";
+
+ /** IP address datatype URI. */
+ public static final String IP_ADDRESS_DATATYPE_URI = "urn:oasis:names:tc:xacml:1.0:data-type:ipAddress";
+
+ /** DNS Name datatype URI. */
+ public static final String DNS_NAME_DATATYPE_URI = "urn:oasis:names:tc:xacml:1.0:data-type:dnsName";
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/XACMLObject.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/XACMLObject.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/XACMLObject.java 17 Aug 2012 15:04:55 -0000 1.1
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml;
+
+import org.opensaml.xml.validation.ValidatingXMLObject;
+
+/**
+ * Base interface for XACML objects.
+ */
+public interface XACMLObject extends ValidatingXMLObject {
+
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/XACMLObjectBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/XACMLObjectBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/XACMLObjectBuilder.java 17 Aug 2012 15:04:55 -0000 1.1
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml;
+
+import org.opensaml.xml.XMLObjectBuilder;
+
+/**
+ * Builder of XACML objects.
+ *
+ * @param type of XACML object built
+ */
+public interface XACMLObjectBuilder extends XMLObjectBuilder {
+
+ /**
+ * Builds a XACML object, using its default attribute name.
+ *
+ * @return constructed XACML object
+ */
+ public XACMLObjectType buildObject();
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/ActionType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/ActionType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/ActionType.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xacml.XACMLConstants;
+import org.opensaml.xacml.XACMLObject;
+
+/** XACML context Action schema type. */
+public interface ActionType extends XACMLObject {
+
+ /** Local name of the Action element. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Action";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(XACMLConstants.XACML20CTX_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "ActionType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(XACMLConstants.XACML20CTX_NS, TYPE_LOCAL_NAME,
+ XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /**
+ * Returns the list of attributes in the subject.
+ *
+ * @return the list of attributes in the subject
+ */
+ public List getAttributes();
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/AttributeType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/AttributeType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/AttributeType.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xacml.XACMLConstants;
+import org.opensaml.xacml.XACMLObject;
+
+/** XACML context Attribute schema type. */
+public interface AttributeType extends XACMLObject {
+
+ /** Local name of the Attribute element. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Attribute";
+
+ /** Default element name XACML20. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(XACMLConstants.XACML20CTX_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "AttributeType";
+
+ /** QName of the XSI type XACML20. */
+ public static final QName TYPE_NAME = new QName(XACMLConstants.XACML20CTX_NS, TYPE_LOCAL_NAME,
+ XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Name of the AttributeId attribute. */
+ public static final String ATTRIBUTEID_ATTTRIB_NAME = "AttributeId";
+
+ /** Name for the Datatype attribute. */
+ public static final String DATATYPE_ATTRIB_NAME = "DataType";
+
+ /** Name of the Issuer attribute. */
+ public static final String ISSUER_ATTRIB_NAME = "Issuer";
+
+ /**
+ * gets the AttributeId.
+ *
+ * @return the AttributeId
+ */
+ public String getAttributeID();
+
+ /**
+ * Gets the list of attribute values for this attribute.
+ *
+ * @return the list of values for this attribute
+ */
+ public List getAttributeValues();
+
+ /**
+ * Get the datatype of the attribute.
+ *
+ * @return the datatype
+ */
+ public String getDataType();
+
+ /**
+ * Gets the issuer of the attribute.
+ *
+ * @return the value of Issuer
+ */
+ public String getIssuer();
+
+ /**
+ * Sets the AttributeId.
+ *
+ * @param attributeId is the wanted AttributeId
+ */
+ public void setAttributeID(String attributeId);
+
+ /**
+ * Sets the datatype of the attribute.
+ *
+ * @param datatype is the wanted datatype
+ */
+ public void setDataType(String datatype);
+
+ /**
+ * Sets the issuer of the attribute.
+ *
+ * @param issuer is the issuer of the attribute
+ */
+ public void setIssuer(String issuer);
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/AttributeValueType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/AttributeValueType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/AttributeValueType.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xacml.XACMLConstants;
+import org.opensaml.xacml.XACMLObject;
+import org.opensaml.xml.AttributeExtensibleXMLObject;
+import org.opensaml.xml.ElementExtensibleXMLObject;
+
+/** XACML context AttributeValue schema type. */
+public interface AttributeValueType extends XACMLObject, ElementExtensibleXMLObject, AttributeExtensibleXMLObject {
+
+ /** Element name, no namespace. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "AttributeValue";
+
+ /** Default element name XACML20. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(XACMLConstants.XACML20CTX_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "AttributeValueType";
+
+ /** QName of the XSI type XACML20. */
+ public static final QName TYPE_NAME = new QName(XACMLConstants.XACML20CTX_NS, TYPE_LOCAL_NAME,
+ XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /**
+ * Gets the text content of the element.
+ *
+ * @return text content of the element
+ */
+ public String getValue();
+
+ /**
+ * Sets the text content of the element.
+ *
+ * NOTE because the library does not support mixed content setting textual content will prohibit
+ * element content.
+ *
+ * @param value text content of the element
+ */
+ public void setValue(String value);
+
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/DecisionType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/DecisionType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/DecisionType.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xacml.XACMLConstants;
+import org.opensaml.xacml.XACMLObject;
+
+/** XACML context Decision schema type. */
+public interface DecisionType extends XACMLObject {
+
+ /** Allowed decision values. */
+ public enum DECISION {
+ Deny, Permit, Indeterminate, NotApplicable
+ };
+
+ /** Element name. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Decision";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(XACMLConstants.XACML20CTX_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "DecisionType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(XACMLConstants.XACML20CTX_NS, TYPE_LOCAL_NAME,
+ XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /**
+ * Gets the value of the decision.
+ *
+ * @return The value of the decision
+ */
+ public DECISION getDecision();
+
+ /**
+ * Sets the value of the decision.
+ *
+ * @param decision value of the decision
+ */
+ public void setDecision(DECISION decision);
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/EnvironmentType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/EnvironmentType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/EnvironmentType.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xacml.XACMLConstants;
+import org.opensaml.xacml.XACMLObject;
+
+/** XACML context Environment schema type. */
+public interface EnvironmentType extends XACMLObject {
+
+ /** Local name of the Attribute element. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Environment";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(XACMLConstants.XACML20CTX_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "EnvironmentType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(XACMLConstants.XACML20CTX_NS, TYPE_LOCAL_NAME,
+ XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /**
+ * Returns the list of attributes in the environment.
+ *
+ * @return the list of attributes in the environment
+ */
+ public List getAttributes();
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/MissingAttributeDetailType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/MissingAttributeDetailType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/MissingAttributeDetailType.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xacml.XACMLConstants;
+import org.opensaml.xacml.XACMLObject;
+
+/** XACML context MissingAttributeDetail schema type. */
+public interface MissingAttributeDetailType extends XACMLObject {
+
+ /** Local name of the element MissingAttributeDetail. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "MissingAttributeDetail";
+
+ /** QName of the element MissingAttributeDetail. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(XACMLConstants.XACML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+ XACMLConstants.XACML_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String SCHEMA_TYPE_LOCAL_NAME = "MissingAttributeDetailType";
+
+ /** QName of the XSI type. */
+ public static final QName SCHEMA_TYPE_NAME = new QName(XACMLConstants.XACML20_NS, SCHEMA_TYPE_LOCAL_NAME,
+ XACMLConstants.XACML_PREFIX);
+
+ /** AttributeId attribute name. */
+ public static final String ATTRIBUTE_ID_ATTRIB_NAME = "AttributeId";
+
+ /** DataType attribute name. */
+ public static final String DATA_TYPE_ATTRIB_NAME = "DataType";
+
+ /** Issuer attribute name. */
+ public static final String ISSUER_ATTRIB_NAME = "Issuer";
+
+ /**
+ * Gets the missing attribute values.
+ *
+ * @return missing attribute values
+ */
+ public List getAttributeValues();
+
+ /**
+ * Gets the ID of the attribute.
+ *
+ * @return ID of the attribute
+ */
+ public String getAttributeId();
+
+ /**
+ * Sets the ID of the attribute.
+ *
+ * @param id ID of the attribute
+ */
+ public void setAttributeId(String id);
+
+ /**
+ * Gets the data type of the attribute.
+ *
+ * @return data type of the attribute
+ */
+ public String getDataType();
+
+ /**
+ * Sets the data type of the attribute.
+ *
+ * @param type data type of the attribute
+ */
+ public void setDataType(String type);
+
+ /**
+ * Gets the issuer of the attribute.
+ *
+ * @return issuer of the attribute
+ */
+ public String getIssuer();
+
+ /**
+ * Sets the issuer of the attribute.
+ *
+ * @param issuer issuer of the attribute
+ */
+ public void setIssuer(String issuer);
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/RequestType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/RequestType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/RequestType.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xacml.XACMLConstants;
+import org.opensaml.xacml.XACMLObject;
+
+/** XACML context Request schema type. */
+public interface RequestType extends XACMLObject {
+
+ /** Element local name. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Request";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(XACMLConstants.XACML20CTX_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "RequestType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(XACMLConstants.XACML20CTX_NS, TYPE_LOCAL_NAME,
+ XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /**
+ * Gets the subjects from the request.
+ *
+ * @return the subjects from the request
+ */
+ public List getSubjects();
+
+ /**
+ * Gets the resources from the request.
+ *
+ * @return the resources from the request
+ */
+ public List getResources();
+
+ /**
+ * Gets the action from the request.
+ *
+ * @return the action from the request
+ */
+ public ActionType getAction();
+
+ /**
+ * Sets the action of the request.
+ *
+ * @param newAction action of the request
+ */
+ public void setAction(ActionType newAction);
+
+ /**
+ * Gets the environment from the request.
+ *
+ * @return the environment from the request
+ */
+ public EnvironmentType getEnvironment();
+
+ /**
+ * Sets the environment of the request.
+ *
+ * @param environment environment of the request
+ */
+ public void setEnvironment(EnvironmentType environment);
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/ResourceContentType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/ResourceContentType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/ResourceContentType.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xacml.XACMLConstants;
+import org.opensaml.xacml.XACMLObject;
+import org.opensaml.xml.AttributeExtensibleXMLObject;
+import org.opensaml.xml.ElementExtensibleXMLObject;
+
+/** XACML context ResourceContent schema type. */
+public interface ResourceContentType extends XACMLObject, ElementExtensibleXMLObject, AttributeExtensibleXMLObject {
+
+ /** Local name of the ResourceContent element. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "ResourceContent";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(XACMLConstants.XACML20CTX_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "ResourceContentType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(XACMLConstants.XACML20CTX_NS, TYPE_LOCAL_NAME,
+ XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /**
+ * Gets the text value of this element.
+ *
+ * @return text value of this element
+ */
+ public String getValue();
+
+ /**
+ * Sets the text value of this element.
+ *
+ * @param value text value of this element
+ */
+ public void setValue(String value);
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/ResourceType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/ResourceType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/ResourceType.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xacml.XACMLConstants;
+import org.opensaml.xacml.XACMLObject;
+
+/** XACML context ResourceContent schema type. */
+public interface ResourceType extends XACMLObject {
+
+ /** Local name of the Attribute element. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Resource";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(XACMLConstants.XACML20CTX_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "ResourceType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(XACMLConstants.XACML20CTX_NS, TYPE_LOCAL_NAME,
+ XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /**
+ * Gets the content of the resource.
+ *
+ * @return content of the resource
+ */
+ public ResourceContentType getResourceContent();
+
+ /**
+ * Sets the content of the resource.
+ *
+ * @param content content of the resource
+ */
+ public void setResourceContent(ResourceContentType content);
+
+ /**
+ * Returns the list of attributes in the resource.
+ *
+ * @return the list of attributes in the resource
+ */
+ public List getAttributes();
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/ResponseType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/ResponseType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/ResponseType.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xacml.XACMLConstants;
+import org.opensaml.xacml.XACMLObject;
+
+/** XACML context Response schema type. */
+public interface ResponseType extends XACMLObject {
+
+ /** Element local name. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Response";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(XACMLConstants.XACML20CTX_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "ResponseType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(XACMLConstants.XACML20CTX_NS, TYPE_LOCAL_NAME,
+ XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /**
+ * Returns the result of the response.
+ *
+ * @return the result of the response
+ */
+ public ResultType getResult();
+
+ /**
+ * Sets the result of the response.
+ *
+ * @param newResult result of the response
+ */
+ public void setResult(ResultType newResult);
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/ResultType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/ResultType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/ResultType.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xacml.XACMLConstants;
+import org.opensaml.xacml.XACMLObject;
+import org.opensaml.xacml.policy.ObligationsType;
+
+/** XACML context Result schema type. */
+public interface ResultType extends XACMLObject {
+
+ /** Local name of the element. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Result";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(XACMLConstants.XACML20CTX_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "ResultType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(XACMLConstants.XACML20CTX_NS, TYPE_LOCAL_NAME,
+ XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** ResourceId attribute name. */
+ public static final String RESOURCE_ID_ATTTRIB_NAME = "ResourceId";
+
+ /**
+ * Returns the decision in the result.
+ *
+ * @return XACMLDecision the decision in the result
+ */
+ public DecisionType getDecision();
+
+ /**
+ * Returns the list of Obligations in the result.
+ *
+ * @return the list of Obligations in the result
+ */
+ public ObligationsType getObligations();
+
+ /**
+ * Sets the obligations for this result.
+ *
+ * @param obligations obligations for this result
+ */
+ public void setObligations(ObligationsType obligations);
+
+ /**
+ * Gets the ResourceId of the result.
+ *
+ * @return The ResourceId of the subject
+ */
+ public String getResourceId();
+
+ /**
+ * Returns the status in the result.
+ *
+ * @return the status in the result
+ */
+ public StatusType getStatus();
+
+ /**
+ * Sets the result status.
+ *
+ * @param status result status
+ */
+ public void setStatus(StatusType status);
+
+ /**
+ * Sets the decision in the result.
+ *
+ * @param newDecision The decision in the result
+ */
+ public void setDecision(DecisionType newDecision);
+
+ /**
+ * Sets the ResourceId.
+ *
+ * @param resourceId is the ResourceId
+ */
+ public void setResourceId(String resourceId);
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/StatusCodeType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/StatusCodeType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/StatusCodeType.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xacml.XACMLConstants;
+import org.opensaml.xacml.XACMLObject;
+
+/** XACML context StatusCode schema type. */
+public interface StatusCodeType extends XACMLObject {
+
+ /** Local name of the StatusCode element. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "StatusCode";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(XACMLConstants.XACML20CTX_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "StatusCodeType";
+
+ /** QName of the XSI type XACML20. */
+ public static final QName TYPE_NAME = new QName(XACMLConstants.XACML20CTX_NS, TYPE_LOCAL_NAME,
+ XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Name of the Value attribute. */
+ public static final String VALUE_ATTTRIB_NAME = "Value";
+
+ /** Missing attribute status code. */
+ public static final String SC_MISSING_ATTRIBUTE = "urn:oasis:names:tc:xacml:1.0:status:missing-attribute";
+
+ /** Ok status code. */
+ public static final String SC_OK = "urn:oasis:names:tc:xacml:1.0:status:ok";
+
+ /** Processing error status code. */
+ public static final String SC_PROCESSING_ERROR = "urn:oasis:names:tc:xacml:1.0:status:processing-error";
+
+ /** Syntax error status code. */
+ public static final String SC_SYNTAX_ERROR = "urn:oasis:names:tc:xacml:1.0:status:syntax-error";
+
+ /**
+ * Gets the status code.
+ *
+ * @return status code
+ */
+ public StatusCodeType getStatusCode();
+
+ /**
+ * Sets the status code.
+ *
+ * @param code status code
+ */
+ public void setStatusCode(StatusCodeType code);
+
+ /**
+ * Gets the value of the attribute named value of the status element.
+ *
+ * @return The value of the attribute named value for the status element
+ */
+ public String getValue();
+
+ /**
+ * Sets the attribute named value of the status elements.
+ *
+ * @param value The wanted value for the attribute value
+ */
+ public void setValue(String value);
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/StatusDetailType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/StatusDetailType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/StatusDetailType.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xacml.XACMLConstants;
+import org.opensaml.xacml.XACMLObject;
+import org.opensaml.xml.ElementExtensibleXMLObject;
+
+/** XACML context StatusDetail schema type. */
+public interface StatusDetailType extends XACMLObject, ElementExtensibleXMLObject {
+
+ /** Element local name. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "StatusDetail";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(XACMLConstants.XACML20CTX_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "StatusDetailType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(XACMLConstants.XACML20CTX_NS, TYPE_LOCAL_NAME,
+ XACMLConstants.XACMLCONTEXT_PREFIX);
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/StatusMessageType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/StatusMessageType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/StatusMessageType.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xacml.XACMLConstants;
+import org.opensaml.xacml.XACMLObject;
+import org.opensaml.xml.schema.XSString;
+
+/** XACML context StatusMessage schema type. */
+public interface StatusMessageType extends XSString, XACMLObject {
+
+ /** Local name of the element. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "StatusMessage";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(XACMLConstants.XACML20CTX_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, XACMLConstants.XACMLCONTEXT_PREFIX);
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/StatusType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/StatusType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/StatusType.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xacml.XACMLConstants;
+import org.opensaml.xacml.XACMLObject;
+
+/** XACML context Status schema type. */
+public interface StatusType extends XACMLObject {
+
+ /** Local name of the StatusCode element. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Status";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(XACMLConstants.XACML20CTX_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "StatusType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(XACMLConstants.XACML20CTX_NS, TYPE_LOCAL_NAME,
+ XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /**
+ * Gets the status code of status.
+ *
+ * @return The status code of status
+ */
+ public StatusCodeType getStatusCode();
+
+ /**
+ * Gets the status detail of status.
+ *
+ * @return The status detail of status
+ */
+ public StatusDetailType getStatusDetail();
+
+ /**
+ * Gets the status message of status.
+ *
+ * @return The status message of status
+ */
+ public StatusMessageType getStatusMessage();
+
+ /**
+ * Sets the status code for the Status.
+ *
+ * @param newStatusCode The new status code
+ */
+ public void setStatusCode(StatusCodeType newStatusCode);
+
+ /**
+ * Sets the status detail for the Status.
+ *
+ * @param statusDetail The new status message
+ */
+ public void setStatusDetail(StatusDetailType statusDetail);
+
+ /**
+ * Sets the status message for the Status.
+ *
+ * @param newStatusMessage The new status message
+ */
+ public void setStatusMessage(StatusMessageType newStatusMessage);
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/SubjectType.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/SubjectType.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/SubjectType.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xacml.XACMLConstants;
+import org.opensaml.xacml.XACMLObject;
+
+/** XACML context Subject schema type. */
+public interface SubjectType extends XACMLObject {
+
+ /** Local name of the element. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Subject";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(XACMLConstants.XACML20CTX_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "SubjectType";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME = new QName(XACMLConstants.XACML20CTX_NS, TYPE_LOCAL_NAME,
+ XACMLConstants.XACMLCONTEXT_PREFIX);
+
+ /** Name of the SubjectCategory attribute. */
+ public static final String SUBJECT_CATEGORY_ATTTRIB_NAME = "SubjectCategory";
+
+ /**
+ * Returns the list of attributes in the subject.
+ *
+ * @return the list of attributes in the subject
+ */
+ public List getAttributes();
+
+ /**
+ * Gets the subjectcategory of the subject.
+ *
+ * @return The subjectcategory of the subject
+ */
+ public String getSubjectCategory();
+
+ /**
+ * Sets the subjectcategory.
+ *
+ * @param subjectCategory Sets the subjectcategory
+ */
+ public void setSubjectCategory(String subjectCategory);
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/provider/BaseObligationHandler.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/provider/BaseObligationHandler.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/provider/BaseObligationHandler.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx.provider;
+
+import org.opensaml.xacml.policy.ObligationType;
+import org.opensaml.xml.util.DatatypeHelper;
+
+/**
+ * Base class for all obligation handlers.
+ *
+ * Handlers are executed in order of precedence. Handlers with a higher precedence are executed before those with a
+ * lower precedence. Handlers with the same precedence are executed in random order.
+ *
+ * Obligation handlers must be stateless.
+ */
+public abstract class BaseObligationHandler {
+
+ /** ID of the handled obligation. */
+ private String id;
+
+ /** Precedence of this handler. */
+ private int precedence;
+
+ /**
+ * Constructor. Obligation has the lowest precedence
+ *
+ * @param obligationId ID of the handled obligation
+ */
+ protected BaseObligationHandler(String obligationId) {
+ this(obligationId, Integer.MIN_VALUE);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param obligationId ID of the handled obligation
+ * @param handlerPrecedence precedence of this handler
+ */
+ protected BaseObligationHandler(String obligationId, int handlerPrecedence) {
+ id = DatatypeHelper.safeTrimOrNullString(obligationId);
+ if (id == null) {
+ throw new IllegalArgumentException("Provided obligation ID may not be null or empty");
+ }
+
+ precedence = handlerPrecedence;
+ }
+
+ /**
+ * Gets the ID of the handled obligation.
+ *
+ * @return ID of the handled obligation
+ */
+ public String getObligationId() {
+ return id;
+ }
+
+ /**
+ * Gets the precedence of the handler.
+ *
+ * @return precedence of the handler
+ */
+ public int getHandlerPrecedence() {
+ return precedence;
+ }
+
+ /**
+ * Evaluates the obligation represented by this handler.
+ *
+ * @param context current processing context
+ * @param obligation the obligation as returned by the PDP
+ *
+ * @throws ObligationProcessingException thrown if there is a problem evaluating this handler
+ */
+ public abstract void evaluateObligation(ObligationProcessingContext context, ObligationType obligation)
+ throws ObligationProcessingException;
+
+ /** {@inheritDoc} */
+ public int hashCode() {
+ return getObligationId().hashCode();
+ }
+
+ /** {@inheritDoc} */
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+
+ if (obj instanceof BaseObligationHandler) {
+ return DatatypeHelper.safeEquals(getObligationId(), ((BaseObligationHandler) obj).getObligationId());
+ }
+
+ return false;
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/provider/ObligationProcessingContext.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/provider/ObligationProcessingContext.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/provider/ObligationProcessingContext.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx.provider;
+
+import org.opensaml.xacml.ctx.ResultType;
+
+/**
+ * A context for processing obligations.
+ */
+public class ObligationProcessingContext {
+
+ /** Result of a XACML authorization request. */
+ private ResultType result;
+
+ /**
+ * Constructor.
+ *
+ * @param authzResult result of a XACML authorization request
+ */
+ public ObligationProcessingContext(ResultType authzResult) {
+ if (authzResult == null) {
+ throw new IllegalArgumentException("Authorization request result may not be null");
+ }
+ result = authzResult;
+ }
+
+ /**
+ * Gets the result of a XACML authorization request.
+ *
+ * @return result of a XACML authorization request
+ */
+ public ResultType getAuthorizationDecisionResult() {
+ return result;
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/provider/ObligationProcessingException.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/provider/ObligationProcessingException.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/provider/ObligationProcessingException.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx.provider;
+
+/** Exception thrown if there is a problem evaluating an obligation. */
+public class ObligationProcessingException extends Exception {
+
+ /** Serial version UID. */
+ private static final long serialVersionUID = -8978474052544318919L;
+
+ /** Constructor. */
+ public ObligationProcessingException() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ */
+ public ObligationProcessingException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public ObligationProcessingException(Exception wrappedException) {
+ super(wrappedException);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public ObligationProcessingException(String message, Exception wrappedException) {
+ super(message, wrappedException);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/provider/ObligationService.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/ctx/provider/ObligationService.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/ctx/provider/ObligationService.java 17 Aug 2012 15:04:52 -0000 1.1
@@ -0,0 +1,201 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.ctx.provider;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+import org.opensaml.xacml.ctx.DecisionType.DECISION;
+import org.opensaml.xacml.policy.EffectType;
+import org.opensaml.xacml.policy.ObligationType;
+import org.opensaml.xacml.policy.ObligationsType;
+
+/** A service for evaluating the obligations within a context. */
+public class ObligationService {
+
+ /** Read/write lock around the registered obligation handlers. */
+ private ReentrantReadWriteLock rwLock;
+
+ /** Registered obligation handlers. */
+ private Set obligationHandlers;
+
+ /** Constructor. */
+ public ObligationService() {
+ rwLock = new ReentrantReadWriteLock(true);
+ obligationHandlers = new TreeSet(new ObligationHandlerComparator());
+ }
+
+ /**
+ * Gets the registered obligation handlers.
+ *
+ * @return registered obligation handlers
+ */
+ public Set getObligationHandlers() {
+ return Collections.unmodifiableSet(obligationHandlers);
+ }
+
+ /**
+ * Adds an obligation handler to the list of registered handlers
+ *
+ * This method waits until a write lock is obtained for the set of registered obligation handlers.
+ *
+ * @param handler the handler to add to the list of registered handlers.
+ */
+ public void addObligationhandler(BaseObligationHandler handler) {
+ if (handler == null) {
+ return;
+ }
+
+ Lock writeLock = rwLock.writeLock();
+ writeLock.lock();
+ try {
+ obligationHandlers.add(handler);
+ } finally {
+ writeLock.unlock();
+ }
+ }
+
+ /**
+ * Adds a collection of obligation handler to the list of registered handlers
+ *
+ * This method waits until a write lock is obtained for the set of registered obligation handlers.
+ *
+ * @param handlers the collection of handlers to add to the list of registered handlers.
+ */
+ public void addObligationhandler(Collection handlers) {
+ if (handlers == null || handlers.isEmpty()) {
+ return;
+ }
+
+ Lock writeLock = rwLock.writeLock();
+ writeLock.lock();
+ try {
+ obligationHandlers.addAll(handlers);
+ } finally {
+ writeLock.unlock();
+ }
+ }
+
+ /**
+ * Removes an obligation handler from the list of registered handlers
+ *
+ * This method waits until a write lock is obtained for the set of registered obligation handlers.
+ *
+ * @param handler the handler to remove from the list of registered handlers.
+ */
+ public void removeObligationHandler(BaseObligationHandler handler) {
+ if (handler == null) {
+ return;
+ }
+
+ Lock writeLock = rwLock.writeLock();
+ writeLock.lock();
+ try {
+ obligationHandlers.remove(handler);
+ } finally {
+ writeLock.unlock();
+ }
+ }
+
+ /**
+ * Processes the obligations within the effective XACML policy.
+ *
+ * This method waits until a read lock is obtained for the set of registered obligation handlers.
+ *
+ * @param context current processing context
+ *
+ * @throws ObligationProcessingException thrown if there is a problem evaluating an obligation
+ */
+ public void processObligations(ObligationProcessingContext context) throws ObligationProcessingException {
+ Lock readLock = rwLock.readLock();
+ readLock.lock();
+ try {
+ Iterator handlerItr = obligationHandlers.iterator();
+ Map effectiveObligations = preprocessObligations(context);
+
+ BaseObligationHandler handler;
+ while (handlerItr.hasNext()) {
+ handler = handlerItr.next();
+ if (effectiveObligations.containsKey(handler.getObligationId())) {
+ handler.evaluateObligation(context, effectiveObligations.get(handler.getObligationId()));
+ }
+ }
+ } finally {
+ readLock.unlock();
+ }
+ }
+
+ /**
+ * Preprocesses the obligations returned within the result. This preprocessing determines the active effect, based
+ * on {@link org.opensaml.xacml.ctx.ResultType#getDecision()}, and creates an index that maps obligation IDs to the
+ * {@link ObligationType} returned by the PDP.
+ *
+ * @param context current processing context
+ *
+ * @return preprocessed obligations
+ */
+ protected Map preprocessObligations(ObligationProcessingContext context) {
+ HashMap effectiveObligations = new HashMap();
+
+ ObligationsType obligations = context.getAuthorizationDecisionResult().getObligations();
+ if (obligations == null || obligations.getObligations() == null) {
+ return effectiveObligations;
+ }
+
+ EffectType activeEffect;
+ if (context.getAuthorizationDecisionResult().getDecision().getDecision() == DECISION.Permit) {
+ activeEffect = EffectType.Permit;
+ } else {
+ activeEffect = EffectType.Deny;
+ }
+
+ for (ObligationType obligation : obligations.getObligations()) {
+ if (obligation != null && obligation.getFulfillOn() == activeEffect) {
+ effectiveObligations.put(obligation.getObligationId(), obligation);
+ }
+ }
+
+ return effectiveObligations;
+ }
+
+ /** Comparator used to order obligation handlers by precedence. */
+ private class ObligationHandlerComparator implements Comparator {
+
+ /** {@inheritDoc} */
+ public int compare(BaseObligationHandler o1, BaseObligationHandler o2) {
+ if (o1.getHandlerPrecedence() == o2.getHandlerPrecedence()) {
+ // If they have the same precedence sort lexigraphically
+ return o1.getObligationId().compareTo(o2.getObligationId());
+ }
+
+ if (o1.getHandlerPrecedence() < o2.getHandlerPrecedence()) {
+ return -1;
+ }
+
+ return 1;
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/impl/AbstractXACMLObject.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/impl/AbstractXACMLObject.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/impl/AbstractXACMLObject.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.impl;
+
+import org.opensaml.xacml.XACMLObject;
+import org.opensaml.xml.validation.AbstractValidatingXMLObject;
+
+/**
+ * An abstract implementation of XACMLObject.
+ */
+public abstract class AbstractXACMLObject extends AbstractValidatingXMLObject implements XACMLObject {
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI the namespace the element is in
+ * @param elementLocalName the local name of the XML element this Object represents
+ * @param namespacePrefix the prefix for the given namespace
+ */
+ protected AbstractXACMLObject(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/impl/AbstractXACMLObjectBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/impl/AbstractXACMLObjectBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/impl/AbstractXACMLObjectBuilder.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.impl;
+
+import org.opensaml.xacml.XACMLObject;
+import org.opensaml.xacml.XACMLObjectBuilder;
+import org.opensaml.xml.AbstractXMLObjectBuilder;
+
+/**
+ * Base builder for {@link XACMLObject}.
+ *
+ * @param the SAML object type built
+ */
+public abstract class AbstractXACMLObjectBuilder extends
+ AbstractXMLObjectBuilder implements XACMLObjectBuilder {
+
+ /**
+ * Builds a XACMLObject using the default name and namespace information provided XACML specifications.
+ *
+ * @return built XACMLObject
+ */
+ public abstract XACMLObjectType buildObject();
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/impl/AbstractXACMLObjectMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/impl/AbstractXACMLObjectMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/impl/AbstractXACMLObjectMarshaller.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.impl;
+
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.AbstractXMLObjectMarshaller;
+import org.opensaml.xml.io.MarshallingException;
+import org.w3c.dom.Element;
+
+/**
+ * A thread safe, abstract implementation of the {@link org.opensaml.xml.io.Marshaller} interface that handles most of
+ * the boilerplate code for Marshallers.
+ */
+public abstract class AbstractXACMLObjectMarshaller extends AbstractXMLObjectMarshaller {
+
+ /**
+ * Constructor.
+ *
+ */
+ public AbstractXACMLObjectMarshaller() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @deprecated no replacement
+ *
+ * @param targetNamespaceURI the namespace URI of either the schema type QName or element QName of the elements this
+ * marshaller operates on
+ * @param targetLocalName the local name of either the schema type QName or element QName of the elements this
+ * marshaller operates on
+ */
+ protected AbstractXACMLObjectMarshaller(String targetNamespaceURI, String targetLocalName) {
+ super(targetNamespaceURI, targetLocalName);
+ }
+
+ /**
+ * No-op method. Extending implementations should override this method if they have attributes to marshall into the
+ * Element.
+ *
+ * {@inheritDoc}
+ */
+ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
+
+ }
+
+ /**
+ * No-op method. Extending implementations should override this method if they have text content to marshall into
+ * the Element.
+ *
+ * {@inheritDoc}
+ */
+ protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException {
+
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/impl/AbstractXACMLObjectUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/impl/AbstractXACMLObjectUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/impl/AbstractXACMLObjectUnmarshaller.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.impl;
+
+import org.opensaml.xml.XMLObject;
+
+import org.opensaml.xml.io.AbstractXMLObjectUnmarshaller;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.w3c.dom.Attr;
+
+/**
+ * An thread safe abstract unmarshaller. This abstract marshaller only works with
+ * {@link AbstractXACMLObject}.
+ */
+public abstract class AbstractXACMLObjectUnmarshaller extends AbstractXMLObjectUnmarshaller {
+
+ /**
+ * Constructor.
+ *
+ * @deprecated no replacement
+ *
+ * @param targetNamespaceURI the namespace URI of either the schema type QName or element QName of the elements this
+ * unmarshaller operates on
+ * @param targetLocalName the local name of either the schema type QName or element QName of the elements this
+ * unmarshaller operates on
+ */
+ protected AbstractXACMLObjectUnmarshaller(String targetNamespaceURI, String targetLocalName) {
+ super(targetNamespaceURI, targetLocalName);
+ }
+
+
+ /**
+ * Constructor.
+ */
+ public AbstractXACMLObjectUnmarshaller() {
+ super();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
+ throws UnmarshallingException {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void processElementContent(XMLObject xmlObject, String elementContent) {
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/ReferencedPoliciesTypeImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/ReferencedPoliciesTypeImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/ReferencedPoliciesTypeImpl.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xacml.policy.PolicySetType;
+import org.opensaml.xacml.policy.PolicyType;
+import org.opensaml.xacml.profile.saml.ReferencedPoliciesType;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.util.XMLObjectChildrenList;
+
+/**
+ * Implementation of {@link ReferencedPoliciesType}.
+ */
+public class ReferencedPoliciesTypeImpl extends AbstractSAMLObject implements ReferencedPoliciesType {
+
+ /**List of policies.*/
+ private XMLObjectChildrenList policies;
+
+ /**List of policieSets.*/
+ private XMLObjectChildrenList policieSets;
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI the namespace the element is in
+ * @param elementLocalName the local name of the XML element this Object represents
+ * @param namespacePrefix the prefix for the given namespace
+ */
+ protected ReferencedPoliciesTypeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ policies = new XMLObjectChildrenList(this);
+ policieSets = new XMLObjectChildrenList(this);
+ }
+
+ /** {@inheritDoc} */
+ public List getPolicySets() {
+ return policieSets;
+ }
+
+ /** {@inheritDoc} */
+ public List getPolicies() {
+ return policies;
+ }
+
+ /** {@inheritDoc} */
+ public List getOrderedChildren() {
+ ArrayList children = new ArrayList();
+
+ if(!policies.isEmpty()) {
+ children.addAll(policies);
+ }
+ if(!policieSets.isEmpty()) {
+ children.addAll(policieSets);
+ }
+ return Collections.unmodifiableList(children);
+ }
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/ReferencedPoliciesTypeImplBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/ReferencedPoliciesTypeImplBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/ReferencedPoliciesTypeImplBuilder.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+import org.opensaml.xacml.XACMLObjectBuilder;
+import org.opensaml.xacml.profile.saml.ReferencedPoliciesType;
+
+/**
+ * Builder for {@link ReferencedPoliciesType}.
+ */
+public class ReferencedPoliciesTypeImplBuilder extends AbstractSAMLObjectBuilder
+implements XACMLObjectBuilder{
+
+ /** {@inheritDoc} */
+ public ReferencedPoliciesType buildObject() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public ReferencedPoliciesType buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new ReferencedPoliciesTypeImpl(namespaceURI,localName,namespacePrefix);
+ }
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/ReferencedPoliciesTypeMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/ReferencedPoliciesTypeMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/ReferencedPoliciesTypeMarshaller.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+
+/**
+ * Marshaller for {@link org.opensaml.xacml.profile.saml.ReferencedPoliciesType}.
+ */
+public class ReferencedPoliciesTypeMarshaller extends AbstractSAMLObjectMarshaller {
+
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/ReferencedPoliciesTypeUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/ReferencedPoliciesTypeUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/ReferencedPoliciesTypeUnmarshaller.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xacml.policy.PolicySetType;
+import org.opensaml.xacml.policy.PolicyType;
+import org.opensaml.xacml.profile.saml.ReferencedPoliciesType;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+
+/**
+ * Unmarshaller for {@link ReferencedPoliciesType}.
+ */
+public class ReferencedPoliciesTypeUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+ /** {@inheritDoc} */
+ protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
+ ReferencedPoliciesType referencedpoliciesType = (ReferencedPoliciesType) parentObject;
+
+ if (childObject instanceof PolicyType) {
+ referencedpoliciesType.getPolicies().add((PolicyType) childObject);
+ } else if (childObject instanceof PolicySetType) {
+ referencedpoliciesType.getPolicySets().add((PolicySetType) childObject);
+ }
+ }
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionQueryTypeImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionQueryTypeImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionQueryTypeImpl.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,214 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.saml2.core.impl.RequestAbstractTypeImpl;
+import org.opensaml.xacml.ctx.RequestType;
+import org.opensaml.xacml.policy.PolicySetType;
+import org.opensaml.xacml.policy.PolicyType;
+import org.opensaml.xacml.profile.saml.ReferencedPoliciesType;
+import org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.schema.XSBooleanValue;
+import org.opensaml.xml.util.XMLObjectChildrenList;
+
+/** A concrete implementation of {@link XACMLAuthzDecisionQueryType}. */
+public class XACMLAuthzDecisionQueryTypeImpl extends RequestAbstractTypeImpl implements XACMLAuthzDecisionQueryType {
+
+ /** Policy children. */
+ private List policies;
+
+ /** PolicySet children. */
+ private List policySets;
+
+ /** ReeferencedPolicies child. */
+ private ReferencedPoliciesType referencedPolicies;
+
+ /** The xacml-context:Request. */
+ private RequestType request;
+
+ /** InputContextOnly attribute value. Default = false. */
+ private XSBooleanValue inputContextOnly;
+
+ /** ReturnContext attribute value.Default = false. */
+ private XSBooleanValue returnContext;
+
+ /** CombinePolicies attribute value. Default = true. */
+ private XSBooleanValue combinePolicies;
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI the namespace the element is in
+ * @param elementLocalName the local name of the XML element this Object represents
+ * @param namespacePrefix the prefix for the given namespace
+ */
+ protected XACMLAuthzDecisionQueryTypeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ setElementNamespacePrefix(namespacePrefix);
+ policies = new XMLObjectChildrenList(this);
+ policySets = new XMLObjectChildrenList(this);
+ }
+
+ /** {@inheritDoc} */
+ public XSBooleanValue getCombinePoliciesXSBooleanValue() {
+ return combinePolicies;
+ }
+
+ /** {@inheritDoc} */
+ public XSBooleanValue getInputContextOnlyXSBooleanValue() {
+ return inputContextOnly;
+ }
+
+ /** {@inheritDoc} */
+ public List getOrderedChildren() {
+ ArrayList children = new ArrayList();
+
+ if (super.getOrderedChildren() != null) {
+ children.addAll(super.getOrderedChildren());
+ }
+ if (request != null) {
+ children.add(request);
+ }
+
+ if (!policies.isEmpty()) {
+ children.addAll(policies);
+ }
+
+ if (!policySets.isEmpty()) {
+ children.addAll(policySets);
+ }
+
+ if (referencedPolicies != null) {
+ children.add(referencedPolicies);
+ }
+
+ return Collections.unmodifiableList(children);
+ }
+
+ /** {@inheritDoc} */
+ public RequestType getRequest() {
+ return request;
+ }
+
+ /** {@inheritDoc} */
+ public XSBooleanValue getReturnContextXSBooleanValue() {
+ return returnContext;
+ }
+
+ /** {@inheritDoc} */
+ public Boolean isCombinePolicies() {
+ if (combinePolicies != null) {
+ return combinePolicies.getValue();
+ }
+
+ return Boolean.TRUE;
+ }
+
+ /** {@inheritDoc} */
+ public Boolean isInputContextOnly() {
+ if (inputContextOnly != null) {
+ return inputContextOnly.getValue();
+ }
+
+ return Boolean.FALSE;
+ }
+
+ /** {@inheritDoc} */
+ public Boolean isReturnContext() {
+ if (returnContext != null) {
+ return returnContext.getValue();
+ }
+
+ return Boolean.FALSE;
+ }
+
+ /** {@inheritDoc} */
+ public void setCombinePolicies(XSBooleanValue combinePolicies) {
+ this.combinePolicies = prepareForAssignment(this.combinePolicies, combinePolicies);
+ }
+
+ /** {@inheritDoc} */
+ public void setCombinePolicies(Boolean combinePolicies) {
+ if (combinePolicies != null) {
+ this.combinePolicies = prepareForAssignment(this.combinePolicies,
+ new XSBooleanValue(combinePolicies, false));
+ } else {
+ this.combinePolicies = prepareForAssignment(this.combinePolicies, null);
+ }
+
+ }
+
+ /** {@inheritDoc} */
+ public void setInputContextOnly(XSBooleanValue inputContextOnly) {
+ this.inputContextOnly = prepareForAssignment(this.inputContextOnly, inputContextOnly);
+ }
+
+ /** {@inheritDoc} */
+ public void setInputContextOnly(Boolean inputContextOnly) {
+ if (inputContextOnly != null) {
+ this.inputContextOnly = prepareForAssignment(this.inputContextOnly, new XSBooleanValue(inputContextOnly,
+ false));
+ } else {
+ this.inputContextOnly = prepareForAssignment(this.inputContextOnly, null);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void setRequest(RequestType request) {
+ this.request = prepareForAssignment(this.request, request);
+ }
+
+ /** {@inheritDoc} */
+ public void setReturnContext(XSBooleanValue returnContext) {
+ this.returnContext = prepareForAssignment(this.returnContext, returnContext);
+ }
+
+ /** {@inheritDoc} */
+ public void setReturnContext(Boolean returnContext) {
+ if (returnContext != null) {
+ this.returnContext = prepareForAssignment(this.returnContext, new XSBooleanValue(returnContext, false));
+ } else {
+ this.returnContext = prepareForAssignment(this.returnContext, null);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public List getPolicies() {
+ return policies;
+ }
+
+ /** {@inheritDoc} */
+ public List getPolicySets() {
+ return policySets;
+ }
+
+ /** {@inheritDoc} */
+ public ReferencedPoliciesType getReferencedPolicies() {
+ return referencedPolicies;
+ }
+
+ /** {@inheritDoc} */
+ public void setReferencedPolicies(ReferencedPoliciesType policies) {
+ referencedPolicies = prepareForAssignment(referencedPolicies, policies);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionQueryTypeImplBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionQueryTypeImplBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionQueryTypeImplBuilder.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+import org.opensaml.xacml.XACMLObjectBuilder;
+import org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType;
+
+/** Builder for {@link XACMLAuthzDecisionQueryType} objects. */
+public class XACMLAuthzDecisionQueryTypeImplBuilder extends AbstractSAMLObjectBuilder
+ implements XACMLObjectBuilder {
+
+ /** Constructor. */
+ public XACMLAuthzDecisionQueryTypeImplBuilder() {
+
+ }
+
+ /** {@inheritDoc} */
+ public XACMLAuthzDecisionQueryType buildObject() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public XACMLAuthzDecisionQueryType buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new XACMLAuthzDecisionQueryTypeImpl(namespaceURI, localName, namespacePrefix);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionQueryTypeMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionQueryTypeMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionQueryTypeMarshaller.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import org.opensaml.saml2.core.impl.RequestAbstractTypeMarshaller;
+import org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.w3c.dom.Element;
+
+/**
+ * A thread-safe Marshaller for {@link org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType} objects.
+ */
+public class XACMLAuthzDecisionQueryTypeMarshaller extends RequestAbstractTypeMarshaller {
+
+ /** {@inheritDoc} */
+ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
+ XACMLAuthzDecisionQueryType query = (XACMLAuthzDecisionQueryType) samlObject;
+
+ if (query.getInputContextOnlyXSBooleanValue() != null) {
+ domElement.setAttributeNS(null, XACMLAuthzDecisionQueryType.INPUTCONTEXTONLY_ATTRIB_NAME, query
+ .getInputContextOnlyXSBooleanValue().toString());
+ }
+
+ if (query.getReturnContextXSBooleanValue() != null) {
+ domElement.setAttributeNS(null, XACMLAuthzDecisionQueryType.RETURNCONTEXT_ATTRIB_NAME, query
+ .getReturnContextXSBooleanValue().toString());
+ }
+
+ if (query.getCombinePoliciesXSBooleanValue() != null) {
+ domElement.setAttributeNS(null, XACMLAuthzDecisionQueryType.COMBINEPOLICIES_ATTRIB_NAME, query
+ .getCombinePoliciesXSBooleanValue().toString());
+ }
+
+ super.marshallAttributes(samlObject, domElement);
+ }
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionQueryTypeUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionQueryTypeUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionQueryTypeUnmarshaller.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import org.opensaml.saml2.core.impl.RequestAbstractTypeUnmarshaller;
+import org.opensaml.xacml.ctx.RequestType;
+import org.opensaml.xacml.policy.PolicySetType;
+import org.opensaml.xacml.policy.PolicyType;
+import org.opensaml.xacml.profile.saml.ReferencedPoliciesType;
+import org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.schema.XSBooleanValue;
+import org.w3c.dom.Attr;
+
+/**
+ * A thread-safe Unmarshaller for {@link org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType} objects.
+ */
+public class XACMLAuthzDecisionQueryTypeUnmarshaller extends RequestAbstractTypeUnmarshaller {
+
+ /** {@inheritDoc} */
+ protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
+ XACMLAuthzDecisionQueryType xacmlauthzdecisionquery = (XACMLAuthzDecisionQueryType) parentObject;
+
+ if (childObject instanceof RequestType) {
+ xacmlauthzdecisionquery.setRequest((RequestType) childObject);
+ } else if (childObject instanceof PolicyType) {
+ xacmlauthzdecisionquery.getPolicies().add((PolicyType) childObject);
+ } else if (childObject instanceof PolicySetType) {
+ xacmlauthzdecisionquery.getPolicySets().add((PolicySetType) childObject);
+ } else if (childObject instanceof ReferencedPoliciesType) {
+ xacmlauthzdecisionquery.setReferencedPolicies((ReferencedPoliciesType) childObject);
+ } else {
+ super.processChildElement(parentObject, childObject);
+ }
+ }
+
+ /** {@inheritDoc} */
+ protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
+ XACMLAuthzDecisionQueryType authzDS = (XACMLAuthzDecisionQueryType) samlObject;
+
+ if (attribute.getLocalName().equals(XACMLAuthzDecisionQueryType.INPUTCONTEXTONLY_ATTRIB_NAME)) {
+ authzDS.setInputContextOnly(XSBooleanValue.valueOf(attribute.getValue()));
+ }
+
+ if (attribute.getLocalName().equals(XACMLAuthzDecisionQueryType.RETURNCONTEXT_ATTRIB_NAME)) {
+ authzDS.setReturnContext(XSBooleanValue.valueOf(attribute.getValue()));
+ }
+
+ if (attribute.getLocalName().equals(XACMLAuthzDecisionQueryType.COMBINEPOLICIES_ATTRIB_NAME)) {
+ authzDS.setCombinePolicies(XSBooleanValue.valueOf(attribute.getValue()));
+ }
+
+ super.processAttribute(samlObject, attribute);
+ }
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionStatementTypeImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionStatementTypeImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionStatementTypeImpl.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xacml.ctx.RequestType;
+import org.opensaml.xacml.ctx.ResponseType;
+import org.opensaml.xacml.profile.saml.XACMLAuthzDecisionStatementType;
+import org.opensaml.xml.XMLObject;
+
+/** A concrete implementation of {@link org.opensaml.xacml.profile.saml.XACMLAuthzDecisionStatementType}. */
+public class XACMLAuthzDecisionStatementTypeImpl extends AbstractSAMLObject implements XACMLAuthzDecisionStatementType {
+
+ /** The request of the authorization request. */
+ private RequestType request;
+
+ /** The response of the authorization request. */
+ private ResponseType response;
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI the namespace the element is in
+ * @param elementLocalName the local name of the XML element this Object represents
+ * @param namespacePrefix the prefix for the given namespace
+ */
+ protected XACMLAuthzDecisionStatementTypeImpl(String namespaceURI, String elementLocalName,
+ String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /** {@inheritDoc} */
+ public RequestType getRequest() {
+ return request;
+ }
+
+ /** {@inheritDoc} */
+ public ResponseType getResponse() {
+ return response;
+ }
+
+ /** {@inheritDoc} */
+ public void setRequest(RequestType request) {
+ this.request = prepareForAssignment(this.request, request);
+ }
+
+ /** {@inheritDoc} */
+ public void setResponse(ResponseType response) {
+ this.response = prepareForAssignment(this.response, response);
+ }
+
+ /** {@inheritDoc} */
+ public List getOrderedChildren() {
+ ArrayList children = new ArrayList();
+
+ if (request != null) {
+ children.add(request);
+ }
+ if (response != null) {
+ children.add(response);
+ }
+
+ return Collections.unmodifiableList(children);
+ }
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionStatementTypeImplBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionStatementTypeImplBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionStatementTypeImplBuilder.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+import org.opensaml.saml2.core.Statement;
+import org.opensaml.xacml.profile.saml.XACMLAuthzDecisionStatementType;
+
+/** vBuilder for {@link org.opensaml.xacml.profile.saml.impl.XACMLAuthzDecisionStatementTypeImpl} objects. */
+public class XACMLAuthzDecisionStatementTypeImplBuilder extends
+ AbstractSAMLObjectBuilder {
+
+ /** Constructor. */
+ public XACMLAuthzDecisionStatementTypeImplBuilder() {
+
+ }
+
+ /** {@inheritDoc} */
+ public XACMLAuthzDecisionStatementType buildObject() {
+ return buildObject(Statement.DEFAULT_ELEMENT_NAME, XACMLAuthzDecisionStatementType.TYPE_NAME);
+ }
+
+ /** {@inheritDoc} */
+ public XACMLAuthzDecisionStatementType buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new XACMLAuthzDecisionStatementTypeImpl(namespaceURI, localName, namespacePrefix);
+ }
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionStatementTypeMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionStatementTypeMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionStatementTypeMarshaller.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+
+/**
+ * A thread-safe Marshaller for {@link org.opensaml.xacml.profile.saml.XACMLAuthzDecisionStatementType}. New 27/07/2007
+ */
+public class XACMLAuthzDecisionStatementTypeMarshaller extends AbstractSAMLObjectMarshaller {
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionStatementTypeUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionStatementTypeUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLAuthzDecisionStatementTypeUnmarshaller.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xacml.ctx.RequestType;
+import org.opensaml.xacml.ctx.ResponseType;
+import org.opensaml.xacml.profile.saml.XACMLAuthzDecisionStatementType;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+
+/**
+ * A thread-safe Unmarshaller for {@link org.opensaml.xacml.profile.saml.XACMLAuthzDecisionStatementType}.
+ */
+public class XACMLAuthzDecisionStatementTypeUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+ /** {@inheritDoc} */
+ protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
+ XACMLAuthzDecisionStatementType xacmlauthzdecisionstatement = (XACMLAuthzDecisionStatementType) parentObject;
+
+ if (childObject instanceof RequestType) {
+ xacmlauthzdecisionstatement.setRequest((RequestType) childObject);
+ } else if (childObject instanceof ResponseType) {
+ xacmlauthzdecisionstatement.setResponse((ResponseType) childObject);
+ } else {
+ super.processChildElement(parentObject, childObject);
+ }
+ }
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyQueryTypeImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyQueryTypeImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyQueryTypeImpl.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.saml2.core.impl.RequestAbstractTypeImpl;
+import org.opensaml.xacml.XACMLObject;
+import org.opensaml.xacml.ctx.RequestType;
+import org.opensaml.xacml.policy.IdReferenceType;
+import org.opensaml.xacml.profile.saml.XACMLPolicyQueryType;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.util.IndexedXMLObjectChildrenList;
+
+/** Concrete implementation of {@link XACMLPolicyQueryType}. */
+public class XACMLPolicyQueryTypeImpl extends RequestAbstractTypeImpl implements XACMLPolicyQueryType {
+
+ /** Choice group for the element. */
+ private IndexedXMLObjectChildrenList choiceGroup;
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI the namespace the element is in
+ * @param elementLocalName the local name of the XML element this Object represents
+ * @param namespacePrefix the prefix for the given namespace
+ */
+ public XACMLPolicyQueryTypeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ setElementNamespacePrefix(namespacePrefix);
+ choiceGroup = new IndexedXMLObjectChildrenList(this);
+ }
+
+ /** {@inheritDoc} */
+ public List getRequests() {
+ return (List) choiceGroup.subList(RequestType.DEFAULT_ELEMENT_NAME);
+ }
+
+ /** {@inheritDoc} */
+ public List getPolicySetIdReferences() {
+ return (List) choiceGroup.subList(IdReferenceType.POLICY_SET_ID_REFERENCE_ELEMENT_NAME);
+ }
+
+ /** {@inheritDoc} */
+ public List getPolicyIdReferences() {
+ return (List) choiceGroup.subList(IdReferenceType.POLICY_ID_REFERENCE_ELEMENT_NAME);
+ }
+
+ /** {@inheritDoc} */
+ public List getOrderedChildren() {
+
+ ArrayList children = new ArrayList();
+
+ if(super.getOrderedChildren() != null){
+ children.addAll(super.getOrderedChildren());
+ }
+
+ children.addAll(choiceGroup);
+
+ return Collections.unmodifiableList(children);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyQueryTypeImplBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyQueryTypeImplBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyQueryTypeImplBuilder.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+import org.opensaml.xacml.profile.saml.XACMLPolicyQueryType;
+
+/** Builder for {@link org.opensaml.xacml.profile.saml.XACMLPolicyQueryType} objects. */
+public class XACMLPolicyQueryTypeImplBuilder extends AbstractSAMLObjectBuilder {
+
+ /** Constructor. */
+ public XACMLPolicyQueryTypeImplBuilder() {
+
+ }
+
+ /** {@inheritDoc} */
+ public XACMLPolicyQueryType buildObject() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public XACMLPolicyQueryType buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new XACMLPolicyQueryTypeImpl(namespaceURI, localName, namespacePrefix);
+ }
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyQueryTypeMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyQueryTypeMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyQueryTypeMarshaller.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import org.opensaml.saml2.core.impl.RequestAbstractTypeMarshaller;
+
+/** Marshaller for {@link org.opensaml.xacml.profile.saml.XACMLPolicyQueryType}. */
+public class XACMLPolicyQueryTypeMarshaller extends RequestAbstractTypeMarshaller {
+
+}
\ No newline at end of file
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyQueryTypeUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyQueryTypeUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyQueryTypeUnmarshaller.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import org.opensaml.saml2.core.impl.RequestAbstractTypeUnmarshaller;
+import org.opensaml.xacml.ctx.RequestType;
+import org.opensaml.xacml.policy.IdReferenceType;
+import org.opensaml.xacml.profile.saml.XACMLPolicyQueryType;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+
+/** Unmarshaller for {@link XACMLPolicyQueryType}. */
+public class XACMLPolicyQueryTypeUnmarshaller extends RequestAbstractTypeUnmarshaller {
+
+ /** {@inheritDoc} */
+ protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
+ XACMLPolicyQueryType xacmlpolicyquery = (XACMLPolicyQueryType) parentObject;
+
+ if (childObject instanceof RequestType) {
+ xacmlpolicyquery.getRequests().add((RequestType) childObject);
+ } else if (childObject.getElementQName().equals(IdReferenceType.POLICY_ID_REFERENCE_ELEMENT_NAME)) {
+ xacmlpolicyquery.getPolicyIdReferences().add((IdReferenceType) childObject);
+ } else if (childObject.getElementQName().equals(IdReferenceType.POLICY_SET_ID_REFERENCE_ELEMENT_NAME)) {
+ xacmlpolicyquery.getPolicySetIdReferences().add((IdReferenceType) childObject);
+ } else {
+ super.processChildElement(parentObject, childObject);
+ }
+ }
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyStatementTypeImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyStatementTypeImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyStatementTypeImpl.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.common.impl.AbstractSAMLObject;
+import org.opensaml.xacml.XACMLObject;
+import org.opensaml.xacml.policy.PolicySetType;
+import org.opensaml.xacml.policy.PolicyType;
+import org.opensaml.xacml.profile.saml.ReferencedPoliciesType;
+import org.opensaml.xacml.profile.saml.XACMLPolicyStatementType;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.util.IndexedXMLObjectChildrenList;
+
+/** Concrete implementation of {@link XACMLPolicyStatementType}. */
+public class XACMLPolicyStatementTypeImpl extends AbstractSAMLObject implements XACMLPolicyStatementType {
+
+ /** Choice group in element. */
+ private IndexedXMLObjectChildrenList choiceGroup;
+
+ /** ReferencedPolicie child. */
+ private ReferencedPoliciesType referencedPolicies;
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI the namespace the element is in
+ * @param elementLocalName the local name of the XML element this Object represents
+ * @param namespacePrefix the prefix for the given namespace
+ */
+ protected XACMLPolicyStatementTypeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ choiceGroup = new IndexedXMLObjectChildrenList(this);
+ }
+
+ /** {@inheritDoc} */
+ public List getOrderedChildren() {
+ ArrayList children = new ArrayList();
+
+ children.addAll(choiceGroup);
+
+ if (referencedPolicies != null) {
+ children.add(referencedPolicies);
+ }
+
+ return Collections.unmodifiableList(children);
+ }
+
+ /** {@inheritDoc} */
+ public List getPolicies() {
+ return (List) choiceGroup.subList(PolicyType.DEFAULT_ELEMENT_NAME);
+ }
+
+ /** {@inheritDoc} */
+ public List getPolicySets() {
+ return (List) choiceGroup.subList(PolicySetType.DEFAULT_ELEMENT_NAME);
+ }
+
+ /** {@inheritDoc} */
+ public ReferencedPoliciesType getReferencedPolicies() {
+ return referencedPolicies;
+ }
+
+ /** {@inheritDoc} */
+ public void setReferencedPolicies(ReferencedPoliciesType policies) {
+ referencedPolicies = prepareForAssignment(referencedPolicies, policies);
+ }
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyStatementTypeImplBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyStatementTypeImplBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyStatementTypeImplBuilder.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+import org.opensaml.saml2.core.Statement;
+import org.opensaml.xacml.profile.saml.XACMLPolicyStatementType;
+
+/** Builder for {@link org.opensaml.xacml.profile.saml.impl.XACMLPolicyStatementTypeImpl} objects. */
+public class XACMLPolicyStatementTypeImplBuilder extends AbstractSAMLObjectBuilder {
+
+ /** Constructor. */
+ public XACMLPolicyStatementTypeImplBuilder() {
+
+ }
+
+ /** {@inheritDoc} */
+ public XACMLPolicyStatementType buildObject() {
+ return buildObject(Statement.DEFAULT_ELEMENT_NAME, XACMLPolicyStatementType.TYPE_NAME);
+ }
+
+ /** {@inheritDoc} */
+ public XACMLPolicyStatementType buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new XACMLPolicyStatementTypeImpl(namespaceURI, localName, namespacePrefix);
+ }
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyStatementTypeMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyStatementTypeMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyStatementTypeMarshaller.java 17 Aug 2012 15:04:54 -0000 1.1
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
+
+/** A thread-safe Marshaller for {@link org.opensaml.xacml.profile.saml.XACMLAuthzDecisionStatementType}. */
+public class XACMLPolicyStatementTypeMarshaller extends AbstractSAMLObjectMarshaller {
+
+}
Index: 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyStatementTypeUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyStatementTypeUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/opensaml/org/opensaml/xacml/profile/saml/impl/XACMLPolicyStatementTypeUnmarshaller.java 17 Aug 2012 15:04:53 -0000 1.1
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.xacml.profile.saml.impl;
+
+import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
+import org.opensaml.xacml.policy.PolicySetType;
+import org.opensaml.xacml.policy.PolicyType;
+import org.opensaml.xacml.profile.saml.ReferencedPoliciesType;
+import org.opensaml.xacml.profile.saml.XACMLPolicyStatementType;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+
+/**
+ * A thread-safe Unmarshaller for {@link org.opensaml.xacml.profile.saml.XACMLAuthzDecisionStatementType}.
+ */
+public class XACMLPolicyStatementTypeUnmarshaller extends AbstractSAMLObjectUnmarshaller {
+
+ /** {@inheritDoc} */
+ protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
+ XACMLPolicyStatementType xacmlpolicystatement = (XACMLPolicyStatementType) parentObject;
+
+ if (childObject instanceof PolicyType) {
+ xacmlpolicystatement.getPolicies().add((PolicyType) childObject);
+ } else if (childObject instanceof PolicySetType) {
+ xacmlpolicystatement.getPolicySets().add((PolicySetType) childObject);
+ } else if (childObject instanceof ReferencedPoliciesType) {
+ xacmlpolicystatement.setReferencedPolicies((ReferencedPoliciesType) childObject);
+ } else {
+ super.processChildElement(parentObject, childObject);
+ }
+ }
+
+}
Index: 3rdParty_sources/openws/org/opensaml/util/SimpleURLCanonicalizer.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/SimpleURLCanonicalizer.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/SimpleURLCanonicalizer.java 17 Aug 2012 15:09:10 -0000 1.1
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * This class performs simple canonicalization of a URL as follows:
+ *
+ *
+ *
+ * - The scheme is lower-cased.
+ * - The hostname is lower-cased
+ * - The port is removed if it is the default port registered for the scheme
+ *
+ *
+ *
+ *
+ *
+ */
+public final class SimpleURLCanonicalizer {
+
+ /** The scheme-to-port mapping data. */
+ private static Map schemePortMap = new HashMap();
+
+ /** Constructor to prevent instantiation. */
+ private SimpleURLCanonicalizer() {}
+
+ /**
+ * Register a new scheme-to-port mapping.
+ *
+ * @param scheme the scheme to register
+ * @param port the default port for that scheme
+ */
+ public static void registerSchemePortMapping(String scheme, Integer port) {
+ if (scheme == null || port == null) {
+ throw new IllegalArgumentException("Scheme and port may not be null");
+ }
+ schemePortMap.put(scheme.toLowerCase(), port);
+ }
+
+ /**
+ * Deregister a scheme-to-port mapping.
+ *
+ * @param scheme the scheme to deregister
+ */
+ public static void deregisterSchemePortMapping(String scheme) {
+ if (scheme == null) {
+ throw new IllegalArgumentException("Scheme may not be null");
+ }
+ schemePortMap.remove(scheme.toLowerCase());
+ }
+
+ /**
+ * Obtain the default port registered for a scheme.
+ *
+ * @param scheme the scheme to look up
+ * @return the default port registered for the scheme, or null if none registered
+ */
+ public static Integer getRegisteredPort(String scheme) {
+ return schemePortMap.get(scheme.toLowerCase());
+ }
+
+ /**
+ * Canonicalize the supplied URL.
+ *
+ * @param url the URL to canonicalize
+ * @return the canonicalized URL
+ */
+ public static String canonicalize(String url) {
+ URLBuilder urlBuilder = new URLBuilder(url);
+ canonicalize(urlBuilder);
+ return urlBuilder.buildURL();
+ }
+
+ /**
+ * Canonicalize the supplied URLBuilder data.
+ *
+ * @param url the URLBuilder to canonicalize
+ */
+ private static void canonicalize(URLBuilder url) {
+ if (url.getScheme() != null) {
+ url.setScheme(url.getScheme().toLowerCase());
+
+ String scheme = url.getScheme();
+ Integer port = getRegisteredPort(scheme);
+ if (port != null && port == url.getPort()) {
+ url.setPort(0);
+ }
+ }
+
+ if (url.getHost() != null) {
+ url.setHost(url.getHost().toLowerCase());
+ }
+ }
+
+ static {
+ registerSchemePortMapping("ftp", 23);
+ registerSchemePortMapping("http", 80);
+ registerSchemePortMapping("https", 443);
+ }
+
+}
Index: 3rdParty_sources/openws/org/opensaml/util/URLBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/URLBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/URLBuilder.java 17 Aug 2012 15:09:10 -0000 1.1
@@ -0,0 +1,346 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.opensaml.ws.transport.http.HTTPTransportUtils;
+import org.opensaml.xml.util.DatatypeHelper;
+import org.opensaml.xml.util.Pair;
+
+/**
+ * Utility class for building URLs. May also be used to parse a URL into its invidual components. All components will be
+ * converted UTF-8 encoding and then application/x-www-form-urlencoded when built.
+ *
+ * This class is not thread-safe.
+ */
+public class URLBuilder {
+
+ /** URL schema (http, https, etc). */
+ private String scheme;
+
+ /** User name in the URL. */
+ private String username;
+
+ /** Password in the URL. */
+ private String password;
+
+ /** Host for the URL. */
+ private String host;
+
+ /** URL port number. */
+ private int port;
+
+ /** URL path. */
+ private String path;
+
+ /** Parameters in the query string. */
+ private List> queryParams;
+
+ /** URL fragment. */
+ private String fragement;
+
+ /**
+ * Constructor.
+ */
+ public URLBuilder() {
+ queryParams = new ArrayList>();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param baseURL URL to parse and use as basis for creating other URLs
+ *
+ * @throws IllegalArgumentException thrown if the given base URL is not well formed
+ */
+ public URLBuilder(String baseURL) {
+ try {
+ URL url = new URL(baseURL);
+
+ setScheme(url.getProtocol());
+
+ String userInfo = url.getUserInfo();
+ if (!DatatypeHelper.isEmpty(userInfo)) {
+ if (userInfo.contains(":")) {
+ String[] userInfoComps = userInfo.split(":");
+ setUsername(HTTPTransportUtils.urlDecode(userInfoComps[0]));
+ setPassword(HTTPTransportUtils.urlDecode(userInfoComps[1]));
+ } else {
+ setUsername(userInfo);
+ }
+ }
+
+ setHost(url.getHost());
+ setPort(url.getPort());
+ setPath(url.getPath());
+
+ queryParams = new ArrayList>();
+ String queryString = url.getQuery();
+ if (!DatatypeHelper.isEmpty(queryString)) {
+ String[] queryComps = queryString.split("&");
+ String queryComp;
+ String[] paramComps;
+ String paramName;
+ String paramValue;
+ for (int i = 0; i < queryComps.length; i++) {
+ queryComp = queryComps[i];
+ if (!queryComp.contains("=")) {
+ paramName = HTTPTransportUtils.urlDecode(queryComp);
+ queryParams.add(new Pair(paramName, null));
+ } else {
+ paramComps = queryComp.split("=");
+ paramName = HTTPTransportUtils.urlDecode(paramComps[0]);
+ paramValue = HTTPTransportUtils.urlDecode(paramComps[1]);
+ queryParams.add(new Pair(paramName, paramValue));
+ }
+ }
+ }
+
+ setFragment(url.getRef());
+ } catch (MalformedURLException e) {
+ throw new IllegalArgumentException("Given URL is not well formed", e);
+ }
+ }
+
+ /**
+ * Gets the URL fragment in its decoded form.
+ *
+ * @return URL fragment in its decoded form
+ */
+ public String getFragment() {
+ return fragement;
+ }
+
+ /**
+ * Sets the URL fragment in its decoded form.
+ *
+ * @param newFragment URL fragment in its decoded form
+ */
+ public void setFragment(String newFragment) {
+ fragement = DatatypeHelper.safeTrimOrNullString(newFragment);
+ }
+
+ /**
+ * Gets the host component of the URL.
+ *
+ * @return host component of the URL
+ */
+ public String getHost() {
+ return host;
+ }
+
+ /**
+ * Sets the host component of the URL.
+ *
+ * @param newHost host component of the URL
+ */
+ public void setHost(String newHost) {
+ host = DatatypeHelper.safeTrimOrNullString(newHost);
+ }
+
+ /**
+ * Gets the user's password in the URL.
+ *
+ * @return user's password in the URL
+ */
+ public String getPassword() {
+ return password;
+ }
+
+ /**
+ * Sets the user's password in the URL.
+ *
+ * @param newPassword user's password in the URL
+ */
+ public void setPassword(String newPassword) {
+ password = DatatypeHelper.safeTrimOrNullString(newPassword);
+ }
+
+ /**
+ * Gets the path component of the URL.
+ *
+ * @return path component of the URL
+ */
+ public String getPath() {
+ return path;
+ }
+
+ /**
+ * Sets the path component of the URL.
+ *
+ * @param newPath path component of the URL
+ */
+ public void setPath(String newPath) {
+ path = DatatypeHelper.safeTrimOrNullString(newPath);
+ }
+
+ /**
+ * Gets the port component of the URL.
+ *
+ * @return port component of the URL
+ */
+ public int getPort() {
+ return port;
+ }
+
+ /**
+ * Sets the port component of the URL.
+ *
+ * @param newPort port component of the URL
+ */
+ public void setPort(int newPort) {
+ port = newPort;
+ }
+
+ /**
+ * Gets the query string parameters for the URL. Params may be added and removed through the map interface.
+ *
+ * @return query string parameters for the URL
+ */
+ public List> getQueryParams() {
+ return queryParams;
+ }
+
+ /**
+ * Gets the URL scheme (http, https, etc).
+ *
+ * @return URL scheme (http, https, etc)
+ */
+ public String getScheme() {
+ return scheme;
+ }
+
+ /**
+ * Sets the URL scheme (http, https, etc).
+ *
+ * @param newScheme URL scheme (http, https, etc)
+ */
+ public void setScheme(String newScheme) {
+ scheme = DatatypeHelper.safeTrimOrNullString(newScheme);
+ }
+
+ /**
+ * Gets the user name component of the URL.
+ *
+ * @return user name component of the URL
+ */
+ public String getUsername() {
+ return username;
+ }
+
+ /**
+ * Sets the user name component of the URL.
+ *
+ * @param newUsername user name component of the URL
+ */
+ public void setUsername(String newUsername) {
+ username = DatatypeHelper.safeTrimOrNullString(newUsername);
+ }
+
+ /**
+ * Builds a URL from the given data. The constructured URL may not be valid if sufficient information is not
+ * provided. The returned URL will be appropriately encoded using application/x-www-form-urlencoded with appropriate
+ * encoding of UTF-8 characters.
+ *
+ * @return URL built from the given data
+ */
+ public String buildURL() {
+ StringBuilder builder = new StringBuilder();
+
+ if (!DatatypeHelper.isEmpty(scheme)) {
+ builder.append(scheme);
+ builder.append("://");
+ }
+
+ if (!DatatypeHelper.isEmpty(username)) {
+ builder.append(username);
+ if (!DatatypeHelper.isEmpty(password)) {
+ builder.append(":");
+ builder.append(password);
+ }
+
+ builder.append("@");
+ }
+
+ if (!DatatypeHelper.isEmpty(host)) {
+ builder.append(host);
+ if (port > 0) {
+ builder.append(":");
+ builder.append(Integer.toString(port));
+ }
+ }
+
+ if (!DatatypeHelper.isEmpty(path)) {
+ if (!path.startsWith("/")) {
+ builder.append("/");
+ }
+ builder.append(path);
+ }
+
+ String queryString = buildQueryString();
+ if (!DatatypeHelper.isEmpty(queryString)) {
+ builder.append("?");
+ builder.append(queryString);
+ }
+
+ if (!DatatypeHelper.isEmpty(fragement)) {
+ builder.append("#");
+ builder.append(fragement);
+ }
+
+ return builder.toString();
+ }
+
+ /**
+ * Builds the query string for the URL.
+ *
+ * @return query string for the URL or null if there are now query parameters
+ */
+ public String buildQueryString() {
+ StringBuilder builder = new StringBuilder();
+ if (queryParams.size() > 0) {
+ String name;
+ String value;
+
+ Pair param;
+ for (int i = 0; i < queryParams.size(); i++) {
+ param = queryParams.get(i);
+ name = DatatypeHelper.safeTrimOrNullString(param.getFirst());
+
+ if (name != null) {
+ builder.append(HTTPTransportUtils.urlEncode(name));
+ value = DatatypeHelper.safeTrimOrNullString(param.getSecond());
+ if (value != null) {
+ builder.append("=");
+ builder.append(HTTPTransportUtils.urlEncode(value));
+ }
+ if (i < queryParams.size() - 1) {
+ builder.append("&");
+ }
+ }
+ }
+ return builder.toString();
+ }
+
+ return null;
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/package.html 17 Aug 2012 15:09:10 -0000 1.1
@@ -0,0 +1,5 @@
+
+
+General utility classes.
+
+
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/resource/AbstractFilteredResource.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/resource/AbstractFilteredResource.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/resource/AbstractFilteredResource.java 17 Aug 2012 15:09:13 -0000 1.1
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.resource;
+
+import java.io.InputStream;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/** A {@link Resource} whose contents may be run through a filter as it is being read. */
+public abstract class AbstractFilteredResource implements Resource {
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(AbstractFilteredResource.class);
+
+ /** Associated resource filter. */
+ private ResourceFilter resourceFilter;
+
+ /** Constructor. */
+ protected AbstractFilteredResource() {
+
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param filter the filter used on the resource
+ *
+ * @deprecated use {@link #setResourceFilter(ResourceFilter)} instead
+ */
+ protected AbstractFilteredResource(ResourceFilter filter) {
+ resourceFilter = filter;
+ }
+
+ /**
+ * Gets the resource filter associated with this resource.
+ *
+ * @return resource filter associated with this resource
+ */
+ public ResourceFilter getResourceFilter() {
+ return resourceFilter;
+ }
+
+ /**
+ * Sets the resource filter associated with this resource.
+ *
+ * @param filter filter associated with this resource
+ */
+ public void setResourceFilter(ResourceFilter filter){
+ resourceFilter = filter;
+ }
+
+ /**
+ * Applies the filter to the given stream resulting in the returned stream. If no filter is set than the given
+ * stream is the returned stream.
+ *
+ * @param stream the stream to filter
+ *
+ * @return the filtered stream
+ *
+ * @throws ResourceException thrown if the filter can not be applied to the stream
+ */
+ protected InputStream applyFilter(InputStream stream) throws ResourceException {
+ ResourceFilter filter = getResourceFilter();
+ if (filter != null) {
+ log.debug("Apply filter '{}' to resource '{}'", filter.getClass(), this.getLocation());
+ return getResourceFilter().applyFilter(stream);
+ } else {
+ return stream;
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/resource/ChainingResourceFilter.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/resource/ChainingResourceFilter.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/resource/ChainingResourceFilter.java 17 Aug 2012 15:09:13 -0000 1.1
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.resource;
+
+import java.io.InputStream;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/** Resource filter that executes a list of resource filters in order. */
+public class ChainingResourceFilter implements ResourceFilter {
+
+ /** Class logger. */
+ private Logger log = LoggerFactory.getLogger(ChainingResourceFilter.class);
+
+ /** Registered resource filters. */
+ private List resourceFilters;
+
+ /**
+ * Constructor.
+ *
+ * @param filters resource filters to execute in order
+ */
+ public ChainingResourceFilter(List filters) {
+ resourceFilters = filters;
+ }
+
+ /** {@inheritDoc} */
+ public InputStream applyFilter(InputStream resource) throws ResourceException {
+ if (resourceFilters == null || resourceFilters.isEmpty()) {
+ log.debug("No resource filters configured, nothing to do");
+ return resource;
+ }
+
+ for (ResourceFilter filter : resourceFilters) {
+ log.debug("Applying filter '{}'", filter.getClass().getName());
+ resource = filter.applyFilter(resource);
+ }
+
+ return resource;
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/resource/ClasspathResource.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/resource/ClasspathResource.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/resource/ClasspathResource.java 17 Aug 2012 15:09:14 -0000 1.1
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.resource;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import org.joda.time.DateTime;
+import org.opensaml.xml.util.DatatypeHelper;
+
+/**
+ * Resource that represents a resource found on the classpath.
+ *
+ * Because object on the classpath are not meant to change during runtime the last modification is set to the time the
+ * {@link ClasspathResource} is created and is never changed.
+ */
+public class ClasspathResource extends AbstractFilteredResource {
+
+ /** Classpath location of resource. */
+ private URL resource;
+
+ /** Last modification time, set to when resources is created. */
+ private DateTime lastModTime;
+
+ /**
+ * Constructor.
+ *
+ * @param path the path to the file for this resource
+ *
+ * @throws ResourceException thrown if the resource path is null or empty or if the resource does not exist
+ */
+ public ClasspathResource(String path) throws ResourceException {
+ super();
+
+ if (DatatypeHelper.isEmpty(path)) {
+ throw new ResourceException("Resource path may not be null or empty");
+ }
+
+ resource = getClass().getResource(path);
+ if (resource == null) {
+ throw new ResourceException("Classpath resource does not exist: " + path);
+ }
+
+ lastModTime = new DateTime();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param path the path to the file for this resource
+ * @param resourceFilter filter to apply to this resource
+ *
+ * @throws ResourceException thrown if the resource path is null or empty or if the resource does not exist
+ *
+ * @deprecated use {@link #setResourceFilter(ResourceFilter)} instead
+ */
+ public ClasspathResource(String path, ResourceFilter resourceFilter) throws ResourceException {
+ super(resourceFilter);
+
+ if (DatatypeHelper.isEmpty(path)) {
+ throw new ResourceException("Resource path may not be null or empty");
+ }
+
+ resource = getClass().getResource(path);
+ if (resource == null) {
+ throw new ResourceException("Classpath resource does not exist: " + path);
+ }
+
+ lastModTime = new DateTime();
+ }
+
+ /** {@inheritDoc} */
+ public boolean exists() throws ResourceException {
+ if (resource != null) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public InputStream getInputStream() throws ResourceException {
+ try {
+ InputStream ins = resource.openStream();
+ return applyFilter(ins);
+ } catch (IOException e) {
+ throw new ResourceException("Unable to open resource: " + resource);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public DateTime getLastModifiedTime() throws ResourceException {
+ return lastModTime;
+ }
+
+ /** {@inheritDoc} */
+ public String getLocation() {
+ return resource.toString();
+ }
+
+ /** {@inheritDoc} */
+ public String toString() {
+ return getLocation();
+ }
+
+ /** {@inheritDoc} */
+ public int hashCode() {
+ return getLocation().hashCode();
+ }
+
+ /** {@inheritDoc} */
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+
+ if (o instanceof ClasspathResource) {
+ return getLocation().equals(((ClasspathResource) o).getLocation());
+ }
+
+ return false;
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/resource/FileBackedHttpResource.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/resource/FileBackedHttpResource.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/resource/FileBackedHttpResource.java 17 Aug 2012 15:09:13 -0000 1.1
@@ -0,0 +1,181 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.resource;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.joda.time.DateTime;
+import org.joda.time.chrono.ISOChronology;
+import org.opensaml.xml.util.DatatypeHelper;
+
+/**
+ * A resource representing a file read from an HTTP(S) location. Every time the file is successfully read from the URL
+ * location it is written to a backing file. If the file can not be read from the URL it is read from this backing file,
+ * if available.
+ *
+ * Note, large files should not be accessed in this manner as the entire file is read into memory before being written
+ * to disk and then returned.
+ */
+public class FileBackedHttpResource extends HttpResource {
+
+ /** Backing resource file. */
+ private File resourceFile;
+
+ /**
+ * Constructor.
+ *
+ * @param resource HTTP(S) URL of the resource
+ * @param backingFile filesystem location to store the resource
+ */
+ public FileBackedHttpResource(String resource, String backingFile) {
+ super(resource);
+
+ if (DatatypeHelper.isEmpty(backingFile)) {
+ throw new IllegalArgumentException("Backing file path may not be null or empty");
+ }
+
+ resourceFile = new File(backingFile);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param resource HTTP(S) URL of the resource
+ * @param backingFile file: URI location to store the resource
+ *
+ * @since 1.2
+ */
+ public FileBackedHttpResource(String resource, URI backingFile) {
+ super(resource);
+
+ if (backingFile == null) {
+ throw new IllegalArgumentException("Backing file path may not be null or empty");
+ }
+
+ resourceFile = new File(backingFile);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param resource HTTP(S) URL of the resource
+ * @param backingFile filesystem location to store the resource
+ * @param resourceFilter filter to apply to this resource
+ *
+ * @deprecated use {@link #setResourceFilter(ResourceFilter)} instead
+ */
+ public FileBackedHttpResource(String resource, String backingFile, ResourceFilter resourceFilter) {
+ super(resource, resourceFilter);
+
+ if (DatatypeHelper.isEmpty(backingFile)) {
+ throw new IllegalArgumentException("Backing file path may not be null or empty");
+ }
+
+ resourceFile = new File(backingFile);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param resource HTTP(S) URL of the resource
+ * @param backingFile filesystem location to store the resource
+ * @param resourceFilter filter to apply to this resource
+ *
+ * @since 1.2
+ * @deprecated use {@link #setResourceFilter(ResourceFilter)} instead
+ */
+ public FileBackedHttpResource(String resource, URI backingFile, ResourceFilter resourceFilter) {
+ super(resource, resourceFilter);
+
+ if (backingFile == null) {
+ throw new IllegalArgumentException("Backing file path may not be null or empty");
+ }
+
+ resourceFile = new File(backingFile);
+ }
+
+ /** {@inheritDoc} */
+ public boolean exists() throws ResourceException {
+ if (!super.exists()) {
+ return resourceFile.exists();
+ }
+
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ public InputStream getInputStream() throws ResourceException {
+ InputStream ins = null;
+ try {
+ GetMethod getMethod = super.getResource();
+ byte[] response = getMethod.getResponseBody();
+ saveToResourceFile(response);
+ ins = getMethod.getResponseBodyAsStream();
+ } catch (Exception e) {
+ try {
+ ins = new FileInputStream(resourceFile);
+ } catch (IOException ioe) {
+ throw new ResourceException("Unable to read resource URL or backing file "
+ + resourceFile.getAbsolutePath(), ioe);
+ }
+ }
+
+ return applyFilter(ins);
+ }
+
+ /** {@inheritDoc} */
+ public DateTime getLastModifiedTime() throws ResourceException {
+ try {
+ return super.getLastModifiedTime();
+ } catch (ResourceException e) {
+ long lastModifiedTime = resourceFile.lastModified();
+ if (lastModifiedTime == 0) {
+ throw new ResourceException("URL resource is not reachable and backing file is not readable");
+ }
+
+ return new DateTime(lastModifiedTime, ISOChronology.getInstanceUTC());
+ }
+ }
+
+ /** {@inheritDoc} */
+ public String getLocation() {
+ return super.getLocation();
+ }
+
+ /**
+ * Saves a resource to the backing file.
+ *
+ * @param resource the string representation of the resource
+ *
+ * @throws ResourceException thrown if the resource backing file can not be written to
+ */
+ protected void saveToResourceFile(byte[] resource) throws ResourceException {
+ try {
+ FileOutputStream out = new FileOutputStream(resourceFile);
+ out.write(resource);
+ } catch (IOException e) {
+ throw new ResourceException("Unable to write resource to backing file " + resourceFile.getAbsolutePath(), e);
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/resource/FilesystemResource.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/resource/FilesystemResource.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/resource/FilesystemResource.java 17 Aug 2012 15:09:12 -0000 1.1
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.resource;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.net.URI;
+
+import org.joda.time.DateTime;
+import org.joda.time.chrono.ISOChronology;
+import org.opensaml.xml.util.DatatypeHelper;
+
+/**
+ * A resource representing a file on the local filesystem.
+ */
+public class FilesystemResource extends AbstractFilteredResource {
+
+ /** The file represented by this resource. */
+ private File resource;
+
+ /**
+ * Constructor.
+ *
+ * @param resourcePath the path to the file for this resource
+ *
+ * @throws ResourceException thrown if the resource path is null or empty
+ */
+ public FilesystemResource(String resourcePath) throws ResourceException {
+ super();
+
+ if (DatatypeHelper.isEmpty(resourcePath)) {
+ throw new ResourceException("Resource path may not be null or empty");
+ }
+
+ resource = new File(resourcePath);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param resourceURI file: URI to the file
+ *
+ * @throws ResourceException thrown if the resource path is null or empty
+ *
+ * @since 1.2.0
+ */
+ public FilesystemResource(URI resourceURI) throws ResourceException {
+ super();
+
+ if (resourceURI == null) {
+ throw new ResourceException("Resource URL may not be null");
+ }
+
+ resource = new File(resourceURI);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param resourcePath the path to the file for this resource
+ * @param resourceFilter filter to apply to this resource
+ *
+ * @throws ResourceException thrown if the resource path is null or empty
+ *
+ * @deprecated use {@link #setResourceFilter(ResourceFilter)} instead
+ */
+ public FilesystemResource(String resourcePath, ResourceFilter resourceFilter) throws ResourceException {
+ super(resourceFilter);
+
+ if (DatatypeHelper.isEmpty(resourcePath)) {
+ throw new ResourceException("Resource path may not be null or empty");
+ }
+
+ resource = new File(resourcePath);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param resourceURI the file: URI to the file for this resource
+ * @param resourceFilter filter to apply to this resource
+ *
+ * @throws ResourceException thrown if the resource path is null or empty
+ *
+ * @since 1.2.0
+ * @deprecated use {@link #setResourceFilter(ResourceFilter)} instead
+ */
+ public FilesystemResource(URI resourceURI, ResourceFilter resourceFilter) throws ResourceException {
+ super(resourceFilter);
+
+ if (resourceURI == null) {
+ throw new ResourceException("Resource URI may not be null");
+ }
+
+ resource = new File(resourceURI);
+ }
+
+ /** {@inheritDoc} */
+ public boolean exists() throws ResourceException {
+ return resource.exists();
+ }
+
+ /** {@inheritDoc} */
+ public InputStream getInputStream() throws ResourceException {
+ try {
+ FileInputStream ins = new FileInputStream(resource);
+ return applyFilter(ins);
+ } catch (FileNotFoundException e) {
+ throw new ResourceException("Resource file does not exist: " + resource.getAbsolutePath());
+ }
+ }
+
+ /** {@inheritDoc} */
+ public DateTime getLastModifiedTime() throws ResourceException {
+ if (!resource.exists()) {
+ throw new ResourceException("Resource file does not exist: " + resource.getAbsolutePath());
+ }
+
+ return new DateTime(resource.lastModified(), ISOChronology.getInstanceUTC());
+ }
+
+ /** {@inheritDoc} */
+ public String getLocation() {
+ return resource.getAbsolutePath();
+ }
+
+ /** {@inheritDoc} */
+ public String toString() {
+ return getLocation();
+ }
+
+ /** {@inheritDoc} */
+ public int hashCode() {
+ return getLocation().hashCode();
+ }
+
+ /** {@inheritDoc} */
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+
+ if (o instanceof FilesystemResource) {
+ return getLocation().equals(((FilesystemResource) o).getLocation());
+ }
+
+ return false;
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/resource/HttpResource.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/resource/HttpResource.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/resource/HttpResource.java 17 Aug 2012 15:09:13 -0000 1.1
@@ -0,0 +1,179 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.resource;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.HeadMethod;
+import org.apache.commons.httpclient.util.DateParseException;
+import org.apache.commons.httpclient.util.DateUtil;
+import org.joda.time.DateTime;
+import org.joda.time.chrono.ISOChronology;
+import org.opensaml.xml.util.DatatypeHelper;
+
+/**
+ * A resource representing a file retrieved from a URL using Apache Commons HTTPClient.
+ */
+public class HttpResource extends AbstractFilteredResource {
+
+ /** HTTP URL of the resource. */
+ private String resourceUrl;
+
+ /** HTTP client. */
+ private HttpClient httpClient;
+
+ /**
+ * Constructor.
+ *
+ * @param resource HTTP(S) URL of the resource
+ */
+ public HttpResource(String resource) {
+ super();
+
+ resourceUrl = DatatypeHelper.safeTrimOrNullString(resource);
+ if (resourceUrl == null) {
+ throw new IllegalArgumentException("Resource URL may not be null or empty");
+ }
+
+ httpClient = new HttpClient();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param resource HTTP(S) URL of the resource
+ * @param resourceFilter filter to apply to this resource
+ *
+ * @deprecated use {@link #setResourceFilter(ResourceFilter)} instead
+ */
+ public HttpResource(String resource, ResourceFilter resourceFilter) {
+ super(resourceFilter);
+
+ resourceUrl = DatatypeHelper.safeTrimOrNullString(resource);
+ if (resourceUrl == null) {
+ throw new IllegalArgumentException("Resource URL may not be null or empty");
+ }
+
+ httpClient = new HttpClient();
+ }
+
+ /** {@inheritDoc} */
+ public boolean exists() throws ResourceException {
+ HeadMethod headMethod = new HeadMethod(resourceUrl);
+
+ try {
+ httpClient.executeMethod(headMethod);
+ if (headMethod.getStatusCode() != HttpStatus.SC_OK) {
+ return false;
+ }
+
+ return true;
+ } catch (IOException e) {
+ throw new ResourceException("Unable to contact resource URL: " + resourceUrl, e);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public InputStream getInputStream() throws ResourceException {
+ GetMethod getMethod = getResource();
+ try {
+ return applyFilter(getMethod.getResponseBodyAsStream());
+ } catch (IOException e) {
+ throw new ResourceException("Unable to read response", e);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public DateTime getLastModifiedTime() throws ResourceException {
+ HeadMethod headMethod = new HeadMethod(resourceUrl);
+
+ try {
+ httpClient.executeMethod(headMethod);
+ if (headMethod.getStatusCode() != HttpStatus.SC_OK) {
+ throw new ResourceException("Unable to retrieve resource URL " + resourceUrl
+ + ", received HTTP status code " + headMethod.getStatusCode());
+ }
+ Header lastModifiedHeader = headMethod.getResponseHeader("Last-Modified");
+ if (lastModifiedHeader != null && ! DatatypeHelper.isEmpty(lastModifiedHeader.getValue())) {
+ long lastModifiedTime = DateUtil.parseDate(lastModifiedHeader.getValue()).getTime();
+ return new DateTime(lastModifiedTime, ISOChronology.getInstanceUTC());
+ }
+
+ return new DateTime();
+ } catch (IOException e) {
+ throw new ResourceException("Unable to contact resource URL: " + resourceUrl, e);
+ } catch (DateParseException e) {
+ throw new ResourceException("Unable to parse last modified date for resource:" + resourceUrl, e);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public String getLocation() {
+ return resourceUrl;
+ }
+
+ /** {@inheritDoc} */
+ public String toString() {
+ return getLocation();
+ }
+
+ /** {@inheritDoc} */
+ public int hashCode() {
+ return getLocation().hashCode();
+ }
+
+ /** {@inheritDoc} */
+ public boolean equals(Object o) {
+ if (o == this) {
+ return true;
+ }
+
+ if (o instanceof HttpResource) {
+ return getLocation().equals(((HttpResource) o).getLocation());
+ }
+
+ return false;
+ }
+
+ /**
+ * Gets remote resource.
+ *
+ * @return the remove resource
+ *
+ * @throws ResourceException thrown if the resource could not be fetched
+ */
+ protected GetMethod getResource() throws ResourceException {
+ GetMethod getMethod = new GetMethod(resourceUrl);
+
+ try {
+ httpClient.executeMethod(getMethod);
+ if (getMethod.getStatusCode() != HttpStatus.SC_OK) {
+ throw new ResourceException("Unable to retrieve resource URL " + resourceUrl
+ + ", received HTTP status code " + getMethod.getStatusCode());
+ }
+ return getMethod;
+ } catch (IOException e) {
+ throw new ResourceException("Unable to contact resource URL: " + resourceUrl, e);
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/resource/PropertyReplacementResourceFilter.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/resource/PropertyReplacementResourceFilter.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/resource/PropertyReplacementResourceFilter.java 17 Aug 2012 15:09:14 -0000 1.1
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.resource;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.opensaml.xml.util.DatatypeHelper;
+
+/**
+ * A resource filter that buffers a resource into a string and replaces instance of macros with properties read from a
+ * file. Macros are of the syntax '${MACRO_NAME}', the same syntax used within the Java Expression Language.
+ *
+ * The property file is read at invocation of this filter.
+ *
+ * The {@link InputStream} should be a character stream as {@link InputStreamReader} will be used to convert the stream
+ * into a string.
+ */
+public class PropertyReplacementResourceFilter implements ResourceFilter {
+
+ /** Location of the property file. */
+ private File propertyFilePath;
+
+ /**
+ * Constructor.
+ *
+ * @param propertyFile property file whose properties will be expanded within the resource
+ */
+ public PropertyReplacementResourceFilter(File propertyFile) {
+ if (propertyFile == null) {
+ throw new IllegalArgumentException("Property file may not be null");
+ }
+ propertyFilePath = propertyFile;
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ public InputStream applyFilter(InputStream resource) throws ResourceException {
+ Properties props = new Properties();
+ try {
+ props.load(new FileInputStream(propertyFilePath));
+ } catch (IOException e) {
+ throw new ResourceException("Unable to read property file", e);
+ }
+
+ if(props.isEmpty()){
+ return resource;
+ }
+
+ try {
+ String resourceString = DatatypeHelper.inputstreamToString(resource, null);
+
+ Iterator keyItr = (Iterator) props.propertyNames();
+ String key;
+ while (keyItr.hasNext()) {
+ key = keyItr.next();
+ resourceString = resourceString.replace("${" + key + "}", props.getProperty(key));
+ }
+
+ resourceString.trim();
+ return new ByteArrayInputStream(resourceString.getBytes());
+ } catch (IOException e) {
+ throw new ResourceException("Unable to read contents of resource", e);
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/resource/Resource.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/resource/Resource.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/resource/Resource.java 17 Aug 2012 15:09:13 -0000 1.1
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.resource;
+
+import java.io.InputStream;
+
+import org.joda.time.DateTime;
+
+/** An interface representing an data resource. */
+public interface Resource {
+
+ /**
+ * Gets resource location information. Examples might be filesystem path, URL, etc.
+ *
+ * @return resource location information
+ */
+ public String getLocation();
+
+ /**
+ * Checks whether the resource exists.
+ *
+ * @return true if the resource exists, false if not
+ *
+ * @throws ResourceException thrown if there is a problem determining if the resource exists
+ */
+ public boolean exists() throws ResourceException;
+
+ /**
+ * Gets the inputstream to the resource's data.
+ *
+ * @return inputstream to the resource's data
+ *
+ * @throws ResourceException thrown if an input stream can not be created for the resource
+ */
+ public InputStream getInputStream() throws ResourceException;
+
+ /**
+ * Gets the date and time the resource was last modified.
+ *
+ * @return date and time the resource was last modified
+ *
+ * @throws ResourceException thrown if the last modified time can not be determined
+ */
+ public DateTime getLastModifiedTime() throws ResourceException;
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/resource/ResourceChangeListener.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/resource/ResourceChangeListener.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/resource/ResourceChangeListener.java 17 Aug 2012 15:09:13 -0000 1.1
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.resource;
+
+/**
+ * A resource change listener.
+ */
+public interface ResourceChangeListener{
+
+ /** Types of change events; creation, update, and deletion. */
+ public enum ResourceChange{ CREATION, UPDATE, DELETE};
+
+ /**
+ * Called when a resource is created.
+ *
+ * @param resource the resource that was created
+ */
+ public void onResourceCreate(Resource resource);
+
+ /**
+ * Called when a resource is update.
+ *
+ * @param resource the resource that was updated
+ */
+ public void onResourceUpdate(Resource resource);
+
+ /**
+ * Called when a resource is deleted.
+ *
+ * @param resource the resource that was deleted
+ */
+ public void onResourceDelete(Resource resource);
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/resource/ResourceChangeWatcher.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/resource/ResourceChangeWatcher.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/resource/ResourceChangeWatcher.java 17 Aug 2012 15:09:13 -0000 1.1
@@ -0,0 +1,209 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.resource;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.TimerTask;
+
+import org.joda.time.DateTime;
+import org.opensaml.util.resource.ResourceChangeListener.ResourceChange;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A watcher that invokes a callback when a resource update/deletion has been detected.
+ */
+public class ResourceChangeWatcher extends TimerTask {
+
+ /** Default polling frequency, 12 hours. */
+ public static final long DEFAULT_POLL_FREQUENCY = 1000 * 60 * 60 * 12;
+
+ /** Default maximum retry attempts, 0. */
+ public static final int DEFAULT_MAX_RETRY_ATTEMPTS = 0;
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(ResourceChangeWatcher.class);
+
+ /** Resource being watched. */
+ private Resource watchedResource;
+
+ /** Frequency, in milliseconds, the resource is polled for changes. */
+ private long pollFrequency;
+
+ /** Max number of polls to try before considering the resource inaccessible. */
+ private int maxRetryAttempts;
+
+ /** Number of times the resource has been polled but generated an error. */
+ private int currentRetryAttempts;
+
+ /** Whether the resource currently exists. */
+ private boolean resourceExist;
+
+ /** Last time the resource was modified. */
+ private DateTime lastModification;
+
+ /** Registered listeners of resource change notifications. */
+ private List resourceListeners;
+
+ /**
+ * Constructor.
+ *
+ * @param resource the resource to be watched
+ *
+ * @throws ResourceException thrown if resource existence or last modification time can not be determined
+ */
+ public ResourceChangeWatcher(Resource resource) throws ResourceException {
+ this(resource, DEFAULT_POLL_FREQUENCY, DEFAULT_MAX_RETRY_ATTEMPTS);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param resource the resource to be watched
+ * @param pollingFrequency the frequency, in milliseconds, to poll the resource for changes
+ *
+ * @throws ResourceException thrown if resource existence or last modification time can not be determined
+ */
+ public ResourceChangeWatcher(Resource resource, long pollingFrequency) throws ResourceException {
+ this(resource, pollingFrequency, DEFAULT_MAX_RETRY_ATTEMPTS);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param resource the resource to be watched
+ * @param pollingFrequency the frequency, in milliseconds, to poll the resource for changes
+ * @param retryAttempts maximum number of poll attempts before the resource is considered inaccessible
+ *
+ * @throws ResourceException thrown if resource existence or last modification time can not be determined
+ */
+ public ResourceChangeWatcher(Resource resource, long pollingFrequency, int retryAttempts) throws ResourceException {
+ if (resource == null) {
+ throw new NullPointerException("Watched resource is null");
+ }
+
+ if (pollingFrequency <= 0) {
+ throw new IllegalArgumentException("Polling frequency must be greater than zero");
+ }
+
+ if (retryAttempts < 0) {
+ throw new IllegalArgumentException("Max retry attempts must be greater than, or equal to, zero");
+ }
+
+ watchedResource = resource;
+ pollFrequency = pollingFrequency;
+ maxRetryAttempts = retryAttempts;
+ currentRetryAttempts = 0;
+
+ if (watchedResource.exists()) {
+ resourceExist = true;
+ lastModification = watchedResource.getLastModifiedTime();
+ } else {
+ resourceExist = false;
+ }
+
+ resourceListeners = new ArrayList(5);
+ log.debug("Watching resource: " + watchedResource.getLocation()
+ + ", polling frequency: {}ms, max retry attempts: {}", pollFrequency, maxRetryAttempts);
+ }
+
+ /**
+ * Gets the frequency, in milliseconds, the watched resource should be polled.
+ *
+ * @return frequency the watched resource should be polled
+ */
+ public long getPollingFrequency() {
+ return pollFrequency;
+ }
+
+ /**
+ * Gets the list of registered resource listeners. New listeners may be registered with the list or old ones
+ * removed.
+ *
+ * @return list of registered resource listeners
+ */
+ public List getResourceListeners() {
+ return resourceListeners;
+ }
+
+ /** {@inheritDoc} */
+ public void run() {
+ try {
+ log.trace("Checking resource for changes: {}", watchedResource.getLocation());
+ if (watchedResource.exists()) {
+ if (!resourceExist) {
+ resourceExist = true;
+ signalListeners(ResourceChange.CREATION);
+ lastModification = watchedResource.getLastModifiedTime();
+ } else {
+ if (lastModification.isBefore(watchedResource.getLastModifiedTime())) {
+ signalListeners(ResourceChange.UPDATE);
+ lastModification = watchedResource.getLastModifiedTime();
+ }
+ }
+ } else {
+ if (resourceExist) {
+ resourceExist = false;
+ signalListeners(ResourceChange.DELETE);
+ }
+ }
+ currentRetryAttempts = 0;
+ } catch (ResourceException e) {
+ log.warn("Resource " + watchedResource.getLocation() + " could not be accessed", e);
+ currentRetryAttempts++;
+ if (currentRetryAttempts >= maxRetryAttempts) {
+ cancel();
+ log.error("Resource " + watchedResource.getLocation()
+ + " was not accessible for max number of retry attempts. This resource will no longer be watched");
+ }
+ }
+ }
+
+ /**
+ * Signals all registered listeners of a resource change.
+ *
+ * @param changeType the resource change type
+ */
+ protected void signalListeners(ResourceChange changeType) {
+ synchronized (resourceListeners) {
+ switch (changeType) {
+ case CREATION:
+ log.debug("Publishing creation event for resource: {}", watchedResource.getLocation());
+ for (ResourceChangeListener listener : resourceListeners) {
+ listener.onResourceCreate(watchedResource);
+ }
+ break;
+ case UPDATE:
+ log.debug("Publishing update event for resource: {}", watchedResource.getLocation());
+ for (ResourceChangeListener listener : resourceListeners) {
+ listener.onResourceUpdate(watchedResource);
+ }
+ break;
+ case DELETE:
+ log.debug("Publishing delete event for resource: {}", watchedResource.getLocation());
+ for (ResourceChangeListener listener : resourceListeners) {
+ listener.onResourceDelete(watchedResource);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/resource/ResourceException.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/resource/ResourceException.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/resource/ResourceException.java 17 Aug 2012 15:09:13 -0000 1.1
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.resource;
+
+/**
+ * Indicates a problem accessing a resource.
+ */
+public class ResourceException extends Exception {
+
+ /** Serial version UID. */
+ private static final long serialVersionUID = -3347987371630094896L;
+
+ /**
+ * Constructor.
+ */
+ public ResourceException() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ */
+ public ResourceException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public ResourceException(Exception wrappedException) {
+ super(wrappedException);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public ResourceException(String message, Exception wrappedException) {
+ super(message, wrappedException);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/resource/ResourceFilter.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/resource/ResourceFilter.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/resource/ResourceFilter.java 17 Aug 2012 15:09:13 -0000 1.1
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.resource;
+
+import java.io.InputStream;
+
+/** Filter that operates over a resource. Filters may perform any logic on the incoming stream. */
+public interface ResourceFilter {
+
+ /**
+ * Applies this filter to the given stream.
+ *
+ * @param resource Resource to which the filter should apply.
+ *
+ * @return filtered stream
+ *
+ * @throws ResourceException thrown is there if a problem applying the filter
+ */
+ public InputStream applyFilter(InputStream resource) throws ResourceException;
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/resource/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/resource/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/resource/package.html 17 Aug 2012 15:09:13 -0000 1.1
@@ -0,0 +1,7 @@
+
+
+Utility classes that represent readable, stream based, resources such as local filesystem and classpath resources as
+well as remote resources such as documents retrieved via HTTP(S). Also contains support for monitoring such resources
+for changes.
+
+
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/storage/AbstractExpiringObject.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/storage/AbstractExpiringObject.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/storage/AbstractExpiringObject.java 17 Aug 2012 15:09:02 -0000 1.1
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.storage;
+
+import java.io.Serializable;
+
+import org.joda.time.DateTime;
+import org.joda.time.chrono.ISOChronology;
+
+/** Base implementation for {@link ExpiringObject}. */
+public abstract class AbstractExpiringObject implements ExpiringObject, Serializable {
+
+ /** Moment of expiration in UTC. */
+ private long expiration;
+
+ /**
+ * Constructor.
+ *
+ * @param expirationTime time this object should expire
+ */
+ public AbstractExpiringObject(DateTime expirationTime) {
+ expiration = expirationTime.toDateTime(ISOChronology.getInstanceUTC()).getMillis();
+ }
+
+ /** {@inheritDoc} */
+ public DateTime getExpirationTime() {
+ return new DateTime(expiration, ISOChronology.getInstanceUTC());
+ }
+
+ /** {@inheritDoc} */
+ public boolean isExpired() {
+ return getExpirationTime().isBeforeNow();
+ }
+
+ /** {@inheritDoc} */
+ public void onExpire() {
+ // no-op, implementations should override if they need to do something
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/storage/ExpiringObject.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/storage/ExpiringObject.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/storage/ExpiringObject.java 17 Aug 2012 15:09:02 -0000 1.1
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.storage;
+
+import org.joda.time.DateTime;
+
+/**
+ * A simple interface for objects that may expire at a given time.
+ */
+public interface ExpiringObject {
+
+ /**
+ * Gets the time the object expires.
+ *
+ * @return time the object expires
+ */
+ public DateTime getExpirationTime();
+
+ /**
+ * Gets whether this object has expired.
+ *
+ * @return true if the expiration time has passed, false if not
+ */
+ public boolean isExpired();
+
+ /**
+ * A callback method invoked when this object is expiring. Note, this method may not be invoked at the exact instant
+ * of expiration but may, instead, be invoked the next time the object is read and noticed to have expired.
+ */
+ public void onExpire();
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/storage/ExpiringObjectStorageServiceSweeper.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/storage/ExpiringObjectStorageServiceSweeper.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/storage/ExpiringObjectStorageServiceSweeper.java 17 Aug 2012 15:09:02 -0000 1.1
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.storage;
+
+import java.util.Iterator;
+import java.util.Set;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A simple task that periodically sweeps over a {@link StorageService} and removes expired entries.
+ */
+public class ExpiringObjectStorageServiceSweeper extends TimerTask {
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(ExpiringObjectStorageServiceSweeper.class);
+
+ /** Interval between sweeps. */
+ private long sweepInterval;
+
+ /** Storage service whose entries will be periodically checked. */
+ private StorageService store;
+
+ /** Storage partitions to sweep. */
+ private Set partitions;
+
+ /**
+ * Constructor. Registers this task with the given timer.
+ *
+ * @param taskTimer timer that will sweep the given storage service
+ * @param interval interval, in milliseconds, that the storage service will be swept
+ * @param sweptStore storage service that will be swept
+ */
+ public ExpiringObjectStorageServiceSweeper(Timer taskTimer, long interval, StorageService sweptStore) {
+ store = sweptStore;
+ sweepInterval = interval;
+ taskTimer.schedule(this, interval, interval);
+ partitions = null;
+ }
+
+ /**
+ * Constructor. Registers this task with the given timer.
+ *
+ * @param taskTimer timer that will sweep the given storage service
+ * @param interval interval, in milliseconds, that the storage service will be swept
+ * @param sweptStore storage service that will be swept
+ * @param sweptPartitions the partitions to sweep, if null or empty all partitions are swept
+ */
+ public ExpiringObjectStorageServiceSweeper(Timer taskTimer, long interval, StorageService sweptStore,
+ Set sweptPartitions) {
+ store = sweptStore;
+ if (sweptPartitions != null || sweptPartitions.isEmpty()) {
+ partitions = sweptPartitions;
+ } else {
+ partitions = null;
+ }
+ sweepInterval = interval;
+ taskTimer.schedule(this, interval, interval);
+ }
+
+ /** {@inheritDoc} */
+ public void run() {
+ try {
+ Iterator sweepPartitions;
+ if (partitions != null && !partitions.isEmpty()) {
+ sweepPartitions = partitions.iterator();
+ } else {
+ sweepPartitions = store.getPartitions();
+ }
+
+ String currentParition;
+ Iterator> partitionKeys;
+ Object partitionKey;
+ Object partitionValue;
+ while (sweepPartitions.hasNext()) {
+ currentParition = sweepPartitions.next();
+ log.trace("Sweeping storage service partition {}", currentParition);
+ partitionKeys = store.getKeys(currentParition);
+ if (partitionKeys == null) {
+ continue;
+ }
+
+ while (partitionKeys.hasNext()) {
+ partitionKey = partitionKeys.next();
+ partitionValue = store.get(currentParition, partitionKey);
+ if (partitionValue instanceof ExpiringObject) {
+ if (((ExpiringObject) partitionValue).isExpired()) {
+ log.trace("Removing expired object from storage service partition {}", currentParition);
+ partitionKeys.remove();
+ }
+ }
+ }
+ }
+ } catch (Throwable t) {
+ log.error("Caught unexpected error, sweeper will execute again in " + sweepInterval + "ms", t);
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/storage/MapBasedStorageService.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/storage/MapBasedStorageService.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/storage/MapBasedStorageService.java 17 Aug 2012 15:09:02 -0000 1.1
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.storage;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * A simple {@link Map} based {@link StorageService} implementation.
+ *
+ * @param object type of the keys
+ * @param object type of the values
+ */
+public class MapBasedStorageService implements StorageService {
+
+ /** Backing map. */
+ private Map> store;
+
+ /** Constructor. */
+ public MapBasedStorageService() {
+ store = new ConcurrentHashMap>();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param serviceStore the map to use as storage
+ */
+ protected MapBasedStorageService(Map> serviceStore) {
+ store = serviceStore;
+ }
+
+ /** {@inheritDoc} */
+ public Iterator getPartitions() {
+ Set keys = store.keySet();
+ if (keys != null) {
+ return keys.iterator();
+ }
+
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public Iterator getKeys(String partition) {
+ if (store.containsKey(partition)) {
+ Set keys = store.get(partition).keySet();
+ if (keys != null) {
+ return keys.iterator();
+ }
+ }
+
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public boolean contains(String partition, KeyType key) {
+ if (key == null) {
+ return false;
+ }
+
+ if (store.containsKey(partition)) {
+ return store.get(partition).containsKey(key);
+ }
+
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ public ValueType get(String partition, KeyType key) {
+ if (key == null) {
+ return null;
+ }
+
+ if (store.containsKey(partition)) {
+ return store.get(partition).get(key);
+ }
+
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ public ValueType put(String partition, KeyType key, ValueType value) {
+ if (key == null) {
+ return null;
+ }
+
+ Map partitionMap;
+ synchronized (store) {
+ partitionMap = store.get(partition);
+ if (partitionMap == null) {
+ partitionMap = new ConcurrentHashMap();
+ }
+ store.put(partition, partitionMap);
+ }
+
+ return partitionMap.put(key, value);
+ }
+
+ /** {@inheritDoc} */
+ public ValueType remove(String partition, KeyType key) {
+ if (key == null) {
+ return null;
+ }
+
+ if (store.containsKey(partition)) {
+ return store.get(partition).remove(key);
+ }
+
+ return null;
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/storage/ReplayCache.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/storage/ReplayCache.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/storage/ReplayCache.java 17 Aug 2012 15:09:02 -0000 1.1
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.storage;
+
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.joda.time.DateTime;
+import org.opensaml.xml.util.DatatypeHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Class that uses an underlying {@link StorageService} to track information associated with messages in order to detect
+ * message replays.
+ *
+ * This class is thread-safe and uses a basic reentrant lock to avoid corruption of the underlying store, as well as to
+ * prevent race conditions with respect to replay checking.
+ */
+public class ReplayCache {
+
+ /** Logger. */
+ private final Logger log = LoggerFactory.getLogger(ReplayCache.class);
+
+ /** Backing storage for the replay cache. */
+ private StorageService storage;
+
+ /** Storage service partition used by this cache. default: replay */
+ private String partition;
+
+ /** Time, in milliseconds, that message state is valid. */
+ private long entryDuration;
+
+ /** Replay cache lock. */
+ private ReentrantLock cacheLock;
+
+ /**
+ * Constructor.
+ *
+ * @param storageService the StorageService which serves as the backing store for the cache
+ * @param duration default length of time that message state is valid
+ */
+ public ReplayCache(StorageService storageService, long duration) {
+ storage = storageService;
+ entryDuration = duration;
+ partition = "replay";
+ cacheLock = new ReentrantLock(true);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param storageService the StorageService which serves as the backing store for the cache
+ * @param storageParition name of storage service partition to use
+ * @param duration default length of time that message state is valid
+ */
+ public ReplayCache(StorageService storageService, String storageParition, long duration) {
+ storage = storageService;
+ entryDuration = duration;
+ if (!DatatypeHelper.isEmpty(storageParition)) {
+ partition = DatatypeHelper.safeTrim(storageParition);
+ } else {
+ partition = "replay";
+ }
+ cacheLock = new ReentrantLock(true);
+ }
+
+ /**
+ * Checks if the message has been replayed. If the message has not been seen before then it is added to the list of
+ * seen of messages for the default duration.
+ *
+ * @param issuerId unique ID of the message issuer
+ * @param messageId unique ID of the message
+ *
+ * @return true if the given message ID has been seen before
+ */
+ public boolean isReplay(String issuerId, String messageId) {
+ log.debug("Attempting to acquire lock for replay cache check");
+ cacheLock.lock();
+ log.debug("Lock acquired");
+
+ try {
+ boolean replayed = true;
+ String entryHash = issuerId + messageId;
+
+ ReplayCacheEntry cacheEntry = storage.get(partition, entryHash);
+
+ if (cacheEntry == null || cacheEntry.isExpired()) {
+ if (log.isDebugEnabled()) {
+ if (cacheEntry == null) {
+ log.debug("Message ID {} was not a replay", messageId);
+ } else if (cacheEntry.isExpired()) {
+ log.debug("Message ID {} expired in replay cache at {}", messageId, cacheEntry
+ .getExpirationTime().toString());
+ storage.remove(partition, entryHash);
+ }
+ }
+ replayed = false;
+ addMessageID(entryHash, new DateTime().plus(entryDuration));
+ } else {
+ log.debug("Replay of message ID {} detected in replay cache, will expire at {}", messageId, cacheEntry
+ .getExpirationTime().toString());
+ }
+
+ return replayed;
+ } finally {
+ cacheLock.unlock();
+ }
+ }
+
+ /**
+ * Accquires a write lock and adds the message state to the underlying storage service.
+ *
+ * @param messageId unique ID of the message
+ * @param expiration time the message state expires
+ */
+ protected void addMessageID(String messageId, DateTime expiration) {
+ log.debug("Writing message ID {} to replay cache with expiration time {}", messageId, expiration.toString());
+ storage.put(partition, messageId, new ReplayCacheEntry(messageId, expiration));
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/storage/ReplayCacheEntry.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/storage/ReplayCacheEntry.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/storage/ReplayCacheEntry.java 17 Aug 2012 15:09:02 -0000 1.1
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.storage;
+
+import java.io.Serializable;
+
+import org.joda.time.DateTime;
+
+/** Replay cache storage service entry. */
+public class ReplayCacheEntry extends AbstractExpiringObject implements Serializable {
+
+ /** Serial version UID. */
+ private static final long serialVersionUID = 1066201734851002196L;
+
+ /** ID of the message that may not be replayed. */
+ private String messageId;
+
+ /**
+ * Constructor.
+ *
+ * @param id ID of the message that may not be replayed
+ * @param expiration time when this entry expires
+ */
+ public ReplayCacheEntry(String id, DateTime expiration) {
+ super(expiration);
+ messageId = id;
+ }
+
+ /**
+ * Gets the ID of the message that may not be replayed.
+ *
+ * @return ID of the message that may not be replayed
+ */
+ public String getMessageId() {
+ return messageId;
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/storage/StorageService.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/storage/StorageService.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/storage/StorageService.java 17 Aug 2012 15:09:02 -0000 1.1
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.util.storage;
+
+import java.util.Iterator;
+
+/**
+ * Generic data storage facility for use by services that require some degree of persistence.
+ *
+ * The storage service is partitioned. This is to allow different objects to use the service, each with its own
+ * partition, without the worry of conflicting keys.
+ *
+ * @param object type of the keys
+ * @param object type of the values
+ */
+public interface StorageService {
+
+ /**
+ * Checks if a given key exists.
+ *
+ * @param partition partition on which to operate
+ * @param key the key to check
+ *
+ * @return true of the given key exists, false if not
+ */
+ public boolean contains(String partition, KeyType key);
+
+ /**
+ * Gets the partitions within the service. Removal of a partition identifier from the iterator removes the partition
+ * from the storage service.
+ *
+ * @return partitions within the service
+ */
+ public Iterator getPartitions();
+
+ /**
+ * Gets the keys for entries in the storage service. Removal of a key from the iterator removes the the key and
+ * associated value from the store.
+ *
+ * Note: this operation may be very expensive
+ *
+ * @param partition partition on which to operate
+ *
+ * @return list of keys currently within the store
+ */
+ public Iterator getKeys(String partition);
+
+ /**
+ * Gets the value stored under a particular key.
+ *
+ * @param partition partition on which to operate
+ * @param key the key
+ *
+ * @return the value for that key, or null if there is no value for the given key
+ */
+ public ValueType get(String partition, KeyType key);
+
+ /**
+ * Adds a value, indexed by a key, in to storage. Note that implementations of this service may determine, on its
+ * own, when to evict items from storage, the expiration time given here is meant only as a system provided hint.
+ *
+ * @param partition partition on which to operate
+ * @param key the key
+ * @param value the value
+ *
+ * @return the value that was registered under that key previously, if there was a previous value
+ */
+ public ValueType put(String partition, KeyType key, ValueType value);
+
+ /**
+ * Removes an item from storage.
+ *
+ * @param partition partition on which to operate
+ * @param key the key to the value to remove
+ *
+ * @return the value that was removed
+ */
+ public ValueType remove(String partition, KeyType key);
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/util/storage/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/util/storage/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/util/storage/package.html 17 Aug 2012 15:09:02 -0000 1.1
@@ -0,0 +1,6 @@
+
+
+Interfaces and classes for storing state data of the type used in replay caches, conversation identifiers, etc. Through
+these interfaces such data may be stored in memory, to a database, or replicated across cluster nodes.
+
+
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/Version.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/Version.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/Version.java 17 Aug 2012 15:09:12 -0000 1.1
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws;
+
+/** Class for printing the version of this library. */
+public final class Version {
+
+ /** Name of the library. */
+ private static final String NAME;
+
+ /** Library version. */
+ private static final String VERSION;
+
+ /** Library major version number. */
+ private static final int MAJOR_VERSION;
+
+ /** Library minor version number. */
+ private static final int MINOR_VERSION;
+
+ /** Library micro version number. */
+ private static final int MICRO_VERSION;
+
+ /** Constructor. */
+ private Version() {
+ }
+
+ /**
+ * Main entry point to program.
+ *
+ * @param args command line arguments
+ */
+ public static void main(String[] args) {
+ System.out.println(NAME + " version " + VERSION);
+ }
+
+ /**
+ * Gets the name of the library.
+ *
+ * @return name of the library
+ */
+ public static String getName() {
+ return NAME;
+ }
+
+ /**
+ * Gets the version of the library.
+ *
+ * @return version of the library
+ */
+ public static String getVersion() {
+ return VERSION;
+ }
+
+ /**
+ * Gets the major version number of the library.
+ *
+ * @return major version number of the library
+ */
+ public static int getMajorVersion() {
+ return MAJOR_VERSION;
+ }
+
+ /**
+ * Gets the minor version number of the library.
+ *
+ * @return minor version number of the library
+ */
+ public static int getMinorVersion() {
+ return MINOR_VERSION;
+ }
+
+ /**
+ * Gets the micro version number of the library.
+ *
+ * @return micro version number of the library
+ */
+ public static int getMicroVersion() {
+ return MICRO_VERSION;
+ }
+
+ static {
+ Package pkg = Version.class.getPackage();
+ NAME = pkg.getImplementationTitle().intern();
+ VERSION = pkg.getImplementationVersion().intern();
+ String[] versionParts = VERSION.split("\\.");
+ MAJOR_VERSION = Integer.parseInt(versionParts[0]);
+ MINOR_VERSION = Integer.parseInt(versionParts[1]);
+ MICRO_VERSION = Integer.parseInt(versionParts[2]);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/WSException.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/WSException.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/WSException.java 17 Aug 2012 15:09:12 -0000 1.1
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws;
+
+/**
+ * General OpenWS exception class.
+ */
+public class WSException extends Exception {
+
+ /**
+ * Serial version UID.
+ */
+ private static final long serialVersionUID = 257983691332151160L;
+
+ /**
+ * Constructor.
+ */
+ public WSException() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ */
+ public WSException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public WSException(Exception wrappedException) {
+ super(wrappedException);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public WSException(String message, Exception wrappedException) {
+ super(message, wrappedException);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/package.html 17 Aug 2012 15:09:12 -0000 1.1
@@ -0,0 +1,5 @@
+
+
+Objects dealing directly with SOAP-based web services.
+
+
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/message/BaseMessageContext.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/BaseMessageContext.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/BaseMessageContext.java 17 Aug 2012 15:09:06 -0000 1.1
@@ -0,0 +1,179 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message;
+
+import org.opensaml.ws.message.handler.HandlerChainResolver;
+import org.opensaml.ws.security.SecurityPolicyResolver;
+import org.opensaml.ws.transport.InTransport;
+import org.opensaml.ws.transport.OutTransport;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.util.DatatypeHelper;
+
+/**
+ * Base class for message context implementations.
+ */
+public class BaseMessageContext implements MessageContext {
+
+ /** Unique id of the communication profile in use. */
+ private String communicationProfile;
+
+ /** The inbound message. */
+ private XMLObject inboundMessage;
+
+ /** Issuer of the inbound message. */
+ private String inboundMessageIssuer;
+
+ /** Inbound message transport. */
+ private InTransport inboundTransport;
+
+ /** Outbound message. */
+ private XMLObject outboundMessage;
+
+ /** Issuer of the outbound message. */
+ private String outboundMessageIssuer;
+
+ /** Outbound message transport. */
+ private OutTransport outboundTransport;
+
+ /** Resolver used to determine active security policy. */
+ private SecurityPolicyResolver securityPolicyResolver;
+
+ /** Pre-SecurityPolicy inbound handler chain. */
+ private HandlerChainResolver preSecurityInboundHandlerChainResolver;
+
+ /** Post-SecurityPolicy inbound handler chain. */
+ private HandlerChainResolver postSecurityInboundHandlerChainResolver;
+
+ /** Inbound handler chain. */
+ private HandlerChainResolver outboundHandlerChainResolver;
+
+ /** {@inheritDoc} */
+ public String getCommunicationProfileId() {
+ return communicationProfile;
+ }
+
+ /** {@inheritDoc} */
+ public XMLObject getInboundMessage() {
+ return inboundMessage;
+ }
+
+ /** {@inheritDoc} */
+ public String getInboundMessageIssuer() {
+ return inboundMessageIssuer;
+ }
+
+ /** {@inheritDoc} */
+ public InTransport getInboundMessageTransport() {
+ return inboundTransport;
+ }
+
+ /** {@inheritDoc} */
+ public XMLObject getOutboundMessage() {
+ return outboundMessage;
+ }
+
+ /** {@inheritDoc} */
+ public String getOutboundMessageIssuer() {
+ return outboundMessageIssuer;
+ }
+
+ /** {@inheritDoc} */
+ public OutTransport getOutboundMessageTransport() {
+ return outboundTransport;
+ }
+
+ /** {@inheritDoc} */
+ public SecurityPolicyResolver getSecurityPolicyResolver() {
+ return securityPolicyResolver;
+ }
+
+ /** {@inheritDoc} */
+ public void setCommunicationProfileId(String id) {
+ communicationProfile = DatatypeHelper.safeTrimOrNullString(id);
+ }
+
+ /** {@inheritDoc} */
+ public void setInboundMessage(XMLObject message) {
+ inboundMessage = message;
+ }
+
+ /** {@inheritDoc} */
+ public void setInboundMessageIssuer(String issuer) {
+ inboundMessageIssuer = issuer;
+ }
+
+ /** {@inheritDoc} */
+ public void setInboundMessageTransport(InTransport transport) {
+ inboundTransport = transport;
+ }
+
+ /** {@inheritDoc} */
+ public void setOutboundMessage(XMLObject message) {
+ outboundMessage = message;
+ }
+
+ /** {@inheritDoc} */
+ public void setOutboundMessageIssuer(String issuer) {
+ outboundMessageIssuer = issuer;
+ }
+
+ /** {@inheritDoc} */
+ public void setOutboundMessageTransport(OutTransport transport) {
+ outboundTransport = transport;
+ }
+
+ /** {@inheritDoc} */
+ public void setSecurityPolicyResolver(SecurityPolicyResolver resolver) {
+ securityPolicyResolver = resolver;
+ }
+
+ /** {@inheritDoc} */
+ public boolean isIssuerAuthenticated() {
+ return getInboundMessageTransport().isAuthenticated();
+ }
+
+ /** {@inheritDoc} */
+ public HandlerChainResolver getPreSecurityInboundHandlerChainResolver() {
+ return preSecurityInboundHandlerChainResolver;
+ }
+
+ /** {@inheritDoc} */
+ public HandlerChainResolver getPostSecurityInboundHandlerChainResolver() {
+ return postSecurityInboundHandlerChainResolver;
+ }
+
+ /** {@inheritDoc} */
+ public HandlerChainResolver getOutboundHandlerChainResolver() {
+ return outboundHandlerChainResolver;
+ }
+
+ /** {@inheritDoc} */
+ public void setPreSecurityInboundHandlerChainResolver(HandlerChainResolver newHandlerChainResolver) {
+ preSecurityInboundHandlerChainResolver = newHandlerChainResolver;
+ }
+
+ /** {@inheritDoc} */
+ public void setPostSecurityInboundHandlerChainResolver(HandlerChainResolver newHandlerChainResolver) {
+ postSecurityInboundHandlerChainResolver = newHandlerChainResolver;
+ }
+
+ /** {@inheritDoc} */
+ public void setOutboundHandlerChainResolver(HandlerChainResolver newHandlerChainResolver) {
+ outboundHandlerChainResolver = newHandlerChainResolver;
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/message/MessageContext.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/MessageContext.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/MessageContext.java 17 Aug 2012 15:09:06 -0000 1.1
@@ -0,0 +1,196 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message;
+
+import org.opensaml.ws.message.handler.HandlerChainResolver;
+import org.opensaml.ws.security.SecurityPolicyResolver;
+import org.opensaml.ws.transport.InTransport;
+import org.opensaml.ws.transport.OutTransport;
+import org.opensaml.xml.XMLObject;
+
+/**
+ * A message context represents the entire context for a given message through the receive, process, and/or response
+ * phases. It is a basic unit of work within the library.
+ *
+ * Message contexts are NOT thread safe.
+ */
+public interface MessageContext {
+
+ /**
+ * Gets the unique id of the communication profile in use.
+ *
+ * @return unique id of the communication profile in use
+ */
+ public String getCommunicationProfileId();
+
+ /**
+ * Gets the inbound message.
+ *
+ * @return the inbound message
+ */
+ public XMLObject getInboundMessage();
+
+ /**
+ * Gets the issuer of the inbound message.
+ *
+ * @return issuer of the inbound message
+ */
+ public String getInboundMessageIssuer();
+
+ /**
+ * Gets the transport used to receive the message.
+ *
+ * @return transport used to receive the message
+ */
+ public InTransport getInboundMessageTransport();
+
+ /**
+ * Gets the outbound message.
+ *
+ * @return the outbound message
+ */
+ public XMLObject getOutboundMessage();
+
+ /**
+ * Gets the issuer of the outbound message.
+ *
+ * @return issuer of the outbound message
+ */
+ public String getOutboundMessageIssuer();
+
+ /**
+ * Gets the transport used to respond to the message.
+ *
+ * @return transport used to respond to the message
+ */
+ public OutTransport getOutboundMessageTransport();
+
+ /**
+ * Gets the resolver used to determine active SecurityPolicy.
+ *
+ * @return resolver used to determine active SecurityPolicy
+ */
+ public SecurityPolicyResolver getSecurityPolicyResolver();
+
+ /**
+ * Gets whether the issuer of the inbound message represented by this context has been authenticated.
+ * What it means for the message issuer to be authenticate will vary by use and
+ * employed authentication mechanisms.
+ *
+ * @return whether the issuer of the inbound message represented by this context has been authenticated
+ */
+ public boolean isIssuerAuthenticated();
+
+ /**
+ * Sets the unique id of the communication profile in use.
+ *
+ * @param id unique id of the communication profile in use
+ */
+ public void setCommunicationProfileId(String id);
+
+ /**
+ * Sets the inbound message.
+ *
+ * @param message the inbound message
+ */
+ public void setInboundMessage(XMLObject message);
+
+ /**
+ * Sets the issuer of the inbound message.
+ *
+ * @param issuer issuer of the inbound message
+ */
+ public void setInboundMessageIssuer(String issuer);
+
+ /**
+ * Sets the transport used to used to receive the message.
+ *
+ * @param transport the transport used to receive the message
+ */
+ public void setInboundMessageTransport(InTransport transport);
+
+ /**
+ * Sets the outbound message.
+ *
+ * @param message the outbound message
+ */
+ public void setOutboundMessage(XMLObject message);
+
+ /**
+ * Sets the issuer of the outbound message.
+ *
+ * @param issuer issuer of the outbound message
+ */
+ public void setOutboundMessageIssuer(String issuer);
+
+ /**
+ * Sets the transport used to respond to the message.
+ *
+ * @param transport the transport used to respond to the message
+ */
+ public void setOutboundMessageTransport(OutTransport transport);
+
+ /**
+ * Sets the resolver used to determine active SecurityPolicy.
+ *
+ * @param resolver resolver used to determine active SecurityPolicy
+ */
+ public void setSecurityPolicyResolver(SecurityPolicyResolver resolver);
+
+ /**
+ * Get the pre-SecurityPolicy inbound handler chain resolver.
+ *
+ * @return the pre-security inbound handler chain resolver.
+ */
+ public HandlerChainResolver getPreSecurityInboundHandlerChainResolver();
+
+ /**
+ * Set the pre-SecurityPolicy inbound handler chain resolver.
+ *
+ * @param newHandlerChainResolver the new pre-SecurityPolicy inbound handler chain.
+ */
+ public void setPreSecurityInboundHandlerChainResolver(HandlerChainResolver newHandlerChainResolver);
+
+ /**
+ * Get the post-SecurityPolicy inbound handler chain resolver.
+ *
+ * @return the pre-SecurityPolicy inbound handler chain resolver.
+ */
+ public HandlerChainResolver getPostSecurityInboundHandlerChainResolver();
+
+ /**
+ * Set the post-SecurityPolicy inbound handler chain resolver.
+ *
+ * @param newHandlerChainResolver the new post-SecurityPolicy inbound handler chain resolver.
+ */
+ public void setPostSecurityInboundHandlerChainResolver(HandlerChainResolver newHandlerChainResolver);
+
+ /**
+ * Get the outbound handler chain resolver.
+ *
+ * @return the outbound handler chain resolver.
+ */
+ public HandlerChainResolver getOutboundHandlerChainResolver();
+
+ /**
+ * Set the outbound handler chain resolver.
+ *
+ * @param newHandlerChainResolver the new outbound handler chain resolver.
+ */
+ public void setOutboundHandlerChainResolver(HandlerChainResolver newHandlerChainResolver);
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/message/MessageContextEvaluatingFunctor.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/MessageContextEvaluatingFunctor.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/MessageContextEvaluatingFunctor.java 17 Aug 2012 15:09:06 -0000 1.1
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message;
+
+
+/**
+ * An interface for components which evaluate a message context as the basis for extracting, calculating,
+ * or otherwise producing a specific data value.
+ *
+ *
+ * Implementations should not have side effects and should not modify any data in the
+ * underlying message context. For a component that is intended to allow message context
+ * modification, see {@link MessageContextMutatingFunctor}.
+ *
+ *
+ * @param the type of product of the component
+ */
+public interface MessageContextEvaluatingFunctor {
+
+ /**
+ * Using the specified MessageContext as the evaluation context,
+ * produce a data value product of the appropriate type.
+ *
+ * @param msgContext the message context to evaluate
+ * @return value product based on the message context, or null
+ *
+ * @throws MessageException if there is a fatal error evaluating the context
+ */
+ public T evaluate(MessageContext msgContext) throws MessageException;
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/message/MessageContextMutatingFunctor.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/MessageContextMutatingFunctor.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/MessageContextMutatingFunctor.java 17 Aug 2012 15:09:06 -0000 1.1
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message;
+
+
+/**
+ * An interface for components which mutate a message context, or data contained therein,
+ * based on an input value of a particular type.
+ *
+ * @param the type of input to the operation to be performed on the message context
+ */
+public interface MessageContextMutatingFunctor {
+
+ /**
+ * Mutate the specified message context based on the supplied input value.
+ *
+ * @param msgContext the current message context
+ * @param input the input to the mutation operation
+ *
+ * @throws MessageException if there is a fatal error processing the context
+ */
+ public void mutate(MessageContext msgContext, T input) throws MessageException;
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/message/MessageException.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/MessageException.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/MessageException.java 17 Aug 2012 15:09:06 -0000 1.1
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message;
+
+import org.opensaml.ws.WSException;
+
+/**
+ * Base class for message related exceptions.
+ */
+public class MessageException extends WSException {
+
+ /** Serial version UID. */
+ private static final long serialVersionUID = 4437402731161754263L;
+
+ /**
+ * Constructor.
+ */
+ public MessageException() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ */
+ public MessageException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public MessageException(Exception wrappedException) {
+ super(wrappedException);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public MessageException(String message, Exception wrappedException) {
+ super(message, wrappedException);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/message/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/package.html 17 Aug 2012 15:09:06 -0000 1.1
@@ -0,0 +1,5 @@
+
+
+Objects related to messages received and sent by web services.
+
+
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/message/decoder/BaseMessageDecoder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/decoder/BaseMessageDecoder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/decoder/BaseMessageDecoder.java 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,215 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.decoder;
+
+import java.io.InputStream;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.message.encoder.MessageEncodingException;
+import org.opensaml.ws.security.SecurityPolicy;
+import org.opensaml.ws.security.SecurityPolicyResolver;
+import org.opensaml.xml.Configuration;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.Marshaller;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.io.Unmarshaller;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.parse.BasicParserPool;
+import org.opensaml.xml.parse.ParserPool;
+import org.opensaml.xml.parse.XMLParserException;
+import org.opensaml.xml.security.SecurityException;
+import org.opensaml.xml.util.XMLHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Base class for message decoders.
+ */
+public abstract class BaseMessageDecoder implements MessageDecoder {
+
+ /** Used to log protocol messages. */
+ private Logger protocolMessageLog = LoggerFactory.getLogger("PROTOCOL_MESSAGE");
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(BaseMessageDecoder.class);
+
+ /** Parser pool used to deserialize the message. */
+ private ParserPool parserPool;
+
+ /** Constructor. */
+ public BaseMessageDecoder() {
+ parserPool = new BasicParserPool();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param pool parser pool used to deserialize messages
+ */
+ public BaseMessageDecoder(ParserPool pool) {
+ if (pool == null) {
+ throw new IllegalArgumentException("Parser pool may not be null");
+ }
+
+ parserPool = pool;
+ }
+
+ /** {@inheritDoc} */
+ public void decode(MessageContext messageContext) throws MessageDecodingException, SecurityException {
+ log.debug("Beginning to decode message from inbound transport of type: {}", messageContext
+ .getInboundMessageTransport().getClass().getName());
+
+ doDecode(messageContext);
+
+ logDecodedMessage(messageContext);
+
+ processSecurityPolicy(messageContext);
+
+ log.debug("Successfully decoded message.");
+ }
+
+ /**
+ * Log the decoded message to the protocol message logger.
+ *
+ * @param messageContext the message context to process
+ */
+ protected void logDecodedMessage(MessageContext messageContext) {
+ if(protocolMessageLog.isDebugEnabled() && messageContext.getInboundMessage() != null){
+ if (messageContext.getInboundMessage().getDOM() == null) {
+ XMLObject message = messageContext.getInboundMessage();
+ Marshaller marshaller = Configuration.getMarshallerFactory().getMarshaller(message);
+ if (marshaller != null) {
+ try {
+ marshaller.marshall(message);
+ } catch (MarshallingException e) {
+ log.error("Unable to marshall message for logging purposes: " + e.getMessage());
+ }
+ }
+ else {
+ log.error("Unable to marshall message for logging purposes, no marshaller registered for message object: "
+ + message.getElementQName());
+ }
+ if (message.getDOM() == null) {
+ return;
+ }
+ }
+ protocolMessageLog.debug("\n" + XMLHelper.prettyPrintXML(messageContext.getInboundMessage().getDOM()));
+ }
+ }
+
+ /**
+ * Process any {@link SecurityPolicy}s which can be resolved for the message context.
+ *
+ * @param messageContext the message context to process
+ * @throws SecurityException thrown if the decoded message does not meet the required security constraints
+ */
+ protected void processSecurityPolicy(MessageContext messageContext) throws SecurityException {
+ SecurityPolicyResolver policyResolver = messageContext.getSecurityPolicyResolver();
+ if (policyResolver != null) {
+ Iterable securityPolicies = policyResolver.resolve(messageContext);
+ if (securityPolicies != null) {
+ for (SecurityPolicy policy : securityPolicies) {
+ if (policy != null) {
+ log.debug("Evaluating security policy of type '{}' for decoded message", policy.getClass()
+ .getName());
+ policy.evaluate(messageContext);
+ }
+ }
+ } else {
+ log.debug("No security policy resolved for this message context, no security policy evaluation attempted");
+ }
+ } else {
+ log.debug("No security policy resolver attached to this message context, no security policy evaluation attempted");
+ }
+ }
+
+ /**
+ * Decodes a message, updating the message context. Security policy evaluation is handled outside this method.
+ *
+ * @param messageContext current message context
+ *
+ * @throws MessageDecodingException thrown if there is a problem decoding the message
+ */
+ protected abstract void doDecode(MessageContext messageContext) throws MessageDecodingException;
+
+ /**
+ * Gets the parser pool used to deserialize incomming messages.
+ *
+ * @return parser pool used to deserialize incomming messages
+ */
+ protected ParserPool getParserPool() {
+ return parserPool;
+ }
+
+ /**
+ * Sets the parser pool used to deserialize incomming messages.
+ *
+ * @param pool parser pool used to deserialize incomming messages
+ */
+ protected void setParserPool(ParserPool pool) {
+ if (pool == null) {
+ throw new IllegalArgumentException("Parser pool may not be null");
+ }
+ parserPool = pool;
+ }
+
+ /**
+ * Helper method that deserializes and unmarshalls the message from the given stream.
+ *
+ * @param messageStream input stream containing the message
+ *
+ * @return the inbound message
+ *
+ * @throws MessageDecodingException thrown if there is a problem deserializing and unmarshalling the message
+ */
+ protected XMLObject unmarshallMessage(InputStream messageStream) throws MessageDecodingException {
+ log.debug("Parsing message stream into DOM document");
+
+ try {
+ Document messageDoc = parserPool.parse(messageStream);
+ Element messageElem = messageDoc.getDocumentElement();
+
+ if (log.isTraceEnabled()) {
+ log.trace("Resultant DOM message was:\n{}", XMLHelper.nodeToString(messageElem));
+ }
+
+ log.debug("Unmarshalling message DOM");
+ Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(messageElem);
+ if (unmarshaller == null) {
+ log.error("Unable to unmarshall message, no unmarshaller registered for message element "
+ + XMLHelper.getNodeQName(messageElem));
+ throw new MessageDecodingException(
+ "Unable to unmarshall message, no unmarshaller registered for message element "
+ + XMLHelper.getNodeQName(messageElem));
+ }
+
+ XMLObject message = unmarshaller.unmarshall(messageElem);
+
+ log.debug("Message succesfully unmarshalled");
+ return message;
+ } catch (XMLParserException e) {
+ log.error("Encountered error parsing message into its DOM representation", e);
+ throw new MessageDecodingException("Encountered error parsing message into its DOM representation", e);
+ } catch (UnmarshallingException e) {
+ log.error("Encountered error unmarshalling message from its DOM representation", e);
+ throw new MessageDecodingException("Encountered error unmarshalling message from its DOM representation", e);
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/message/decoder/MessageDecoder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/decoder/MessageDecoder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/decoder/MessageDecoder.java 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.decoder;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.xml.security.SecurityException;
+
+/**
+ * Decodes a message, from an inbound transport, in a binding specific manner. As the decode proceeds information is
+ * stored in the {@link MessageContext}. The decoding process deserializes the message from the inbound transport into
+ * its DOM representation, unmarshall the DOM into the appropriate XMLObject, and then evaluates the security policy
+ * against the inbound transport and decoded message.
+ *
+ * Message decoders MUST must be thread safe and stateless.
+ */
+public interface MessageDecoder {
+
+ /**
+ * Decodes a message in a binding specific manner.
+ *
+ * @param messageContext current message context
+ *
+ * @throws MessageDecodingException thrown if the message can not be decoded
+ * @throws SecurityException thrown if the decoded message does not meet the required security constraints
+ */
+ public void decode(MessageContext messageContext) throws MessageDecodingException, SecurityException;
+
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/message/decoder/MessageDecodingException.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/decoder/MessageDecodingException.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/decoder/MessageDecodingException.java 17 Aug 2012 15:09:10 -0000 1.1
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.decoder;
+
+import org.opensaml.ws.message.MessageException;
+
+/**
+ * Exception thrown when a problem occurs decoding a message from an input transport.
+ */
+public class MessageDecodingException extends MessageException {
+
+ /** Serial version UID. */
+ private static final long serialVersionUID = 8151752605618631906L;
+
+ /**
+ * Constructor.
+ */
+ public MessageDecodingException() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ */
+ public MessageDecodingException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public MessageDecodingException(Exception wrappedException) {
+ super(wrappedException);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public MessageDecodingException(String message, Exception wrappedException) {
+ super(message, wrappedException);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/message/decoder/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/decoder/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/decoder/package.html 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,5 @@
+
+
+Messages decoders are responsible for extracting an incomming web serivce message from the inbound transport.
+
+
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/message/encoder/BaseMessageEncoder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/encoder/BaseMessageEncoder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/encoder/BaseMessageEncoder.java 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.encoder;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.message.decoder.MessageDecodingException;
+import org.opensaml.xml.Configuration;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.Marshaller;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Element;
+
+/**
+ * Base class for message decoders.
+ */
+public abstract class BaseMessageEncoder implements MessageEncoder {
+
+ /** Used to log protocol messages. */
+ private Logger protocolMessageLog = LoggerFactory.getLogger("PROTOCOL_MESSAGE");
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(BaseMessageEncoder.class);
+
+ /** Constructor. */
+ public BaseMessageEncoder() {
+
+ }
+
+ /** {@inheritDoc} */
+ public void encode(MessageContext messageContext) throws MessageEncodingException {
+ log.debug("Beginning encode message to outbound transport of type: {}", messageContext
+ .getOutboundMessageTransport().getClass().getName());
+
+ doEncode(messageContext);
+
+ logEncodedMessage(messageContext);
+
+ log.debug("Successfully encoded message.");
+ }
+
+ /**
+ * Log the encoded message to the protocol message logger.
+ *
+ * @param messageContext the message context to process
+ */
+ protected void logEncodedMessage(MessageContext messageContext) {
+ if(protocolMessageLog.isDebugEnabled() && messageContext.getOutboundMessage() != null){
+ if (messageContext.getOutboundMessage().getDOM() == null) {
+ try {
+ marshallMessage(messageContext.getOutboundMessage());
+ } catch (MessageEncodingException e) {
+ log.error("Unable to marshall message for logging purposes: " + e.getMessage());
+ return;
+ }
+ }
+ protocolMessageLog.debug("\n" + XMLHelper.prettyPrintXML(messageContext.getOutboundMessage().getDOM()));
+ }
+ }
+
+ /**
+ * Encodes the outbound message onto the outbound transport.
+ *
+ * @param messageContext current message context
+ *
+ * @throws MessageEncodingException thrown if there is a problem encoding the message
+ */
+ protected abstract void doEncode(MessageContext messageContext) throws MessageEncodingException;
+
+ /**
+ * Helper method that marshalls the given message.
+ *
+ * @param message message the marshall and serialize
+ *
+ * @return marshalled message
+ *
+ * @throws MessageEncodingException thrown if the give message can not be marshalled into its DOM representation
+ */
+ protected Element marshallMessage(XMLObject message) throws MessageEncodingException {
+ log.debug("Marshalling message");
+
+ try {
+ Marshaller marshaller = Configuration.getMarshallerFactory().getMarshaller(message);
+ if (marshaller == null) {
+ log.error("Unable to marshall message, no marshaller registered for message object: "
+ + message.getElementQName());
+ throw new MessageEncodingException(
+ "Unable to marshall message, no marshaller registered for message object: "
+ + message.getElementQName());
+ }
+ Element messageElem = marshaller.marshall(message);
+ if (log.isTraceEnabled()) {
+ log.trace("Marshalled message into DOM:\n{}", XMLHelper.nodeToString(messageElem));
+ }
+ return messageElem;
+ } catch (MarshallingException e) {
+ log.error("Encountered error marshalling message to its DOM representation", e);
+ throw new MessageEncodingException("Encountered error marshalling message into its DOM representation", e);
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/message/encoder/MessageEncoder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/encoder/MessageEncoder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/encoder/MessageEncoder.java 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.encoder;
+
+import org.opensaml.ws.message.MessageContext;
+
+/**
+ * Encodes a message onto the outbound transport.
+ *
+ * Message encoders MUST must be thread safe and stateless.
+ */
+public interface MessageEncoder {
+
+ /**
+ * Encodes the message in the binding specific manner.
+ *
+ * @param messageContext current message context
+ *
+ * @throws MessageEncodingException thrown if the problem can not be encoded
+ */
+ public void encode(MessageContext messageContext) throws MessageEncodingException;
+
+ /**
+ * Indicates whether this encoder, given the current message context, provides end-to-end message confidentiality.
+ *
+ * @param messageContext the current message context
+ *
+ * @return true if the encoder provides end-to-end message confidentiality, false if not
+ *
+ * @throws MessageEncodingException thrown if the encoder encounter an error while attempt to evaluate its ability
+ * to provide message confidentiality.
+ */
+ public boolean providesMessageConfidentiality(MessageContext messageContext) throws MessageEncodingException;
+
+ /**
+ * Indicates whether this encoder, given the current message context, provides end-to-end message integrity.
+ *
+ * @param messageContext the current message context
+ *
+ * @return true if the encoder provides end-to-end message integrity, false if not
+ *
+ * @throws MessageEncodingException thrown if the encoder encounter an error while attempt to evaluate its ability
+ * to provide message integrity.
+ */
+ public boolean providesMessageIntegrity(MessageContext messageContext) throws MessageEncodingException;
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/message/encoder/MessageEncodingException.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/encoder/MessageEncodingException.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/encoder/MessageEncodingException.java 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.encoder;
+
+import org.opensaml.ws.message.MessageException;
+
+/**
+ * Exception thrown when a problem occurs encoding a message from to an output transport.
+ */
+public class MessageEncodingException extends MessageException {
+
+ /** Serial version UID. */
+ private static final long serialVersionUID = 5394876087412894874L;
+
+ /**
+ * Constructor.
+ */
+ public MessageEncodingException() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ */
+ public MessageEncodingException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public MessageEncodingException(Exception wrappedException) {
+ super(wrappedException);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public MessageEncodingException(String message, Exception wrappedException) {
+ super(message, wrappedException);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/message/encoder/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/encoder/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/encoder/package.html 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,5 @@
+
+
+Messages encoders are responsible for encoding an outgoing web serivce message onto the outbound transport.
+
+
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/message/handler/BaseHandlerChainAwareMessageDecoder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/handler/BaseHandlerChainAwareMessageDecoder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/handler/BaseHandlerChainAwareMessageDecoder.java 17 Aug 2012 15:09:11 -0000 1.1
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.handler;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.message.decoder.BaseMessageDecoder;
+import org.opensaml.ws.message.decoder.MessageDecodingException;
+import org.opensaml.xml.parse.ParserPool;
+import org.opensaml.xml.security.SecurityException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Base class for message decoders which are capable of processing the message context's inbound {@link HandlerChain}.
+ */
+public abstract class BaseHandlerChainAwareMessageDecoder extends BaseMessageDecoder implements HandlerChainAware {
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(BaseHandlerChainAwareMessageDecoder.class);
+
+ /**
+ * Constructor.
+ *
+ */
+ public BaseHandlerChainAwareMessageDecoder() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param pool parser pool used to deserialize messages
+ */
+ public BaseHandlerChainAwareMessageDecoder(ParserPool pool) {
+ super(pool);
+ }
+
+ /** {@inheritDoc} */
+ public void decode(MessageContext messageContext) throws MessageDecodingException, SecurityException {
+ log.debug("Beginning to decode message from inbound transport of type: {}", messageContext
+ .getInboundMessageTransport().getClass().getName());
+
+ doDecode(messageContext);
+
+ logDecodedMessage(messageContext);
+
+ processPreSecurityInboundHandlerChain(messageContext);
+ log.debug("Successfully processed pre-SecurityPolicy inbound handler chain.");
+
+ processSecurityPolicy(messageContext);
+
+ processPostSecurityInboundHandlerChain(messageContext);
+ log.debug("Successfully processed post-SecurityPolicy inbound handler chain.");
+
+ log.debug("Successfully decoded message.");
+ }
+
+ /**
+ * Process the pre-SecurityPolicy inbound {@link HandlerChain} for the message context, if any.
+ *
+ * @param messageContext the message context to process
+ * @throws MessageDecodingException thrown if a handler indicates a problem handling the message
+ */
+ protected void processPreSecurityInboundHandlerChain(MessageContext messageContext)
+ throws MessageDecodingException {
+ HandlerChainResolver inboundHandlerChainResolver = messageContext.getPreSecurityInboundHandlerChainResolver();
+ if (inboundHandlerChainResolver != null) {
+ log.debug("Invoking pre-SecurityPolicy inbound handler chain on message context");
+ try {
+ for (HandlerChain inboundHandlerChain : inboundHandlerChainResolver.resolve(messageContext)) {
+ if (inboundHandlerChain != null) {
+ invokeHandlerChain(inboundHandlerChain, messageContext);
+ }
+ }
+ } catch (HandlerException e) {
+ log.error("Encountered pre-SecurityPolicy HandlerException when decoding message: {}", e.getMessage());
+ throw new MessageDecodingException("Pre-SecurityPolicy Handler exception while decoding message", e);
+ }
+ }
+ }
+
+ /**
+ * Process the post-SecurityPolicy inbound {@link HandlerChain} for the message context, if any.
+ *
+ * @param messageContext the message context to process
+ * @throws MessageDecodingException thrown if a handler indicates a problem handling the message
+ */
+ protected void processPostSecurityInboundHandlerChain(MessageContext messageContext)
+ throws MessageDecodingException {
+ HandlerChainResolver inboundHandlerChainResolver = messageContext.getPostSecurityInboundHandlerChainResolver();
+ if (inboundHandlerChainResolver != null) {
+ log.debug("Invoking post-SecurityPolicy inbound handler chain on message context");
+ try {
+ for (HandlerChain inboundHandlerChain : inboundHandlerChainResolver.resolve(messageContext)) {
+ if (inboundHandlerChain != null) {
+ invokeHandlerChain(inboundHandlerChain, messageContext);
+ }
+ }
+ } catch (HandlerException e) {
+ log.error("Encountered post-SecurityPolicy HandlerException when decoding message: {}", e.getMessage());
+ throw new MessageDecodingException("Handler exception while decoding message", e);
+ }
+ }
+ }
+
+ /**
+ * Invoke a handler chain on the specified message context.
+ *
+ * @param handlerChain the handle chain to invoke
+ * @param messageContext the message context to process
+ *
+ * @throws HandlerException if handler chain encountered a problem handling the message context
+ */
+ protected void invokeHandlerChain(HandlerChain handlerChain, MessageContext messageContext)
+ throws HandlerException {
+ if (handlerChain != null && messageContext != null) {
+ handlerChain.invoke(messageContext);
+ }
+ }
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/message/handler/BaseHandlerChainAwareMessageEncoder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/handler/BaseHandlerChainAwareMessageEncoder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/handler/BaseHandlerChainAwareMessageEncoder.java 17 Aug 2012 15:09:11 -0000 1.1
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.handler;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.message.encoder.BaseMessageEncoder;
+import org.opensaml.ws.message.encoder.MessageEncodingException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Base class for message encoders which are capable of processing the message context's outbound {@link HandlerChain}.
+ */
+public abstract class BaseHandlerChainAwareMessageEncoder extends BaseMessageEncoder implements HandlerChainAware {
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(BaseHandlerChainAwareMessageEncoder.class);
+
+ /** {@inheritDoc} */
+ protected void doEncode(MessageContext messageContext) throws MessageEncodingException {
+ prepareMessageContext(messageContext);
+
+ processOutboundHandlerChain(messageContext);
+
+ encodeToTransport(messageContext);
+ }
+
+ /**
+ * Perform final binding-specific processing of message context and prepare it for encoding
+ * to the transport.
+ *
+ *
+ * This should include constructing and populating all binding-specific structure and data that needs to be
+ * reflected by the message context's properties.
+ *
+ *
+ *
+ * This method is called prior to {@link #processOutboundHandlerChain(MessageContext)}.
+ *
+ *
+ * @param messageContext the message context to process
+ * @throws MessageEncodingException thrown if there is a problem preparing the message context
+ * for encoding
+ */
+ protected abstract void prepareMessageContext(MessageContext messageContext) throws MessageEncodingException;
+
+ /**
+ * Encode the message context to the transport.
+ *
+ * @param messageContext the message context to process
+ * @throws MessageEncodingException thrown if there is a problem encoding the message context
+ * to the transport
+ */
+ protected abstract void encodeToTransport(MessageContext messageContext) throws MessageEncodingException;
+
+ /**
+ * Process the outbound {@link HandlerChain} for the message context, if any.
+ *
+ * @param messageContext the message context to process
+ * @throws MessageEncodingException thrown if a handler indicates a problem handling the message
+ */
+ protected void processOutboundHandlerChain(MessageContext messageContext) throws MessageEncodingException {
+ HandlerChainResolver outboundHandlerChainResolver = messageContext.getOutboundHandlerChainResolver();
+ if (outboundHandlerChainResolver != null) {
+ log.debug("Invoking outbound handler chain on message context");
+ try {
+ for (HandlerChain outboundHandlerChain : outboundHandlerChainResolver.resolve(messageContext)) {
+ if (outboundHandlerChain != null) {
+ invokeHandlerChain(outboundHandlerChain, messageContext);
+ }
+ }
+ } catch (HandlerException e) {
+ log.error("Encountered HandlerException when encoding message: {}", e.getMessage());
+ throw new MessageEncodingException("Handler exception while encoding message", e);
+ }
+ }
+ }
+
+ /**
+ * Invoke a handler chain on the specified message context.
+ *
+ * @param handlerChain the handle chain to invoke
+ * @param messageContext the message context to process
+ *
+ * @throws HandlerException if handler chain encountered a problem handling the message context
+ */
+ protected void invokeHandlerChain(HandlerChain handlerChain, MessageContext messageContext)
+ throws HandlerException {
+ if (handlerChain != null && messageContext != null) {
+ handlerChain.invoke(messageContext);
+ }
+ }
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/message/handler/BasicHandlerChain.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/handler/BasicHandlerChain.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/handler/BasicHandlerChain.java 17 Aug 2012 15:09:11 -0000 1.1
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.handler;
+
+import java.util.List;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.xml.util.LazyList;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A basic implementation of {@link HandlerChain}.
+ */
+public class BasicHandlerChain implements HandlerChain {
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(BasicHandlerChain.class);
+
+ /** The handler chain. */
+ private List handlers;
+
+ /** Constructor. */
+ public BasicHandlerChain() {
+ handlers = new LazyList();
+ }
+
+ /** {@inheritDoc} */
+ public List getHandlers() {
+ return handlers;
+ }
+
+ /** {@inheritDoc} */
+ public void invoke(MessageContext msgContext) throws HandlerException {
+ log.trace("Invoking handler chain");
+ for (Handler handler : getHandlers()) {
+ log.trace("Invoking handler: {}", handler.getClass().getName());
+ handler.invoke(msgContext);
+ }
+ }
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/message/handler/BasicPhasedHandlerChain.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/handler/BasicPhasedHandlerChain.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/handler/BasicPhasedHandlerChain.java 17 Aug 2012 15:09:11 -0000 1.1
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.handler;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.opensaml.xml.util.LazyList;
+import org.opensaml.xml.util.LazyMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A basic implementation of {@link PhasedHandlerChain}.
+ */
+public class BasicPhasedHandlerChain extends BasicHandlerChain implements PhasedHandlerChain {
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(BasicPhasedHandlerChain.class);
+
+ /** The ordered list of phases to invoke. */
+ private List phaseOrder;
+
+ /** Map of phases to corresponding Handler chain. */
+ private Map phaseChains;
+
+ /** Constructor. */
+ public BasicPhasedHandlerChain() {
+ super();
+ phaseOrder = new LazyList();
+ phaseChains = new LazyMap();
+ }
+
+ /** {@inheritDoc} */
+ public List getHandlers() {
+ ArrayList handlers = new ArrayList();
+ for (String phaseName : getPhaseOrder()) {
+ HandlerChain phase = getPhaseChains().get(phaseName);
+ if (phase != null) {
+ List phaseHandlers = phase.getHandlers();
+ if (!phaseHandlers.isEmpty()) {
+ handlers.addAll(phaseHandlers);
+ } else {
+ log.info("Specified phase name '{}' exists in PhasedHandlerChain, but contains no handlers",
+ phaseName);
+ }
+ } else {
+ log.warn("Specified phase name '{}' does not exist in PhasedHandlerChain: {}",
+ phaseName, getPhaseChains().keySet());
+ }
+ }
+ return Collections.unmodifiableList(handlers);
+ }
+
+ /** {@inheritDoc} */
+ public Map getPhaseChains() {
+ return phaseChains;
+ }
+
+ /** {@inheritDoc} */
+ public List getPhaseOrder() {
+ return phaseOrder;
+ }
+
+ /** {@inheritDoc} */
+ public void setPhaseOrder(List newPhaseOrder) {
+ phaseOrder = newPhaseOrder;
+ }
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/message/handler/Handler.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/handler/Handler.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/handler/Handler.java 17 Aug 2012 15:09:11 -0000 1.1
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.handler;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.message.decoder.MessageDecoder;
+import org.opensaml.ws.message.encoder.MessageEncoder;
+
+/**
+ * A handler is invoked to implement specific business logic on a {@link MessageContext}.
+ *
+ *
+ * It is most commonly used to invoke logic within {@link MessageEncoder}'s and {@link MessageDecoder}'s,
+ * but could also be used outside of that framework.
+ *
+ *
+ */
+public interface Handler {
+
+ /**
+ * Invoke the handler on the specified message context.
+ *
+ * @param msgContext the message context on which to invoke the handler
+ * @throws HandlerException if there is a problem handling the message context
+ */
+ public void invoke(MessageContext msgContext) throws HandlerException;
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/message/handler/HandlerChain.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/handler/HandlerChain.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/handler/HandlerChain.java 17 Aug 2012 15:09:11 -0000 1.1
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.handler;
+
+import java.util.List;
+
+import org.opensaml.ws.message.MessageContext;
+
+/**
+ * An ordered chain of {@link Handler} instances which may be invoked on a message context.
+ */
+public interface HandlerChain {
+
+ /**
+ * Invoke the handler chain on the specified message context.
+ *
+ * @param msgContext the message context on which to invoke the handler chain
+ * @throws HandlerException if there is a problem handling the message context
+ */
+ public void invoke(MessageContext msgContext) throws HandlerException;
+
+
+ /**
+ * Get the modifiable list of handlers in the handler chain.
+ *
+ * @return list of handlers
+ */
+ public List getHandlers();
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/message/handler/HandlerChainAware.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/handler/HandlerChainAware.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/handler/HandlerChainAware.java 17 Aug 2012 15:09:11 -0000 1.1
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.handler;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.message.decoder.MessageDecoder;
+import org.opensaml.ws.message.encoder.MessageEncoder;
+
+/**
+ * A marker interface for {@link MessageDecoder} and {@link MessageEncoder} implementations
+ * which process a message context's {@link Handler}'s.
+ *
+ *
+ * Specifically, it identifies those implementations which process the handlers produced by a message context's
+ * {@link MessageContext#getPreSecurityInboundHandlerChainResolver()} and
+ * {@link MessageContext#getPostSecurityInboundHandlerChainResolver()},
+ * and {@link MessageContext#getOutboundHandlerChainResolver()}, for decoders and encoders respectively.
+ *
+ */
+public interface HandlerChainAware {
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/message/handler/HandlerChainResolver.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/handler/HandlerChainResolver.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/handler/HandlerChainResolver.java 17 Aug 2012 15:09:11 -0000 1.1
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.handler;
+
+import org.opensaml.ws.message.MessageContext;
+
+/**
+ * A resolver which uses the message context information to resolve and return instances of {@link HandlerChain}.
+ */
+public interface HandlerChainResolver {
+
+ /**
+ * Resolve handler chain instances based on the message context.
+ *
+ * @param messageContext the message context to process
+ * @return resolved handler chains
+ * @throws HandlerException thrown if there is an error resolving the handler chain
+ */
+ Iterable resolve(MessageContext messageContext) throws HandlerException;
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/message/handler/HandlerException.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/handler/HandlerException.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/handler/HandlerException.java 17 Aug 2012 15:09:11 -0000 1.1
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.handler;
+
+import org.opensaml.ws.message.MessageException;
+
+
+/**
+ * Base class for message handler related exceptions.
+ */
+public class HandlerException extends MessageException {
+
+ /** Serial version UID. */
+ private static final long serialVersionUID = -897750712163000591L;
+
+ /**
+ * Constructor.
+ */
+ public HandlerException() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ */
+ public HandlerException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public HandlerException(Exception wrappedException) {
+ super(wrappedException);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public HandlerException(String message, Exception wrappedException) {
+ super(message, wrappedException);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/message/handler/PhasedHandlerChain.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/handler/PhasedHandlerChain.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/handler/PhasedHandlerChain.java 17 Aug 2012 15:09:11 -0000 1.1
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.handler;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * A specialized type of {@link HandlerChain} which supports organizing multiple
+ * handler chains into a set of named handler chains called 'phases', which will be
+ * invoked in a specified order.
+ */
+public interface PhasedHandlerChain extends HandlerChain {
+
+ /**
+ * Modifiable map of phase names to corresponding handler chains.
+ *
+ * @return the map of phase names to handler chains
+ */
+ public Map getPhaseChains();
+
+ /**
+ * Get the order of phase invocation. Handler chains will be invoked in the order
+ * determined by this list.
+ *
+ * @return the ordered list of phase names
+ */
+ public List getPhaseOrder();
+
+ /**
+ * Set the order of phase invocation. Handler chains will be invoked in the order
+ * determined by this list.
+ *
+ * @param newPhaseOrder a list of phase names
+ */
+ public void setPhaseOrder(List newPhaseOrder);
+
+ /**
+ * Get the complete effective list of ordered handlers in the handler chain.
+ *
+ *
+ * Note that unlike {@link HandlerChain}, the returned list is NOTmodifiable.
+ * {@link Handler} instances in the effective chain should be added and removed via
+ * membership in the appropriate handler chain phase, obtained via {@link #getPhaseChains()}.
+ *
+ *
+ * @return list of handlers
+ */
+ public List getHandlers();
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/message/handler/StaticHandlerChainResolver.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/message/handler/StaticHandlerChainResolver.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/message/handler/StaticHandlerChainResolver.java 17 Aug 2012 15:09:11 -0000 1.1
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.message.handler;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.xml.util.LazyList;
+
+/** A simple handler chain resolver implementation that returns a static list of handler chains. */
+public class StaticHandlerChainResolver implements HandlerChainResolver {
+
+ /** Registered handler chains. */
+ private List handlerChains;
+
+ /**
+ * Constructor.
+ *
+ * @param newHandlerChain the static handler chain returned by this resolver
+ */
+ public StaticHandlerChainResolver(HandlerChain newHandlerChain) {
+ handlerChains = new LazyList();
+ if(newHandlerChain != null){
+ handlerChains.add(newHandlerChain);
+ }
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param newHandlerChains the static list of handler chains returned by this resolver
+ */
+ public StaticHandlerChainResolver(List newHandlerChains) {
+ handlerChains = new LazyList();
+ if(newHandlerChains != null){
+ handlerChains.addAll(newHandlerChains);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public Iterable resolve(MessageContext messageContext) throws HandlerException {
+ return Collections.unmodifiableList(handlerChains);
+ }
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/security/SecurityPolicy.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/security/SecurityPolicy.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/security/SecurityPolicy.java 17 Aug 2012 15:09:12 -0000 1.1
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.security;
+
+import java.util.List;
+
+import org.opensaml.ws.message.MessageContext;
+
+/**
+ * A security policy is a collection of {@link SecurityPolicyRule}, evaluated against a {@link MessageContext}, that
+ * is meant to determine if a message is well-formed, valid, and otherwise okay to process.
+ *
+ * Security policies MUST be thread safe and stateless.
+ */
+public interface SecurityPolicy {
+
+ /**
+ * Gets the rules that are evaluated for this policy.
+ *
+ * @return rules that are evaluated for this policy
+ */
+ public List getPolicyRules();
+
+ /**
+ * Evaluates this policy. Rules are evaluated in the order returned by {@link #getPolicyRules()}.
+ *
+ * @param messageContext the message context being evaluated
+ *
+ * @throws SecurityPolicyException thrown if the requirements of the security policy, including those of
+ * any of its rules, are not satisfied by the given message context. Also thrown if any error
+ * is encountered during evaluation
+ */
+ public void evaluate(MessageContext messageContext) throws SecurityPolicyException;
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/security/SecurityPolicyException.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/security/SecurityPolicyException.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/security/SecurityPolicyException.java 17 Aug 2012 15:09:12 -0000 1.1
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.security;
+
+import org.opensaml.xml.security.SecurityException;
+
+/**
+ * Exception indicating a security policy failure.
+ */
+public class SecurityPolicyException extends SecurityException {
+
+ /**
+ * Serial version UID.
+ */
+ private static final long serialVersionUID = -1074554750436470084L;
+
+ /**
+ * Constructor.
+ */
+ public SecurityPolicyException() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ */
+ public SecurityPolicyException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public SecurityPolicyException(Exception wrappedException) {
+ super(wrappedException);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public SecurityPolicyException(String message, Exception wrappedException) {
+ super(message, wrappedException);
+ }
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/security/SecurityPolicyResolver.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/security/SecurityPolicyResolver.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/security/SecurityPolicyResolver.java 17 Aug 2012 15:09:12 -0000 1.1
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.security;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.xml.security.Resolver;
+
+/**
+ * A resolver which uses different criteria to resolve and return instances of {@link SecurityPolicy}.
+ */
+public interface SecurityPolicyResolver extends Resolver {
+
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/security/SecurityPolicyRule.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/security/SecurityPolicyRule.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/security/SecurityPolicyRule.java 17 Aug 2012 15:09:12 -0000 1.1
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.security;
+
+import org.opensaml.ws.message.MessageContext;
+
+/**
+ * An individual rule that a message context is required to meet in order to be considered valid.
+ *
+ * Rules MUST be thread safe and stateless.
+ */
+public interface SecurityPolicyRule {
+
+ /**
+ * Evaluates the message context against the rule.
+ *
+ * @param messageContext the message context being evaluated
+ *
+ * @throws SecurityPolicyException thrown if the message context does not meet the requirements of the rule,
+ * or if there is a non-recoverable error during evaluation
+ */
+ public void evaluate(MessageContext messageContext) throws SecurityPolicyException;
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/security/ServletRequestX509CredentialAdapter.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/security/ServletRequestX509CredentialAdapter.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/security/ServletRequestX509CredentialAdapter.java 17 Aug 2012 15:09:12 -0000 1.1
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.security;
+
+import java.security.cert.X509Certificate;
+import java.util.Arrays;
+
+import javax.servlet.ServletRequest;
+
+import org.opensaml.xml.security.credential.UsageType;
+import org.opensaml.xml.security.x509.BasicX509Credential;
+import org.opensaml.xml.security.x509.X509Credential;
+
+/**
+ * An adapter that exposes the X.509 certificates contained in the servlet request attribute.
+ */
+public class ServletRequestX509CredentialAdapter extends BasicX509Credential implements X509Credential {
+
+ /** Servlet request attribute to pull certificate info from. */
+ public static final String X509_CERT_REQUEST_ATTRIBUTE = "javax.servlet.request.X509Certificate";
+
+ /**
+ * Constructor.
+ *
+ * @param request the servlet request
+ */
+ public ServletRequestX509CredentialAdapter(ServletRequest request) {
+ X509Certificate[] chain = (X509Certificate[]) request.getAttribute(X509_CERT_REQUEST_ATTRIBUTE);
+ if (chain == null || chain.length == 0) {
+ throw new IllegalArgumentException("Servlet request does not contain X.509 certificates in attribute "
+ + X509_CERT_REQUEST_ATTRIBUTE);
+ }
+
+ setEntityCertificate(chain[0]);
+ setEntityCertificateChain(Arrays.asList(chain));
+ setUsageType(UsageType.SIGNING);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/security/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/security/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/security/package.html 17 Aug 2012 15:09:12 -0000 1.1
@@ -0,0 +1,7 @@
+
+
+Provides interfaces that may be used to implement policies that are evaluated against incoming messages. Such policies
+may include things like message replay detection, SOAP version enforcement, SOAP "mustUnderstand" attribute enforcement,
+etc.
+
+
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/security/provider/BaseTrustEngineRule.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/security/provider/BaseTrustEngineRule.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/security/provider/BaseTrustEngineRule.java 17 Aug 2012 15:09:11 -0000 1.1
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.security.provider;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.security.SecurityPolicyException;
+import org.opensaml.ws.security.SecurityPolicyRule;
+import org.opensaml.xml.security.CriteriaSet;
+import org.opensaml.xml.security.SecurityException;
+import org.opensaml.xml.security.trust.TrustEngine;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Base rule which uses a trust engine to evaluate a token extracted from the request or message.
+ *
+ * @param type of token which is being evaluated by the underlying trust engine
+ */
+public abstract class BaseTrustEngineRule implements SecurityPolicyRule {
+
+ /** Logger. */
+ private final Logger log = LoggerFactory.getLogger(BaseTrustEngineRule.class);
+
+ /** Trust engine used to verify the particular token type. */
+ private TrustEngine trustEngine;
+
+ /**
+ * Constructor.
+ *
+ * @param engine Trust engine used to verify the particular token type
+ */
+ public BaseTrustEngineRule(TrustEngine engine) {
+ trustEngine = engine;
+ }
+
+ /**
+ * Gets the engine used to validate the untrusted token.
+ *
+ * @return engine engine used to validate the untrusted token
+ */
+ protected TrustEngine getTrustEngine() {
+ return trustEngine;
+ }
+
+ /**
+ * Subclasses are required to implement this method to build a criteria set for the trust engine
+ * according to trust engine and application-specific needs.
+ *
+ * @param entityID the candidate issuer entity ID which is being evaluated
+ * @param messageContext the message context which is being evaluated
+ * @return a newly constructly set of criteria suitable for the configured trust engine
+ * @throws SecurityPolicyException thrown if criteria set can not be constructed
+ */
+ protected abstract CriteriaSet buildCriteriaSet(String entityID, MessageContext messageContext)
+ throws SecurityPolicyException;
+
+ /**
+ * Evaluate the token using the configured trust engine against criteria built using
+ * the specified candidate issuer entity ID and message context information.
+ *
+ * @param token the token to be evaluated
+ * @param entityID the candidate issuer entity ID which is being evaluated
+ * @param messageContext the message context which is being evaluated
+ * @return true if the token satisfies the criteria as determined by the trust engine, otherwise false
+ * @throws SecurityPolicyException thrown if there is a fatal error during trust engine evaluation
+ */
+ protected boolean evaluate(TokenType token, String entityID, MessageContext messageContext)
+ throws SecurityPolicyException {
+
+ CriteriaSet criteriaSet = buildCriteriaSet(entityID, messageContext);
+ if (criteriaSet == null) {
+ log.error("Returned criteria set was null, can not perform trust engine evaluation of token");
+ throw new SecurityPolicyException("Returned criteria set was null");
+ }
+
+ return evaluate(token, criteriaSet);
+ }
+
+ /**
+ * Evaluate the token against the specified criteria using the configured trust engine.
+ *
+ * @param token the token to be evaluated
+ * @param criteriaSet the set of criteria against which to evaluate the token
+ * @return true if the token satisfies the criteria as determined by the trust engine, otherwise false
+ * @throws SecurityPolicyException thrown if there is a fatal error during trust engine evaluation
+ */
+ protected boolean evaluate(TokenType token, CriteriaSet criteriaSet) throws SecurityPolicyException {
+ try {
+ return getTrustEngine().validate(token, criteriaSet);
+ } catch (SecurityException e) {
+ log.error("There was an error evaluating the request's token using the trust engine", e);
+ throw new SecurityPolicyException("Error during trust engine evaluation of the token", e);
+ }
+ }
+
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/security/provider/BasicSecurityPolicy.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/security/provider/BasicSecurityPolicy.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/security/provider/BasicSecurityPolicy.java 17 Aug 2012 15:09:10 -0000 1.1
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.security.provider;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.security.SecurityPolicy;
+import org.opensaml.ws.security.SecurityPolicyException;
+import org.opensaml.ws.security.SecurityPolicyRule;
+
+/**
+ * Basic security policy implementation which evaluates a given set of {@link SecurityPolicyRule} in an ordered manner.
+ *
+ * A policy evaluates successfully if, and only if, all policy rules evaluate successfully.
+ */
+public class BasicSecurityPolicy implements SecurityPolicy {
+
+ /** Registered security rules. */
+ private ArrayList rules;
+
+ /** Constructor. */
+ public BasicSecurityPolicy(){
+ rules = new ArrayList(5);
+ }
+
+ /** {@inheritDoc} */
+ public List getPolicyRules() {
+ return rules;
+ }
+
+ /** {@inheritDoc} */
+ public void evaluate(MessageContext messageContext) throws SecurityPolicyException {
+ for(SecurityPolicyRule rule : getPolicyRules()){
+ rule.evaluate(messageContext);
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/security/provider/CertificateNameOptions.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/security/provider/CertificateNameOptions.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/security/provider/CertificateNameOptions.java 17 Aug 2012 15:09:10 -0000 1.1
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.security.provider;
+
+import java.util.LinkedHashSet;
+
+import javax.security.auth.x500.X500Principal;
+
+import org.opensaml.xml.security.x509.InternalX500DNHandler;
+import org.opensaml.xml.security.x509.X500DNHandler;
+
+/**
+ * Options for deriving message context issuer names from an X.509 certificate. Used by {@link ClientCertAuthRule}.
+ */
+public class CertificateNameOptions implements Cloneable {
+
+ /** Evaluate the certificate subject DN as a derived issuer entity ID. */
+ private boolean evaluateSubjectDN;
+
+ /** Evaluate the certificate subject DN's common name (CN) as a derived issuer entity ID. */
+ private boolean evaluateSubjectCommonName;
+
+ /** The set of types of subject alternative names evaluate as derived issuer entity ID names. */
+ private LinkedHashSet subjectAltNames;
+
+ /**
+ * Responsible for serializing X.500 names to strings from certificate-derived {@link X500Principal} instances.
+ */
+ private X500DNHandler x500DNHandler;
+
+ /** The format specifier for serializaing X.500 subject names to strings. */
+ private String x500SubjectDNFormat;
+
+ /** Constructor. */
+ public CertificateNameOptions() {
+ subjectAltNames = new LinkedHashSet();
+ x500DNHandler = new InternalX500DNHandler();
+ x500SubjectDNFormat = X500DNHandler.FORMAT_RFC2253;
+ }
+
+ /**
+ * Get whether to evaluate the certificate subject DN's common name (CN) as a derived issuer entity ID.
+ *
+ * @return Returns the evaluateSubjectCommonName.
+ */
+ public boolean evaluateSubjectCommonName() {
+ return evaluateSubjectCommonName;
+ }
+
+ /**
+ * Set whether to evaluate the certificate subject DN's common name (CN) as a derived issuer entity ID.
+ *
+ * @param flag new new evaluateSubjectCommonName value.
+ */
+ public void setEvaluateSubjectCommonName(boolean flag) {
+ evaluateSubjectCommonName = flag;
+ }
+
+ /**
+ * Get whether to evaluate the certificate subject DN as a derived issuer entity ID.
+ *
+ * @return Returns the evaluateSubjectDN.
+ */
+ public boolean evaluateSubjectDN() {
+ return evaluateSubjectDN;
+ }
+
+ /**
+ * Set whether to evaluate the certificate subject DN as a derived issuer entity ID.
+ *
+ * @param flag the new evaluateSubjectDN value.
+ */
+ public void setEvaluateSubjectDN(boolean flag) {
+ evaluateSubjectDN = flag;
+ }
+
+ /**
+ * Get the set of types of subject alternative names evaluate as derived issuer entity ID names.
+ *
+ * @return Returns the subjectAltNames.
+ */
+ public LinkedHashSet getSubjectAltNames() {
+ return subjectAltNames;
+ }
+
+ /**
+ * Get the handler responsible for serializing X.500 names to strings from certificate-derived
+ * {@link X500Principal} instances.
+ *
+ * @return Returns the x500DNHandler.
+ */
+ public X500DNHandler getX500DNHandler() {
+ return x500DNHandler;
+ }
+
+ /**
+ * Set the handler responsible for serializing X.500 names to strings from certificate-derived
+ * {@link X500Principal} instances.
+ *
+ * @param handler the new x500DNHandler value.
+ */
+ public void setX500DNHandler(X500DNHandler handler) {
+ if (handler == null) {
+ throw new IllegalArgumentException("X500DNHandler may not be null");
+ }
+ x500DNHandler = handler;
+ }
+
+ /**
+ * Get the the format specifier for serializaing X.500 subject names to strings.
+ *
+ * @return Returns the x500SubjectDNFormat.
+ */
+ public String getX500SubjectDNFormat() {
+ return x500SubjectDNFormat;
+ }
+
+ /**
+ * Set the the format specifier for serializaing X.500 subject names to strings.
+ *
+ * @param format the new x500SubjectDNFormat value.
+ */
+ public void setX500SubjectDNFormat(String format) {
+ x500SubjectDNFormat = format;
+ }
+
+ /** {@inheritDoc} */
+ public CertificateNameOptions clone() {
+ CertificateNameOptions clonedOptions;
+ try {
+ clonedOptions = (CertificateNameOptions) super.clone();
+ } catch (CloneNotSupportedException e) {
+ // we know we're cloneable, so this will never happen
+ return null;
+ }
+
+ clonedOptions.subjectAltNames = new LinkedHashSet();
+ clonedOptions.subjectAltNames.addAll(this.subjectAltNames);
+
+ clonedOptions.x500DNHandler = this.x500DNHandler.clone();
+
+ return clonedOptions;
+ }
+
+}
+
Index: 3rdParty_sources/openws/org/opensaml/ws/security/provider/ClientCertAuthRule.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/security/provider/ClientCertAuthRule.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/security/provider/ClientCertAuthRule.java 17 Aug 2012 15:09:10 -0000 1.1
@@ -0,0 +1,503 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.security.provider;
+
+import java.security.cert.CertificateEncodingException;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.security.SecurityPolicyException;
+import org.opensaml.xml.security.CriteriaSet;
+import org.opensaml.xml.security.credential.Credential;
+import org.opensaml.xml.security.credential.UsageType;
+import org.opensaml.xml.security.criteria.EntityIDCriteria;
+import org.opensaml.xml.security.criteria.UsageCriteria;
+import org.opensaml.xml.security.trust.TrustEngine;
+import org.opensaml.xml.security.x509.X509Credential;
+import org.opensaml.xml.security.x509.X509Util;
+import org.opensaml.xml.util.Base64;
+import org.opensaml.xml.util.DatatypeHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Policy rule that checks if the client cert used to authenticate the request is valid and trusted.
+ *
+ *
+ * This rule is only evaluated if the message context contains a peer {@link X509Credential} as returned from the
+ * inbound message context's inbound message transport {@link org.opensaml.ws.transport.Transport#getPeerCredential()}.
+ *
+ *
+ *
+ * The entity ID used to perform trust evaluation of the X509 credential is first retrieved via
+ * {@link #getCertificatePresenterEntityID(MessageContext)}. If this value is non-null, trust evaluation proceeds on
+ * that basis. If trust evaluation using this entity ID is successful, the message context's inbound transport
+ * authentication state will be set to true
and processing is terminated. If unsuccessful, a
+ * {@link SecurityPolicyException} is thrown.
+ *
+ *
+ *
+ * If a non-null value was available from {@link #getCertificatePresenterEntityID(MessageContext)}, then rule evaluation
+ * will be attempted as described in {@link #evaluateCertificateNameDerivedPresenters(X509Credential, MessageContext)},
+ * based on the currently configured certificate name evaluation options. If this method returns a non-null certificate
+ * presenter entity ID, it will be set on the message context by calling
+ * {@link #setAuthenticatedCertificatePresenterEntityID(MessageContext, String)} The message context's inbound transport
+ * authentication state will be set to true
via
+ * {@link org.opensaml.ws.transport.InTransport#setAuthenticated(boolean)}. Rule processing is then terminated. If the
+ * method returns null, the client certificate presenter entity ID and inbound transport authentication state will
+ * remain unmodified and rule processing continues.
+ *
+ *
+ *
+ * Finally rule evaluation will proceed as described in
+ * {@link #evaluateDerivedPresenters(X509Credential, MessageContext)}. This is primarily an extension point by which
+ * subclasses may implement specific custom logic. If this method returns a non-null client certificate presenter entity
+ * ID, it will be set via {@link #setAuthenticatedCertificatePresenterEntityID(MessageContext, String)}, the message
+ * context's inbound transport authentication state will be set to true
and rule processing is terminated.
+ * If the method returns null, the client certificate presenter entity ID and transport authentication state will remain
+ * unmodified.
+ *
+ */
+public class ClientCertAuthRule extends BaseTrustEngineRule {
+
+ /** Logger. */
+ private final Logger log = LoggerFactory.getLogger(ClientCertAuthRule.class);
+
+ /** Options for derving client cert presenter entity ID's from an X.509 certificate. */
+ private CertificateNameOptions certNameOptions;
+
+ /**
+ * Constructor.
+ *
+ * @param engine Trust engine used to verify the request X509Credential
+ * @param nameOptions options for deriving certificate presenter entity ID's from an X.509 certificate
+ *
+ */
+ public ClientCertAuthRule(TrustEngine engine, CertificateNameOptions nameOptions) {
+ super(engine);
+ certNameOptions = nameOptions;
+ }
+
+ /** {@inheritDoc} */
+ public void evaluate(MessageContext messageContext) throws SecurityPolicyException {
+
+ Credential peerCredential = messageContext.getInboundMessageTransport().getPeerCredential();
+
+ if (peerCredential == null) {
+ log.info("Inbound message transport did not contain a peer credential, "
+ + "skipping client certificate authentication");
+ return;
+ }
+ if (!(peerCredential instanceof X509Credential)) {
+ log.info("Inbound message transport did not contain an X509Credential, "
+ + "skipping client certificate authentication");
+ return;
+ }
+
+ X509Credential requestCredential = (X509Credential) peerCredential;
+ if (log.isDebugEnabled()) {
+ try {
+ log.debug("Attempting to authenticate inbound connection that presented the certificate:");
+ log.debug(Base64.encodeBytes(requestCredential.getEntityCertificate().getEncoded()));
+ } catch (CertificateEncodingException e) {
+ // do nothing
+ }
+ }
+ doEvaluate(requestCredential, messageContext);
+ }
+
+ /**
+ * Get the currently configured certificate name options.
+ *
+ * @return the certificate name options
+ */
+ protected CertificateNameOptions getCertificateNameOptions() {
+ return certNameOptions;
+ }
+
+ /**
+ * Evaluate the request credential.
+ *
+ * @param requestCredential the X509Credential derived from the request
+ * @param messageContext the message context being evaluated
+ * @throws SecurityPolicyException thrown if a certificate presenter entity ID available from the message context
+ * and the client certificate token can not be establishd as trusted on that basis, or if there is error
+ * during evaluation processing
+ */
+ protected void doEvaluate(X509Credential requestCredential, MessageContext messageContext)
+ throws SecurityPolicyException {
+
+ String presenterEntityID = getCertificatePresenterEntityID(messageContext);
+
+ if (presenterEntityID != null) {
+ log.debug("Attempting client certificate authentication using context presenter entity ID: {}",
+ presenterEntityID);
+ if (evaluate(requestCredential, presenterEntityID, messageContext)) {
+ log.info("Authentication via client certificate succeeded for context presenter entity ID: {}",
+ presenterEntityID);
+ messageContext.getInboundMessageTransport().setAuthenticated(true);
+ } else {
+ log.error("Authentication via client certificate failed for context presenter entity ID {}",
+ presenterEntityID);
+ throw new SecurityPolicyException(
+ "Client certificate authentication failed for context presenter entity ID");
+ }
+ return;
+ }
+
+ String derivedPresenter = evaluateCertificateNameDerivedPresenters(requestCredential, messageContext);
+ if (derivedPresenter != null) {
+ log.info("Authentication via client certificate succeeded for certificate-derived presenter entity ID {}",
+ derivedPresenter);
+ setAuthenticatedCertificatePresenterEntityID(messageContext, derivedPresenter);
+ messageContext.getInboundMessageTransport().setAuthenticated(true);
+ return;
+ }
+
+ derivedPresenter = evaluateDerivedPresenters(requestCredential, messageContext);
+ if (derivedPresenter != null) {
+ log.info("Authentication via client certificate succeeded for derived presenter entity ID {}",
+ derivedPresenter);
+ setAuthenticatedCertificatePresenterEntityID(messageContext, derivedPresenter);
+ messageContext.getInboundMessageTransport().setAuthenticated(true);
+ return;
+ }
+ }
+
+ /**
+ * Get the entity ID of the presenter of the client TLS certificate, as will be used for trust evaluation purposes.
+ *
+ *
+ * The default behavior is to return the value of {@link MessageContext#getInboundMessageIssuer()}. Subclasses may
+ * override to implement different logic.
+ *
+ *
+ * @param messageContext the current message context
+ * @return the entity ID of the client TLS certificate presenter
+ */
+ protected String getCertificatePresenterEntityID(MessageContext messageContext) {
+ return messageContext.getInboundMessageIssuer();
+ }
+
+ /**
+ * Store the sucessfully authenticated derived entity ID of the certificate presenter in the message context.
+ *
+ *
+ * The default behavior is to set the value by calling {@link MessageContext#setInboundMessageIssuer(String)}.
+ * Subclasses may override to implement different logic.
+ *
+ *
+ * @param messageContext the current message context
+ * @param entityID the successfully authenticated derived entity ID of the client TLS certificate presenter
+ */
+ protected void setAuthenticatedCertificatePresenterEntityID(MessageContext messageContext, String entityID) {
+ messageContext.setInboundMessageIssuer(entityID);
+ }
+
+ /** {@inheritDoc} */
+ protected CriteriaSet buildCriteriaSet(String entityID, MessageContext messageContext)
+ throws SecurityPolicyException {
+
+ CriteriaSet criteriaSet = new CriteriaSet();
+ if (!DatatypeHelper.isEmpty(entityID)) {
+ criteriaSet.add(new EntityIDCriteria(entityID));
+ }
+
+ criteriaSet.add(new UsageCriteria(UsageType.SIGNING));
+
+ return criteriaSet;
+ }
+
+ /**
+ * Evaluate any candidate presenter entity ID's which may be derived from the credential or other message context
+ * information.
+ *
+ *
+ * This serves primarily as an extension point for subclasses to implement application-specific logic.
+ *
+ *
+ *
+ * If multiple derived candidate entity ID's would satisfy the trust engine criteria, the choice of which one to
+ * return as the canonical presenter entity ID value is implementation-specific.
+ *
+ *
+ * @param requestCredential the X509Credential derived from the request
+ * @param messageContext the message context being evaluated
+ * @return a presenter entity ID which was successfully evaluated by the trust engine
+ * @throws SecurityPolicyException thrown if there is error during processing
+ * @deprecated Use {@link #evaluateDerivedPresenters(X509Credential,MessageContext)} instead
+ */
+ protected String evaluateDerivedIssuers(X509Credential requestCredential, MessageContext messageContext)
+ throws SecurityPolicyException {
+ return evaluateDerivedPresenters(requestCredential, messageContext);
+ }
+
+ /**
+ * Evaluate any candidate presenter entity ID's which may be derived from the credential or other message context
+ * information.
+ *
+ *
+ * This serves primarily as an extension point for subclasses to implement application-specific logic.
+ *
+ *
+ *
+ * If multiple derived candidate entity ID's would satisfy the trust engine criteria, the choice of which one to
+ * return as the canonical presenter entity ID value is implementation-specific.
+ *
+ *
+ * @param requestCredential the X509Credential derived from the request
+ * @param messageContext the message context being evaluated
+ * @return a presenter entity ID which was successfully evaluated by the trust engine
+ * @throws SecurityPolicyException thrown if there is error during processing
+ */
+ protected String evaluateDerivedPresenters(X509Credential requestCredential, MessageContext messageContext)
+ throws SecurityPolicyException {
+
+ return null;
+ }
+
+ /**
+ * Evaluate candidate presenter entity ID's which may be derived from the request credential's entity certificate
+ * according to the options supplied via {@link CertificateNameOptions}.
+ *
+ *
+ * Configured certificate name types are derived as candidate presenter entity ID's and processed in the following
+ * order:
+ *
+ * - The certificate subject DN string as serialized by the X500DNHandler obtained via
+ * {@link CertificateNameOptions#getX500DNHandler()} and using the output format indicated by
+ * {@link CertificateNameOptions#getX500SubjectDNFormat()}.
+ * - Subject alternative names of the types configured via {@link CertificateNameOptions#getSubjectAltNames()}.
+ * Note that this is a LinkedHashSet, so the order of evaluation is the order of insertion.
+ * - The first common name (CN) value appearing in the certificate subject DN.
+ *
+ *
+ *
+ *
+ * The first one of the above which is successfully evaluated by the trust engine using criteria built from
+ * {@link BaseTrustEngineRule#buildCriteriaSet(String, MessageContext)} will be returned.
+ *
+ *
+ * @param requestCredential the X509Credential derived from the request
+ * @param messageContext the message context being evaluated
+ * @return a certificate presenter entity ID which was successfully evaluated by the trust engine
+ * @throws SecurityPolicyException thrown if there is error during processing
+ * @deprecated Use {@link #evaluateCertificateNameDerivedPresenters(X509Credential,MessageContext)} instead
+ */
+ protected String evaluateCertificateNameDerivedIssuers(X509Credential requestCredential,
+ MessageContext messageContext) throws SecurityPolicyException {
+ return evaluateCertificateNameDerivedPresenters(requestCredential, messageContext);
+ }
+
+ /**
+ * Evaluate candidate presenter entity ID's which may be derived from the request credential's entity certificate
+ * according to the options supplied via {@link CertificateNameOptions}.
+ *
+ *
+ * Configured certificate name types are derived as candidate presenter entity ID's and processed in the following
+ * order:
+ *
+ * - The certificate subject DN string as serialized by the X500DNHandler obtained via
+ * {@link CertificateNameOptions#getX500DNHandler()} and using the output format indicated by
+ * {@link CertificateNameOptions#getX500SubjectDNFormat()}.
+ * - Subject alternative names of the types configured via {@link CertificateNameOptions#getSubjectAltNames()}.
+ * Note that this is a LinkedHashSet, so the order of evaluation is the order of insertion.
+ * - The first common name (CN) value appearing in the certificate subject DN.
+ *
+ *
+ *
+ *
+ * The first one of the above which is successfully evaluated by the trust engine using criteria built from
+ * {@link BaseTrustEngineRule#buildCriteriaSet(String, MessageContext)} will be returned.
+ *
+ *
+ * @param requestCredential the X509Credential derived from the request
+ * @param messageContext the message context being evaluated
+ * @return a certificate presenter entity ID which was successfully evaluated by the trust engine
+ * @throws SecurityPolicyException thrown if there is error during processing
+ */
+ protected String evaluateCertificateNameDerivedPresenters(X509Credential requestCredential,
+ MessageContext messageContext) throws SecurityPolicyException {
+
+ String candidatePresenter = null;
+
+ if (certNameOptions.evaluateSubjectDN()) {
+ candidatePresenter = evaluateSubjectDN(requestCredential, messageContext);
+ if (candidatePresenter != null) {
+ return candidatePresenter;
+ }
+ }
+
+ if (!certNameOptions.getSubjectAltNames().isEmpty()) {
+ candidatePresenter = evaluateSubjectAltNames(requestCredential, messageContext);
+ if (candidatePresenter != null) {
+ return candidatePresenter;
+ }
+ }
+
+ if (certNameOptions.evaluateSubjectCommonName()) {
+ candidatePresenter = evaluateSubjectCommonName(requestCredential, messageContext);
+ if (candidatePresenter != null) {
+ return candidatePresenter;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Evaluate the presenter entity ID as derived from the cert subject common name (CN).
+ *
+ * Only the first CN value from the subject DN is evaluated.
+ *
+ * @param requestCredential the X509Credential derived from the request
+ * @param messageContext the message context being evaluated
+ * @return a presenter entity ID which was successfully evaluated by the trust engine
+ * @throws SecurityPolicyException thrown if there is error during processing
+ */
+ protected String evaluateSubjectCommonName(X509Credential requestCredential, MessageContext messageContext)
+ throws SecurityPolicyException {
+
+ log.debug("Evaluating client cert by deriving presenter as cert CN");
+ X509Certificate certificate = requestCredential.getEntityCertificate();
+ String candidatePresenter = getCommonName(certificate);
+ if (candidatePresenter != null) {
+ if (evaluate(requestCredential, candidatePresenter, messageContext)) {
+ log.info("Authentication succeeded for presenter entity ID derived from CN {}", candidatePresenter);
+ return candidatePresenter;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Evaluate the presenter entity ID as derived from the cert subject DN.
+ *
+ * @param requestCredential the X509Credential derived from the request
+ * @param messageContext the message context being evaluated
+ * @return a presenter entity ID which was successfully evaluated by the trust engine
+ * @throws SecurityPolicyException thrown if there is error during processing
+ */
+ protected String evaluateSubjectDN(X509Credential requestCredential, MessageContext messageContext)
+ throws SecurityPolicyException {
+
+ log.debug("Evaluating client cert by deriving presenter as cert subject DN");
+ X509Certificate certificate = requestCredential.getEntityCertificate();
+ String candidatePresenter = getSubjectName(certificate);
+ if (candidatePresenter != null) {
+ if (evaluate(requestCredential, candidatePresenter, messageContext)) {
+ log.info("Authentication succeeded for presenter entity ID derived from subject DN {}",
+ candidatePresenter);
+ return candidatePresenter;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Evaluate the presenter entity ID as derived from the cert subject alternative names specified by types enumerated
+ * in {@link CertificateNameOptions#getSubjectAltNames()}.
+ *
+ * @param requestCredential the X509Credential derived from the request
+ * @param messageContext the message context being evaluated
+ * @return a presenter entity ID which was successfully evaluated by the trust engine
+ * @throws SecurityPolicyException thrown if there is error during processing
+ */
+ protected String evaluateSubjectAltNames(X509Credential requestCredential, MessageContext messageContext)
+ throws SecurityPolicyException {
+
+ log.debug("Evaluating client cert by deriving presenter from subject alt names");
+ X509Certificate certificate = requestCredential.getEntityCertificate();
+ for (Integer altNameType : certNameOptions.getSubjectAltNames()) {
+ log.debug("Evaluating alt names of type: {}", altNameType.toString());
+ List altNames = getAltNames(certificate, altNameType);
+ for (String altName : altNames) {
+ if (evaluate(requestCredential, altName, messageContext)) {
+ log.info("Authentication succeeded for presenter entity ID derived from subject alt name {}",
+ altName);
+ return altName;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get the first common name (CN) value from the subject DN of the specified certificate.
+ *
+ * @param cert the certificate being processed
+ * @return the first CN value, or null if there are none
+ */
+ protected String getCommonName(X509Certificate cert) {
+ List names = X509Util.getCommonNames(cert.getSubjectX500Principal());
+ if (names != null && !names.isEmpty()) {
+ String name = names.get(0);
+ log.debug("Extracted common name from certificate: {}", name);
+ return name;
+ }
+ return null;
+ }
+
+ /**
+ * Get subject name from a certificate, using the currently configured X500DNHandler and subject DN output format.
+ *
+ * @param cert the certificate being processed
+ * @return the subject name
+ */
+ protected String getSubjectName(X509Certificate cert) {
+ if (cert == null) {
+ return null;
+ }
+ String name = null;
+ if (!DatatypeHelper.isEmpty(certNameOptions.getX500SubjectDNFormat())) {
+ name = certNameOptions.getX500DNHandler().getName(cert.getSubjectX500Principal(),
+ certNameOptions.getX500SubjectDNFormat());
+ } else {
+ name = certNameOptions.getX500DNHandler().getName(cert.getSubjectX500Principal());
+ }
+ log.debug("Extracted subject name from certificate: {}", name);
+ return name;
+ }
+
+ /**
+ * Get the list of subject alt name values from the certificate which are of the specified alt name type.
+ *
+ * @param cert the certificate from which to extract alt names
+ * @param altNameType the type of alt name to extract
+ *
+ * @return the list of certificate subject alt names
+ */
+ protected List getAltNames(X509Certificate cert, Integer altNameType) {
+ log.debug("Extracting alt names from certificate of type: {}", altNameType.toString());
+ Integer[] nameTypes = new Integer[] { altNameType };
+ List altNames = X509Util.getAltNames(cert, nameTypes);
+ List names = new ArrayList();
+ for (Object altNameValue : altNames) {
+ if (!(altNameValue instanceof String)) {
+ log.debug("Skipping non-String certificate alt name value");
+ } else {
+ names.add((String) altNameValue);
+ }
+ }
+ log.debug("Extracted alt names from certificate: {}", names.toString());
+ return names;
+ }
+
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/security/provider/HTTPRule.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/security/provider/HTTPRule.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/security/provider/HTTPRule.java 17 Aug 2012 15:09:10 -0000 1.1
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.security.provider;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.security.SecurityPolicyException;
+import org.opensaml.ws.security.SecurityPolicyRule;
+import org.opensaml.ws.transport.http.HTTPTransport;
+import org.opensaml.xml.util.DatatypeHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A security rule that checks basic HTTP connection properties.
+ */
+public class HTTPRule implements SecurityPolicyRule {
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(HTTPRule.class);
+
+ /** Expected content type of the request. */
+ private String requiredContentType;
+
+ /** Expected method of the request. */
+ private String requiredRequestMethod;
+
+ /** Whether the request must be secure. */
+ private boolean requireSecured;
+
+ /**
+ * Constructor.
+ *
+ * @param type expected content type
+ * @param method expected request method
+ * @param secured whether the request must be secured
+ */
+ public HTTPRule(String type, String method, boolean secured) {
+ requiredContentType = DatatypeHelper.safeTrimOrNullString(type);
+ requiredRequestMethod = DatatypeHelper.safeTrimOrNullString(method);
+ requireSecured = secured;
+ }
+
+ /** {@inheritDoc} */
+ public void evaluate(MessageContext messageContext) throws SecurityPolicyException {
+
+ if (!(messageContext.getInboundMessageTransport() instanceof HTTPTransport)) {
+ log.debug("Message context was did not contain an HTTP transport, unable to evaluate security rule");
+ return;
+ }
+
+ doEvaluate(messageContext);
+ }
+
+ /**
+ * Evaluates if the message context transport, guaranteed to be of type {@link HTTPTransport}, meets all
+ * requirements.
+ *
+ * @param messageContext message context being evaluated
+ *
+ * @throws SecurityPolicyException thrown if the message context does not meet the requirements of an evaluated rule
+ */
+ protected void doEvaluate(MessageContext messageContext) throws SecurityPolicyException {
+ HTTPTransport transport = (HTTPTransport) messageContext.getInboundMessageTransport();
+ evaluateContentType(transport);
+ evaluateRequestMethod(transport);
+ evaluateSecured(transport);
+ }
+
+ /**
+ * Checks if the transport is of the correct content type.
+ *
+ * @param transport transport being evalauted
+ *
+ * @throws SecurityPolicyException thrown if the content type was an unexpected value
+ */
+ protected void evaluateContentType(HTTPTransport transport) throws SecurityPolicyException {
+ String transportContentType = transport.getHeaderValue("Content-Type");
+ if (requiredContentType != null && !transportContentType.startsWith(requiredContentType)) {
+ log.error("Invalid content type, expected " + requiredContentType + " but was " + transportContentType);
+ throw new SecurityPolicyException("Invalid content type, expected " + requiredContentType + " but was "
+ + transportContentType);
+ }
+ }
+
+ /**
+ * Checks if the transport is of the correct request method.
+ *
+ * @param transport transport being evalauted
+ *
+ * @throws SecurityPolicyException thrown if the request method was an unexpected value
+ */
+ protected void evaluateRequestMethod(HTTPTransport transport) throws SecurityPolicyException {
+ String transportMethod = transport.getHTTPMethod();
+ if (requiredRequestMethod != null && !transportMethod.equalsIgnoreCase(requiredRequestMethod)) {
+ log.error("Invalid request method, expected " + requiredRequestMethod + " but was " + transportMethod);
+ throw new SecurityPolicyException("Invalid request method, expected " + requiredRequestMethod + " but was "
+ + transportMethod);
+ }
+ }
+
+ /**
+ * Checks if the transport is secured.
+ *
+ * @param transport transport being evalauted
+ *
+ * @throws SecurityPolicyException thrown if the transport is not secure and was required to be
+ */
+ protected void evaluateSecured(HTTPTransport transport) throws SecurityPolicyException {
+ if (requireSecured && !transport.isConfidential()) {
+ log.error("Request was required to be secured but was not");
+ throw new SecurityPolicyException("Request was required to be secured but was not");
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/security/provider/MandatoryAuthenticatedMessageRule.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/security/provider/MandatoryAuthenticatedMessageRule.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/security/provider/MandatoryAuthenticatedMessageRule.java 17 Aug 2012 15:09:10 -0000 1.1
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.security.provider;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.security.SecurityPolicyException;
+import org.opensaml.ws.security.SecurityPolicyRule;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Security policy rule that requires that a message has been authenticated.
+ */
+public class MandatoryAuthenticatedMessageRule implements SecurityPolicyRule {
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(MandatoryAuthenticatedMessageRule.class);
+
+ /** {@inheritDoc} */
+ public void evaluate(MessageContext messageContext) throws SecurityPolicyException {
+ if(!messageContext.isIssuerAuthenticated()) {
+ log.error("Inbound message issuer was not authenticated.");
+ throw new SecurityPolicyException("Inbound message issuer was not authenticated.");
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/security/provider/MandatoryIssuerRule.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/security/provider/MandatoryIssuerRule.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/security/provider/MandatoryIssuerRule.java 17 Aug 2012 15:09:10 -0000 1.1
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.security.provider;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.security.SecurityPolicyException;
+import org.opensaml.ws.security.SecurityPolicyRule;
+import org.opensaml.xml.util.DatatypeHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Security policy rule implementation that which requires that an inbound message context issuer has been set by a
+ * previous rule. Should typically run at the end of the security policy rule chain.
+ */
+public class MandatoryIssuerRule implements SecurityPolicyRule {
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(MandatoryIssuerRule.class);
+
+ /** {@inheritDoc} */
+ public void evaluate(MessageContext messageContext) throws SecurityPolicyException {
+
+ if (DatatypeHelper.isEmpty(messageContext.getInboundMessageIssuer())) {
+ log.error("Mandatory inbound message context issuer was not present");
+ throw new SecurityPolicyException("Mandatory inbound message context issuer not present");
+ }
+
+ }
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/security/provider/StaticSecurityPolicyResolver.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/security/provider/StaticSecurityPolicyResolver.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/security/provider/StaticSecurityPolicyResolver.java 17 Aug 2012 15:09:10 -0000 1.1
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.security.provider;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.security.SecurityPolicy;
+import org.opensaml.ws.security.SecurityPolicyResolver;
+import org.opensaml.xml.security.SecurityException;
+import org.opensaml.xml.util.LazyList;
+
+/** A simple security policy resolver implementation that returns a static list of policies. */
+public class StaticSecurityPolicyResolver implements SecurityPolicyResolver {
+
+ /** Registered security policies. */
+ private List securityPolicies;
+
+ /**
+ * Constructor.
+ *
+ * @param policy the static policy returned by this resolver
+ */
+ public StaticSecurityPolicyResolver(SecurityPolicy policy) {
+ securityPolicies = new LazyList();
+ if(policy != null){
+ securityPolicies.add(policy);
+ }
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param policies the static list of policies returned by this resolver
+ */
+ public StaticSecurityPolicyResolver(List policies) {
+ securityPolicies = new LazyList();
+ if(policies != null){
+ securityPolicies.addAll(policies);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public Iterable resolve(MessageContext criteria) throws SecurityException {
+ return Collections.unmodifiableList(securityPolicies);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * If more than one policy is registered with this resolver this method returns the first policy in the list.
+ */
+ public SecurityPolicy resolveSingle(MessageContext criteria) throws SecurityException {
+ if (!securityPolicies.isEmpty()) {
+ return securityPolicies.get(0);
+ } else {
+ return null;
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/security/provider/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/security/provider/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/security/provider/package.html 17 Aug 2012 15:09:10 -0000 1.1
@@ -0,0 +1,5 @@
+
+
+Basic implementations of some security policies.
+
+
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/client/BasicSOAPMessageContext.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/client/BasicSOAPMessageContext.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/client/BasicSOAPMessageContext.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.client;
+
+import org.opensaml.ws.message.BaseMessageContext;
+import org.opensaml.ws.soap.client.SOAPClient.SOAPRequestParameters;
+
+/** Basic {@link SOAPMessageContext} implementation. */
+public class BasicSOAPMessageContext extends BaseMessageContext implements SOAPMessageContext {
+
+ /** Binding/transport-specific SOAP request parameters. */
+ private SOAPRequestParameters requestParameters;
+
+ /** {@inheritDoc} */
+ public SOAPRequestParameters getSOAPRequestParameters() {
+ return requestParameters;
+ }
+
+ /** {@inheritDoc} */
+ public void setSOAPRequestParameters(SOAPRequestParameters parameters) {
+ requestParameters = parameters;
+ }
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/client/SOAPClient.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/client/SOAPClient.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/client/SOAPClient.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.client;
+
+import org.opensaml.ws.soap.common.SOAPException;
+import org.opensaml.xml.security.SecurityException;
+
+import net.jcip.annotations.ThreadSafe;
+
+/**
+ * An interface for a very basic SOAP client.
+ *
+ * Implementations of this interface do NOT attempt to do intelligent things like figure out when and how to attach
+ * WS-Security headers. It is strictly meant to open sockets, shuttle messages over it, and return a response.
+ */
+@ThreadSafe
+public interface SOAPClient {
+
+ /**
+ * Sends a message and waits for a response.
+ *
+ * @param endpoint the endpoint to which to send the message
+ * @param messageContext the message context containing the outbound SOAP message
+ *
+ * @throws SOAPClientException thrown if there is a problem sending the message or receiving the response or if the
+ * response is a SOAP fault
+ * @throws SecurityException thrown if the response does not meet any security policy associated with the message
+ * context
+ */
+ public void send(String endpoint, SOAPMessageContext messageContext) throws SOAPException, SecurityException;
+
+ /** Marker interface for binding/transport request parameters. */
+ public interface SOAPRequestParameters {};
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/client/SOAPClientException.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/client/SOAPClientException.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/client/SOAPClientException.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.client;
+
+import org.opensaml.ws.soap.common.SOAPException;
+
+/** Exception indicating an error sending or receiving a SOAP message. */
+public class SOAPClientException extends SOAPException {
+
+ /** Serial version UID. */
+ private static final long serialVersionUID = 6203715340959992457L;
+
+ /** Constructor. */
+ public SOAPClientException() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ */
+ public SOAPClientException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public SOAPClientException(Exception wrappedException) {
+ super(wrappedException);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public SOAPClientException(String message, Exception wrappedException) {
+ super(message, wrappedException);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/client/SOAPFaultException.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/client/SOAPFaultException.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/client/SOAPFaultException.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.client;
+
+import org.opensaml.ws.soap.common.SOAPException;
+import org.opensaml.ws.soap.soap11.Fault;
+
+/** Exception indicating a SOAP fault. */
+public class SOAPFaultException extends SOAPException {
+
+ /** Serial version UID. */
+ private static final long serialVersionUID = 4770411452264097320L;
+
+ /** The fault that caused this exception. */
+ private Fault soapFault;
+
+ /** Constructor. */
+ public SOAPFaultException() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ */
+ public SOAPFaultException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public SOAPFaultException(Exception wrappedException) {
+ super(wrappedException);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public SOAPFaultException(String message, Exception wrappedException) {
+ super(message, wrappedException);
+ }
+
+ /**
+ * Gets the fault that caused the exception.
+ *
+ * @return fault that caused the exception
+ */
+ public Fault getFault() {
+ return soapFault;
+ }
+
+ /**
+ * Sets the fault that caused the exception.
+ *
+ * @param fault fault that caused the exception
+ */
+ public void setFault(Fault fault) {
+ soapFault = fault;
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/client/SOAPMessageContext.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/client/SOAPMessageContext.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/client/SOAPMessageContext.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.client;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.soap.client.SOAPClient.SOAPRequestParameters;
+
+/** Message context for SOAP messages. */
+public interface SOAPMessageContext extends MessageContext{
+
+ /**
+ * Gets a set of binding/transport-specific request parameters.
+ *
+ * @return set of binding/transport-specific request parameters
+ */
+ public SOAPRequestParameters getSOAPRequestParameters();
+
+ /**
+ * Sets a set of binding/transport-specific request parameters.
+ *
+ * @param parameters a set of binding/transport-specific request parameters
+ */
+ public void setSOAPRequestParameters(SOAPRequestParameters parameters);
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/client/http/HttpClientBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/client/http/HttpClientBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/client/http/HttpClientBuilder.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,409 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.client.http;
+
+import net.jcip.annotations.NotThreadSafe;
+
+import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
+import org.apache.commons.httpclient.HostConfiguration;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
+import org.apache.commons.httpclient.UsernamePasswordCredentials;
+import org.apache.commons.httpclient.auth.AuthScope;
+import org.apache.commons.httpclient.params.HttpClientParams;
+import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
+import org.apache.commons.httpclient.protocol.Protocol;
+import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory;
+import org.opensaml.xml.util.DatatypeHelper;
+
+/**
+ * A builder for {@link HttpClient}s.
+ *
+ * This builder will produce clients that employ the {@link MultiThreadedHttpConnectionManager} and as such users of the
+ * clients MUST be sure to invoke {@link org.apache.commons.httpclient.HttpMethod#releaseConnection()} after they have
+ * finished with the method.
+ */
+@NotThreadSafe
+public class HttpClientBuilder {
+
+ /** Host name of the HTTP proxy server through which connections will be made. */
+ private String proxyHost;
+
+ /** Port number of the HTTP proxy server through which connections will be made. */
+ private int proxyPort;
+
+ /** Username used to connect to the HTTP proxy server. */
+ private String proxyUsername;
+
+ /** Password used to connect to the HTTP proxy server. */
+ private String proxyPassword;
+
+ /** Whether authentication should be performed preemptively, defaults to false. */
+ private boolean preemptiveAuthentication;
+
+ /** Character set used for HTTP content, defaults to UTF-8. */
+ private String contentCharSet;
+
+ /** Amount of time, in milliseconds, to wait for a connection to be established, default is 5,000. */
+ private int connectionTimeout;
+
+ /** Size of the buffer, in bytes, used to hold outbound information, defaults to 4,096. */
+ private int sendBufferSize;
+
+ /** Size of the buffer, in bytes, used to hold inbound information, defaults to 16,384. */
+ private int receiveBufferSize;
+
+ /** Whether to use TCP No Delay algorithm, defaults to true. */
+ private boolean tcpNoDelay;
+
+ /** Total number of connections allowed to a specific host, defaults to 5. */
+ private int maxConnectionsPerHost;
+
+ /** Total number of connections allowed to all hosts, defaults to 20. */
+ private int maxTotalConnectons;
+
+ /** Number of times a failed connection to a host should be retried. */
+ private int connectionRetryAttempts;
+
+ /** Socket factory used for the 'https' scheme. */
+ private SecureProtocolSocketFactory httpsProtocolSocketFactory;
+
+ /** Constructor. */
+ public HttpClientBuilder() {
+ resetDefaults();
+ }
+
+ /** Resets the builder to its default values. */
+ public void resetDefaults() {
+ proxyPort = -1;
+ preemptiveAuthentication = false;
+ contentCharSet = "UTF-8";
+ connectionTimeout = 5000;
+ sendBufferSize = 4096;
+ receiveBufferSize = 16384;
+ tcpNoDelay = true;
+ maxConnectionsPerHost = 5;
+ maxTotalConnectons = 20;
+ connectionRetryAttempts = 0;
+ }
+
+ /**
+ * Builds an HTTP client with the given settings. Settings are NOT reset to their default values after a client has
+ * been created.
+ *
+ * @return the created client.
+ */
+ public HttpClient buildClient() {
+ if (httpsProtocolSocketFactory != null) {
+ Protocol.registerProtocol("https", new Protocol("https", httpsProtocolSocketFactory, 443));
+ }
+
+ HttpClientParams clientParams = new HttpClientParams();
+ clientParams.setAuthenticationPreemptive(isPreemptiveAuthentication());
+ clientParams.setContentCharset(getContentCharSet());
+ clientParams.setParameter(HttpClientParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(
+ connectionRetryAttempts, false));
+
+ HttpConnectionManagerParams connMgrParams = new HttpConnectionManagerParams();
+ connMgrParams.setConnectionTimeout(getConnectionTimeout());
+ connMgrParams.setDefaultMaxConnectionsPerHost(getMaxConnectionsPerHost());
+ connMgrParams.setMaxTotalConnections(getMaxTotalConnections());
+ connMgrParams.setReceiveBufferSize(getReceiveBufferSize());
+ connMgrParams.setSendBufferSize(getSendBufferSize());
+ connMgrParams.setTcpNoDelay(isTcpNoDelay());
+
+ MultiThreadedHttpConnectionManager connMgr = new MultiThreadedHttpConnectionManager();
+ connMgr.setParams(connMgrParams);
+
+ HttpClient httpClient = new HttpClient(clientParams, connMgr);
+
+ if (proxyHost != null) {
+ HostConfiguration hostConfig = new HostConfiguration();
+ hostConfig.setProxy(proxyHost, proxyPort);
+ httpClient.setHostConfiguration(hostConfig);
+
+ if (proxyUsername != null) {
+ AuthScope proxyAuthScope = new AuthScope(proxyHost, proxyPort);
+ UsernamePasswordCredentials proxyCredentials = new UsernamePasswordCredentials(proxyUsername,
+ proxyPassword);
+ httpClient.getState().setProxyCredentials(proxyAuthScope, proxyCredentials);
+ }
+ }
+
+ return httpClient;
+ }
+
+ /**
+ * Gets the host name of the HTTP proxy server through which connections will be made.
+ *
+ * @return host name of the HTTP proxy server through which connections will be made
+ */
+ public String getProxyHost() {
+ return proxyHost;
+ }
+
+ /**
+ * Sets the host name of the HTTP proxy server through which connections will be made.
+ *
+ * @param host host name of the HTTP proxy server through which connections will be made
+ */
+ public void setProxyHost(String host) {
+ proxyHost = DatatypeHelper.safeTrimOrNullString(host);
+ }
+
+ /**
+ * Gets the port of the HTTP proxy server through which connections will be made.
+ *
+ * @return port of the HTTP proxy server through which connections will be made
+ */
+ public int getProxyPort() {
+ return proxyPort;
+ }
+
+ /**
+ * Sets the port of the HTTP proxy server through which connections will be made.
+ *
+ * @param port port of the HTTP proxy server through which connections will be made
+ */
+ public void setProxyPort(int port) {
+ proxyPort = port;
+ }
+
+ /**
+ * Gets the username used to connect to the HTTP proxy server.
+ *
+ * @return username used to connect to the HTTP proxy server
+ */
+ public String getProxyUsername() {
+ return proxyUsername;
+ }
+
+ /**
+ * Sets the username used to connect to the HTTP proxy server.
+ *
+ * @param username username used to connect to the HTTP proxy server
+ */
+ public void setProxyUsername(String username) {
+ proxyUsername = DatatypeHelper.safeTrimOrNullString(username);
+ }
+
+ /**
+ * Gets the password used to connect to the HTTP proxy server.
+ *
+ * @return password used to connect to the HTTP proxy server
+ */
+ public String getProxyPassword() {
+ return proxyPassword;
+ }
+
+ /**
+ * Sets the password used to connect to the HTTP proxy server.
+ *
+ * @param password password used to connect to the HTTP proxy server
+ */
+ public void setProxyPassword(String password) {
+ proxyPassword = DatatypeHelper.safeTrimOrNullString(password);
+ }
+
+ /**
+ * Gets whether authentication is performed preemptively. Default value is false
.
+ *
+ * @return whether authentication is performed preemptively
+ */
+ public boolean isPreemptiveAuthentication() {
+ return preemptiveAuthentication;
+ }
+
+ /**
+ * Sets whether authentication is performed preemptively.
+ *
+ * @param preemptive whether authentication is performed preemptively
+ */
+ public void setPreemptiveAuthentication(boolean preemptive) {
+ preemptiveAuthentication = preemptive;
+ }
+
+ /**
+ * Gets the character set used for HTTP content. Default value is UTF-8
.
+ *
+ * @return character set used for HTTP content
+ */
+ public String getContentCharSet() {
+ return contentCharSet;
+ }
+
+ /**
+ * Sets the character set used for HTTP content.
+ *
+ * @param charSet character set used for HTTP content
+ */
+ public void setContentCharSet(String charSet) {
+ contentCharSet = charSet;
+ }
+
+ /**
+ * Gets the time, in milliseconds, to wait for connection establishments. Default value is 5,000. A value of 0
+ * indicates there is no timeout.
+ *
+ * @return time, in milliseconds, to wait for connection establishments
+ */
+ public int getConnectionTimeout() {
+ return connectionTimeout;
+ }
+
+ /**
+ * Sets the time, in milliseconds, to wait for connection establishments. A value of 0 indicates there is no
+ * timeout.
+ *
+ * @param timeout time, in milliseconds, to wait for connection establishments
+ */
+ public void setConnectionTimeout(int timeout) {
+ connectionTimeout = timeout;
+ }
+
+ /**
+ * Gets the size of buffer, in bytes, used when sending content. Default value is 4,096.
+ *
+ * @return size of buffer, in bytes, used when sending content
+ */
+ public int getSendBufferSize() {
+ return sendBufferSize;
+ }
+
+ /**
+ * Sets the size of buffer, in bytes, used when sending content.
+ *
+ * @param size size of buffer, in bytes, used when sending content
+ */
+ public void setSendBufferSize(int size) {
+ sendBufferSize = size;
+ }
+
+ /**
+ * Gets the size of buffer, in bytes, used when receiving content. Default value is 16,384.
+ *
+ * @return size of buffer, in bytes, used when sending content
+ */
+ public int getReceiveBufferSize() {
+ return receiveBufferSize;
+ }
+
+ /**
+ * Sets the size of buffer, in bytes, used when sending content.
+ *
+ * @param size size of buffer, in bytes, used when sending content
+ */
+ public void setReceiveBufferSize(int size) {
+ receiveBufferSize = size;
+ }
+
+ /**
+ * Gets whether to use TCP No Delay when sending data. Default value is true
.
+ *
+ * @return whether to use TCP No Delay when sending data
+ */
+ public boolean isTcpNoDelay() {
+ return tcpNoDelay;
+ }
+
+ /**
+ * Sets whether to use TCP No Delay when sending data.
+ *
+ * @param noDelay whether to use TCP No Delay when sending data
+ */
+ public void setTcpNoDelay(boolean noDelay) {
+ tcpNoDelay = noDelay;
+ }
+
+ /**
+ * Gets the maximum number of connections, per host, that the client will create. Default value is 5. A value of 0
+ * indicates there is no maximum.
+ *
+ * @return maximum number of connections, per host, that the client will create
+ */
+ public int getMaxConnectionsPerHost() {
+ return maxConnectionsPerHost;
+ }
+
+ /**
+ * Sets the maximum number of connections, per host, that the client will create. A value of 0 indicates there is no
+ * maximum.
+ *
+ * @param max maximum number of connections, per host, that the client will create
+ */
+ public void setMaxConnectionsPerHost(int max) {
+ maxConnectionsPerHost = max;
+ }
+
+ /**
+ * Gets the maximum number of total connections the client will create. Default value is 20.
+ *
+ * @return maximum number of total connections the client will create
+ */
+ public int getMaxTotalConnections() {
+ return maxTotalConnectons;
+ }
+
+ /**
+ * Sets the maximum number of total connections the client will create.
+ *
+ * @param max maximum number of total connections the client will create, must be greater than zero
+ */
+ public void setMaxTotalConnections(int max) {
+ if (max < 1) {
+ throw new IllegalArgumentException("Maximum total number of connections must be greater than zero.");
+ }
+ maxTotalConnectons = max;
+ }
+
+ /**
+ * Gets the number of times a connection will be tried if a host is unreachable.
+ *
+ * @return number of times a connection will be tried if a host is unreachable
+ */
+ public int getConnectionRetryAttempts() {
+ return connectionRetryAttempts;
+ }
+
+ /**
+ * Sets the number of times a connection will be tried if a host is unreachable.
+ *
+ * @param attempts number of times a connection will be tried if a host is unreachable
+ */
+ public void setConnectionRetryAttempts(int attempts) {
+ connectionRetryAttempts = attempts;
+ }
+
+ /**
+ * Gets the protocol socket factory used for the https scheme.
+ *
+ * @return protocol socket factory used for the https scheme
+ */
+ public SecureProtocolSocketFactory getHttpsProtocolSocketFactory() {
+ return httpsProtocolSocketFactory;
+ }
+
+ /**
+ * Sets the protocol socket factory used for the https scheme.
+ *
+ * @param factory the httpsProtocolSocketFactory to set
+ */
+ public void setHttpsProtocolSocketFactory(SecureProtocolSocketFactory factory) {
+ httpsProtocolSocketFactory = factory;
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/client/http/HttpSOAPClient.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/client/http/HttpSOAPClient.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/client/http/HttpSOAPClient.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,279 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.client.http;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStreamWriter;
+import java.nio.charset.Charset;
+import java.util.List;
+
+import net.jcip.annotations.ThreadSafe;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.RequestEntity;
+import org.opensaml.ws.security.SecurityPolicy;
+import org.opensaml.ws.security.SecurityPolicyResolver;
+import org.opensaml.ws.soap.client.SOAPClient;
+import org.opensaml.ws.soap.client.SOAPClientException;
+import org.opensaml.ws.soap.client.SOAPFaultException;
+import org.opensaml.ws.soap.client.SOAPMessageContext;
+import org.opensaml.ws.soap.common.SOAPException;
+import org.opensaml.ws.soap.soap11.Envelope;
+import org.opensaml.ws.soap.soap11.Fault;
+import org.opensaml.xml.Configuration;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.Marshaller;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.io.Unmarshaller;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.parse.ParserPool;
+import org.opensaml.xml.parse.XMLParserException;
+import org.opensaml.xml.security.SecurityException;
+import org.opensaml.xml.util.XMLHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Element;
+
+/**
+ * SOAP client that uses HTTP as the underlying transport and POST as the binding.
+ *
+ * NOTE this client does not provide access to a {@link org.opensaml.ws.transport.InTransport} or
+ * {@link org.opensaml.ws.transport.OutTransport}. Therefore any {@link SecurityPolicy} which operates on these object
+ * can not be used with this client.
+ */
+@ThreadSafe
+public class HttpSOAPClient implements SOAPClient {
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(HttpSOAPClient.class);
+
+ /** HTTP client used to send requests and receive responses. */
+ private HttpClient httpClient;
+
+ /** Pool of XML parsers used to parser incoming responses. */
+ private ParserPool parserPool;
+
+ /**
+ * Constructor.
+ *
+ * @param client Client used to make outbound HTTP requests. This client SHOULD employ a
+ * {@link org.apache.commons.httpclient.MultiThreadedHttpConnectionManager} and may be shared with other
+ * objects.
+ * @param parser pool of XML parsers used to parse incoming responses
+ */
+ public HttpSOAPClient(HttpClient client, ParserPool parser) {
+ if (client == null) {
+ throw new IllegalArgumentException("HtppClient may not be null");
+ }
+ httpClient = client;
+
+ if (parser == null) {
+ throw new IllegalArgumentException("ParserPool may not be null");
+ }
+ parserPool = parser;
+ }
+
+ /** {@inheritDoc} */
+ public void send(String endpoint, SOAPMessageContext messageContext) throws SOAPException, SecurityException {
+ PostMethod post = null;
+ try {
+ post = createPostMethod(endpoint, (HttpSOAPRequestParameters) messageContext.getSOAPRequestParameters(),
+ (Envelope) messageContext.getOutboundMessage());
+
+ int result = httpClient.executeMethod(post);
+ log.debug("Received HTTP status code of {} when POSTing SOAP message to {}", result, endpoint);
+
+ if (result == HttpStatus.SC_OK) {
+ processSuccessfulResponse(post, messageContext);
+ } else if (result == HttpStatus.SC_INTERNAL_SERVER_ERROR) {
+ processFaultResponse(post, messageContext);
+ } else {
+ throw new SOAPClientException("Received " + result + " HTTP response status code from HTTP request to "
+ + endpoint);
+ }
+ } catch (IOException e) {
+ throw new SOAPClientException("Unable to send request to " + endpoint, e);
+ } finally {
+ if (post != null) {
+ post.releaseConnection();
+ }
+ }
+ }
+
+ /**
+ * Creates the post method used to send the SOAP request.
+ *
+ * @param endpoint endpoint to which the message is sent
+ * @param requestParams HTTP request parameters
+ * @param message message to be sent
+ *
+ * @return the post method to be used to send this message
+ *
+ * @throws SOAPClientException thrown if the message could not be marshalled
+ */
+ protected PostMethod createPostMethod(String endpoint, HttpSOAPRequestParameters requestParams, Envelope message)
+ throws SOAPClientException {
+ log.debug("POSTing SOAP message to {}", endpoint);
+
+ PostMethod post = new PostMethod(endpoint);
+ post.setRequestEntity(createRequestEntity(message, Charset.forName("UTF-8")));
+ if (requestParams != null && requestParams.getSoapAction() != null) {
+ post.setRequestHeader(HttpSOAPRequestParameters.SOAP_ACTION_HEADER, requestParams.getSoapAction());
+ }
+
+ return post;
+ }
+
+ /**
+ * Creates the request entity that makes up the POST message body.
+ *
+ * @param message message to be sent
+ * @param charset character set used for the message
+ *
+ * @return request entity that makes up the POST message body
+ *
+ * @throws SOAPClientException thrown if the message could not be marshalled
+ */
+ protected RequestEntity createRequestEntity(Envelope message, Charset charset) throws SOAPClientException {
+ try {
+ Marshaller marshaller = Configuration.getMarshallerFactory().getMarshaller(message);
+ ByteArrayOutputStream arrayOut = new ByteArrayOutputStream();
+ OutputStreamWriter writer = new OutputStreamWriter(arrayOut, charset);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Outbound SOAP message is:\n" + XMLHelper.prettyPrintXML(marshaller.marshall(message)));
+ }
+ XMLHelper.writeNode(marshaller.marshall(message), writer);
+ return new ByteArrayRequestEntity(arrayOut.toByteArray(), "text/xml");
+ } catch (MarshallingException e) {
+ throw new SOAPClientException("Unable to marshall SOAP envelope", e);
+ }
+ }
+
+ /**
+ * Processes a successful, as determined by an HTTP 200 status code, response.
+ *
+ * @param httpMethod the HTTP method used to send the request and receive the response
+ * @param messageContext current messages context
+ *
+ * @throws SOAPClientException thrown if there is a problem reading the response from the {@link PostMethod}
+ */
+ protected void processSuccessfulResponse(PostMethod httpMethod, SOAPMessageContext messageContext)
+ throws SOAPClientException {
+ try {
+ Envelope response = unmarshallResponse(httpMethod.getResponseBodyAsStream());
+ messageContext.setInboundMessage(response);
+ evaluateSecurityPolicy(messageContext);
+ } catch (IOException e) {
+ throw new SOAPClientException("Unable to read response", e);
+ }
+ }
+
+ /**
+ * Processes a SOAP fault, as determined by an HTTP 500 status code, response.
+ *
+ * @param httpMethod the HTTP method used to send the request and receive the response
+ * @param messageContext current messages context
+ *
+ * @throws SOAPClientException thrown if the response can not be read from the {@link PostMethod}
+ * @throws SOAPFaultException an exception containing the SOAP fault
+ */
+ protected void processFaultResponse(PostMethod httpMethod, SOAPMessageContext messageContext)
+ throws SOAPClientException, SOAPFaultException {
+ try {
+ Envelope response = unmarshallResponse(httpMethod.getResponseBodyAsStream());
+ messageContext.setInboundMessage(response);
+
+ List faults = response.getBody().getUnknownXMLObjects(Fault.DEFAULT_ELEMENT_NAME);
+ if (faults.size() < 1) {
+ throw new SOAPClientException("HTTP status code was 500 but SOAP response did not contain a Fault");
+ }
+ Fault fault = (Fault) faults.get(0);
+
+ log.debug("SOAP fault code {} with message {}", fault.getCode().getValue(), fault.getMessage().getValue());
+ SOAPFaultException faultException = new SOAPFaultException("SOAP Fault: " + fault.getCode().getValue()
+ + " Fault Message: " + fault.getMessage().getValue());
+ faultException.setFault(fault);
+ throw faultException;
+ } catch (IOException e) {
+ throw new SOAPClientException("Unable to read response", e);
+ }
+ }
+
+ /**
+ * Unmarshalls the incoming response from a POST request.
+ *
+ * @param responseStream input stream bearing the response
+ *
+ * @return the response
+ *
+ * @throws SOAPClientException thrown if the incoming response can not be unmarshalled into an {@link Envelope}
+ */
+ protected Envelope unmarshallResponse(InputStream responseStream) throws SOAPClientException {
+ try {
+ Element responseElem = parserPool.parse(responseStream).getDocumentElement();
+ if (log.isDebugEnabled()) {
+ log.debug("Inbound SOAP message was:\n" + XMLHelper.prettyPrintXML(responseElem));
+ }
+ Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(responseElem);
+ return (Envelope) unmarshaller.unmarshall(responseElem);
+ } catch (XMLParserException e) {
+ throw new SOAPClientException("Unable to parse the XML within the response", e);
+ } catch (UnmarshallingException e) {
+ throw new SOAPClientException("unable to unmarshall the response DOM", e);
+ }
+ }
+
+ /**
+ * Evaluates the security policy associated with the given message context. If no policy resolver is registered or
+ * no policy is located during the resolution process then no policy is evaluated. Note that neither the inbound or
+ * outbound message transport is available.
+ *
+ * @param messageContext current message context
+ *
+ * @throws SOAPClientException thrown if there is a problem resolving or evaluating a security policy
+ */
+ protected void evaluateSecurityPolicy(SOAPMessageContext messageContext) throws SOAPClientException {
+ SecurityPolicyResolver policyResolver = messageContext.getSecurityPolicyResolver();
+ if (policyResolver == null) {
+ return;
+ }
+
+ SecurityPolicy policy = null;
+ try {
+ policy = policyResolver.resolveSingle(messageContext);
+ if (policy == null) {
+ return;
+ }
+ } catch (SecurityException e) {
+ throw new SOAPClientException("Unable to resolve security policy for inbound SOAP response", e);
+ }
+
+ try {
+ log.debug("Evaluating security policy for inbound SOAP response");
+ policy.evaluate(messageContext);
+ } catch (SecurityException e) {
+ throw new SOAPClientException("Inbound SOAP response does not meet security policy", e);
+ }
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/client/http/HttpSOAPRequestParameters.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/client/http/HttpSOAPRequestParameters.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/client/http/HttpSOAPRequestParameters.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.client.http;
+
+import net.jcip.annotations.ThreadSafe;
+
+import org.opensaml.ws.soap.client.SOAPClient.SOAPRequestParameters;
+import org.opensaml.xml.util.DatatypeHelper;
+
+/** HTTP transported SOAP request parameters. */
+@ThreadSafe
+public class HttpSOAPRequestParameters implements SOAPRequestParameters {
+
+ /** Name of the HTTP SOAPAction header. */
+ public static final String SOAP_ACTION_HEADER = "SOAPAction";
+
+ /** HTTP SOAPAction header. */
+ private String soapAction;
+
+ /**
+ * Constructor.
+ *
+ * @param action value for the SOAPAction HTTP header
+ */
+ public HttpSOAPRequestParameters(String action) {
+ soapAction = DatatypeHelper.safeTrimOrNullString(action);
+ }
+
+ /**
+ * Gets the HTTP SOAPAction header.
+ *
+ * @return HTTP SOAPAction header
+ */
+ public String getSoapAction() {
+ return soapAction;
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/client/http/TLSProtocolSocketFactory.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/client/http/TLSProtocolSocketFactory.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/client/http/TLSProtocolSocketFactory.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.client.http;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.net.SocketAddress;
+import java.security.GeneralSecurityException;
+
+import javax.net.SocketFactory;
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509KeyManager;
+import javax.net.ssl.X509TrustManager;
+
+import net.jcip.annotations.ThreadSafe;
+
+import org.apache.commons.httpclient.params.HttpConnectionParams;
+import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory;
+
+/** An SSL/TLS socket factory that uses KeyStoreFactory's to get its key and trust material. */
+@ThreadSafe
+public class TLSProtocolSocketFactory implements SecureProtocolSocketFactory {
+
+ /** Manager used to retrieve client-cert authentication keys for a given host. */
+ private X509KeyManager keyManager;
+
+ /** Manager used to validate the X.509 credentials of a given host. */
+ private X509TrustManager trustManager;
+
+ /** Currently active SSL context. */
+ private SSLContext sslContext;
+
+ /**
+ * Constructor.
+ *
+ * @param keyMgr manager used to retrieve client-cert authentication keys for a given host
+ * @param trustMgr manager used to validate the X.509 credentials of a given host
+ *
+ * @throws IllegalArgumentException thrown if the given key or trust manager can not be used to create the
+ * {@link SSLContext} used to create new sockets
+ */
+ public TLSProtocolSocketFactory(X509KeyManager keyMgr, X509TrustManager trustMgr) throws IllegalArgumentException {
+ keyManager = keyMgr;
+ trustManager = trustMgr;
+
+ try {
+ sslContext = SSLContext.getInstance("SSL");
+ sslContext.init(new KeyManager[] { keyManager }, new TrustManager[] { trustManager }, null);
+ } catch (GeneralSecurityException e) {
+ throw new IllegalArgumentException("Error create SSL context", e);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public Socket createSocket(String host, int port) throws IOException {
+ return sslContext.getSocketFactory().createSocket(host, port);
+ }
+
+ /** {@inheritDoc} */
+ public Socket createSocket(String host, int port, InetAddress localHost, int clientPort) throws IOException {
+ return sslContext.getSocketFactory().createSocket(host, port, localHost, clientPort);
+ }
+
+ /** {@inheritDoc} */
+ public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException {
+ return sslContext.getSocketFactory().createSocket(socket, host, port, autoClose);
+ }
+
+ /** {@inheritDoc} */
+ public Socket createSocket(String host, int port, InetAddress localHost, int localPort,
+ HttpConnectionParams connParams) throws IOException {
+ if (connParams == null) {
+ throw new IllegalArgumentException("Parameters may not be null");
+ }
+ int timeout = connParams.getConnectionTimeout();
+ SocketFactory socketfactory = sslContext.getSocketFactory();
+ if (timeout == 0) {
+ return socketfactory.createSocket(host, port, localHost, localPort);
+ } else {
+ Socket socket = socketfactory.createSocket();
+ SocketAddress localaddr = new InetSocketAddress(localHost, localPort);
+ SocketAddress remoteaddr = new InetSocketAddress(host, port);
+ socket.bind(localaddr);
+ socket.connect(remoteaddr, timeout);
+ return socket;
+ }
+ }
+
+ /** {@inheritDoc} */
+ public boolean equals(Object obj) {
+ return (obj != null) && obj.getClass().equals(getClass());
+ }
+
+ /** {@inheritDoc} */
+ public int hashCode() {
+ return getClass().hashCode();
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/common/AbstractExtensibleSOAPObject.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/common/AbstractExtensibleSOAPObject.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/common/AbstractExtensibleSOAPObject.java 17 Aug 2012 15:09:14 -0000 1.1
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.common;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.xml.AttributeExtensibleXMLObject;
+import org.opensaml.xml.ElementExtensibleXMLObject;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.util.AttributeMap;
+import org.opensaml.xml.util.IndexedXMLObjectChildrenList;
+import org.opensaml.xml.validation.AbstractValidatingXMLObject;
+
+/**
+ * Abstract class implementating validation and element and attribute extensibility.
+ */
+public class AbstractExtensibleSOAPObject extends AbstractValidatingXMLObject implements SOAPObject,
+ AttributeExtensibleXMLObject, ElementExtensibleXMLObject {
+
+ /** "Any" type children. */
+ private IndexedXMLObjectChildrenList unknownXMLObjects;
+
+ /** Attributes of the proxied Element. */
+ private AttributeMap attributes;
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI namespace of the element
+ * @param elementLocalName name of the element
+ * @param namespacePrefix namespace prefix of the element
+ */
+ protected AbstractExtensibleSOAPObject(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ attributes = new AttributeMap(this);
+ unknownXMLObjects = new IndexedXMLObjectChildrenList(this);
+ }
+
+ /** {@inheritDoc} */
+ public List getOrderedChildren() {
+ ArrayList children = new ArrayList();
+
+ children.addAll(unknownXMLObjects);
+
+ return Collections.unmodifiableList(children);
+ }
+
+ /** {@inheritDoc} */
+ public List getUnknownXMLObjects() {
+ return unknownXMLObjects;
+ }
+
+ /** {@inheritDoc} */
+ public List getUnknownXMLObjects(QName typeOrName) {
+ return (List) unknownXMLObjects.subList(typeOrName);
+ }
+
+ /** {@inheritDoc} */
+ public AttributeMap getUnknownAttributes() {
+ return attributes;
+ }
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/common/SOAPException.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/common/SOAPException.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/common/SOAPException.java 17 Aug 2012 15:09:14 -0000 1.1
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.common;
+
+import org.opensaml.ws.WSException;
+
+/**
+ * Base SOAP exception.
+ */
+public class SOAPException extends WSException {
+
+ /** Serial version UID. */
+ private static final long serialVersionUID = 1374150092262909937L;
+
+ /**
+ * Constructor.
+ */
+ public SOAPException() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ */
+ public SOAPException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public SOAPException(Exception wrappedException) {
+ super(wrappedException);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message exception message
+ * @param wrappedException exception to be wrapped by this one
+ */
+ public SOAPException(String message, Exception wrappedException) {
+ super(message, wrappedException);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/common/SOAPHandler.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/common/SOAPHandler.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/common/SOAPHandler.java 17 Aug 2012 15:09:14 -0000 1.1
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.common;
+
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.message.handler.Handler;
+
+/**
+ * Interface for {@link Handler}'s that are specific to SOAP message processing.
+ */
+public interface SOAPHandler extends Handler {
+
+ /**
+ * Get the set of SOAP header names that the handler
+ * indicates it understands.
+ *
+ * @return unmodifiable set of understood header names, possibly empty
+ */
+ public Set understandsHeaders();
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/common/SOAPObject.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/common/SOAPObject.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/common/SOAPObject.java 17 Aug 2012 15:09:14 -0000 1.1
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.common;
+
+import org.opensaml.xml.validation.ValidatingXMLObject;
+
+/**
+ * Base interface for all SOAP objects.
+ */
+public interface SOAPObject extends ValidatingXMLObject {
+
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/common/SOAPObjectBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/common/SOAPObjectBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/common/SOAPObjectBuilder.java 17 Aug 2012 15:09:14 -0000 1.1
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.common;
+
+import org.opensaml.xml.XMLObjectBuilder;
+
+/**
+ * Builder for SOAPObjects.
+ *
+ * @param the type of SOAPObject being built
+ */
+public interface SOAPObjectBuilder extends XMLObjectBuilder {
+
+ /**
+ * Builds a SOAPObject using the default name and namespace information provided SOAP specifications.
+ *
+ * @return built SAMLObject
+ */
+ public SOAPObjectType buildObject();
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/common/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/common/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/common/package.html 17 Aug 2012 15:09:14 -0000 1.1
@@ -0,0 +1,5 @@
+
+
+Common classes shared across SOAP versions, clients, and transports.
+
+
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/ActorBearing.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/ActorBearing.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/ActorBearing.java 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.util.SOAPConstants;
+
+/**
+ * Interface for element having a @soap11:actor
attribute.
+ */
+public interface ActorBearing {
+
+ /** The soap11:@actor attribute local name. */
+ public static final String SOAP11_ACTOR_ATTR_LOCAL_NAME = "actor";
+
+ /** The soap11:@actor qualified attribute name. */
+ public static final QName SOAP11_ACTOR_ATTR_NAME =
+ new QName(SOAPConstants.SOAP11_NS, SOAP11_ACTOR_ATTR_LOCAL_NAME, SOAPConstants.SOAP11_PREFIX);
+
+ /** The specification-defined value 'http://schemas.xmlsoap.org/soap/actor/next'. */
+ public static final String SOAP11_ACTOR_NEXT = "http://schemas.xmlsoap.org/soap/actor/next";
+
+ /**
+ * Get the attribute value.
+ *
+ * @return return the attribute vlue
+ */
+ public String getSOAP11Actor();
+
+ /**
+ * Set the attribute value.
+ *
+ * @param newActor the new attribute value
+ */
+ public void setSOAP11Actor(String newActor);
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/Body.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/Body.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/Body.java 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.common.SOAPObject;
+import org.opensaml.ws.soap.util.SOAPConstants;
+import org.opensaml.xml.AttributeExtensibleXMLObject;
+import org.opensaml.xml.ElementExtensibleXMLObject;
+
+/**
+ * SOAP 1.1 Body.
+ */
+public interface Body extends SOAPObject, ElementExtensibleXMLObject, AttributeExtensibleXMLObject {
+
+ /** Element local name. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Body";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME =
+ new QName(SOAPConstants.SOAP11_NS, DEFAULT_ELEMENT_LOCAL_NAME, SOAPConstants.SOAP11_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "Body";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME =
+ new QName(SOAPConstants.SOAP11_NS, TYPE_LOCAL_NAME, SOAPConstants.SOAP11_PREFIX);
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/Detail.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/Detail.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/Detail.java 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.common.SOAPObject;
+import org.opensaml.ws.soap.util.SOAPConstants;
+import org.opensaml.xml.AttributeExtensibleXMLObject;
+import org.opensaml.xml.ElementExtensibleXMLObject;
+
+/**
+ * SOAP 1.1 Detail.
+ */
+public interface Detail extends SOAPObject, ElementExtensibleXMLObject, AttributeExtensibleXMLObject {
+
+ /** Element local name. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "detail";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(DEFAULT_ELEMENT_LOCAL_NAME);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "detail";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME =
+ new QName(SOAPConstants.SOAP11_NS, TYPE_LOCAL_NAME, SOAPConstants.SOAP11_PREFIX);
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/EncodingStyleBearing.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/EncodingStyleBearing.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/EncodingStyleBearing.java 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.util.SOAPConstants;
+
+/**
+ * Interface for element having a @soap11:encodingStyle
attribute.
+ */
+public interface EncodingStyleBearing {
+
+ /** The soap11:@encodingStyle attribute local name. */
+ public static final String SOAP11_ENCODING_STYLE_ATTR_LOCAL_NAME = "encodingStyle";
+
+ /** The soap11:@encodingStyle qualified attribute name. */
+ public static final QName SOAP11_ENCODING_STYLE_ATTR_NAME =
+ new QName(SOAPConstants.SOAP11_NS, SOAP11_ENCODING_STYLE_ATTR_LOCAL_NAME, SOAPConstants.SOAP11_PREFIX);
+
+ /**
+ * Get the attribute value.
+ *
+ * @return return the list of attribute values
+ */
+ public List getSOAP11EncodingStyles();
+
+ /**
+ * Set the attribute value.
+ *
+ * @param newEncodingStyles the new list of attribute values
+ */
+ public void setSOAP11EncodingStyles(List newEncodingStyles);
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/Envelope.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/Envelope.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/Envelope.java 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.common.SOAPObject;
+import org.opensaml.ws.soap.util.SOAPConstants;
+import org.opensaml.xml.AttributeExtensibleXMLObject;
+import org.opensaml.xml.ElementExtensibleXMLObject;
+
+/**
+ * SOAP 1.1 Envelope.
+ */
+public interface Envelope extends SOAPObject, ElementExtensibleXMLObject, AttributeExtensibleXMLObject {
+
+ /** Element local name. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Envelope";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME =
+ new QName(SOAPConstants.SOAP11_NS, DEFAULT_ELEMENT_LOCAL_NAME, SOAPConstants.SOAP11_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "Envelope";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME =
+ new QName(SOAPConstants.SOAP11_NS, TYPE_LOCAL_NAME, SOAPConstants.SOAP11_PREFIX);
+
+ /**
+ * Gets the header of this envelope.
+ *
+ * @return the header of this envelope
+ */
+ public Header getHeader();
+
+ /**
+ * Sets the header of this envelope.
+ *
+ * @param newHeader the header of this envelope
+ */
+ public void setHeader(Header newHeader);
+
+ /**
+ * Gets the body of this envelope.
+ *
+ * @return the body of this envelope
+ */
+ public Body getBody();
+
+ /**
+ * Sets the body of this envelope.
+ *
+ * @param newBody the body of this envelope
+ */
+ public void setBody(Body newBody);
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/Fault.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/Fault.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/Fault.java 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.common.SOAPObject;
+import org.opensaml.ws.soap.util.SOAPConstants;
+
+/**
+ * SOAP 1.1 Fault.
+ */
+public interface Fault extends SOAPObject {
+
+ /** Element local name. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Fault";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME =
+ new QName(SOAPConstants.SOAP11_NS, DEFAULT_ELEMENT_LOCAL_NAME, SOAPConstants.SOAP11_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "Fault";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME =
+ new QName(SOAPConstants.SOAP11_NS, TYPE_LOCAL_NAME, SOAPConstants.SOAP11_PREFIX);
+
+ /**
+ * Gets the fault code for this fault.
+ *
+ * @return the fault code for this fault
+ */
+ public FaultCode getCode();
+
+ /**
+ * Sets the fault code for this fault.
+ *
+ * @param newFaultCode the fault code for this fault
+ */
+ public void setCode(FaultCode newFaultCode);
+
+ /**
+ * Gets the fault string for this fault.
+ *
+ * @return the fault string for this fault
+ */
+ public FaultString getMessage();
+
+ /**
+ * Sets the fault string for this fault.
+ *
+ * @param newMessage the fault string for this fault
+ */
+ public void setMessage(FaultString newMessage);
+
+ /**
+ * Gets the URI of the fault actor for this fault.
+ *
+ * @return the URI of the fault actor for this fault
+ */
+ public FaultActor getActor();
+
+ /**
+ * Sets the URI of the fault actor for this fault.
+ *
+ * @param newActor the URI of the fault actor for this fault
+ */
+ public void setActor(FaultActor newActor);
+
+ /**
+ * Gets details of this fault.
+ *
+ * @return details of this fault
+ */
+ public Detail getDetail();
+
+ /**
+ * Sets details of this fault.
+ *
+ * @param newDetail details of this fault
+ */
+ public void setDetail(Detail newDetail);
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/FaultActor.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/FaultActor.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/FaultActor.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.common.SOAPObject;
+import org.opensaml.xml.schema.XSURI;
+
+/**
+ * SOAP 1.1 faultactor.
+ */
+public interface FaultActor extends SOAPObject, XSURI {
+
+ /** Element local name. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "faultactor";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(DEFAULT_ELEMENT_LOCAL_NAME);
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/FaultCode.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/FaultCode.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/FaultCode.java 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.common.SOAPObject;
+import org.opensaml.ws.soap.util.SOAPConstants;
+import org.opensaml.xml.schema.XSQName;
+
+/**
+ * SOAP 1.1 faultcode.
+ */
+public interface FaultCode extends SOAPObject, XSQName {
+
+ /** Element local name. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "faultcode";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(DEFAULT_ELEMENT_LOCAL_NAME);
+
+ /** FaultCode value VersionMismatch
. */
+ public static final QName VERSION_MISMATCH = new QName(SOAPConstants.SOAP11_NS, "VersionMismatch",
+ SOAPConstants.SOAP11_PREFIX);
+
+ /** FaultCode value MustUnderstand
. */
+ public static final QName MUST_UNDERSTAND = new QName(SOAPConstants.SOAP11_NS, "MustUnderstand",
+ SOAPConstants.SOAP11_PREFIX);
+
+ /** FaultCode value Server
. */
+ public static final QName SERVER = new QName(SOAPConstants.SOAP11_NS, "Server", SOAPConstants.SOAP11_PREFIX);
+
+ /** FaultCode value Client
. */
+ public static final QName CLIENT = new QName(SOAPConstants.SOAP11_NS, "Client", SOAPConstants.SOAP11_PREFIX);
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/FaultString.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/FaultString.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/FaultString.java 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.common.SOAPObject;
+import org.opensaml.xml.schema.XSString;
+
+/**
+ * SOAP 1.1 faultstring.
+ */
+public interface FaultString extends SOAPObject, XSString {
+
+ /** Element local name. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "faultstring";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME = new QName(DEFAULT_ELEMENT_LOCAL_NAME);
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/Header.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/Header.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/Header.java 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.common.SOAPObject;
+import org.opensaml.ws.soap.util.SOAPConstants;
+import org.opensaml.xml.AttributeExtensibleXMLObject;
+import org.opensaml.xml.ElementExtensibleXMLObject;
+
+/**
+ * SOAP 1.1 Header.
+ */
+public interface Header extends SOAPObject, ElementExtensibleXMLObject, AttributeExtensibleXMLObject {
+
+ /** Element local name. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Header";
+
+ /** Default element name. */
+ public static final QName DEFAULT_ELEMENT_NAME =
+ new QName(SOAPConstants.SOAP11_NS, DEFAULT_ELEMENT_LOCAL_NAME, SOAPConstants.SOAP11_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "Header";
+
+ /** QName of the XSI type. */
+ public static final QName TYPE_NAME =
+ new QName(SOAPConstants.SOAP11_NS, TYPE_LOCAL_NAME, SOAPConstants.SOAP11_PREFIX);
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/MustUnderstandBearing.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/MustUnderstandBearing.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/MustUnderstandBearing.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.util.SOAPConstants;
+import org.opensaml.xml.schema.XSBooleanValue;
+
+/**
+ * Interface for element having a @soap11:mustUnderstand
attribute.
+ */
+public interface MustUnderstandBearing {
+
+ /** The soap11:@mustUnderstand attribute local name. */
+ public static final String SOAP11_MUST_UNDERSTAND_ATTR_LOCAL_NAME = "mustUnderstand";
+
+ /** The soap11:@mustUnderstand qualified attribute name. */
+ public static final QName SOAP11_MUST_UNDERSTAND_ATTR_NAME =
+ new QName(SOAPConstants.SOAP11_NS, SOAP11_MUST_UNDERSTAND_ATTR_LOCAL_NAME, SOAPConstants.SOAP11_PREFIX);
+
+ /**
+ * Get the attribute value.
+ *
+ * @return return the attribute vlue
+ */
+ public Boolean isSOAP11MustUnderstand();
+
+ /**
+ * Get the attribute value.
+ *
+ * @return return the attribute vlue
+ */
+ public XSBooleanValue isSOAP11MustUnderstandXSBoolean();
+
+ /**
+ * Set the attribute value.
+ *
+ * @param newMustUnderstand the new attribute value
+ */
+ public void setSOAP11MustUnderstand(Boolean newMustUnderstand);
+
+ /**
+ * Set the attribute value.
+ *
+ * @param newMustUnderstand the new attribute value
+ */
+ public void setSOAP11MustUnderstand(XSBooleanValue newMustUnderstand);
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/package.html 17 Aug 2012 15:09:09 -0000 1.1
@@ -0,0 +1,5 @@
+
+
+XMLObject interfaces for SOAP 1.1 elements.
+
+
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/decoder/SOAP11Decoder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/decoder/SOAP11Decoder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/decoder/SOAP11Decoder.java 17 Aug 2012 15:08:51 -0000 1.1
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.decoder ;
+
+import java.util.List;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.message.decoder.MessageDecodingException;
+import org.opensaml.ws.message.handler.BaseHandlerChainAwareMessageDecoder;
+import org.opensaml.ws.soap.soap11.Envelope;
+import org.opensaml.ws.soap.soap11.Header;
+import org.opensaml.ws.transport.InTransport;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.parse.ParserPool;
+import org.opensaml.xml.security.SecurityException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Basic SOAP 1.1 decoder.
+ */
+public class SOAP11Decoder extends BaseHandlerChainAwareMessageDecoder {
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(SOAP11Decoder.class);
+
+ /** Constructor. */
+ public SOAP11Decoder() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param pool parser pool used to deserialize messages
+ */
+ public SOAP11Decoder(ParserPool pool) {
+ super(pool);
+ }
+
+ /** {@inheritDoc} */
+ protected void doDecode(MessageContext messageContext) throws MessageDecodingException {
+
+ InTransport inTransport = messageContext.getInboundMessageTransport();
+
+ log.debug("Unmarshalling SOAP message");
+ Envelope soapMessage = (Envelope) unmarshallMessage(inTransport.getIncomingStream());
+ messageContext.setInboundMessage(soapMessage);
+ }
+
+
+ /** {@inheritDoc} */
+ public void decode(MessageContext messageContext) throws MessageDecodingException, SecurityException {
+ super.decode(messageContext);
+
+ // TODO enable once header checking support is completed
+ // checkUnderstoodSOAPHeaders(messageContext);
+ }
+
+ /**
+ * Check that all headers which carry the soap11:mustUnderstand
attribute
+ * and which are targeted to this SOAP node via the soap11:actor
were understood by the
+ * decoder.
+ *
+ * @param messageContext the message context being processed
+ *
+ * @throws MessageDecodingException thrown if a SOAP header requires understanding by
+ * this node but was not understood
+ */
+ private void checkUnderstoodSOAPHeaders(MessageContext messageContext)
+ throws MessageDecodingException {
+
+ Envelope envelope = (Envelope) messageContext.getInboundMessage();
+ Header soapHeader = envelope.getHeader();
+ if (soapHeader == null) {
+ log.debug("SOAP Envelope contained no Header");
+ return;
+ }
+ List headers = soapHeader.getUnknownXMLObjects();
+ if (headers == null || headers.isEmpty()) {
+ log.debug("SOAP Envelope header list was either null or empty");
+ return;
+ }
+
+ for (XMLObject header : headers) {
+ //TODO
+ }
+ }
+
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/decoder/http/HTTPSOAP11Decoder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/decoder/http/HTTPSOAP11Decoder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/decoder/http/HTTPSOAP11Decoder.java 17 Aug 2012 15:09:14 -0000 1.1
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.decoder.http;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.message.decoder.MessageDecodingException;
+import org.opensaml.ws.soap.soap11.decoder.SOAP11Decoder;
+import org.opensaml.ws.transport.http.HTTPInTransport;
+import org.opensaml.xml.parse.ParserPool;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Basic SOAP 1.1 over decoder for HTTP transport.
+ */
+public class HTTPSOAP11Decoder extends SOAP11Decoder {
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(HTTPSOAP11Decoder.class);
+
+ /** Constructor. */
+ public HTTPSOAP11Decoder() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param pool parser pool used to deserialize messages
+ */
+ public HTTPSOAP11Decoder(ParserPool pool) {
+ super(pool);
+ }
+
+ /** {@inheritDoc} */
+ protected void doDecode(MessageContext messageContext) throws MessageDecodingException {
+
+ if (!(messageContext.getInboundMessageTransport() instanceof HTTPInTransport)) {
+ log.error("Invalid inbound message transport type, this decoder only support HTTPInTransport");
+ throw new MessageDecodingException(
+ "Invalid inbound message transport type, this decoder only support HTTPInTransport");
+ }
+
+ HTTPInTransport inTransport = (HTTPInTransport) messageContext.getInboundMessageTransport();
+ if (!inTransport.getHTTPMethod().equalsIgnoreCase("POST")) {
+ throw new MessageDecodingException("This message deocoder only supports the HTTP POST method");
+ }
+
+ super.doDecode(messageContext);
+
+ }
+
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/encoder/SOAP11Encoder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/encoder/SOAP11Encoder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/encoder/SOAP11Encoder.java 17 Aug 2012 15:09:14 -0000 1.1
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.encoder;
+
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.message.encoder.MessageEncodingException;
+import org.opensaml.ws.message.handler.BaseHandlerChainAwareMessageEncoder;
+import org.opensaml.ws.soap.common.SOAPObjectBuilder;
+import org.opensaml.ws.soap.soap11.Body;
+import org.opensaml.ws.soap.soap11.Envelope;
+import org.opensaml.ws.transport.OutTransport;
+import org.opensaml.xml.Configuration;
+import org.opensaml.xml.XMLObjectBuilderFactory;
+import org.opensaml.xml.util.XMLHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Element;
+
+/**
+ * Basic SOAP 1.1 encoder.
+ */
+public class SOAP11Encoder extends BaseHandlerChainAwareMessageEncoder {
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(SOAP11Encoder.class);
+
+ /** SOAP Envelope builder. */
+ private SOAPObjectBuilder envBuilder;
+
+ /** SOAP Body builder. */
+ private SOAPObjectBuilder bodyBuilder;
+
+
+ /** Constructor. */
+ @SuppressWarnings("unchecked")
+ public SOAP11Encoder() {
+ super();
+ XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFactory();
+ envBuilder = (SOAPObjectBuilder) builderFactory.getBuilder(Envelope.DEFAULT_ELEMENT_NAME);
+ bodyBuilder = (SOAPObjectBuilder) builderFactory.getBuilder(Body.DEFAULT_ELEMENT_NAME);
+ }
+
+ /** {@inheritDoc} */
+ public boolean providesMessageConfidentiality(MessageContext messageContext) throws MessageEncodingException {
+ return messageContext.getOutboundMessageTransport().isConfidential();
+ }
+
+ /** {@inheritDoc} */
+ public boolean providesMessageIntegrity(MessageContext messageContext) throws MessageEncodingException {
+ return messageContext.getOutboundMessageTransport().isIntegrityProtected();
+ }
+
+ /** {@inheritDoc} */
+ protected void prepareMessageContext(MessageContext messageContext) throws MessageEncodingException {
+ if (messageContext.getOutboundMessage() == null) {
+ messageContext.setOutboundMessage(buildSOAPEnvelope(messageContext));
+ }
+ }
+
+ /** {@inheritDoc} */
+ protected void encodeToTransport(MessageContext messageContext) throws MessageEncodingException {
+ Element envelopeElem = marshallMessage(messageContext.getOutboundMessage());
+
+ preprocessTransport(messageContext);
+
+ try {
+ OutTransport outTransport = messageContext.getOutboundMessageTransport();
+ Writer out = new OutputStreamWriter(outTransport.getOutgoingStream(), "UTF-8");
+ XMLHelper.writeNode(envelopeElem, out);
+ out.flush();
+ } catch (UnsupportedEncodingException e) {
+ log.error("JVM does not support required UTF-8 encoding");
+ throw new MessageEncodingException("JVM does not support required UTF-8 encoding");
+ } catch (IOException e) {
+ log.error("Unable to write message content to outbound stream", e);
+ throw new MessageEncodingException("Unable to write message content to outbound stream", e);
+ }
+ }
+
+ /**
+ * Perform any processing or fixup on the message context's outbound transport, prior to encoding the actual
+ * message.
+ *
+ *
+ * The default implementation does nothing. Subclasses should override to implement transport-specific
+ * behavior.
+ *
+ *
+ * @param messageContext the current message context being processed
+ *
+ * @throws MessageEncodingException thrown if there is a problem preprocessing the transport
+ */
+ protected void preprocessTransport(MessageContext messageContext) throws MessageEncodingException {
+ }
+
+ /**
+ * Builds the SOAP envelope and body skeleton to be encoded.
+ *
+ * @param messageContext the message context being processed
+ *
+ * @return the minimal SOAP message envelope skeleton
+ */
+ protected Envelope buildSOAPEnvelope(MessageContext messageContext) {
+ log.debug("Building SOAP envelope");
+
+ Envelope envelope = envBuilder.buildObject();
+
+ Body body = bodyBuilder.buildObject();
+ envelope.setBody(body);
+
+ return envelope;
+ }
+
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/encoder/http/HTTPSOAP11Encoder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/encoder/http/HTTPSOAP11Encoder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/encoder/http/HTTPSOAP11Encoder.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.encoder.http;
+
+import java.util.List;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.message.encoder.MessageEncodingException;
+import org.opensaml.ws.soap.soap11.Envelope;
+import org.opensaml.ws.soap.soap11.Header;
+import org.opensaml.ws.soap.soap11.encoder.SOAP11Encoder;
+import org.opensaml.ws.transport.http.HTTPOutTransport;
+import org.opensaml.ws.transport.http.HTTPTransportUtils;
+import org.opensaml.ws.wsaddressing.Action;
+import org.opensaml.xml.XMLObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Basic SOAP 1.1 encoder for HTTP transport.
+ */
+public class HTTPSOAP11Encoder extends SOAP11Encoder {
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(HTTPSOAP11Encoder.class);
+
+
+ /** Constructor. */
+ public HTTPSOAP11Encoder() {
+ super();
+ }
+
+ /** {@inheritDoc} */
+ protected void doEncode(MessageContext messageContext) throws MessageEncodingException {
+ if (!(messageContext.getOutboundMessageTransport() instanceof HTTPOutTransport)) {
+ log.error("Invalid outbound message transport type, this encoder only support HTTPOutTransport");
+ throw new MessageEncodingException(
+ "Invalid outbound message transport type, this encoder only support HTTPOutTransport");
+ }
+
+ super.doEncode(messageContext);
+ }
+
+ /**
+ *
+ * This implementation performs the following actions on the context's {@link HTTPOutTransport}:
+ *
+ * - Adds the HTTP header: "Cache-control: no-cache, no-store"
+ * - Adds the HTTP header: "Pragma: no-cache"
+ * - Sets the character encoding to: "UTF-8"
+ * - Sets the content type to: "text/xml"
+ * - Sets the SOAPAction HTTP header the value returned by {@link #getSOAPAction(MessageContext)}, if
+ * that returns non-null.
+ *
+ *
+ *
+ *
+ * Subclasses should NOT set the SOAPAction HTTP header in this method. Instead, they should override
+ * the method {@link #getSOAPAction(MessageContext)}.
+ *
+ *
+ * @param messageContext the current message context being processed
+ *
+ * @throws MessageEncodingException thrown if there is a problem preprocessing the transport
+ */
+ protected void preprocessTransport(MessageContext messageContext) throws MessageEncodingException {
+ HTTPOutTransport outTransport = (HTTPOutTransport) messageContext.getOutboundMessageTransport();
+ HTTPTransportUtils.addNoCacheHeaders(outTransport);
+ HTTPTransportUtils.setUTF8Encoding(outTransport);
+ HTTPTransportUtils.setContentType(outTransport, "text/xml");
+
+ String soapAction = getSOAPAction(messageContext);
+ if (soapAction != null) {
+ outTransport.setHeader("SOAPAction", soapAction);
+ } else {
+ outTransport.setHeader("SOAPAction", "");
+ }
+ }
+
+ /**
+ * Determine the value of the SOAPAction HTTP header to send.
+ *
+ *
+ * The default behavior is to return the value of the SOAP Envelope's WS-Addressing Action header,
+ * if present.
+ *
+ *
+ * @param messageContext the current message context being processed
+ * @return a SOAPAction HTTP header URI value
+ */
+ protected String getSOAPAction(MessageContext messageContext) {
+ Envelope env = (Envelope) messageContext.getOutboundMessage();
+ Header header = env.getHeader();
+ if (header == null) {
+ return null;
+ }
+ List objList = header.getUnknownXMLObjects(Action.ELEMENT_NAME);
+ if (objList == null || objList.isEmpty()) {
+ return null;
+ } else {
+ return ((Action)objList.get(0)).getValue();
+ }
+ }
+
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/BodyBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/BodyBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/BodyBuilder.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import org.opensaml.ws.soap.common.SOAPObjectBuilder;
+import org.opensaml.ws.soap.soap11.Body;
+import org.opensaml.ws.soap.util.SOAPConstants;
+import org.opensaml.xml.AbstractXMLObjectBuilder;
+
+/**
+ * Builder of {@link org.opensaml.ws.soap.soap11.impl.BodyImpl} objects.
+ */
+public class BodyBuilder extends AbstractXMLObjectBuilder implements SOAPObjectBuilder {
+
+ /**
+ * Creates an envelope object with the default SOAP 1.1 namespace, prefix and "Body" as the element local name.
+ *
+ * @return the build Envelope object
+ */
+ public Body buildObject(){
+ return buildObject(SOAPConstants.SOAP11_NS, Body.DEFAULT_ELEMENT_LOCAL_NAME, SOAPConstants.SOAP11_PREFIX);
+ }
+
+ /** {@inheritDoc} */
+ public Body buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new BodyImpl(namespaceURI, localName, namespacePrefix);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/BodyImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/BodyImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/BodyImpl.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import org.opensaml.ws.soap.common.AbstractExtensibleSOAPObject;
+import org.opensaml.ws.soap.soap11.Body;
+
+/**
+ * Concrete implemenation of {@link org.opensaml.ws.soap.soap11.Body}.
+ */
+public class BodyImpl extends AbstractExtensibleSOAPObject implements Body {
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI namespace of the element
+ * @param elementLocalName name of the element
+ * @param namespacePrefix namespace prefix of the element
+ */
+ protected BodyImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/BodyMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/BodyMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/BodyMarshaller.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import java.util.Map.Entry;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.soap11.Body;
+import org.opensaml.xml.Configuration;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.AbstractXMLObjectMarshaller;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+
+/**
+ * A thread-safe marshaller for {@link org.opensaml.ws.soap.soap11.Body}s.
+ */
+public class BodyMarshaller extends AbstractXMLObjectMarshaller {
+
+ /** {@inheritDoc} */
+ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
+ Body body = (Body) xmlObject;
+
+ Attr attribute;
+ for (Entry entry : body.getUnknownAttributes().entrySet()) {
+ attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
+ attribute.setValue(entry.getValue());
+ domElement.setAttributeNodeNS(attribute);
+ if (Configuration.isIDAttribute(entry.getKey())
+ || body.getUnknownAttributes().isIDAttribute(entry.getKey())) {
+ attribute.getOwnerElement().setIdAttributeNode(attribute, true);
+ }
+ }
+ }
+
+ /** {@inheritDoc} */
+ protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException {
+ // nothing to do, not element content
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/BodyUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/BodyUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/BodyUnmarshaller.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.soap11.Body;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.AbstractXMLObjectUnmarshaller;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Attr;
+
+/**
+ * A thread-safe unmarshaller for {@link org.opensaml.ws.soap.soap11.Body}s.
+ */
+public class BodyUnmarshaller extends AbstractXMLObjectUnmarshaller {
+
+ /** {@inheritDoc} */
+ protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
+ throws UnmarshallingException {
+ Body body = (Body) parentXMLObject;
+ body.getUnknownXMLObjects().add(childXMLObject);
+ }
+
+ /** {@inheritDoc} */
+ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
+ Body body = (Body) xmlObject;
+ QName attribQName = XMLHelper.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute
+ .getPrefix());
+ if (attribute.isId()) {
+ body.getUnknownAttributes().registerID(attribQName);
+ }
+ body.getUnknownAttributes().put(attribQName, attribute.getValue());
+ }
+
+ /** {@inheritDoc} */
+ protected void processElementContent(XMLObject xmlObject, String elementContent) {
+ // do nothing, no child content
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/DetailBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/DetailBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/DetailBuilder.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import org.opensaml.ws.soap.common.SOAPObjectBuilder;
+import org.opensaml.ws.soap.soap11.Detail;
+import org.opensaml.xml.AbstractXMLObjectBuilder;
+
+/**
+ * Builder of {@link DetailImpl} objects.
+ */
+public class DetailBuilder extends AbstractXMLObjectBuilder implements SOAPObjectBuilder{
+
+ /**
+ * Creates an envelope object with the default SOAP 1.1 namespace, prefix and "Detail" as the element local name.
+ *
+ * @return the build Envelope object
+ */
+ public Detail buildObject(){
+ return buildObject(null, Detail.DEFAULT_ELEMENT_LOCAL_NAME, null);
+ }
+
+ /** {@inheritDoc} */
+ public Detail buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new DetailImpl(namespaceURI, localName, namespacePrefix);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/DetailImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/DetailImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/DetailImpl.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import org.opensaml.ws.soap.common.AbstractExtensibleSOAPObject;
+import org.opensaml.ws.soap.soap11.Detail;
+
+/**
+ * Concrete implementation of {@link org.opensaml.ws.soap.soap11.Detail}.
+ */
+public class DetailImpl extends AbstractExtensibleSOAPObject implements Detail {
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI namespace of the element
+ * @param elementLocalName name of the element
+ * @param namespacePrefix namespace prefix of the element
+ */
+ protected DetailImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/DetailMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/DetailMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/DetailMarshaller.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import java.util.Map.Entry;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.soap11.Detail;
+import org.opensaml.xml.Configuration;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.AbstractXMLObjectMarshaller;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+
+/**
+ * A thread-safe marshaller for {@link org.opensaml.ws.soap.soap11.Detail}s.
+ */
+public class DetailMarshaller extends AbstractXMLObjectMarshaller {
+
+ /** {@inheritDoc} */
+ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
+ Detail detail = (Detail) xmlObject;
+
+ Attr attribute;
+ for (Entry entry : detail.getUnknownAttributes().entrySet()) {
+ attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
+ attribute.setValue(entry.getValue());
+ domElement.setAttributeNodeNS(attribute);
+ if (Configuration.isIDAttribute(entry.getKey())
+ || detail.getUnknownAttributes().isIDAttribute(entry.getKey())) {
+ attribute.getOwnerElement().setIdAttributeNode(attribute, true);
+ }
+ }
+ }
+
+ /** {@inheritDoc} */
+ protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException {
+ // nothing to do, not element content
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/DetailUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/DetailUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/DetailUnmarshaller.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.soap11.Detail;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.AbstractXMLObjectUnmarshaller;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Attr;
+
+/**
+ * A thread-safe unmarshaller for {@link org.opensaml.ws.soap.soap11.Detail}s.
+ */
+public class DetailUnmarshaller extends AbstractXMLObjectUnmarshaller {
+
+ /** {@inheritDoc} */
+ protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
+ throws UnmarshallingException {
+ Detail detail = (Detail) parentXMLObject;
+ detail.getUnknownXMLObjects().add(childXMLObject);
+ }
+
+ /** {@inheritDoc} */
+ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
+ Detail detail = (Detail) xmlObject;
+ QName attribQName = XMLHelper.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute
+ .getPrefix());
+ if (attribute.isId()) {
+ detail.getUnknownAttributes().registerID(attribQName);
+ }
+ detail.getUnknownAttributes().put(attribQName, attribute.getValue());
+ }
+
+ /** {@inheritDoc} */
+ protected void processElementContent(XMLObject xmlObject, String elementContent) {
+ // do nothing, no child content
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/EnvelopeBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/EnvelopeBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/EnvelopeBuilder.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import org.opensaml.ws.soap.common.SOAPObjectBuilder;
+import org.opensaml.ws.soap.soap11.Envelope;
+import org.opensaml.ws.soap.util.SOAPConstants;
+import org.opensaml.xml.AbstractXMLObjectBuilder;
+
+/**
+ * Builder of {@link org.opensaml.ws.soap.soap11.impl.EnvelopeImpl} objects.
+ */
+public class EnvelopeBuilder extends AbstractXMLObjectBuilder implements SOAPObjectBuilder {
+
+ /**
+ * Creates an envelope object with the default SOAP 1.1 namespace, prefix and "Envelope" as the element local name.
+ *
+ * @return the build Envelope object
+ */
+ public Envelope buildObject(){
+ return buildObject(SOAPConstants.SOAP11_NS, Envelope.DEFAULT_ELEMENT_LOCAL_NAME, SOAPConstants.SOAP11_PREFIX);
+ }
+
+ /** {@inheritDoc} */
+ public Envelope buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new EnvelopeImpl(namespaceURI, localName, namespacePrefix);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/EnvelopeImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/EnvelopeImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/EnvelopeImpl.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.ws.soap.common.AbstractExtensibleSOAPObject;
+import org.opensaml.ws.soap.soap11.Body;
+import org.opensaml.ws.soap.soap11.Envelope;
+import org.opensaml.ws.soap.soap11.Header;
+import org.opensaml.xml.XMLObject;
+
+/**
+ * Concrete implementation of {@link org.opensaml.ws.soap.soap11.Envelope}.
+ */
+public class EnvelopeImpl extends AbstractExtensibleSOAPObject implements Envelope {
+
+ /** SOAP header. */
+ private Header header;
+
+ /** SOAP body. */
+ private Body body;
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI namespace of the element
+ * @param elementLocalName name of the element
+ * @param namespacePrefix namespace prefix of the element
+ */
+ protected EnvelopeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /** {@inheritDoc} */
+ public Header getHeader() {
+ return header;
+ }
+
+ /** {@inheritDoc} */
+ public void setHeader(Header newHeader) {
+ header = prepareForAssignment(header, newHeader);
+ }
+
+ /** {@inheritDoc} */
+ public Body getBody() {
+ return body;
+ }
+
+ /** {@inheritDoc} */
+ public void setBody(Body newBody) {
+ body = prepareForAssignment(body, newBody);
+ }
+
+ /** {@inheritDoc} */
+ public List getOrderedChildren() {
+ ArrayList children = new ArrayList();
+
+ children.add(header);
+ children.add(body);
+ children.addAll(super.getOrderedChildren());
+
+ return Collections.unmodifiableList(children);
+ }
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/EnvelopeMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/EnvelopeMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/EnvelopeMarshaller.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ *
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import java.util.Map.Entry;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.soap11.Envelope;
+import org.opensaml.xml.Configuration;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.AbstractXMLObjectMarshaller;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+
+/**
+ * A thread-safe marshaller for {@link org.opensaml.ws.soap.soap11.Envelope}s.
+ */
+public class EnvelopeMarshaller extends AbstractXMLObjectMarshaller {
+
+ /** {@inheritDoc} */
+ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
+ Envelope envelope = (Envelope) xmlObject;
+
+ Attr attribute;
+ for (Entry entry : envelope.getUnknownAttributes().entrySet()) {
+ attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
+ attribute.setValue(entry.getValue());
+ domElement.setAttributeNodeNS(attribute);
+ if (Configuration.isIDAttribute(entry.getKey())
+ || envelope.getUnknownAttributes().isIDAttribute(entry.getKey())) {
+ attribute.getOwnerElement().setIdAttributeNode(attribute, true);
+ }
+ }
+ }
+
+ /** {@inheritDoc} */
+ protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException {
+ // nothing to do, not element content
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/EnvelopeUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/EnvelopeUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/EnvelopeUnmarshaller.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.soap11.Body;
+import org.opensaml.ws.soap.soap11.Envelope;
+import org.opensaml.ws.soap.soap11.Header;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.AbstractXMLObjectUnmarshaller;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Attr;
+
+/**
+ * A thread-safe unmarshaller for {@link org.opensaml.ws.soap.soap11.Envelope}s.
+ */
+public class EnvelopeUnmarshaller extends AbstractXMLObjectUnmarshaller {
+
+ /** {@inheritDoc} */
+ protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
+ throws UnmarshallingException {
+ Envelope envelope = (Envelope) parentXMLObject;
+
+ if (childXMLObject instanceof Header) {
+ envelope.setHeader((Header) childXMLObject);
+ } else if (childXMLObject instanceof Body) {
+ envelope.setBody((Body) childXMLObject);
+ } else {
+ envelope.getUnknownXMLObjects().add(childXMLObject);
+ }
+ }
+
+ /** {@inheritDoc} */
+ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
+ Envelope envelope = (Envelope) xmlObject;
+ QName attribQName = XMLHelper.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute
+ .getPrefix());
+ if (attribute.isId()) {
+ envelope.getUnknownAttributes().registerID(attribQName);
+ }
+ envelope.getUnknownAttributes().put(attribQName, attribute.getValue());
+ }
+
+ /** {@inheritDoc} */
+ protected void processElementContent(XMLObject xmlObject, String elementContent) {
+ // do nothing, no child content
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultActorBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultActorBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultActorBuilder.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import org.opensaml.ws.soap.common.SOAPObjectBuilder;
+import org.opensaml.ws.soap.soap11.FaultActor;
+import org.opensaml.xml.AbstractXMLObjectBuilder;
+
+/**
+ * A builder of {@link org.opensaml.ws.soap.soap11.impl.FaultActorImpl} objects.
+ */
+public class FaultActorBuilder extends AbstractXMLObjectBuilder implements SOAPObjectBuilder {
+
+ /** {@inheritDoc} */
+ public FaultActor buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new FaultActorImpl(namespaceURI, localName, namespacePrefix);
+ }
+
+ /** {@inheritDoc} */
+ public FaultActor buildObject() {
+ return buildObject(null, FaultActor.DEFAULT_ELEMENT_LOCAL_NAME, null);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultActorImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultActorImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultActorImpl.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import org.opensaml.ws.soap.soap11.FaultActor;
+import org.opensaml.xml.schema.impl.XSURIImpl;
+
+/**
+ * Concrete implementation of {@link org.opensaml.ws.soap.soap11.FaultActor}.
+ */
+public class FaultActorImpl extends XSURIImpl implements FaultActor {
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI the namespace the element is in
+ * @param elementLocalName the local name of the XML element this Object represents
+ * @param namespacePrefix the prefix for the given namespace
+ */
+ protected FaultActorImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultBuilder.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import org.opensaml.ws.soap.common.SOAPObjectBuilder;
+import org.opensaml.ws.soap.soap11.Fault;
+import org.opensaml.ws.soap.util.SOAPConstants;
+import org.opensaml.xml.AbstractXMLObjectBuilder;
+
+/**
+ * Builder of {@link org.opensaml.ws.soap.soap11.impl.FaultImpl} objects.
+ */
+public class FaultBuilder extends AbstractXMLObjectBuilder implements SOAPObjectBuilder{
+
+ /**
+ * Creates an envelope object with the default SOAP 1.1 namespace, prefix and "Fault" as the element local name.
+ *
+ * @return the build Envelope object
+ */
+ public Fault buildObject() {
+ return buildObject(SOAPConstants.SOAP11_NS, Fault.DEFAULT_ELEMENT_LOCAL_NAME, SOAPConstants.SOAP11_PREFIX);
+ }
+
+ /** {@inheritDoc} */
+ public Fault buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new FaultImpl(namespaceURI, localName, namespacePrefix);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultCodeBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultCodeBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultCodeBuilder.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import org.opensaml.ws.soap.common.SOAPObjectBuilder;
+import org.opensaml.ws.soap.soap11.FaultCode;
+import org.opensaml.xml.AbstractXMLObjectBuilder;
+
+/**
+ * Builder of {@link org.opensaml.ws.soap.soap11.impl.FaultCodeImpl} objects.
+ */
+public class FaultCodeBuilder extends AbstractXMLObjectBuilder implements SOAPObjectBuilder {
+
+ /** {@inheritDoc} */
+ public FaultCode buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new FaultCodeImpl(namespaceURI, localName, namespacePrefix);
+ }
+
+ /** {@inheritDoc} */
+ public FaultCode buildObject() {
+ return buildObject(null, FaultCode.DEFAULT_ELEMENT_LOCAL_NAME, null);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultCodeImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultCodeImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultCodeImpl.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import org.opensaml.ws.soap.soap11.FaultCode;
+import org.opensaml.xml.schema.impl.XSQNameImpl;
+
+/**
+ * Concrete implementation of {@link org.opensaml.ws.soap.soap11.FaultCode}.
+ */
+public class FaultCodeImpl extends XSQNameImpl implements FaultCode {
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI the namespace the element is in
+ * @param elementLocalName the local name of the XML element this Object represents
+ * @param namespacePrefix the prefix for the given namespace
+ */
+ protected FaultCodeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultImpl.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.opensaml.ws.soap.soap11.Detail;
+import org.opensaml.ws.soap.soap11.Fault;
+import org.opensaml.ws.soap.soap11.FaultActor;
+import org.opensaml.ws.soap.soap11.FaultCode;
+import org.opensaml.ws.soap.soap11.FaultString;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.validation.AbstractValidatingXMLObject;
+
+/**
+ * Concrete implemenation of {@link org.opensaml.ws.soap.soap11.Fault}.
+ */
+public class FaultImpl extends AbstractValidatingXMLObject implements Fault {
+
+ /** Fault code. */
+ private FaultCode faultCode;
+
+ /** Fault message. */
+ private FaultString message;
+
+ /** Actor that faulted. */
+ private FaultActor actor;
+
+ /** Details of the fault. */
+ private Detail detail;
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI namespace of the element
+ * @param elementLocalName name of the element
+ * @param namespacePrefix namespace prefix of the element
+ */
+ protected FaultImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+
+ /** {@inheritDoc} */
+ public FaultCode getCode() {
+ return faultCode;
+ }
+
+ /** {@inheritDoc} */
+ public void setCode(FaultCode newFaultCode) {
+ faultCode = prepareForAssignment(faultCode, newFaultCode);
+ }
+
+ /** {@inheritDoc} */
+ public FaultString getMessage() {
+ return message;
+ }
+
+ /** {@inheritDoc} */
+ public void setMessage(FaultString newMessage) {
+ message = prepareForAssignment(message, newMessage);
+ }
+
+ /** {@inheritDoc} */
+ public FaultActor getActor() {
+ return actor;
+ }
+
+ /** {@inheritDoc} */
+ public void setActor(FaultActor newActor) {
+ actor = prepareForAssignment(actor, newActor);
+ }
+
+ /** {@inheritDoc} */
+ public Detail getDetail() {
+ return detail;
+ }
+
+ /** {@inheritDoc} */
+ public void setDetail(Detail newDetail) {
+ detail = prepareForAssignment(detail, newDetail);
+ }
+
+ /** {@inheritDoc} */
+ public List getOrderedChildren() {
+ ArrayList children = new ArrayList();
+
+ children.add(faultCode);
+ children.add(message);
+ children.add(actor);
+ children.add(detail);
+
+ return Collections.unmodifiableList(children);
+ }
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultMarshaller.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.AbstractXMLObjectMarshaller;
+import org.opensaml.xml.io.MarshallingException;
+import org.w3c.dom.Element;
+
+/**
+ * A thread-safe marshaller for {@link org.opensaml.ws.soap.soap11.Fault}s.
+ */
+public class FaultMarshaller extends AbstractXMLObjectMarshaller {
+
+ /** {@inheritDoc} */
+ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
+ // nothing to do, no attributes
+ }
+
+ /** {@inheritDoc} */
+ protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException {
+ // nothing to do, no content
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultStringBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultStringBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultStringBuilder.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import org.opensaml.ws.soap.common.SOAPObjectBuilder;
+import org.opensaml.ws.soap.soap11.FaultString;
+import org.opensaml.xml.AbstractXMLObjectBuilder;
+
+/**
+ * Builder of {@link org.opensaml.ws.soap.soap11.impl.FaultStringImpl} objects.
+ */
+public class FaultStringBuilder extends AbstractXMLObjectBuilder implements SOAPObjectBuilder {
+
+ /** {@inheritDoc} */
+ public FaultString buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new FaultStringImpl(namespaceURI, localName, namespacePrefix);
+ }
+
+ /** {@inheritDoc} */
+ public FaultString buildObject() {
+ return buildObject(null, FaultString.DEFAULT_ELEMENT_LOCAL_NAME, null);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultStringImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultStringImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultStringImpl.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import org.opensaml.ws.soap.soap11.FaultString;
+import org.opensaml.xml.schema.impl.XSStringImpl;
+
+/**
+ * Concrete implemenation of {@link org.opensaml.ws.soap.soap11.FaultString}.
+ */
+public class FaultStringImpl extends XSStringImpl implements FaultString {
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI the namespace the element is in
+ * @param elementLocalName the local name of the XML element this Object represents
+ * @param namespacePrefix the prefix for the given namespace
+ */
+ protected FaultStringImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/FaultUnmarshaller.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import org.opensaml.ws.soap.soap11.Detail;
+import org.opensaml.ws.soap.soap11.Fault;
+import org.opensaml.ws.soap.soap11.FaultActor;
+import org.opensaml.ws.soap.soap11.FaultCode;
+import org.opensaml.ws.soap.soap11.FaultString;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.AbstractXMLObjectUnmarshaller;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.schema.XSQName;
+import org.opensaml.xml.schema.XSString;
+import org.opensaml.xml.schema.XSURI;
+import org.w3c.dom.Attr;
+
+/**
+ * A thread-safe unmarshaller for {@link org.opensaml.ws.soap.soap11.Fault}s.
+ */
+public class FaultUnmarshaller extends AbstractXMLObjectUnmarshaller {
+
+ /** {@inheritDoc} */
+ protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
+ throws UnmarshallingException {
+ Fault fault = (Fault) parentXMLObject;
+
+ if(childXMLObject instanceof XSQName){
+ fault.setCode((FaultCode) childXMLObject);
+ }else if(childXMLObject instanceof XSString){
+ fault.setMessage((FaultString) childXMLObject);
+ }else if(childXMLObject instanceof XSURI){
+ fault.setActor((FaultActor) childXMLObject);
+ }else if(childXMLObject instanceof Detail){
+ fault.setDetail((Detail) childXMLObject);
+ }
+ }
+
+ /** {@inheritDoc} */
+ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
+ // nothing to do, no attributes
+ }
+
+ /** {@inheritDoc} */
+ protected void processElementContent(XMLObject xmlObject, String elementContent) {
+ //nothing to do, no element conent
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/HeaderBuilder.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/HeaderBuilder.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/HeaderBuilder.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import org.opensaml.ws.soap.common.SOAPObjectBuilder;
+import org.opensaml.ws.soap.soap11.Header;
+import org.opensaml.ws.soap.util.SOAPConstants;
+import org.opensaml.xml.AbstractXMLObjectBuilder;
+
+/**
+ * Builder of {@link org.opensaml.ws.soap.soap11.impl.HeaderImpl} objects.
+ */
+public class HeaderBuilder extends AbstractXMLObjectBuilder implements SOAPObjectBuilder{
+
+ /**
+ * Creates an envelope object with the default SOAP 1.1 namespace, prefix and "Header" as the element local name.
+ *
+ * @return the build Envelope object
+ */
+ public Header buildObject() {
+ return buildObject(SOAPConstants.SOAP11_NS, Header.DEFAULT_ELEMENT_LOCAL_NAME, SOAPConstants.SOAP11_PREFIX);
+ }
+
+ /** {@inheritDoc} */
+ public Header buildObject(String namespaceURI, String localName, String namespacePrefix) {
+ return new HeaderImpl(namespaceURI, localName, namespacePrefix);
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/HeaderImpl.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/HeaderImpl.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/HeaderImpl.java 17 Aug 2012 15:09:08 -0000 1.1
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import org.opensaml.ws.soap.common.AbstractExtensibleSOAPObject;
+import org.opensaml.ws.soap.soap11.Header;
+
+/**
+ * Concrete implementation of {@link org.opensaml.ws.soap.soap11.Header}.
+ */
+public class HeaderImpl extends AbstractExtensibleSOAPObject implements Header {
+
+ /**
+ * Constructor.
+ *
+ * @param namespaceURI namespace of the element
+ * @param elementLocalName name of the element
+ * @param namespacePrefix namespace prefix of the element
+ */
+ protected HeaderImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
+ super(namespaceURI, elementLocalName, namespacePrefix);
+ }
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/HeaderMarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/HeaderMarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/HeaderMarshaller.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import java.util.Map.Entry;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.soap11.Header;
+import org.opensaml.xml.Configuration;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.AbstractXMLObjectMarshaller;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+
+/**
+ * A thread-safe marshaller for {@link org.opensaml.ws.soap.soap11.Header}s.
+ */
+public class HeaderMarshaller extends AbstractXMLObjectMarshaller {
+
+ /** {@inheritDoc} */
+ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
+ Header header = (Header) xmlObject;
+
+ Attr attribute;
+ for (Entry entry : header.getUnknownAttributes().entrySet()) {
+ attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
+ attribute.setValue(entry.getValue());
+ domElement.setAttributeNodeNS(attribute);
+ if (Configuration.isIDAttribute(entry.getKey())
+ || header.getUnknownAttributes().isIDAttribute(entry.getKey())) {
+ attribute.getOwnerElement().setIdAttributeNode(attribute, true);
+ }
+ }
+ }
+
+ /** {@inheritDoc} */
+ protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException {
+ // nothing to do, not element content
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/HeaderUnmarshaller.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/HeaderUnmarshaller.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/HeaderUnmarshaller.java 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap11.impl;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.soap11.Header;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.AbstractXMLObjectUnmarshaller;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Attr;
+
+/**
+ * A thread-safe unmarshaller for {@link org.opensaml.ws.soap.soap11.Header}s.
+ */
+public class HeaderUnmarshaller extends AbstractXMLObjectUnmarshaller {
+
+ /** {@inheritDoc} */
+ protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
+ throws UnmarshallingException {
+ Header header = (Header) parentXMLObject;
+ header.getUnknownXMLObjects().add(childXMLObject);
+ }
+
+ /** {@inheritDoc} */
+ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
+ Header header = (Header) xmlObject;
+ QName attribQName = XMLHelper.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute
+ .getPrefix());
+ if (attribute.isId()) {
+ header.getUnknownAttributes().registerID(attribQName);
+ }
+ header.getUnknownAttributes().put(attribQName, attribute.getValue());
+ }
+
+ /** {@inheritDoc} */
+ protected void processElementContent(XMLObject xmlObject, String elementContent) {
+ // do nothing, no child content
+ }
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/package.html
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/package.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap11/impl/package.html 17 Aug 2012 15:09:07 -0000 1.1
@@ -0,0 +1,5 @@
+
+
+Provided implementations of the SOAP 1.1 XMLObject interfaces.
+
+
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap12/EncodingStyleBearing.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap12/EncodingStyleBearing.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap12/EncodingStyleBearing.java 17 Aug 2012 15:09:14 -0000 1.1
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap12;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.util.SOAPConstants;
+
+/**
+ * Interface for element having a @soap12:encodingStyle
attribute.
+ */
+public interface EncodingStyleBearing {
+
+ /** The soap12:@encodingStyle attribute local name. */
+ public static final String SOAP12_ENCODING_STYLE_ATTR_LOCAL_NAME = "encodingStyle";
+
+ /** The soap12:@encodingStyle qualified attribute name. */
+ public static final QName SOAP12_ENCODING_STYLE_ATTR_NAME =
+ new QName(SOAPConstants.SOAP12_NS, SOAP12_ENCODING_STYLE_ATTR_LOCAL_NAME, SOAPConstants.SOAP12_PREFIX);
+
+ /**
+ * Get the attribute value.
+ *
+ * @return return the attribute value
+ */
+ public String getSOAP12EncodingStyle();
+
+ /**
+ * Set the attribute value.
+ *
+ * @param newEncodingStyle the new attribute value
+ */
+ public void setSOAP12EncodingStyle(String newEncodingStyle);
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap12/MustUnderstandBearing.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap12/MustUnderstandBearing.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap12/MustUnderstandBearing.java 17 Aug 2012 15:09:14 -0000 1.1
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap12;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.util.SOAPConstants;
+import org.opensaml.xml.schema.XSBooleanValue;
+
+/**
+ * Interface for element having a @soap12:mustUnderstand
attribute.
+ */
+public interface MustUnderstandBearing {
+
+ /** The soap12:@mustUnderstand attribute local name. */
+ public static final String SOAP12_MUST_UNDERSTAND_ATTR_LOCAL_NAME = "mustUnderstand";
+
+ /** The soap12:@mustUnderstand qualified attribute name. */
+ public static final QName SOAP12_MUST_UNDERSTAND_ATTR_NAME =
+ new QName(SOAPConstants.SOAP12_NS, SOAP12_MUST_UNDERSTAND_ATTR_LOCAL_NAME, SOAPConstants.SOAP12_PREFIX);
+
+ /**
+ * Get the attribute value.
+ *
+ * @return return the attribute value
+ */
+ public Boolean isSOAP12MustUnderstand();
+
+ /**
+ * Get the attribute value.
+ *
+ * @return return the attribute value
+ */
+ public XSBooleanValue isSOAP12MustUnderstandXSBoolean();
+
+ /**
+ * Set the attribute value.
+ *
+ * @param newMustUnderstand the new attribute value
+ */
+ public void setSOAP12MustUnderstand(Boolean newMustUnderstand);
+
+ /**
+ * Set the attribute value.
+ *
+ * @param newMustUnderstand the new attribute value
+ */
+ public void setSOAP12MustUnderstand(XSBooleanValue newMustUnderstand);
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap12/RelayBearing.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap12/RelayBearing.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap12/RelayBearing.java 17 Aug 2012 15:09:14 -0000 1.1
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap12;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.util.SOAPConstants;
+import org.opensaml.xml.schema.XSBooleanValue;
+
+/**
+ * Interface for element having a @soap12:relay
attribute.
+ */
+public interface RelayBearing {
+
+ /** The soap12:@relay attribute local name. */
+ public static final String SOAP12_RELAY_ATTR_LOCAL_NAME = "relay";
+
+ /** The soap12:@relay qualified attribute name. */
+ public static final QName SOAP12_RELAY_ATTR_NAME =
+ new QName(SOAPConstants.SOAP12_NS, SOAP12_RELAY_ATTR_LOCAL_NAME, SOAPConstants.SOAP12_PREFIX);
+
+ /**
+ * Get the attribute value.
+ *
+ * @return return the attribute vlue
+ */
+ public Boolean isSOAP12Relay();
+
+ /**
+ * Get the attribute value.
+ *
+ * @return return the attribute vlue
+ */
+ public XSBooleanValue isSOAP12RelayXSBoolean();
+
+ /**
+ * Set the attribute value.
+ *
+ * @param newRelay the new attribute value
+ */
+ public void setSOAP12Relay(Boolean newRelay);
+
+ /**
+ * Set the attribute value.
+ *
+ * @param newRelay the new attribute value
+ */
+ public void setSOAP12Relay(XSBooleanValue newRelay);
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/soap12/RoleBearing.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/soap12/RoleBearing.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/soap12/RoleBearing.java 17 Aug 2012 15:09:14 -0000 1.1
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.soap12;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.soap.util.SOAPConstants;
+
+/**
+ * Interface for element having a @soap12:role
attribute.
+ */
+public interface RoleBearing {
+
+ /** The soap12:@role attribute local name. */
+ public static final String SOAP12_ROLE_ATTR_LOCAL_NAME = "role";
+
+ /** The soap12:@role qualified attribute name. */
+ public static final QName SOAP12_ROLE_ATTR_NAME =
+ new QName(SOAPConstants.SOAP12_NS, SOAP12_ROLE_ATTR_LOCAL_NAME, SOAPConstants.SOAP12_PREFIX);
+
+ /**
+ * Get the attribute value.
+ *
+ * @return return the attribute vlue
+ */
+ public String getSOAP12Role();
+
+ /**
+ * Set the attribute value.
+ *
+ * @param newRole the new attribute value
+ */
+ public void setSOAP12Role(String newRole);
+
+}
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/util/SOAPConstants.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/util/SOAPConstants.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/util/SOAPConstants.java 17 Aug 2012 15:09:06 -0000 1.1
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.util;
+
+/** SOAP Related Constants. */
+public class SOAPConstants {
+
+ /** SOAP 1.1 namespace. */
+ public static final String SOAP11_NS = "http://schemas.xmlsoap.org/soap/envelope/";
+
+ /** SOAP 1.1 prefix. */
+ public static final String SOAP11_PREFIX = "soap11";
+
+ /** SOAP 1.2 namespace. */
+ public static final String SOAP12_NS = "http://www.w3.org/2003/05/soap-envelope";
+
+ /** SOAP 1.2 prefix. */
+ public static final String SOAP12_PREFIX = "soap12";
+}
\ No newline at end of file
Index: 3rdParty_sources/openws/org/opensaml/ws/soap/util/SOAPHelper.java
===================================================================
RCS file: /usr/local/cvsroot/3rdParty_sources/openws/org/opensaml/ws/soap/util/SOAPHelper.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 3rdParty_sources/openws/org/opensaml/ws/soap/util/SOAPHelper.java 17 Aug 2012 15:09:06 -0000 1.1
@@ -0,0 +1,660 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opensaml.ws.soap.util;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import javax.xml.namespace.QName;
+
+import org.opensaml.ws.message.MessageContext;
+import org.opensaml.ws.soap.soap11.ActorBearing;
+import org.opensaml.ws.soap.soap11.Detail;
+import org.opensaml.ws.soap.soap11.EncodingStyleBearing;
+import org.opensaml.ws.soap.soap11.Envelope;
+import org.opensaml.ws.soap.soap11.Fault;
+import org.opensaml.ws.soap.soap11.FaultActor;
+import org.opensaml.ws.soap.soap11.FaultCode;
+import org.opensaml.ws.soap.soap11.FaultString;
+import org.opensaml.ws.soap.soap11.Header;
+import org.opensaml.ws.soap.soap11.MustUnderstandBearing;
+import org.opensaml.xml.AttributeExtensibleXMLObject;
+import org.opensaml.xml.Configuration;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.XMLObjectBuilderFactory;
+import org.opensaml.xml.schema.XSBooleanValue;
+import org.opensaml.xml.util.AttributeMap;
+import org.opensaml.xml.util.DatatypeHelper;
+import org.opensaml.xml.util.LazyList;
+import org.opensaml.xml.util.XMLHelper;
+
+/**
+ * Helper methods for working with SOAP.
+ */
+public final class SOAPHelper {
+
+ /**
+ * Private constructor.
+ */
+ private SOAPHelper() {
+ }
+
+ /**
+ * Adds a soap11:mustUnderstand
attribute to the given SOAP object.
+ *
+ * @param soapObject the SOAP object to add the attribute to
+ * @param mustUnderstand whether mustUnderstand is true or false
+ */
+ public static void addSOAP11MustUnderstandAttribute(XMLObject soapObject, boolean mustUnderstand) {
+ if (soapObject instanceof MustUnderstandBearing) {
+ ((MustUnderstandBearing) soapObject).setSOAP11MustUnderstand(new XSBooleanValue(mustUnderstand, true));
+ } else if (soapObject instanceof AttributeExtensibleXMLObject) {
+ ((AttributeExtensibleXMLObject) soapObject).getUnknownAttributes().put(
+ MustUnderstandBearing.SOAP11_MUST_UNDERSTAND_ATTR_NAME,
+ new XSBooleanValue(mustUnderstand, true).toString());
+ } else {
+ throw new IllegalArgumentException("Specified object was neither MustUnderBearing nor AttributeExtensible");
+ }
+ }
+
+ /**
+ * Get the soap11:mustUnderstand
attribute from a given SOAP object.
+ *
+ * @param soapObject the SOAP object to add the attribute to
+ *
+ * @return value of the mustUnderstand attribute, or false if not present
+ */
+ public static boolean getSOAP11MustUnderstandAttribute(XMLObject soapObject) {
+ if (soapObject instanceof MustUnderstandBearing) {
+ XSBooleanValue value = ((MustUnderstandBearing) soapObject).isSOAP11MustUnderstandXSBoolean();
+ if (value != null) {
+ return value.getValue();
+ }
+ }
+ if (soapObject instanceof AttributeExtensibleXMLObject) {
+ String value = DatatypeHelper.safeTrimOrNullString(((AttributeExtensibleXMLObject) soapObject)
+ .getUnknownAttributes().get(MustUnderstandBearing.SOAP11_MUST_UNDERSTAND_ATTR_NAME));
+ return DatatypeHelper.safeEquals("1", value);
+ }
+ return false;
+ }
+
+ /**
+ * Adds a soap11:actor
attribute to the given SOAP object.
+ *
+ * @param soapObject the SOAP object to add the attribute to
+ * @param actorURI the URI of the actor
+ */
+ public static void addSOAP11ActorAttribute(XMLObject soapObject, String actorURI) {
+ if (soapObject instanceof ActorBearing) {
+ ((ActorBearing) soapObject).setSOAP11Actor(actorURI);
+ } else if (soapObject instanceof AttributeExtensibleXMLObject) {
+ ((AttributeExtensibleXMLObject) soapObject).getUnknownAttributes().put(ActorBearing.SOAP11_ACTOR_ATTR_NAME,
+ actorURI);
+ } else {
+ throw new IllegalArgumentException("Specified object was neither ActorBearing nor AttributeExtensible");
+ }
+ }
+
+ /**
+ * Gets the soap11:actor
attribute from a given SOAP object.
+ *
+ * @param soapObject the SOAP object to add the attribute to
+ *
+ * @return the value of the actor attribute, or null if not present
+ */
+ public static String getSOAP11ActorAttribute(XMLObject soapObject) {
+ String value = null;
+ if (soapObject instanceof ActorBearing) {
+ value = DatatypeHelper.safeTrimOrNullString(((ActorBearing) soapObject).getSOAP11Actor());
+ if (value != null) {
+ return value;
+ }
+ }
+ if (soapObject instanceof AttributeExtensibleXMLObject) {
+ value = DatatypeHelper.safeTrimOrNullString(((AttributeExtensibleXMLObject) soapObject)
+ .getUnknownAttributes().get(ActorBearing.SOAP11_ACTOR_ATTR_NAME));
+ return value;
+ }
+ return null;
+ }
+
+ /**
+ * Adds a single encoding style to the given SOAP object. If an existing soap11:encodingStyle
attribute
+ * is present, the given style will be added to the existing list.
+ *
+ * @param soapObject the SOAP object to add the attribute to
+ * @param encodingStyle the encoding style to add
+ */
+ public static void addSOAP11EncodingStyle(XMLObject soapObject, String encodingStyle) {
+ if (soapObject instanceof EncodingStyleBearing) {
+ EncodingStyleBearing esb = (EncodingStyleBearing) soapObject;
+ List list = esb.getSOAP11EncodingStyles();
+ if (list == null) {
+ list = new LazyList();
+ esb.setSOAP11EncodingStyles(list);
+ }
+ list.add(encodingStyle);
+ } else if (soapObject instanceof AttributeExtensibleXMLObject) {
+ AttributeMap am = ((AttributeExtensibleXMLObject) soapObject).getUnknownAttributes();
+ String list = am.get(EncodingStyleBearing.SOAP11_ENCODING_STYLE_ATTR_NAME);
+ if (list == null) {
+ list = encodingStyle;
+ } else {
+ list = list + " " + encodingStyle;
+ }
+ am.put(EncodingStyleBearing.SOAP11_ENCODING_STYLE_ATTR_NAME, list);
+ } else {
+ throw new IllegalArgumentException(
+ "Specified object was neither EncodingStyleBearing nor AttributeExtensible");
+ }
+ }
+
+ /**
+ * Adds a soap11:encodingStyle
attribute to the given SOAP object.
+ *
+ * @param soapObject the SOAP object to add the attribute to
+ * @param encodingStyles the list of encoding styles to add
+ */
+ public static void addSOAP11EncodingStyles(XMLObject soapObject, List encodingStyles) {
+ if (soapObject instanceof EncodingStyleBearing) {
+ ((EncodingStyleBearing) soapObject).setSOAP11EncodingStyles(encodingStyles);
+ } else if (soapObject instanceof AttributeExtensibleXMLObject) {
+ ((AttributeExtensibleXMLObject) soapObject).getUnknownAttributes().put(
+ EncodingStyleBearing.SOAP11_ENCODING_STYLE_ATTR_NAME,
+ DatatypeHelper.listToStringValue(encodingStyles, " "));
+ } else {
+ throw new IllegalArgumentException(
+ "Specified object was neither EncodingStyleBearing nor AttributeExtensible");
+ }
+ }
+
+ /**
+ * Gets the list value of the soap11:encodingStyle
attribute from the given SOAP object.
+ *
+ * @param soapObject the SOAP object to add the attribute to
+ *
+ * @return the list of encoding styles, or null if not present
+ */
+ public static List getSOAP11EncodingStyles(XMLObject soapObject) {
+ if (soapObject instanceof EncodingStyleBearing) {
+ List value = ((EncodingStyleBearing) soapObject).getSOAP11EncodingStyles();
+ if (value != null) {
+ return value;
+ }
+ }
+ if (soapObject instanceof AttributeExtensibleXMLObject) {
+ String value = DatatypeHelper.safeTrimOrNullString(((AttributeExtensibleXMLObject) soapObject)
+ .getUnknownAttributes().get(EncodingStyleBearing.SOAP11_ENCODING_STYLE_ATTR_NAME));
+ if (value != null) {
+ DatatypeHelper.stringToList(value, XMLHelper.LIST_DELIMITERS);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Adds the soap12:encodingStyle
attribute to the given soap object.
+ *
+ * @param soapObject object to which the encoding style attribute should be added
+ * @param style the encoding style
+ */
+ public static void addSOAP12EncodingStyleAttribute(XMLObject soapObject, String style) {
+ if (soapObject instanceof org.opensaml.ws.soap.soap12.EncodingStyleBearing) {
+ ((org.opensaml.ws.soap.soap12.EncodingStyleBearing) soapObject).setSOAP12EncodingStyle(style);
+ } else if (soapObject instanceof AttributeExtensibleXMLObject) {
+ ((AttributeExtensibleXMLObject) soapObject).getUnknownAttributes().put(
+ org.opensaml.ws.soap.soap12.EncodingStyleBearing.SOAP12_ENCODING_STYLE_ATTR_NAME, style);
+ } else {
+ throw new IllegalArgumentException(
+ "Specified object was neither EncodingStyleBearing nor AttribtueExtensible");
+ }
+ }
+
+ /**
+ * Gets the soap12:encodingStyle
.
+ *
+ * @param soapObject the SOAP object which may contain the encoding style
+ *
+ * @return the encoding style or null if it is not set on the object
+ */
+ public static String getSOAP12EncodingStyleAttribute(XMLObject soapObject) {
+ String style = null;
+ if (soapObject instanceof org.opensaml.ws.soap.soap12.EncodingStyleBearing) {
+ style = ((org.opensaml.ws.soap.soap12.EncodingStyleBearing) soapObject).getSOAP12EncodingStyle();
+ }
+
+ if (style == null && soapObject instanceof AttributeExtensibleXMLObject) {
+ style = DatatypeHelper.safeTrimOrNullString(((AttributeExtensibleXMLObject) soapObject)
+ .getUnknownAttributes().get(
+ org.opensaml.ws.soap.soap12.EncodingStyleBearing.SOAP12_ENCODING_STYLE_ATTR_NAME));
+ }
+
+ return style;
+ }
+
+ /**
+ * Adds a soap12:mustUnderstand
attribute to the given SOAP object.
+ *
+ * @param soapObject the SOAP object to add the attribute to
+ * @param mustUnderstand whether mustUnderstand is true or false
+ */
+ public static void addSOAP12MustUnderstandAttribute(XMLObject soapObject, boolean mustUnderstand) {
+ if (soapObject instanceof org.opensaml.ws.soap.soap12.MustUnderstandBearing) {
+ ((org.opensaml.ws.soap.soap12.MustUnderstandBearing) soapObject)
+ .setSOAP12MustUnderstand(new XSBooleanValue(mustUnderstand, false));
+ } else if (soapObject instanceof AttributeExtensibleXMLObject) {
+ ((AttributeExtensibleXMLObject) soapObject).getUnknownAttributes().put(
+ org.opensaml.ws.soap.soap12.MustUnderstandBearing.SOAP12_MUST_UNDERSTAND_ATTR_NAME,
+ new XSBooleanValue(mustUnderstand, false).toString());
+ } else {
+ throw new IllegalArgumentException("Specified object was neither MustUnderstandBearing nor AttributeExtensible");
+ }
+ }
+
+ /**
+ * Get the soap12:mustUnderstand
attribute from a given SOAP object.
+ *
+ * @param soapObject the SOAP object to add the attribute to
+ *
+ * @return value of the mustUnderstand attribute, or false if not present
+ */
+ public static boolean getSOAP12MustUnderstandAttribute(XMLObject soapObject) {
+ if (soapObject instanceof org.opensaml.ws.soap.soap12.MustUnderstandBearing) {
+ XSBooleanValue value = ((org.opensaml.ws.soap.soap12.MustUnderstandBearing) soapObject)
+ .isSOAP12MustUnderstandXSBoolean();
+ if (value != null) {
+ return value.getValue();
+ }
+ }
+ if (soapObject instanceof AttributeExtensibleXMLObject) {
+ String value = DatatypeHelper.safeTrimOrNullString(((AttributeExtensibleXMLObject) soapObject)
+ .getUnknownAttributes().get(
+ org.opensaml.ws.soap.soap12.MustUnderstandBearing.SOAP12_MUST_UNDERSTAND_ATTR_NAME));
+ return DatatypeHelper.safeEquals("1", value) || DatatypeHelper.safeEquals("true", value);
+ }
+ return false;
+ }
+
+ /**
+ * Adds a soap12:relay
attribute to the given SOAP object.
+ *
+ * @param soapObject the SOAP object to add the attribute to
+ * @param relay whether relay is true or false
+ */
+ public static void addSOAP12RelayAttribute(XMLObject soapObject, boolean relay) {
+ if (soapObject instanceof org.opensaml.ws.soap.soap12.RelayBearing) {
+ ((org.opensaml.ws.soap.soap12.RelayBearing) soapObject).setSOAP12Relay(new XSBooleanValue(relay, false));
+ } else if (soapObject instanceof AttributeExtensibleXMLObject) {
+ ((AttributeExtensibleXMLObject) soapObject).getUnknownAttributes().put(
+ org.opensaml.ws.soap.soap12.RelayBearing.SOAP12_RELAY_ATTR_NAME,
+ new XSBooleanValue(relay, false).toString());
+ } else {
+ throw new IllegalArgumentException("Specified object was neither RelyBearing nor AttributeExtensible");
+ }
+ }
+
+ /**
+ * Get the soap12:relay
attribute from a given SOAP object.
+ *
+ * @param soapObject the SOAP object to add the attribute to
+ *
+ * @return value of the relay attribute, or false if not present
+ */
+ public static boolean getSOAP12RelayAttribute(XMLObject soapObject) {
+ if (soapObject instanceof org.opensaml.ws.soap.soap12.RelayBearing) {
+ XSBooleanValue value = ((org.opensaml.ws.soap.soap12.RelayBearing) soapObject).isSOAP12RelayXSBoolean();
+ if (value != null) {
+ return value.getValue();
+ }
+ }
+ if (soapObject instanceof AttributeExtensibleXMLObject) {
+ String value = DatatypeHelper.safeTrimOrNullString(((AttributeExtensibleXMLObject) soapObject)
+ .getUnknownAttributes().get(org.opensaml.ws.soap.soap12.RelayBearing.SOAP12_RELAY_ATTR_LOCAL_NAME));
+ return DatatypeHelper.safeEquals("1", value) || DatatypeHelper.safeEquals("true", value);
+ }
+ return false;
+ }
+
+ /**
+ * Adds the soap12:role
attribute to the given soap object.
+ *
+ * @param soapObject object to which the rol attribute should be added
+ * @param role the role
+ */
+ public static void addSOAP12RoleAttribute(XMLObject soapObject, String role) {
+ if (soapObject instanceof org.opensaml.ws.soap.soap12.RoleBearing) {
+ ((org.opensaml.ws.soap.soap12.RoleBearing) soapObject).setSOAP12Role(role);
+ } else if (soapObject instanceof AttributeExtensibleXMLObject) {
+ ((AttributeExtensibleXMLObject) soapObject).getUnknownAttributes().put(
+ org.opensaml.ws.soap.soap12.RoleBearing.SOAP12_ROLE_ATTR_NAME, role);
+ } else {
+ throw new IllegalArgumentException(
+ "Specified object was neither RoleBearing nor AttribtueExtensible");
+ }
+ }
+
+ /**
+ * Gets the soap12:role
.
+ *
+ * @param soapObject the SOAP object which may contain the role
+ *
+ * @return the role or null if it is not set on the object
+ */
+ public static String getSOAP12RoleAttribute(XMLObject soapObject) {
+ String role = null;
+ if (soapObject instanceof org.opensaml.ws.soap.soap12.RoleBearing) {
+ role = ((org.opensaml.ws.soap.soap12.RoleBearing) soapObject).getSOAP12Role();
+ }
+
+ if (role == null && soapObject instanceof AttributeExtensibleXMLObject) {
+ role = DatatypeHelper.safeTrimOrNullString(((AttributeExtensibleXMLObject) soapObject)
+ .getUnknownAttributes().get(
+ org.opensaml.ws.soap.soap12.RoleBearing.SOAP12_ROLE_ATTR_LOCAL_NAME));
+ }
+
+ return role;
+ }
+
+ /**
+ * Adds a soap11:actor
attribute to the given SOAP object.
+ *
+ * @param soapObject the SOAP object to add the attribute to
+ * @param actorURI the URI of the actor
+ *
+ * @deprecated use instead {@link #addSOAP11ActorAttribute(XMLObject, String)}.
+ */
+ public static void addActorAttribute(XMLObject soapObject, String actorURI) {
+ addSOAP11ActorAttribute(soapObject, actorURI);
+ }
+
+ /**
+ * Adds a single encoding style to the given SOAP object. If an existing soap11:encodingStyle
attribute
+ * is present, the given style will be added to the existing list.
+ *
+ * @param soapObject the SOAP object to add the attribute to
+ * @param encodingStyle the encoding style to add
+ *
+ * @deprecated use instead {@link #addSOAP11EncodingStyle(XMLObject, String)}.
+ */
+ public static void addEncodingStyle(XMLObject soapObject, String encodingStyle) {
+ addSOAP11EncodingStyle(soapObject, encodingStyle);
+ }
+
+ /**
+ * Adds a soap11:encodingStyle
attribute to the given SOAP object.
+ *
+ * @param soapObject the SOAP object to add the attribute to
+ * @param encodingStyles the list of encoding styles to add
+ *
+ * @deprecated use instead {@link #addSOAP11EncodingStyles(XMLObject, List)}.
+ */
+ public static void addEncodingStyles(XMLObject soapObject, List encodingStyles) {
+ addSOAP11EncodingStyles(soapObject, encodingStyles);
+ }
+
+ /**
+ * Adds a soap11:mustUnderstand
attribute to the given SOAP object.
+ *
+ * @param soapObject the SOAP object to add the attribute to
+ * @param mustUnderstand whether mustUnderstand is true or false
+ *
+ * @deprecated use instead {@link #addSOAP11MustUnderstandAttribute(XMLObject, boolean)}.
+ */
+ public static void addMustUnderstandAttribute(XMLObject soapObject, boolean mustUnderstand) {
+ addSOAP11MustUnderstandAttribute(soapObject, mustUnderstand);
+ }
+
+ /**
+ * Add a header block to the SOAP envelope contained within the specified message context's
+ * {@link MessageContext#getOutboundMessage()}.
+ *
+ * @param messageContext the message context being processed
+ * @param headerBlock the header block to add
+ */
+ public static void addHeaderBlock(MessageContext messageContext, XMLObject headerBlock) {
+ XMLObject outboundEnvelope = messageContext.getOutboundMessage();
+ if (outboundEnvelope == null) {
+ throw new IllegalArgumentException("Message context does not contain a SOAP envelope");
+ }
+
+ // SOAP 1.1 Envelope
+ if (outboundEnvelope instanceof Envelope) {
+ addSOAP11HeaderBlock((Envelope) outboundEnvelope, headerBlock);
+ }
+
+ //TODO SOAP 1.2 support when object providers are implemented
+
+ }
+
+ /**
+ * Add a header to the SOAP 1.1 Envelope.
+ *
+ * @param envelope the SOAP 1.1 envelope to process
+ * @param headerBlock the header to add
+ */
+ public static void addSOAP11HeaderBlock(Envelope envelope, XMLObject headerBlock) {
+ Header envelopeHeader = envelope.getHeader();
+ if (envelopeHeader == null) {
+ envelopeHeader = (Header) Configuration.getBuilderFactory().getBuilder(Header.DEFAULT_ELEMENT_NAME)
+ .buildObject(Header.DEFAULT_ELEMENT_NAME);
+ envelope.setHeader(envelopeHeader);
+ }
+
+ envelopeHeader.getUnknownXMLObjects().add(headerBlock);
+ }
+
+ /**
+ * Get a header block from the SOAP envelope contained within the specified message context's
+ * {@link MessageContext#getInboundMessage()}.
+ *
+ * @param msgContext the message context being processed
+ * @param headerName the name of the header block to return
+ * @param targetNodes the explicitly specified SOAP node actors (1.1) or roles (1.2) for which the header is desired
+ * @param isFinalDestination true specifies that headers targeted for message final destination should be returned,
+ * false means they should not be returned
+ * @return the list of matching header blocks
+ */
+ public static List getInboundHeaderBlock(MessageContext msgContext, QName headerName,
+ Set targetNodes, boolean isFinalDestination) {
+ XMLObject inboundEnvelope = msgContext.getInboundMessage();
+ if (inboundEnvelope == null) {
+ throw new IllegalArgumentException("Message context does not contain an inbound SOAP envelope");
+ }
+
+ // SOAP 1.1 Envelope
+ if (inboundEnvelope instanceof Envelope) {
+ return getSOAP11HeaderBlock((Envelope) inboundEnvelope, headerName, targetNodes, isFinalDestination);
+ }
+
+ //TODO SOAP 1.2 support when object providers are implemented
+ return Collections.emptyList();
+ }
+
+ /**
+ * Get a header block from the SOAP envelope contained within the specified message context's
+ * {@link MessageContext#getOutboundMessage()}.
+ *
+ * @param msgContext the message context being processed
+ * @param headerName the name of the header block to return
+ * @param targetNodes the explicitly specified SOAP node actors (1.1) or roles (1.2) for which the header is desired
+ * @param isFinalDestination true specifies that headers targeted for message final destination should be returned,
+ * false specifies they should not be returned
+ * @return the list of matching header blocks
+ */
+ public static List getOutboundHeaderBlock(MessageContext msgContext, QName headerName,
+ Set targetNodes, boolean isFinalDestination) {
+ XMLObject outboundEnvelope = msgContext.getOutboundMessage();
+ if (outboundEnvelope == null) {
+ throw new IllegalArgumentException("Message context does not contain an outbound SOAP envelope");
+ }
+
+ // SOAP 1.1 Envelope
+ if (outboundEnvelope instanceof Envelope) {
+ return getSOAP11HeaderBlock((Envelope) outboundEnvelope, headerName, targetNodes, isFinalDestination);
+ }
+
+ //TODO SOAP 1.2 support when object providers are implemented
+ return Collections.emptyList();
+ }
+
+ /**
+ * Get a header block from the SOAP 1.1 envelope.
+ *
+ * @param envelope the SOAP 1.1 envelope to process
+ * @param headerName the name of the header block to return
+ * @param targetNodes the explicitly specified SOAP node actors for which the header is desired
+ * @param isFinalDestination true specifies that headers targeted for message final destination should be returned,
+ * false specifies they should not be returned
+ * @return the list of matching header blocks
+ */
+ public static List getSOAP11HeaderBlock(Envelope envelope, QName headerName, Set