| Method from org.apache.commons.httpclient.auth.AuthState Detail: |
public AuthScheme getAuthScheme() {
return authScheme;
}
|
public String getRealm() {
if (this.authScheme != null) {
return this.authScheme.getRealm();
} else {
return null;
}
}
Returns the authentication realm. |
public void invalidate() {
this.authScheme = null;
this.authRequested = false;
this.authAttempted = false;
this.preemptive = false;
}
Invalidates the authentication state by resetting its parameters. |
public boolean isAuthAttempted() {
return this.authAttempted;
}
Tests whether authenication challenge has been responsed to |
public boolean isAuthRequested() {
return this.authRequested;
}
Tests whether authenication challenge has been received |
public boolean isPreemptive() {
return this.preemptive;
}
Tests if preemptive authentication is used. |
public void setAuthAttempted(boolean challengeResponded) {
this.authAttempted = challengeResponded;
}
Sets authentication attempt status |
public void setAuthRequested(boolean challengeReceived) {
this.authRequested = challengeReceived;
}
Sets authentication request status |
public void setAuthScheme(AuthScheme authScheme) {
if (authScheme == null) {
invalidate();
return;
}
if (this.preemptive && !(this.authScheme.getClass().isInstance(authScheme))) {
this.preemptive = false;
this.authAttempted = false;
}
this.authScheme = authScheme;
}
|
public void setPreemptive() {
if (!this.preemptive) {
if (this.authScheme != null) {
throw new IllegalStateException("Authentication state already initialized");
}
this.authScheme = AuthPolicy.getAuthScheme(PREEMPTIVE_AUTH_SCHEME);
this.preemptive = true;
}
}
Preemptively assigns Basic authentication scheme. |
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append("Auth state: auth requested [");
buffer.append(this.authRequested);
buffer.append("]; auth attempted [");
buffer.append(this.authAttempted);
if (this.authScheme != null) {
buffer.append("]; auth scheme [");
buffer.append(this.authScheme.getSchemeName());
buffer.append("]; realm [");
buffer.append(this.authScheme.getRealm());
}
buffer.append("] preemptive [");
buffer.append(this.preemptive);
buffer.append("]");
return buffer.toString();
}
|