Class: AMQ::Client::Async::AuthMechanismAdapter

### Home Classes Methods

### In Files

- lib/amq/client/async/auth_mechanism_adapter.rb

### Parent

Object

### Namespace

- CLASS AMQ::Client::Async::AuthMechanismAdapter::External
- CLASS AMQ::Client::Async::AuthMechanismAdapter::Plain

### Methods

- ::auth_mechanism
- ::for_adapter
- ::new

### Class/Module Index

Quicksearch

- AMQ
- AMQ::Client
- AMQ::Client::Async
- AMQ::Client::Async::Adapter
- AMQ::Client::Async::Adapter::ClassMethods
- AMQ::Client::Async::AuthMechanismAdapter
- AMQ::Client::Async::AuthMechanismAdapter::External
- AMQ::Client::Async::AuthMechanismAdapter::Plain
- AMQ::Client::Async::Callbacks
- AMQ::Client::Async::Channel
- AMQ::Client::Async::Consumer
- AMQ::Client::Async::CoolioClient
- AMQ::Client::Async::CoolioClient::Socket
- AMQ::Client::Async::Entity
- AMQ::Client::Async::EventMachineClient
- AMQ::Client::Async::Exchange
- AMQ::Client::Async::Extensions
- AMQ::Client::Async::Extensions::RabbitMQ
- AMQ::Client::Async::Extensions::RabbitMQ::Basic
- AMQ::Client::Async::Extensions::RabbitMQ::Basic::ChannelMixin
- AMQ::Client::Async::Extensions::RabbitMQ::Basic::ConsumerMixin
- AMQ::Client::Async::Extensions::RabbitMQ::Basic::QueueMixin
- AMQ::Client::Async::Extensions::RabbitMQ::Confirm
- AMQ::Client::Async::Extensions::RabbitMQ::Confirm::ChannelMixin
- AMQ::Client::Async::ProtocolMethodHandlers
- AMQ::Client::Async::Queue
- AMQ::Client::Async::RegisterEntityMixin
- AMQ::Client::BadLengthError
- AMQ::Client::ConnectionClosedError
- AMQ::Client::ConsumerTagGenerator
- AMQ::Client::Framing
- AMQ::Client::Framing::IO
- AMQ::Client::Framing::IO::Frame
- AMQ::Client::Framing::String
- AMQ::Client::Framing::String::Frame
- AMQ::Client::HandlersRegistry
- AMQ::Client::InconsistentDataError
- AMQ::Client::Logging
- AMQ::Client::Logging::IncompatibleLoggerError
- AMQ::Client::MissingHandlerError
- AMQ::Client::NoFinalOctetError
- AMQ::Client::Openable
- AMQ::Client::Openable::ImproperStatusError
- AMQ::Client::PossibleAuthenticationFailureError
- AMQ::Client::ServerNamedEntity
- AMQ::Client::Settings
- AMQ::Client::TCPConnectionFailed
- AMQ::Client::UnknownExchangeTypeError
- AMQ::Protocol
- AMQ::Protocol::GetResponse

No matching classes.

# AMQ::Client::Async::AuthMechanismAdapter

Provides a flexible method for encoding AMQP credentials. PLAIN and EXTERNAL are provided by this gem. In order to implement a new authentication mechanism, create a subclass like so:

    class MyAuthMechanism < AMQ::Client::Async::AuthMechanismAdapter
      auth_mechanism "X-MYAUTH"

      def encode_credentials(username, password)
        # ...
      end
    end

### Attributes

adapter[R]

The Adapter that this AuthMechanismAdapter operates on behalf of.

### Public Class Methods

for_adapter(adapter) click to toggle source

Find and instantiate an AuthMechanismAdapter.

@param [Adapter] adapter The Adapter for which to encode credentials. @return [AuthMechanismAdapter] An AuthMechanismAdapter that can encode

    credentials for the Adapter.

@raise [NotImplementedError] The Adapter's mechanism does not

    correspond to any known AuthMechanismAdapter.

    # File lib/amq/client/async/auth_mechanism_adapter.rb, line 23
    def self.for_adapter(adapter)
      registry[adapter.mechanism].new adapter
    end

new(adapter) click to toggle source

Create a new AuthMechanismAdapter. Users of this class should instead retrieve an instance through for_adapter.

    # File lib/amq/client/async/auth_mechanism_adapter.rb, line 57
    def initialize(adapter)
      @adapter = adapter
    end

### Protected Class Methods

auth_mechanism(*mechanisms) click to toggle source

Used by subclasses to declare the mechanisms that an AuthMechanismAdapter understands.

@param [Array<String>] mechanisms One or more mechanisms that can be

    handled by the subclass.

    # File lib/amq/client/async/auth_mechanism_adapter.rb, line 34
    def self.auth_mechanism(*mechanisms)
      mechanisms.each {|mechanism| registry[mechanism] = self}
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.