Exemplo n.º 1
0
  private UOctet transitionTypeToInteractionStage(
      IPTestTransitionType transType, InteractionType interactionType) {
    switch (transType.getOrdinal()) {
      case IPTestTransitionType._ACK_INDEX:
      case IPTestTransitionType._ACK_ERROR_INDEX:
        switch (interactionType.getOrdinal()) {
          case InteractionType._SUBMIT_INDEX:
            return MALSubmitOperation.SUBMIT_ACK_STAGE;
          case InteractionType._INVOKE_INDEX:
            return MALInvokeOperation.INVOKE_ACK_STAGE;
          case InteractionType._PROGRESS_INDEX:
            return MALProgressOperation.PROGRESS_ACK_STAGE;
        }
        break;
      case IPTestTransitionType._UPDATE_INDEX:
      case IPTestTransitionType._UPDATE_ERROR_INDEX:
        switch (interactionType.getOrdinal()) {
          case InteractionType._PROGRESS_INDEX:
            return MALProgressOperation.PROGRESS_UPDATE_STAGE;
        }
        break;
      case IPTestTransitionType._RESPONSE_INDEX:
      case IPTestTransitionType._RESPONSE_ERROR_INDEX:
        switch (interactionType.getOrdinal()) {
          case InteractionType._REQUEST_INDEX:
            return MALRequestOperation.REQUEST_RESPONSE_STAGE;
          case InteractionType._INVOKE_INDEX:
            return MALInvokeOperation.INVOKE_RESPONSE_STAGE;
          case InteractionType._PROGRESS_INDEX:
            return MALProgressOperation.PROGRESS_RESPONSE_STAGE;
        }
        break;
    }

    return null;
  }