[java-opensaml] branch master updated: OSJ-291 - Sweep SAML XMLObject interfaces for consistency
Scott Cantor
cantor.2 at osu.edu
Thu Nov 21 12:31:02 EST 2019
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch master
in repository java-opensaml.
View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=4bc5eb4a3167f7c0a2fcae2b8af2d699fc212367
The following commit(s) were added to refs/heads/master by this push:
new 4bc5eb4 OSJ-291 - Sweep SAML XMLObject interfaces for consistency
4bc5eb4 is described below
commit 4bc5eb4a3167f7c0a2fcae2b8af2d699fc212367
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Nov 21 12:31:00 2019 -0500
OSJ-291 - Sweep SAML XMLObject interfaces for consistency
https://issues.shibboleth.net/jira/browse/OSJ-291
Clean most of SAML 2 core.
---
.../java/org/opensaml/saml/saml2/core/Action.java | 89 ++++++++++++++--------
.../org/opensaml/saml/saml2/core/Artifact.java | 42 ++++++++--
.../org/opensaml/saml/saml2/core/Audience.java | 8 +-
.../saml/saml2/core/DecisionTypeEnumeration.java | 22 ++++--
.../org/opensaml/saml/saml2/core/GetComplete.java | 37 +++++++--
.../java/org/opensaml/saml/saml2/core/NewID.java | 37 +++++++--
.../org/opensaml/saml/saml2/core/RequesterID.java | 37 +++++++--
.../org/opensaml/saml/saml2/core/SessionIndex.java | 38 +++++++--
.../saml2/profile/SAML2ActionTestingSupport.java | 2 +-
.../binding/decoding/impl/HTTPArtifactDecoder.java | 2 +-
.../opensaml/saml/saml2/core/impl/ActionImpl.java | 8 +-
.../saml/saml2/core/impl/ActionMarshaller.java | 4 +-
.../saml/saml2/core/impl/ActionUnmarshaller.java | 4 +-
.../saml/saml2/core/impl/ArtifactImpl.java | 10 +--
.../saml/saml2/core/impl/ArtifactMarshaller.java | 6 +-
.../saml/saml2/core/impl/ArtifactUnmarshaller.java | 4 +-
.../impl/AuthzDecisionStatementUnmarshaller.java | 20 ++---
.../saml/saml2/core/impl/GetCompleteImpl.java | 10 +--
.../saml2/core/impl/GetCompleteMarshaller.java | 6 +-
.../saml2/core/impl/GetCompleteUnmarshaller.java | 4 +-
.../opensaml/saml/saml2/core/impl/NewIDImpl.java | 8 +-
.../saml/saml2/core/impl/NewIDMarshaller.java | 6 +-
.../saml/saml2/core/impl/NewIDUnmarshaller.java | 4 +-
.../saml/saml2/core/impl/RequesterIDImpl.java | 10 +--
.../saml2/core/impl/RequesterIDMarshaller.java | 6 +-
.../saml2/core/impl/RequesterIDUnmarshaller.java | 4 +-
.../saml/saml2/core/impl/SessionIndexImpl.java | 10 +--
.../saml2/core/impl/SessionIndexMarshaller.java | 6 +-
.../saml2/core/impl/SessionIndexUnmarshaller.java | 4 +-
.../saml/saml2/profile/impl/ResolveArtifact.java | 4 +-
.../opensaml/saml/saml2/core/impl/ActionTest.java | 8 +-
.../saml/saml2/core/impl/ArtifactTest.java | 4 +-
.../core/impl/AuthzDecisionStatementTest.java | 11 ++-
.../saml/saml2/core/impl/GetCompleteTest.java | 4 +-
.../opensaml/saml/saml2/core/impl/NewIDTest.java | 4 +-
.../saml/saml2/core/impl/RequesterIDTest.java | 4 +-
.../saml/saml2/core/impl/SessionIndexTest.java | 4 +-
.../impl/AuthzDecisionStatementInvalidDecision.xml | 2 +
38 files changed, 335 insertions(+), 158 deletions(-)
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Action.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Action.java
index 059befc..d48f741 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Action.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Action.java
@@ -17,112 +17,139 @@
package org.opensaml.saml.saml2.core;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLObject;
import org.opensaml.saml.common.xml.SAMLConstants;
+import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
+
/**
* SAML 2.0 Core Action.
*/
public interface Action extends SAMLObject {
/** Element local name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Action";
+ @Nonnull @NotEmpty static final String DEFAULT_ELEMENT_LOCAL_NAME = "Action";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+ static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.SAML20_PREFIX);
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "ActionType";
+ @Nonnull @NotEmpty static final String TYPE_LOCAL_NAME = "ActionType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
+ static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
SAMLConstants.SAML20_PREFIX);
/** Name of the Namespace attribute. */
- public static final String NAMEPSACE_ATTRIB_NAME = "Namespace";
+ @Nonnull @NotEmpty static final String NAMEPSACE_ATTRIB_NAME = "Namespace";
/** Read/Write/Execute/Delete/Control action namespace. */
- public static final String RWEDC_NS_URI = "urn:oasis:names:tc:SAML:1.0:action:rwedc";
+ @Nonnull @NotEmpty static final String RWEDC_NS_URI = "urn:oasis:names:tc:SAML:1.0:action:rwedc";
/** Read/Write/Execute/Delete/Control negation action namespace. */
- public static final String RWEDC_NEGATION_NS_URI = "urn:oasis:names:tc:SAML:1.0:action:rwedc-negation";
+ @Nonnull @NotEmpty static final String RWEDC_NEGATION_NS_URI = "urn:oasis:names:tc:SAML:1.0:action:rwedc-negation";
/** Get/Head/Put/Post action namespace. */
- public static final String GHPP_NS_URI = "urn:oasis:names:tc:SAML:1.0:action:ghpp";
+ @Nonnull @NotEmpty static final String GHPP_NS_URI = "urn:oasis:names:tc:SAML:1.0:action:ghpp";
/** UNIX file permission action namespace. */
- public static final String UNIX_NS_URI = "urn:oasis:names:tc:SAML:1.0:action:unix";
+ @Nonnull @NotEmpty static final String UNIX_NS_URI = "urn:oasis:names:tc:SAML:1.0:action:unix";
/** Read action. */
- public static final String READ_ACTION = "Read";
+ @Nonnull @NotEmpty static final String READ_ACTION = "Read";
/** Write action. */
- public static final String WRITE_ACTION = "Write";
+ @Nonnull @NotEmpty static final String WRITE_ACTION = "Write";
/** Execute action. */
- public static final String EXECUTE_ACTION = "Execute";
+ @Nonnull @NotEmpty static final String EXECUTE_ACTION = "Execute";
/** Delete action. */
- public static final String DELETE_ACTION = "Delete";
+ @Nonnull @NotEmpty static final String DELETE_ACTION = "Delete";
/** Control action. */
- public static final String CONTROL_ACTION = "Control";
+ @Nonnull @NotEmpty static final String CONTROL_ACTION = "Control";
/** Negated Read action. */
- public static final String NEG_READ_ACTION = "~Read";
+ @Nonnull @NotEmpty static final String NEG_READ_ACTION = "~Read";
/** Negated Write action. */
- public static final String NEG_WRITE_ACTION = "~Write";
+ @Nonnull @NotEmpty static final String NEG_WRITE_ACTION = "~Write";
/** Negated Execute action. */
- public static final String NEG_EXECUTE_ACTION = "~Execute";
+ @Nonnull @NotEmpty static final String NEG_EXECUTE_ACTION = "~Execute";
/** Negated Delete action. */
- public static final String NEG_DELETE_ACTION = "~Delete";
+ @Nonnull @NotEmpty static final String NEG_DELETE_ACTION = "~Delete";
/** Negated Control action. */
- public static final String NEG_CONTROL_ACTION = "~Control";
+ @Nonnull @NotEmpty static final String NEG_CONTROL_ACTION = "~Control";
/** HTTP GET action. */
- public static final String HTTP_GET_ACTION = "GET";
+ @Nonnull @NotEmpty static final String HTTP_GET_ACTION = "GET";
/** HTTP HEAD action. */
- public static final String HTTP_HEAD_ACTION = "HEAD";
+ @Nonnull @NotEmpty static final String HTTP_HEAD_ACTION = "HEAD";
/** HTTP PUT action. */
- public static final String HTTP_PUT_ACTION = "PUT";
+ @Nonnull @NotEmpty static final String HTTP_PUT_ACTION = "PUT";
/** HTTP POST action. */
- public static final String HTTP_POST_ACTION = "POST";
+ @Nonnull @NotEmpty static final String HTTP_POST_ACTION = "POST";
/**
* Gets the namespace scope of the specified action.
*
* @return the namespace scope of the specified action
*/
- public String getNamespace();
+ @Nullable String getNamespace();
/**
* Sets the namespace scope of the specified action.
*
* @param newNamespace the namespace scope of the specified action
*/
- public void setNamespace(String newNamespace);
+ void setNamespace(@Nullable final String newNamespace);
+
+ /**
+ * Gets the value of the action to be performed.
+ *
+ * @return the value of the action to be performed
+ */
+ @Nullable String getValue();
/**
- * Gets the URI of the action to be performed.
+ * Sets the value of the action to be performed.
*
- * @return the URI of the action to be performed
+ * @param value the value of the action to be performed
*/
- public String getAction();
+ void setValue(@Nullable final String value);
+
+ /**
+ * Gets the value of the action to be performed.
+ *
+ * @return the value of the action to be performed
+ *
+ * @deprecated
+ */
+ @Nullable default String getAction() {
+ return getValue();
+ }
/**
- * Sets the URI of the action to be performed.
+ * Sets the value of the action to be performed.
+ *
+ * @param value the value of the action to be performed
*
- * @param newAction the URI of the action to be performed
+ * @deprecated
*/
- public void setAction(String newAction);
+ default void setAction(@Nullable final String value) {
+ setValue(value);
+ }
+
}
\ No newline at end of file
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Artifact.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Artifact.java
index 8467a84..eac9f55 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Artifact.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Artifact.java
@@ -21,28 +21,32 @@
package org.opensaml.saml.saml2.core;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLObject;
import org.opensaml.saml.common.xml.SAMLConstants;
+import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
+
/**
* SAML 2.0 Core Artifact.
*/
public interface Artifact extends SAMLObject {
/** Element local name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Artifact";
+ @Nonnull @NotEmpty static final String DEFAULT_ELEMENT_LOCAL_NAME = "Artifact";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20P_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+ @Nonnull static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20P_NS, DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.SAML20P_PREFIX);
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "ArtifactType";
+ @Nonnull @NotEmpty static final String TYPE_LOCAL_NAME = "ArtifactType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20P_NS, TYPE_LOCAL_NAME,
+ @Nonnull static final QName TYPE_NAME = new QName(SAMLConstants.SAML20P_NS, TYPE_LOCAL_NAME,
SAMLConstants.SAML20P_PREFIX);
/**
@@ -50,13 +54,35 @@ public interface Artifact extends SAMLObject {
*
* @return the artifact value
*/
- public String getArtifact();
+ @Nullable String getValue();
/**
* Set artifact value.
*
- * @param newArtifact sets the new artifact value
+ * @param value new artifact value
+ */
+ void setValue(@Nullable final String value);
+
+ /**
+ * Get artifact value.
+ *
+ * @return the artifact value
+ *
+ * @deprecated
+ */
+ @Nullable default String getArtifact() {
+ return getValue();
+ }
+
+ /**
+ * Set artifact value.
+ *
+ * @param value new artifact value
+ *
+ * @deprecated
*/
- public void setArtifact(String newArtifact);
+ default void setArtifact(@Nullable final String value) {
+ setValue(value);
+ }
-}
+}
\ No newline at end of file
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Audience.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Audience.java
index fa92230..2fdc202 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Audience.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/Audience.java
@@ -32,17 +32,17 @@ import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
public interface Audience extends SAMLObject {
/** Element local name. */
- @Nonnull @NotEmpty public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Audience";
+ @Nonnull @NotEmpty static final String DEFAULT_ELEMENT_LOCAL_NAME = "Audience";
/** Default element name. */
- @Nonnull public static final QName DEFAULT_ELEMENT_NAME =
+ @Nonnull static final QName DEFAULT_ELEMENT_NAME =
new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20_PREFIX);
/** Local name of the XSI type. */
- @Nonnull @NotEmpty public static final String TYPE_LOCAL_NAME = "AudienceType";
+ @Nonnull @NotEmpty static final String TYPE_LOCAL_NAME = "AudienceType";
/** QName of the XSI type. */
- @Nonnull public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
+ @Nonnull static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
SAMLConstants.SAML20_PREFIX);
/**
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/DecisionTypeEnumeration.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/DecisionTypeEnumeration.java
index 1a57617..3edc47e 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/DecisionTypeEnumeration.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/DecisionTypeEnumeration.java
@@ -17,34 +17,40 @@
package org.opensaml.saml.saml2.core;
+import javax.annotation.Nonnull;
+
+import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
+
/**
- * A type safe enumeration of {@link org.opensaml.saml.saml2.core.AuthzDecisionStatement} decision types.
+ * A type safe enumeration of {@link AuthzDecisionStatement} decision types.
*/
-public final class DecisionTypeEnumeration {
+public enum DecisionTypeEnumeration {
/** Permit decision type. */
- public static final DecisionTypeEnumeration PERMIT = new DecisionTypeEnumeration("Permit");
+ PERMIT("Permit"),
/** Deny decision type. */
- public static final DecisionTypeEnumeration DENY = new DecisionTypeEnumeration("Deny");
+ DENY("Deny"),
/** Indeterminate decision type. */
- public static final DecisionTypeEnumeration INDETERMINATE = new DecisionTypeEnumeration("Indeterminate");
+ INDETERMINATE("Indeterminate");
/** The decision type string. */
- private String decisionType;
+ @Nonnull @NotEmpty private String decisionType;
/**
* Constructor.
*
* @param newDecisionType the decision type string
*/
- protected DecisionTypeEnumeration(final String newDecisionType) {
- this.decisionType = newDecisionType;
+ private DecisionTypeEnumeration(@Nonnull @NotEmpty final String newDecisionType) {
+ decisionType = newDecisionType;
}
/** {@inheritDoc} */
+ @Override
public String toString() {
return decisionType;
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/GetComplete.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/GetComplete.java
index abded5b..6c006bb 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/GetComplete.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/GetComplete.java
@@ -17,21 +17,25 @@
package org.opensaml.saml.saml2.core;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLObject;
import org.opensaml.saml.common.xml.SAMLConstants;
+import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
+
/**
* SAML 2.0 Core GetComplete.
*/
public interface GetComplete extends SAMLObject {
/** Element Local Name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "GetComplete";
+ @Nonnull @NotEmpty static final String DEFAULT_ELEMENT_LOCAL_NAME = "GetComplete";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20P_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+ @Nonnull static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20P_NS, DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.SAML20P_PREFIX);
/**
@@ -39,12 +43,35 @@ public interface GetComplete extends SAMLObject {
*
* @return GetComplete URI
*/
- public String getGetComplete();
+ @Nullable String getURI();
/**
* Sets the GetComplete URI.
*
- * @param newGetComplete the GetComplete URI
+ * @param uri the GetComplete URI
+ */
+ void setURI(@Nullable final String uri);
+
+ /**
+ * Gets the GetComplete URI value.
+ *
+ * @return GetComplete URI
+ *
+ * @deprecated
*/
- public void setGetComplete(String newGetComplete);
+ @Nullable default String getGetComplete() {
+ return getURI();
+ }
+
+ /**
+ * Sets the GetComplete URI.
+ *
+ * @param uri the GetComplete URI
+ *
+ * @deprecated
+ */
+ default void setGetComplete(@Nullable final String uri) {
+ setURI(uri);
+ }
+
}
\ No newline at end of file
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/NewID.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/NewID.java
index e697a82..f830e2f 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/NewID.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/NewID.java
@@ -21,21 +21,25 @@
package org.opensaml.saml.saml2.core;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLObject;
import org.opensaml.saml.common.xml.SAMLConstants;
+import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
+
/**
* SAML 2.0 Core NewID.
*/
public interface NewID extends SAMLObject {
/** Element local name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "NewID";
+ @Nonnull @NotEmpty static final String DEFAULT_ELEMENT_LOCAL_NAME = "NewID";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20P_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+ @Nonnull static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20P_NS, DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.SAML20P_PREFIX);
/**
@@ -43,12 +47,35 @@ public interface NewID extends SAMLObject {
*
* @return NewID value
*/
- public String getNewID();
+ @Nullable String getValue();
/**
* Set NewID value.
*
- * @param newNewID the new NewID value
+ * @param value the new NewID value
+ */
+ void setValue(@Nullable final String value);
+
+ /**
+ * Get NewID value.
+ *
+ * @return NewID value
+ *
+ * @deprecated
*/
- public void setNewID(String newNewID);
+ @Nullable default String getNewID() {
+ return getValue();
+ }
+
+ /**
+ * Set NewID value.
+ *
+ * @param value the new NewID value
+ *
+ * @deprecated
+ */
+ default void setNewID(@Nullable final String value) {
+ setValue(value);
+ }
+
}
\ No newline at end of file
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/RequesterID.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/RequesterID.java
index 0b4daac..5e82bb3 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/RequesterID.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/RequesterID.java
@@ -17,21 +17,25 @@
package org.opensaml.saml.saml2.core;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLObject;
import org.opensaml.saml.common.xml.SAMLConstants;
+import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
+
/**
* SAML 2.0 Core RequesterID.
*/
public interface RequesterID extends SAMLObject {
/** Element Local Name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "RequesterID";
+ @Nonnull @NotEmpty static final String DEFAULT_ELEMENT_LOCAL_NAME = "RequesterID";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20P_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+ @Nonnull static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20P_NS, DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.SAML20P_PREFIX);
/**
@@ -39,12 +43,35 @@ public interface RequesterID extends SAMLObject {
*
* @return RequesterID value
*/
- public String getRequesterID();
+ @Nullable String getValue();
+
+ /**
+ * Sets the RequesterID value.
+ *
+ * @param value the RequesterID value
+ */
+ void setValue(@Nullable final String value);
+
+ /**
+ * Gets the RequesterID value.
+ *
+ * @return RequesterID value
+ *
+ * @deprecated
+ */
+ @Nullable default String getRequesterID() {
+ return getValue();
+ }
/**
* Sets the RequesterID value.
*
- * @param newRequesterID the RequesterID value
+ * @param value the RequesterID value
+ *
+ * @deprecated
*/
- public void setRequesterID(String newRequesterID);
+ default void setRequesterID(@Nullable final String value) {
+ setValue(value);
+ }
+
}
\ No newline at end of file
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/SessionIndex.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/SessionIndex.java
index 42dcd8b..3dc57e9 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/SessionIndex.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/core/SessionIndex.java
@@ -21,21 +21,25 @@
package org.opensaml.saml.saml2.core;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLObject;
import org.opensaml.saml.common.xml.SAMLConstants;
+import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
+
/**
* SAML 2.0 Core SessionIndex.
*/
public interface SessionIndex extends SAMLObject {
/** Element local name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "SessionIndex";
+ @Nonnull @NotEmpty static final String DEFAULT_ELEMENT_LOCAL_NAME = "SessionIndex";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20P_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+ @Nonnull static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20P_NS, DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.SAML20P_PREFIX);
/**
@@ -43,13 +47,35 @@ public interface SessionIndex extends SAMLObject {
*
* @return the session index value of the request
*/
- public String getSessionIndex();
+ @Nullable String getValue();
+
+ /**
+ * Sets the session index value of the request.
+ *
+ * @param value the new session index value of the request
+ */
+ void setValue(@Nullable final String value);
+
+ /**
+ * Gets the session index value of the request.
+ *
+ * @return the session index value of the request
+ *
+ * @deprecated
+ */
+ @Nullable default String getSessionIndex() {
+ return getValue();
+ }
/**
* Sets the session index value of the request.
*
- * @param newSessionIndex the new session index value of the request
+ * @param value the new session index value of the request
+ *
+ * @deprecated
*/
- public void setSessionIndex(String newSessionIndex);
+ default void setSessionIndex(@Nullable final String value) {
+ setValue(value);
+ }
-}
+}
\ No newline at end of file
diff --git a/opensaml-saml-api/src/test/java/org/opensaml/saml/saml2/profile/SAML2ActionTestingSupport.java b/opensaml-saml-api/src/test/java/org/opensaml/saml/saml2/profile/SAML2ActionTestingSupport.java
index a82027d..0934caa 100644
--- a/opensaml-saml-api/src/test/java/org/opensaml/saml/saml2/profile/SAML2ActionTestingSupport.java
+++ b/opensaml-saml-api/src/test/java/org/opensaml/saml/saml2/profile/SAML2ActionTestingSupport.java
@@ -331,7 +331,7 @@ public class SAML2ActionTestingSupport {
XMLObjectProviderRegistrySupport.getBuilderFactory().<Artifact>getBuilderOrThrow(
Artifact.DEFAULT_ELEMENT_NAME);
final Artifact art = artifactBuilder.buildObject();
- art.setArtifact(artifact);
+ art.setValue(artifact);
request.setArtifact(art);
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HTTPArtifactDecoder.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HTTPArtifactDecoder.java
index 09a05ca..821eb71 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HTTPArtifactDecoder.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/binding/decoding/impl/HTTPArtifactDecoder.java
@@ -514,7 +514,7 @@ public class HTTPArtifactDecoder extends BaseHttpServletRequestXMLMessageDecoder
(ArtifactResolve) XMLObjectSupport.buildXMLObject(ArtifactResolve.DEFAULT_ELEMENT_NAME);
final Artifact requestArtifact = (Artifact) XMLObjectSupport.buildXMLObject(Artifact.DEFAULT_ELEMENT_NAME);
- requestArtifact.setArtifact(Base64Support.encode(artifact.getArtifactBytes(), false));
+ requestArtifact.setValue(Base64Support.encode(artifact.getArtifactBytes(), false));
request.setArtifact(requestArtifact);
request.setID(idStrategy.generateIdentifier(true));
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ActionImpl.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ActionImpl.java
index 1aff3cf..051f9f9 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ActionImpl.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ActionImpl.java
@@ -28,7 +28,7 @@ import org.opensaml.core.xml.XMLObject;
import org.opensaml.saml.saml2.core.Action;
/**
- * A concrete implementation of {@link org.opensaml.saml.saml2.core.Action}.
+ * A concrete implementation of {@link Action}.
*/
public class ActionImpl extends AbstractXMLObject implements Action {
@@ -60,13 +60,13 @@ public class ActionImpl extends AbstractXMLObject implements Action {
}
/** {@inheritDoc} */
- public String getAction() {
+ public String getValue() {
return action;
}
/** {@inheritDoc} */
- public void setAction(final String newAction) {
- this.action = prepareForAssignment(this.action, newAction);
+ public void setValue(final String value) {
+ action = prepareForAssignment(action, value);
}
/** {@inheritDoc} */
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ActionMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ActionMarshaller.java
index 102e7e3..12935b5 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ActionMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ActionMarshaller.java
@@ -30,7 +30,7 @@ import org.opensaml.saml.saml2.core.Action;
import org.w3c.dom.Element;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.Action}.
+ * A thread-safe Marshaller for {@link Action}.
*/
public class ActionMarshaller extends AbstractSAMLObjectMarshaller {
@@ -48,6 +48,6 @@ public class ActionMarshaller extends AbstractSAMLObjectMarshaller {
protected void marshallElementContent(final XMLObject samlObject, final Element domElement)
throws MarshallingException {
final Action action = (Action) samlObject;
- ElementSupport.appendTextContent(domElement, action.getAction());
+ ElementSupport.appendTextContent(domElement, action.getValue());
}
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ActionUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ActionUnmarshaller.java
index 86c7a25..d8a7b4e 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ActionUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ActionUnmarshaller.java
@@ -28,14 +28,14 @@ import org.opensaml.saml.saml2.core.Action;
import org.w3c.dom.Attr;
/**
- * A thread-safe Unmarshaller for {@link org.opensaml.saml.saml2.core.Action}.
+ * A thread-safe Unmarshaller for {@link Action}.
*/
public class ActionUnmarshaller extends AbstractSAMLObjectUnmarshaller {
/** {@inheritDoc} */
protected void processElementContent(final XMLObject samlObject, final String elementContent) {
final Action action = (Action) samlObject;
- action.setAction(elementContent);
+ action.setValue(elementContent);
}
/** {@inheritDoc} */
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactImpl.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactImpl.java
index 2976bd1..e0f0706 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactImpl.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactImpl.java
@@ -28,7 +28,7 @@ import org.opensaml.core.xml.XMLObject;
import org.opensaml.saml.saml2.core.Artifact;
/**
- * Concrete implementation of {@link org.opensaml.saml.saml2.core.Artifact}.
+ * Concrete implementation of {@link Artifact}.
*/
public class ArtifactImpl extends AbstractXMLObject implements Artifact {
@@ -47,13 +47,13 @@ public class ArtifactImpl extends AbstractXMLObject implements Artifact {
}
/** {@inheritDoc} */
- public String getArtifact() {
- return this.artifact;
+ public String getValue() {
+ return artifact;
}
/** {@inheritDoc} */
- public void setArtifact(final String newArtifact) {
- this.artifact = prepareForAssignment(this.artifact, newArtifact);
+ public void setValue(final String value) {
+ artifact = prepareForAssignment(artifact, value);
}
/** {@inheritDoc} */
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactMarshaller.java
index cd19068..eb8f0f5 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactMarshaller.java
@@ -30,7 +30,7 @@ import org.opensaml.saml.saml2.core.Artifact;
import org.w3c.dom.Element;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.Artifact}.
+ * A thread-safe Marshaller for {@link Artifact}.
*/
public class ArtifactMarshaller extends AbstractSAMLObjectMarshaller {
@@ -39,8 +39,8 @@ public class ArtifactMarshaller extends AbstractSAMLObjectMarshaller {
throws MarshallingException {
final Artifact artifact = (Artifact) samlObject;
- if (artifact.getArtifact() != null) {
- ElementSupport.appendTextContent(domElement, artifact.getArtifact());
+ if (artifact.getValue() != null) {
+ ElementSupport.appendTextContent(domElement, artifact.getValue());
}
}
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactUnmarshaller.java
index 4f88115..c592aa1 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactUnmarshaller.java
@@ -26,7 +26,7 @@ import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
import org.opensaml.saml.saml2.core.Artifact;
/**
- * A thead-safe Unmarshaller for {@link org.opensaml.saml.saml2.core.Artifact}.
+ * A thead-safe Unmarshaller for {@link Artifact}.
*/
public class ArtifactUnmarshaller extends AbstractSAMLObjectUnmarshaller {
@@ -34,7 +34,7 @@ public class ArtifactUnmarshaller extends AbstractSAMLObjectUnmarshaller {
protected void processElementContent(final XMLObject samlObject, final String elementContent) {
final Artifact artifact = (Artifact) samlObject;
- artifact.setArtifact(elementContent);
+ artifact.setValue(elementContent);
}
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementUnmarshaller.java
index 7404250..90fcc66 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementUnmarshaller.java
@@ -31,7 +31,7 @@ import org.opensaml.saml.saml2.core.Evidence;
import org.w3c.dom.Attr;
/**
- * A thread-safe Unmarshaller for {@link org.opensaml.saml.saml2.core.AuthzDecisionStatement}.
+ * A thread-safe Unmarshaller for {@link AuthzDecisionStatement}.
*/
public class AuthzDecisionStatementUnmarshaller extends AbstractSAMLObjectUnmarshaller {
@@ -57,15 +57,15 @@ public class AuthzDecisionStatementUnmarshaller extends AbstractSAMLObjectUnmars
if (attribute.getLocalName().equals(AuthzDecisionStatement.RESOURCE_ATTRIB_NAME)) {
authzDS.setResource(attribute.getValue());
} else if (attribute.getLocalName().equals(AuthzDecisionStatement.DECISION_ATTRIB_NAME)) {
- final String value = attribute.getValue();
- if (value.equals(DecisionTypeEnumeration.PERMIT.toString())) {
- authzDS.setDecision(DecisionTypeEnumeration.PERMIT);
- } else if (value.equals(DecisionTypeEnumeration.DENY.toString())) {
- authzDS.setDecision(DecisionTypeEnumeration.DENY);
- } else if (value.equals(DecisionTypeEnumeration.INDETERMINATE.toString())) {
- authzDS.setDecision(DecisionTypeEnumeration.INDETERMINATE);
- } else {
- throw new UnmarshallingException("Unknown value for DecisionType '" + value + "'");
+ try {
+ if (attribute.getValue() != null) {
+ authzDS.setDecision(DecisionTypeEnumeration.valueOf(attribute.getValue().toUpperCase()));
+ } else {
+ throw new UnmarshallingException("Saw an empty value for Decision attribute");
+ }
+ } catch (final IllegalArgumentException e) {
+ throw new UnmarshallingException("Saw an invalid value for Decision attribute: "
+ + attribute.getValue());
}
} else {
super.processAttribute(samlObject, attribute);
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/GetCompleteImpl.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/GetCompleteImpl.java
index ea4a347..8c339df 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/GetCompleteImpl.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/GetCompleteImpl.java
@@ -28,7 +28,7 @@ import org.opensaml.core.xml.XMLObject;
import org.opensaml.saml.saml2.core.GetComplete;
/**
- * Concrete implementation of {@link org.opensaml.saml.saml2.core.GetComplete}.
+ * Concrete implementation of {@link GetComplete}.
*/
public class GetCompleteImpl extends AbstractXMLObject implements GetComplete {
@@ -47,13 +47,13 @@ public class GetCompleteImpl extends AbstractXMLObject implements GetComplete {
}
/** {@inheritDoc} */
- public String getGetComplete() {
- return this.getComplete;
+ public String getURI() {
+ return getComplete;
}
/** {@inheritDoc} */
- public void setGetComplete(final String newGetComplete) {
- this.getComplete = prepareForAssignment(this.getComplete, newGetComplete);
+ public void setURI(final String uri) {
+ getComplete = prepareForAssignment(getComplete, uri);
}
/** {@inheritDoc} */
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/GetCompleteMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/GetCompleteMarshaller.java
index 6af6b5c..a7963ca 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/GetCompleteMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/GetCompleteMarshaller.java
@@ -30,7 +30,7 @@ import org.opensaml.saml.saml2.core.GetComplete;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.GetComplete} objects.
+ * A thread safe Marshaller for {@link GetComplete} objects.
*/
public class GetCompleteMarshaller extends AbstractSAMLObjectMarshaller {
@@ -39,8 +39,8 @@ public class GetCompleteMarshaller extends AbstractSAMLObjectMarshaller {
throws MarshallingException {
final GetComplete gc = (GetComplete) samlObject;
- if (gc.getGetComplete() != null) {
- ElementSupport.appendTextContent(domElement, gc.getGetComplete());
+ if (gc.getURI() != null) {
+ ElementSupport.appendTextContent(domElement, gc.getURI());
}
}
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/GetCompleteUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/GetCompleteUnmarshaller.java
index 976f0d6..146defa 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/GetCompleteUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/GetCompleteUnmarshaller.java
@@ -26,7 +26,7 @@ import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
import org.opensaml.saml.saml2.core.GetComplete;
/**
- * A thread-safe Unmarshaller for {@link org.opensaml.saml.saml2.core.GetComplete} objects.
+ * A thread-safe Unmarshaller for {@link GetComplete} objects.
*/
public class GetCompleteUnmarshaller extends AbstractSAMLObjectUnmarshaller {
@@ -34,6 +34,6 @@ public class GetCompleteUnmarshaller extends AbstractSAMLObjectUnmarshaller {
protected void processElementContent(final XMLObject samlObject, final String elementContent) {
final GetComplete gc = (GetComplete) samlObject;
- gc.setGetComplete(elementContent);
+ gc.setURI(elementContent);
}
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NewIDImpl.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NewIDImpl.java
index bebc4ff..4596120 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NewIDImpl.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NewIDImpl.java
@@ -28,7 +28,7 @@ import org.opensaml.core.xml.XMLObject;
import org.opensaml.saml.saml2.core.NewID;
/**
- * Concrete implementation of {@link org.opensaml.saml.saml2.core.NewID}.
+ * Concrete implementation of {@link NewID}.
*/
public class NewIDImpl extends AbstractXMLObject implements NewID {
@@ -47,13 +47,13 @@ public class NewIDImpl extends AbstractXMLObject implements NewID {
}
/** {@inheritDoc} */
- public String getNewID() {
+ public String getValue() {
return newID;
}
/** {@inheritDoc} */
- public void setNewID(final String newNewID) {
- this.newID = prepareForAssignment(this.newID, newNewID);
+ public void setValue(final String value) {
+ newID = prepareForAssignment(newID, value);
}
/** {@inheritDoc} */
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NewIDMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NewIDMarshaller.java
index 9996ad6..bbfa8c5 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NewIDMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NewIDMarshaller.java
@@ -30,7 +30,7 @@ import org.opensaml.saml.saml2.core.NewID;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.NewID} objects.
+ * A thread safe Marshaller for {@link NewID} objects.
*/
public class NewIDMarshaller extends AbstractSAMLObjectMarshaller {
@@ -39,8 +39,8 @@ public class NewIDMarshaller extends AbstractSAMLObjectMarshaller {
throws MarshallingException {
final NewID newID = (NewID) samlObject;
- if (newID.getNewID() != null) {
- ElementSupport.appendTextContent(domElement, newID.getNewID());
+ if (newID.getValue() != null) {
+ ElementSupport.appendTextContent(domElement, newID.getValue());
}
}
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NewIDUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NewIDUnmarshaller.java
index beb61c3..bb8ac18 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NewIDUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NewIDUnmarshaller.java
@@ -26,7 +26,7 @@ import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
import org.opensaml.saml.saml2.core.NewID;
/**
- * A thread-safe Unmarshaller for {@link org.opensaml.saml.saml2.core.NewID} objects.
+ * A thread-safe Unmarshaller for {@link NewID} objects.
*/
public class NewIDUnmarshaller extends AbstractSAMLObjectUnmarshaller {
@@ -34,6 +34,6 @@ public class NewIDUnmarshaller extends AbstractSAMLObjectUnmarshaller {
protected void processElementContent(final XMLObject samlObject, final String elementContent) {
final NewID newID = (NewID) samlObject;
- newID.setNewID(elementContent);
+ newID.setValue(elementContent);
}
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequesterIDImpl.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequesterIDImpl.java
index db7ced7..071b9db 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequesterIDImpl.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequesterIDImpl.java
@@ -28,7 +28,7 @@ import org.opensaml.core.xml.XMLObject;
import org.opensaml.saml.saml2.core.RequesterID;
/**
- * Concrete implementation of {@link org.opensaml.saml.saml2.core.RequesterID}.
+ * Concrete implementation of {@link RequesterID}.
*/
public class RequesterIDImpl extends AbstractXMLObject implements RequesterID {
@@ -47,13 +47,13 @@ public class RequesterIDImpl extends AbstractXMLObject implements RequesterID {
}
/** {@inheritDoc} */
- public String getRequesterID() {
- return this.requesterID;
+ public String getValue() {
+ return requesterID;
}
/** {@inheritDoc} */
- public void setRequesterID(final String newRequesterID) {
- this.requesterID = prepareForAssignment(this.requesterID, newRequesterID);
+ public void setValue(final String value) {
+ requesterID = prepareForAssignment(requesterID, value);
}
/** {@inheritDoc} */
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequesterIDMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequesterIDMarshaller.java
index 70cbf9a..81d5152 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequesterIDMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequesterIDMarshaller.java
@@ -30,7 +30,7 @@ import org.opensaml.saml.saml2.core.RequesterID;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.RequesterID} objects.
+ * A thread safe Marshaller for {@link RequesterID} objects.
*/
public class RequesterIDMarshaller extends AbstractSAMLObjectMarshaller {
@@ -39,8 +39,8 @@ public class RequesterIDMarshaller extends AbstractSAMLObjectMarshaller {
throws MarshallingException {
final RequesterID reqID = (RequesterID) samlObject;
- if (reqID.getRequesterID() != null) {
- ElementSupport.appendTextContent(domElement, reqID.getRequesterID());
+ if (reqID.getValue() != null) {
+ ElementSupport.appendTextContent(domElement, reqID.getValue());
}
}
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequesterIDUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequesterIDUnmarshaller.java
index dd4b0fa..326c324 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequesterIDUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequesterIDUnmarshaller.java
@@ -26,7 +26,7 @@ import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
import org.opensaml.saml.saml2.core.RequesterID;
/**
- * A thread-safe Unmarshaller for {@link org.opensaml.saml.saml2.core.RequesterID} objects.
+ * A thread-safe Unmarshaller for {@link RequesterID} objects.
*/
public class RequesterIDUnmarshaller extends AbstractSAMLObjectUnmarshaller {
@@ -34,6 +34,6 @@ public class RequesterIDUnmarshaller extends AbstractSAMLObjectUnmarshaller {
protected void processElementContent(final XMLObject samlObject, final String elementContent) {
final RequesterID reqID = (RequesterID) samlObject;
- reqID.setRequesterID(elementContent);
+ reqID.setValue(elementContent);
}
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SessionIndexImpl.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SessionIndexImpl.java
index c7dfe26..2fae8cd 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SessionIndexImpl.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SessionIndexImpl.java
@@ -28,7 +28,7 @@ import org.opensaml.core.xml.XMLObject;
import org.opensaml.saml.saml2.core.SessionIndex;
/**
- * Concrete implementation of {@link org.opensaml.saml.saml2.core.SessionIndex}.
+ * Concrete implementation of {@link SessionIndex}.
*/
public class SessionIndexImpl extends AbstractXMLObject implements SessionIndex {
@@ -47,13 +47,13 @@ public class SessionIndexImpl extends AbstractXMLObject implements SessionIndex
}
/** {@inheritDoc} */
- public String getSessionIndex() {
- return this.sessionIndex;
+ public String getValue() {
+ return sessionIndex;
}
/** {@inheritDoc} */
- public void setSessionIndex(final String newSessionIndex) {
- this.sessionIndex = prepareForAssignment(this.sessionIndex, newSessionIndex);
+ public void setValue(final String value) {
+ sessionIndex = prepareForAssignment(sessionIndex, value);
}
/** {@inheritDoc} */
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SessionIndexMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SessionIndexMarshaller.java
index db33776..a6d8e60 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SessionIndexMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SessionIndexMarshaller.java
@@ -30,7 +30,7 @@ import org.opensaml.saml.saml2.core.SessionIndex;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.SessionIndex} objects.
+ * A thread safe Marshaller for {@link SessionIndex} objects.
*/
public class SessionIndexMarshaller extends AbstractSAMLObjectMarshaller {
@@ -39,8 +39,8 @@ public class SessionIndexMarshaller extends AbstractSAMLObjectMarshaller {
throws MarshallingException {
final SessionIndex si = (SessionIndex) samlObject;
- if (si.getSessionIndex() != null) {
- ElementSupport.appendTextContent(domElement, si.getSessionIndex());
+ if (si.getValue() != null) {
+ ElementSupport.appendTextContent(domElement, si.getValue());
}
}
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SessionIndexUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SessionIndexUnmarshaller.java
index 0a29015..fed99bb 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SessionIndexUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SessionIndexUnmarshaller.java
@@ -26,7 +26,7 @@ import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
import org.opensaml.saml.saml2.core.SessionIndex;
/**
- * A thread-safe Unmarshaller for {@link org.opensaml.saml.saml2.core.SessionIndex} objects.
+ * A thread-safe Unmarshaller for {@link SessionIndex} objects.
*/
public class SessionIndexUnmarshaller extends AbstractSAMLObjectUnmarshaller {
@@ -34,6 +34,6 @@ public class SessionIndexUnmarshaller extends AbstractSAMLObjectUnmarshaller {
protected void processElementContent(final XMLObject samlObject, final String elementContent) {
final SessionIndex si = (SessionIndex) samlObject;
- si.setSessionIndex(elementContent);
+ si.setValue(elementContent);
}
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/ResolveArtifact.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/ResolveArtifact.java
index 06a030a..a2681fc 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/ResolveArtifact.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/ResolveArtifact.java
@@ -173,7 +173,7 @@ public class ResolveArtifact extends AbstractProfileAction {
log.debug("{} No request located", getLogPrefix());
ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_MSG_CTX);
return false;
- } else if (request.getArtifact() == null || request.getArtifact().getArtifact() == null) {
+ } else if (request.getArtifact() == null || request.getArtifact().getValue() == null) {
log.debug("{} No Artifact element found in request, nothing to do", getLogPrefix());
ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_MSG_CTX);
return false;
@@ -207,7 +207,7 @@ public class ResolveArtifact extends AbstractProfileAction {
@Override
protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
- final String artifact = request.getArtifact().getArtifact();
+ final String artifact = request.getArtifact().getValue();
SAMLArtifactMapEntry entry = null;
diff --git a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/ActionTest.java b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/ActionTest.java
index b9334a9..7350ae7 100644
--- a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/ActionTest.java
+++ b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/ActionTest.java
@@ -54,7 +54,7 @@ public class ActionTest extends XMLObjectProviderBaseTestCase {
public void testSingleElementUnmarshall() {
Action action = (Action) unmarshallElement(singleElementFile);
- String actionname = action.getAction();
+ String actionname = action.getValue();
Assert.assertEquals(actionname, expectedAction, "Action was " + actionname + ", expected " + expectedAction);
}
@@ -63,7 +63,7 @@ public class ActionTest extends XMLObjectProviderBaseTestCase {
public void testSingleElementOptionalAttributesUnmarshall() {
Action action = (Action) unmarshallElement(singleElementOptionalAttributesFile);
- String actionname = action.getAction();
+ String actionname = action.getValue();
Assert.assertEquals(actionname, expectedAction, "Action was " + actionname + ", expected " + expectedAction);
String namespace = action.getNamespace();
@@ -76,7 +76,7 @@ public class ActionTest extends XMLObjectProviderBaseTestCase {
QName qname = new QName(SAMLConstants.SAML20_NS, Action.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20_PREFIX);
Action action = (Action) buildXMLObject(qname);
- action.setAction(expectedAction);
+ action.setValue(expectedAction);
assertXMLEquals(expectedDOM, action);
}
@@ -86,7 +86,7 @@ public class ActionTest extends XMLObjectProviderBaseTestCase {
QName qname = new QName(SAMLConstants.SAML20_NS, Action.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20_PREFIX);
Action action = (Action) buildXMLObject(qname);
- action.setAction(expectedAction);
+ action.setValue(expectedAction);
action.setNamespace(expectedNamespace);
assertXMLEquals(expectedOptionalAttributesDOM, action);
}
diff --git a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/ArtifactTest.java b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/ArtifactTest.java
index 9964df9..91c7223 100644
--- a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/ArtifactTest.java
+++ b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/ArtifactTest.java
@@ -52,7 +52,7 @@ public class ArtifactTest extends XMLObjectProviderBaseTestCase {
public void testSingleElementUnmarshall() {
Artifact artifact = (Artifact) unmarshallElement(singleElementFile);
- Assert.assertEquals(artifact.getArtifact(), expectedContent, "Artifact content is not the expected value");
+ Assert.assertEquals(artifact.getValue(), expectedContent, "Artifact content is not the expected value");
}
/** {@inheritDoc} */
@@ -60,7 +60,7 @@ public class ArtifactTest extends XMLObjectProviderBaseTestCase {
public void testSingleElementMarshall() {
Artifact artifact = (Artifact) buildXMLObject(Artifact.DEFAULT_ELEMENT_NAME);
- artifact.setArtifact(expectedContent);
+ artifact.setValue(expectedContent);
assertXMLEquals(expectedDOM, artifact);
}
diff --git a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementTest.java b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementTest.java
index b6fbe12..2486040 100644
--- a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementTest.java
+++ b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementTest.java
@@ -20,6 +20,7 @@ package org.opensaml.saml.saml2.core.impl;
import javax.xml.namespace.QName;
import org.opensaml.core.xml.XMLObjectProviderBaseTestCase;
+import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.saml.common.xml.SAMLConstants;
import org.opensaml.saml.saml2.core.Action;
import org.opensaml.saml.saml2.core.AuthzDecisionStatement;
@@ -29,6 +30,8 @@ import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+import net.shibboleth.utilities.java.support.xml.XMLParserException;
+
/**
* Test case for creating, marshalling, and unmarshalling
* {@link org.opensaml.saml.saml2.core.impl.AuthzDecisionStatementImpl}.
@@ -49,6 +52,7 @@ public class AuthzDecisionStatementTest extends XMLObjectProviderBaseTestCase {
singleElementFile = "/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatement.xml";
singleElementOptionalAttributesFile = "/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementOptionalAttributes.xml";
childElementsFile = "/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementChildElements.xml";
+ invalidFile = "/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementInvalidDecision.xml";
}
@BeforeMethod
@@ -56,7 +60,12 @@ public class AuthzDecisionStatementTest extends XMLObjectProviderBaseTestCase {
expectedResource = "resource name";
expectedDecision = DecisionTypeEnumeration.DENY;
}
-
+
+ @Test(expectedExceptions=UnmarshallingException.class)
+ public void testInvalidUnmarshall() throws XMLParserException, UnmarshallingException {
+ unmarshallElement(invalidFile, true);
+ }
+
/** {@inheritDoc} */
@Test
public void testSingleElementUnmarshall() {
diff --git a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/GetCompleteTest.java b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/GetCompleteTest.java
index ca0cc5b..564401c 100644
--- a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/GetCompleteTest.java
+++ b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/GetCompleteTest.java
@@ -54,7 +54,7 @@ public class GetCompleteTest extends XMLObjectProviderBaseTestCase {
public void testSingleElementUnmarshall() {
GetComplete gc = (GetComplete) unmarshallElement(singleElementFile);
- Assert.assertEquals(gc.getGetComplete(), expectedGetComplete, "Unmarshalled GetComplete URI was not the expected value");
+ Assert.assertEquals(gc.getURI(), expectedGetComplete, "Unmarshalled GetComplete URI was not the expected value");
}
@@ -63,7 +63,7 @@ public class GetCompleteTest extends XMLObjectProviderBaseTestCase {
public void testSingleElementMarshall() {
GetComplete gc = (GetComplete) buildXMLObject(GetComplete.DEFAULT_ELEMENT_NAME);
- gc.setGetComplete(expectedGetComplete);
+ gc.setURI(expectedGetComplete);
assertXMLEquals(expectedDOM, gc);
}
diff --git a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/NewIDTest.java b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/NewIDTest.java
index 3c68dd2..f7debe3 100644
--- a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/NewIDTest.java
+++ b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/NewIDTest.java
@@ -53,7 +53,7 @@ public class NewIDTest extends XMLObjectProviderBaseTestCase {
public void testSingleElementUnmarshall() {
NewID newID = (NewID) unmarshallElement(singleElementFile);
- Assert.assertEquals(newID.getNewID(), expectedNewID, "The unmarshalled NewID was not the expected value");
+ Assert.assertEquals(newID.getValue(), expectedNewID, "The unmarshalled NewID was not the expected value");
}
/** {@inheritDoc} */
@@ -61,7 +61,7 @@ public class NewIDTest extends XMLObjectProviderBaseTestCase {
public void testSingleElementMarshall() {
NewID newID = (NewID) buildXMLObject(NewID.DEFAULT_ELEMENT_NAME);
- newID.setNewID(expectedNewID);
+ newID.setValue(expectedNewID);
assertXMLEquals(expectedDOM, newID);
}
diff --git a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/RequesterIDTest.java b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/RequesterIDTest.java
index dbdad22..7c89a3d 100644
--- a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/RequesterIDTest.java
+++ b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/RequesterIDTest.java
@@ -54,7 +54,7 @@ public class RequesterIDTest extends XMLObjectProviderBaseTestCase {
public void testSingleElementUnmarshall() {
RequesterID reqID = (RequesterID) unmarshallElement(singleElementFile);
- Assert.assertEquals(reqID.getRequesterID(), expectedRequesterID, "Unmarshalled requester ID was not the expected value");
+ Assert.assertEquals(reqID.getValue(), expectedRequesterID, "Unmarshalled requester ID was not the expected value");
}
/** {@inheritDoc} */
@@ -62,7 +62,7 @@ public class RequesterIDTest extends XMLObjectProviderBaseTestCase {
public void testSingleElementMarshall() {
RequesterID reqID = (RequesterID) buildXMLObject(RequesterID.DEFAULT_ELEMENT_NAME);
- reqID.setRequesterID(expectedRequesterID);
+ reqID.setValue(expectedRequesterID);
assertXMLEquals(expectedDOM, reqID);
}
diff --git a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/SessionIndexTest.java b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/SessionIndexTest.java
index cb63a6e..7ce81cb 100644
--- a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/SessionIndexTest.java
+++ b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/core/impl/SessionIndexTest.java
@@ -55,7 +55,7 @@ public class SessionIndexTest extends XMLObjectProviderBaseTestCase {
public void testSingleElementUnmarshall() {
SessionIndex si = (SessionIndex) unmarshallElement(singleElementFile);
- Assert.assertEquals(si.getSessionIndex(), expectedSessionIndex, "The unmarshalled session index as not the expected value");
+ Assert.assertEquals(si.getValue(), expectedSessionIndex, "The unmarshalled session index as not the expected value");
}
/** {@inheritDoc} */
@@ -63,7 +63,7 @@ public class SessionIndexTest extends XMLObjectProviderBaseTestCase {
public void testSingleElementMarshall() {
SessionIndex si = (SessionIndex) buildXMLObject(SessionIndex.DEFAULT_ELEMENT_NAME);
- si.setSessionIndex(expectedSessionIndex);
+ si.setValue(expectedSessionIndex);
assertXMLEquals(expectedDOM, si);
}
diff --git a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementInvalidDecision.xml b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementInvalidDecision.xml
new file mode 100644
index 0000000..cef5348
--- /dev/null
+++ b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementInvalidDecision.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<saml2:AuthzDecisionStatement xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" Resource="resource name" Decision="Bogus"/>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list