Methods Summary |
---|
public boolean | authRequired()
return this.isSourceAuthRequired() || this.isRecipientAuthRequired();
|
public boolean | equals(java.lang.Object o)
if (this == o) {
return true;
}
if (!(o instanceof AuthPolicy)) {
return false;
}
AuthPolicy that = (AuthPolicy)o;
if (this.authenticateSource == that.authenticateSource &&
this.authenticateRecipient == that.authenticateRecipient &&
this.recipientBeforeContent == that.recipientBeforeContent) {
return true;
}
return false;
|
public int | getSourceAuth()
return this.authenticateSource;
|
public int | hashCode()
return authenticateSource +
(authenticateRecipient ? 5 : 0) +
(recipientBeforeContent ? 10 : 0);
|
public boolean | isContentAuthRequired()
return ( this.isSourceAuthRequired() ?
( this.getSourceAuth() == SOURCE_AUTH_CONTENT ?
true : false ) : false );
|
public boolean | isRecipientAuthBeforeContent()
return this.recipientBeforeContent;
|
public boolean | isRecipientAuthBeforeContent(boolean orderForValidation)
return (orderForValidation ?
!this.recipientBeforeContent : this.recipientBeforeContent);
|
public boolean | isRecipientAuthRequired()
return this.authenticateRecipient;
|
public boolean | isSenderAuthRequired()
return ( this.isSourceAuthRequired() ?
( this.getSourceAuth() == SOURCE_AUTH_SENDER ?
true : false ) : false );
|
public boolean | isSourceAuthRequired()
return this.authenticateSource == 0 ? false : true;
|
private void | setAuthenticationType(int sourceAuthType)
switch (sourceAuthType) {
case SOURCE_AUTH_NONE:
case SOURCE_AUTH_SENDER:
case SOURCE_AUTH_CONTENT:
this.authenticateSource = sourceAuthType;
break;
default:
break;
}
|
public void | setContentAuth(boolean required)
if (required) {
this.setSourceAuth(SOURCE_AUTH_CONTENT);
}
else if (!isSenderAuthRequired()) {
this.setSourceAuth(SOURCE_AUTH_NONE);
}
|
public void | setRecipientAuth(boolean required, boolean beforeContent)
this.authenticateRecipient = required;
this.recipientBeforeContent = beforeContent;
|
public void | setSenderAuth(boolean required)
if (required) {
this.setSourceAuth(SOURCE_AUTH_SENDER);
}
else if (!isContentAuthRequired()) {
this.setSourceAuth(SOURCE_AUTH_NONE);
}
|
public void | setSourceAuth(int sourceAuthenticationType)
setAuthenticationType(sourceAuthenticationType);
|
public java.lang.String | toString()
// wait for 1.5
// StringBuilder sb = new StringBuilder();
StringBuffer sb = new StringBuffer();
switch (authenticateSource) {
case SOURCE_AUTH_NONE:
sb.append("source-auth-type = SOURCE_AUTH_NONE");
break;
case SOURCE_AUTH_SENDER:
sb.append("source-auth-type = SOURCE_AUTH_SENDER");
break;
case SOURCE_AUTH_CONTENT:
sb.append("source-auth-type = SOURCE_AUTH_CONTENT");
break;
}
if (authenticateRecipient) {
sb.append("\n\tauthenticate-recipient=true" +
"\n\tbeforeContent=" + recipientBeforeContent);
} else {
sb.append("\n\tauthenticate-recipient=false");
}
return sb.toString();
|