org.eclipse.net4j.util.security

## Class Negotiator<STATE extends java.lang.Enum<?>,EVENT extends java.lang.Enum<?>>

- java.lang.Object
- - org.eclipse.net4j.util.event.Notifier
  - - org.eclipse.net4j.util.lifecycle.Lifecycle
    - - org.eclipse.net4j.util.fsm.FiniteStateMachine<STATE,EVENT,INegotiationContext>
      - - org.eclipse.net4j.util.security.Negotiator<STATE,EVENT>

- All Implemented Interfaces:
    INotifier, IDeactivateable, ILifecycle, ILifecycle.DeferrableActivation, INegotiationContext.Receiver, INegotiator
  Direct Known Subclasses:
    ChallengeResponseNegotiator

      public abstract class Negotiator<STATE extends java.lang.Enum<?>,EVENT extends java.lang.Enum<?>>
      extends FiniteStateMachine<STATE,EVENT,INegotiationContext>
      implements INegotiator, INegotiationContext.Receiver

  Author:
    Eike Stepper

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.eclipse.net4j.util.fsm.FiniteStateMachine

      `FiniteStateMachine.ChangeStateTransition, FiniteStateMachine.FailTransition, FiniteStateMachine.IgnoreTransition, FiniteStateMachine.StateChangedEvent`

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle

      `ILifecycle.DeferrableActivation`

  - ### Field Summary

    - ### Fields inherited from class org.eclipse.net4j.util.fsm.FiniteStateMachine

      `FAIL, IGNORE`

    - ### Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle

      `USE_LABEL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Negotiator(java.lang.Class<STATE> stateEnum, java.lang.Class<EVENT> eventEnum, STATE initialState, STATE successState, STATE failureState, EVENT startEvent, EVENT bufferEvent, boolean initiator)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `EVENT` | `getBufferEvent()`
    `STATE` | `getFailureState()`
    `STATE` | `getInitialState()`
    `EVENT` | `getStartEvent()`
    `STATE` | `getSuccessState()`
    `protected void` | `handleFailure(INegotiationContext context)`
    `protected void` | `handleSuccess(INegotiationContext context)`
    `boolean` | `isInitiator()`
    `void` | `negotiate(INegotiationContext context)`
    `protected void` | `postProcess(INegotiationContext context)`
    `void` | `receiveBuffer(INegotiationContext context, java.nio.ByteBuffer buffer)`

    - ### Methods inherited from class org.eclipse.net4j.util.fsm.FiniteStateMachine

      `changeState, createFailTransition, createIgnoreTransition, formatFailMessage, formatIgnoreMessage, formatProcessMessage, getEvents, getState, getStates, getTransition, init, init, initAll, initAll, initEvents, initEvents, initStates, initStates, process, setState`

    - ### Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle

      `activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, doDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString`

    - ### Methods inherited from class org.eclipse.net4j.util.event.Notifier

      `addListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener`

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

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

    - ### Methods inherited from interface org.eclipse.net4j.util.event.INotifier

      `addListener, getListeners, hasListeners, removeListener`

- - ### Constructor Detail

    - #### Negotiator

          public Negotiator(java.lang.Class<STATE> stateEnum,
                            java.lang.Class<EVENT> eventEnum,
                            STATE initialState,
                            STATE successState,
                            STATE failureState,
                            EVENT startEvent,
                            EVENT bufferEvent,
                            boolean initiator)

  - ### Method Detail

    - #### getInitialState

          public STATE getInitialState()

    - #### getSuccessState

          public STATE getSuccessState()

    - #### getFailureState

          public STATE getFailureState()

    - #### getBufferEvent

          public EVENT getBufferEvent()

    - #### getStartEvent

          public EVENT getStartEvent()

    - #### isInitiator

          public boolean isInitiator()

      Specified by:
        `isInitiator` in interface `INegotiator`

    - #### negotiate

          public void negotiate(INegotiationContext context)

      Specified by:
        `negotiate` in interface `INegotiator`

    - #### receiveBuffer

          public void receiveBuffer(INegotiationContext context,
                                    java.nio.ByteBuffer buffer)

      Specified by:
        `receiveBuffer` in interface `INegotiationContext.Receiver`

    - #### postProcess

          protected void postProcess(INegotiationContext context)

    - #### handleSuccess

          protected void handleSuccess(INegotiationContext context)

      Since:
        2.0

    - #### handleFailure

          protected void handleFailure(INegotiationContext context)

      Since:
        2.0

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html