Package org.eclipse.net4j.connector

## Class ConnectorCredentialsInjector

- java.lang.Object
- - org.eclipse.net4j.util.security.ResponseNegotiatorInjector
  - - org.eclipse.net4j.connector.ConnectorCredentialsInjector

- All Implemented Interfaces:
    `org.eclipse.net4j.util.container.IElementProcessor`

      public class ConnectorCredentialsInjector
      extends org.eclipse.net4j.util.security.ResponseNegotiatorInjector

  Injects a configurable response negotiator into selected client connectors.

  An example:

       IManagedContainer container = IPluginContainer.INSTANCE;

       String connectorDescription = "localhost:2036";
       String userID = "name";
       String password = "secret";

       IPasswordCredentialsProvider credentialsProvider = new PasswordCredentialsProvider(userID, password);

       container.addPostProcessor(new ConnectorCredentialsInjector(connectorDescription, credentialsProvider));
       IConnector connector = (IConnector)container.getElement("org.eclipse.net4j.connectors", "tcp", connectorDescription);

       IChannel channel = connector.openChannel();
       // ...

  Since:
    2.0
  Author:
    Eike Stepper

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ConnectorCredentialsInjector​(java.lang.String connectorDescription, org.eclipse.net4j.util.security.IPasswordCredentialsProvider credentialsProvider)` |
    `ConnectorCredentialsInjector​(java.lang.String connectorDescription, org.eclipse.net4j.util.security.IPasswordCredentialsProvider credentialsProvider, java.lang.String algorithmName)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected boolean` | `filterConnectorDescription​(java.lang.String description)` |
    `protected boolean` | `filterElement​(java.lang.String productGroup, java.lang.String factoryType, java.lang.String description, org.eclipse.net4j.util.security.INegotiatorAware negotiatorAware)` |

    - ### Methods inherited from class org.eclipse.net4j.util.security.ResponseNegotiatorInjector

      `getNegotiator, process`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ConnectorCredentialsInjector

          public ConnectorCredentialsInjector​(java.lang.String connectorDescription,
                                              org.eclipse.net4j.util.security.IPasswordCredentialsProvider credentialsProvider,
                                              java.lang.String algorithmName)

      Parameters:
        `connectorDescription` - The description of the IConnector that the negotiator shall be injected into, or `null` to bypass the description check.

    - #### ConnectorCredentialsInjector

          public ConnectorCredentialsInjector​(java.lang.String connectorDescription,
                                              org.eclipse.net4j.util.security.IPasswordCredentialsProvider credentialsProvider)

      Parameters:
        `connectorDescription` - The description of the IConnector that the negotiator shall be injected into, or `null` to bypass the description check.

  - ### Method Detail

    - #### filterElement

          protected boolean filterElement​(java.lang.String productGroup,
                                          java.lang.String factoryType,
                                          java.lang.String description,
                                          org.eclipse.net4j.util.security.INegotiatorAware negotiatorAware)

      Specified by:
        `filterElement` in class `org.eclipse.net4j.util.security.ResponseNegotiatorInjector`

    - #### filterConnectorDescription

          protected boolean filterConnectorDescription​(java.lang.String description)