Skip to content

Commit 12683e6

Browse files
committed
Make LogoutRequest and LogoutResponse more extensible
This increases the visibility of LogoutResponse.query() to protected and adds setValidationException to both LogoutResponse and LogoutRequest to ease the development of extension classes that need to customize the validation process.
1 parent 523786b commit 12683e6

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

core/src/main/java/com/onelogin/saml2/logout/LogoutRequest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,16 @@ public Exception getValidationException() {
758758
return validationException;
759759
}
760760

761+
/**
762+
* Sets the validation exception that this {@link LogoutRequest} should return
763+
* when a validation error occurs.
764+
*
765+
* @param validationException
766+
* the validation exception to set
767+
*/
768+
protected void setValidationException(Exception validationException) {
769+
this.validationException = validationException;
770+
}
761771

762772
/**
763773
* @return the ID of the Logout Request

core/src/main/java/com/onelogin/saml2/logout/LogoutResponse.java

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,15 @@ public SamlResponseStatus getSamlResponseStatus() throws ValidationError
338338
}
339339

340340
/**
341-
* Extracts nodes that match the query from the DOMDocument (Logout Response Menssage)
342-
*
343-
* @param query
344-
* Xpath Expression
345-
*
346-
* @return DOMNodeList The queried nodes
347-
*/
348-
private NodeList query (String query) throws XPathExpressionException {
341+
* Extracts nodes that match the query from the DOMDocument (Logout Response Menssage)
342+
*
343+
* @param query
344+
* Xpath Expression
345+
*
346+
* @return DOMNodeList The queried nodes
347+
* @throws XPathExpressionException
348+
*/
349+
protected NodeList query (String query) throws XPathExpressionException {
349350
return Util.query(this.logoutResponseDocument, query, null);
350351
}
351352

@@ -475,4 +476,15 @@ public String getError() {
475476
public Exception getValidationException() {
476477
return validationException;
477478
}
479+
480+
/**
481+
* Sets the validation exception that this {@link LogoutResponse} should return
482+
* when a validation error occurs.
483+
*
484+
* @param validationException
485+
* the validation exception to set
486+
*/
487+
protected void setValidationException(Exception validationException) {
488+
this.validationException = validationException;
489+
}
478490
}

0 commit comments

Comments
 (0)