Interface TrustedContractNegotiatorHandler


  • public interface TrustedContractNegotiatorHandler
    Handler used to receive and react to different kinds of contract negotiation events.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void onAccept​(se.arkalix.core.plugin.cp.TrustedContractNegotiationDto negotiation)
      Called to indicate that a previously made contract offer was accepted by its receiver.
      default void onExpiry​(long negotiationId)
      Called to indicate that a previously made or received contract offer expired before being responded to.
      default void onFault​(long negotiationId, java.lang.Throwable throwable)
      Called to indicate that some submitted offer could not be sent due to an unexpected exception.
      void onOffer​(se.arkalix.core.plugin.cp.TrustedContractNegotiationDto negotiation, TrustedContractNegotiatorResponder responder)
      Called to notify about a new offer or counter-offer being received.
      void onReject​(se.arkalix.core.plugin.cp.TrustedContractNegotiationDto negotiation)
      Called to indicate that a previously made contract offer was rejected by its receiver.
    • Method Detail

      • onAccept

        void onAccept​(se.arkalix.core.plugin.cp.TrustedContractNegotiationDto negotiation)
        Called to indicate that a previously made contract offer was accepted by its receiver.

        The negotiation session in question must be considered permanently closed when this method is invoked.

        Parameters:
        negotiation - Session containing accepted offer.
      • onOffer

        void onOffer​(se.arkalix.core.plugin.cp.TrustedContractNegotiationDto negotiation,
                     TrustedContractNegotiatorResponder responder)
        Called to notify about a new offer or counter-offer being received.
        Parameters:
        negotiation - Session containing the received offer or counter-offer.
        responder - Object useful for responding to the received offer.
      • onReject

        void onReject​(se.arkalix.core.plugin.cp.TrustedContractNegotiationDto negotiation)
        Called to indicate that a previously made contract offer was rejected by its receiver.

        The negotiation session in question must be considered permanently closed when this method is invoked.

        Parameters:
        negotiation - Session containing rejected offer.
      • onExpiry

        default void onExpiry​(long negotiationId)
        Called to indicate that a previously made or received contract offer expired before being responded to.

        The negotiation session in question must be considered permanently closed when this method is invoked.

      • onFault

        default void onFault​(long negotiationId,
                             java.lang.Throwable throwable)
        Called to indicate that some submitted offer could not be sent due to an unexpected exception.

        This method being invoked does not necessarily imply that the negotiation session in question is closed.

        Parameters:
        throwable - Exception preventing offer submission.