All Credential interface declared in the DD should be one of the
allowed interface
boolean oneFailed = false;
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
if(!descriptor.getOutBoundDefined())
{
result.addNaDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.notApplicable(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.connector.managed.notApplicableForInboundRA",
"Resource Adapter does not provide outbound communication"));
return result;
}
Set mechanisms =
descriptor.getOutboundResourceAdapter().getAuthMechanisms();
if (mechanisms.isEmpty()) {
// passed
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.passed(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.connector.AuthMechType.nonexist",
"No authentication mechanism defined for this resource adapater"));
return result;
}
Iterator mechIterator = mechanisms.iterator();
while (mechIterator.hasNext()) {
AuthMechanism am = (AuthMechanism) mechIterator.next();
String credInterface = am.getCredentialInterface();
boolean allowedInterface = false;
if (credInterface!=null) {
for (int i=0;i<allowedInterfaces.length;i++) {
if (credInterface.equals(allowedInterfaces[i])) {
allowedInterface = true;
break;
}
}
}
if (!allowedInterface || credInterface == null) {
// failed
oneFailed = true;
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.failed(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.connector.CredentialInterface.failed",
"Authentication mechanism credential interface [ {0} ] defined in the credential-interface tag is not allowed",
new Object[] {credInterface}));
}
}
if (!oneFailed) {
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.passed(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.connector.CredentialInterface.passed",
"All defined authorization mechanism credential interfaces are allowed"));
}
return result;