protected void handleAspActiveAck(ASPActiveAck aspActiveAck) {
    if (!this.aspFactoryImpl.started) {
      // If management stopped this ASP, ignore ASPActiveAck
      return;
    }

    RoutingContext rc = aspActiveAck.getRoutingContext();

    if (aspFactoryImpl.getFunctionality() == Functionality.AS
        || (aspFactoryImpl.getFunctionality() == Functionality.SGW
            && aspFactoryImpl.getExchangeType() == ExchangeType.DE)
        || (aspFactoryImpl.getFunctionality() == Functionality.IPSP
            && aspFactoryImpl.getExchangeType() == ExchangeType.DE)
        || (aspFactoryImpl.getFunctionality() == Functionality.IPSP
            && aspFactoryImpl.getExchangeType() == ExchangeType.SE
            && aspFactoryImpl.getIpspType() == IPSPType.CLIENT)) {

      TrafficModeType trMode = aspActiveAck.getTrafficModeType();

      if (rc == null) {
        AspImpl aspImpl = this.getAspForNullRc();

        if (aspImpl == null) {
          // Error condition
          logger.error(
              String.format(
                  "Rx : ASP ACTIVE_ACK=%s with null RC for Aspfactory=%s. But no ASP configured for null RC. Sent back Error",
                  aspActiveAck, this.aspFactoryImpl.getName()));
          return;
        }
        handleAspActiveAck(aspImpl, aspActiveAck, trMode);
      } else {
        long[] rcs = rc.getRoutingContexts();
        for (int count = 0; count < rcs.length; count++) {
          AspImpl aspImpl = this.aspFactoryImpl.getAsp(rcs[count]);
          handleAspActiveAck(aspImpl, aspActiveAck, trMode);
        } // for
      }

    } else {
      // TODO : Should we silently drop ASPACTIVE_ACK?

      // ASPACTIVE_ACK is unexpected in this state
      ErrorCode errorCodeObj =
          this.aspFactoryImpl.parameterFactory.createErrorCode(ErrorCode.Unexpected_Message);
      sendError(rc, errorCodeObj);
    }
  }
  private void handleAspActive(AspImpl aspImpl, ASPActive aspActive) {
    AsImpl appServer = (AsImpl) aspImpl.getAs();

    TrafficModeType trfModType = aspActive.getTrafficModeType();

    if (appServer.getTrafficModeType() != null) {
      // AppServer has Traffic Mode Type defined check if it
      // matches with sent ASP ACTIVE Message
      if (trfModType != null && appServer.getTrafficModeType().getMode() != trfModType.getMode()) {

        // Traffic Mode Type mismatch. Send Error.
        // TODO should send error or drop message?
        ErrorCode errorCodeObj =
            this.aspFactoryImpl.parameterFactory.createErrorCode(
                ErrorCode.Unsupported_Traffic_Mode_Type);
        this.sendError(appServer.getRoutingContext(), errorCodeObj);
        return;
      }

      // message doesn't have Traffic Mode Type
    } else {

      // AppServer Traffic Mode Type is optionally configured via
      // management config. If not select the first available in
      // AspUp message

      if (trfModType == null) {
        // Asp UP didn't specify the Traffic Mode either. use
        // default which is loadshare
        appServer.setDefaultTrafficModeType();
      } else {
        // Set the Traffic Mode Type passed in ASP ACTIVE
        appServer.setTrafficModeType(trfModType);
      }
    }

    FSM aspPeerFSM = aspImpl.getPeerFSM();
    if (aspPeerFSM == null) {
      logger.error(
          String.format(
              "Received ASPACTIVE=%s for ASP=%s. But peer FSM for ASP is null.",
              aspActive, this.aspFactoryImpl.getName()));
      return;
    }

    FSM asLocalFSM = appServer.getLocalFSM();
    if (asLocalFSM == null) {
      logger.error(
          String.format(
              "Received ASPACTIVE=%s for ASP=%s. But local FSM for AS is null.",
              aspActive, this.aspFactoryImpl.getName()));
      return;
    }

    ASPActiveAck aspActAck =
        (ASPActiveAck)
            this.aspFactoryImpl.messageFactory.createMessage(
                MessageClass.ASP_TRAFFIC_MAINTENANCE, MessageType.ASP_ACTIVE_ACK);
    aspActAck.setTrafficModeType(appServer.getTrafficModeType());
    aspActAck.setRoutingContext(appServer.getRoutingContext());

    this.aspFactoryImpl.write(aspActAck);

    try {
      aspPeerFSM.setAttribute(FSM.ATTRIBUTE_MESSAGE, aspActive);
      aspPeerFSM.signal(TransitionState.ASP_ACTIVE);

      // Signal AS to transition
      asLocalFSM.setAttribute(AsImpl.ATTRIBUTE_ASP, aspImpl);
      asLocalFSM.signal(TransitionState.ASP_ACTIVE);

    } catch (UnknownTransitionException e) {
      logger.error(e.getMessage(), e);
    }
  }