|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.cas.client.validation.AbstractUrlBasedTicketValidator
public abstract class AbstractUrlBasedTicketValidator
Abstract validator implementation for tickets that must be validated against a server.
| Field Summary | |
|---|---|
protected HostnameVerifier |
hostnameVerifier
Hostname verifier used when making an SSL request to the CAS server. |
protected org.apache.commons.logging.Log |
log
Commons Logging instance. |
| Constructor Summary | |
|---|---|
protected |
AbstractUrlBasedTicketValidator(String casServerUrlPrefix)
Constructs a new TicketValidator with the casServerUrlPrefix. |
| Method Summary | |
|---|---|
protected String |
constructValidationUrl(String ticket,
String serviceUrl)
Constructs the URL to send the validation request to. |
protected String |
encodeUrl(String url)
Encodes a URL using the URLEncoder format. |
protected String |
getEncoding()
|
protected abstract String |
getUrlSuffix()
The endpoint of the validation URL. |
protected abstract Assertion |
parseResponseFromServer(String response)
Parses the response from the server into a CAS Assertion. |
protected void |
populateUrlAttributeMap(Map<String,String> urlParameters)
Template method for ticket validators that need to provide additional parameters to the validation url. |
protected abstract String |
retrieveResponseFromServer(URL validationUrl,
String ticket)
Contacts the CAS Server to retrieve the response for the ticket validation. |
void |
setCustomParameters(Map<String,String> customParameters)
|
protected abstract void |
setDisableXmlSchemaValidation(boolean disabled)
Disable XML Schema validation. |
void |
setEncoding(String encoding)
|
void |
setHostnameVerifier(HostnameVerifier verifier)
|
void |
setRenew(boolean renew)
|
Assertion |
validate(String ticket,
String service)
Attempts to validate a ticket for the provided service. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log log
protected HostnameVerifier hostnameVerifier
| Constructor Detail |
|---|
protected AbstractUrlBasedTicketValidator(String casServerUrlPrefix)
casServerUrlPrefix - the location of the CAS server.| Method Detail |
|---|
protected void populateUrlAttributeMap(Map<String,String> urlParameters)
urlParameters - the map containing the parameters.protected abstract String getUrlSuffix()
protected abstract void setDisableXmlSchemaValidation(boolean disabled)
disabled - whether to disable or not.
protected final String constructValidationUrl(String ticket,
String serviceUrl)
ticket - the ticket to be validated.serviceUrl - the service identifier.
protected final String encodeUrl(String url)
url - the url to encode.
protected abstract Assertion parseResponseFromServer(String response)
throws TicketValidationException
response - the response from the server, in any format.
TicketValidationException - if an Assertion could not be created.
protected abstract String retrieveResponseFromServer(URL validationUrl,
String ticket)
validationUrl - the url to send the validation request to.ticket - the ticket to validate.
public Assertion validate(String ticket,
String service)
throws TicketValidationException
TicketValidator
validate in interface TicketValidatorticket - the ticket to attempt to validate.service - the service this ticket is valid for.
TicketValidationException - if the ticket cannot be validated.public final void setRenew(boolean renew)
public final void setCustomParameters(Map<String,String> customParameters)
public final void setHostnameVerifier(HostnameVerifier verifier)
public final void setEncoding(String encoding)
protected final String getEncoding()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||