use of com.sun.enterprise.deployment.OutboundResourceAdapter in project Payara by payara.
the class AuthMechNode method writeDescriptor.
/**
* write the descriptor class to a DOM tree and return it
*
* @param parent node for the DOM tree
* @param the descriptor to write
* @return the DOM tree top node
*/
public Node writeDescriptor(Node parent, Descriptor descriptor) {
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
if (authMechs != null) {
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;
}
Aggregations