Example usage for com.rabbitmq.client.impl PlainMechanism PlainMechanism

List of usage examples for com.rabbitmq.client.impl PlainMechanism PlainMechanism

Introduction

In this page you can find the example usage for com.rabbitmq.client.impl PlainMechanism PlainMechanism.

Prototype

PlainMechanism

Source Link

Usage

From source file:org.geoserver.notification.common.CustomSaslConfig.java

License:Open Source License

@Override
public SaslMechanism getSaslMechanism(String[] serverMechanisms) {
    Set<String> server = new HashSet<String>(Arrays.asList(serverMechanisms));
    for (String m : mechanisms) {
        if (server.contains(m)) {
            if (m.equals("PLAIN")) {
                return new PlainMechanism();
            } else if (m.equals("EXTERNAL")) {
                return new ExternalMechanism();
            } else if (m.equals("ANONYMOUS")) {
                return new AnonymousMechanism();
            }/*from ww w  .  ja  va  2 s .  co m*/
        }
    }

    return null;
}