write the descriptor class to a DOM tree and return it
if (! (descriptor instanceof OutboundResourceAdapter) &&
! (descriptor instanceof ConnectorDescriptor)) {
throw new IllegalArgumentException(getClass() + " cannot handle descriptors of type " + descriptor.getClass());
}
Iterator authMechs = null;
if (descriptor instanceof ConnectorDescriptor) {
authMechs = ((ConnectorDescriptor)descriptor).getAuthMechanisms().iterator();
} else if (descriptor instanceof OutboundResourceAdapter) {
authMechs = ((OutboundResourceAdapter)descriptor).getAuthMechanisms().iterator();
}
//auth mechanism info
for (;authMechs.hasNext();) {
AuthMechanism auth = (AuthMechanism) authMechs.next();
Node authNode = appendChild(parent, ConnectorTagNames.AUTH_MECHANISM);
appendTextChild(authNode, TagNames.DESCRIPTION, auth.getDescription());
appendTextChild(authNode, ConnectorTagNames.AUTH_MECH_TYPE, auth.getAuthMechType());
appendTextChild(authNode, ConnectorTagNames.CREDENTIAL_INTF, auth.getCredentialInterface());
}
return parent;