Search in sources :

Example 16 with OutboundResourceAdapter

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;
}
Also used : ConnectorDescriptor(com.sun.enterprise.deployment.ConnectorDescriptor) AuthMechanism(com.sun.enterprise.deployment.AuthMechanism) Node(org.w3c.dom.Node) DeploymentDescriptorNode(com.sun.enterprise.deployment.node.DeploymentDescriptorNode) Iterator(java.util.Iterator) OutboundResourceAdapter(com.sun.enterprise.deployment.OutboundResourceAdapter)

Aggregations

OutboundResourceAdapter (com.sun.enterprise.deployment.OutboundResourceAdapter)16 ConnectionDefDescriptor (com.sun.enterprise.deployment.ConnectionDefDescriptor)11 Set (java.util.Set)10 Iterator (java.util.Iterator)9 AuthMechanism (com.sun.enterprise.deployment.AuthMechanism)5 ConnectorDescriptor (com.sun.enterprise.deployment.ConnectorDescriptor)5 Result (com.sun.enterprise.tools.verifier.Result)5 RarBundleContext (com.sun.enterprise.deployment.annotation.context.RarBundleContext)3 AuthenticationMechanism (javax.resource.spi.AuthenticationMechanism)3 BasicPasswordAuthenticationService (com.sun.enterprise.connectors.authentication.BasicPasswordAuthenticationService)1 EnvironmentProperty (com.sun.enterprise.deployment.EnvironmentProperty)1 LicenseDescriptor (com.sun.enterprise.deployment.LicenseDescriptor)1 DeploymentDescriptorNode (com.sun.enterprise.deployment.node.DeploymentDescriptorNode)1 ClassLoader (java.lang.ClassLoader)1 Method (java.lang.reflect.Method)1 SecurityPermission (javax.resource.spi.SecurityPermission)1 WorkContext (javax.resource.spi.work.WorkContext)1 Node (org.w3c.dom.Node)1