@Override
  public GenericAcknowledgmentType provision(ProvisionRequestType parameters)
      throws ServiceException {
    validateOAuthScope(NsiScope.PROVISION);
    validateProviderNsa(parameters.getProvision().getProviderNSA());

    Connection connection = getConnectionOrFail(parameters.getProvision().getConnectionId());

    log.info("Received provision request for connection: {}", connection);

    NsiRequestDetails requestDetails =
        new NsiRequestDetails(parameters.getReplyTo(), parameters.getCorrelationId());
    connectionService.provision(connection.getId(), requestDetails);

    return createGenericAcknowledgment(requestDetails.getCorrelationId());
  }
  /**
   * The reservation method processes an NSI reservation request for inter-domain bandwidth. Those
   * parameters required for the request to proceed to a processing actor will be validated,
   * however, all other parameters will be validated in the processing actor.
   *
   * @param parameters The un-marshaled JAXB object holding the NSI reservation request.
   * @return The GenericAcknowledgmentType object returning the correlationId sent in the
   *     reservation request. We are acknowledging that we have received the request.
   * @throws ServiceException if we can determine there is processing error before digging into the
   *     request.
   */
  @Override
  public GenericAcknowledgmentType reserve(final ReserveRequestType reservationRequest)
      throws ServiceException {
    checkNotNull(reservationRequest);
    validateOAuthScope(NsiScope.RESERVE);

    log.info(
        "Received a NSI reserve request connectionId {}",
        reservationRequest.getReserve().getReservation().getConnectionId());

    Connection connection = RESERVE_REQUEST_TO_CONNECTION.apply(reservationRequest);

    final NsiRequestDetails requestDetails =
        new NsiRequestDetails(
            reservationRequest.getReplyTo(), reservationRequest.getCorrelationId());

    reserve(connection, requestDetails, Security.getUserDetails());

    return createGenericAcknowledgment(requestDetails.getCorrelationId());
  }
  @Override
  public GenericAcknowledgmentType terminate(TerminateRequestType parameters)
      throws ServiceException {
    log.info(
        "Received a NSI terminate request for connectionId '{}'",
        parameters.getTerminate().getConnectionId());

    validateOAuthScope(NsiScope.TERMINATE);
    validateProviderNsa(parameters.getTerminate().getProviderNSA());

    Connection connection = getConnectionOrFail(parameters.getTerminate().getConnectionId());

    NsiRequestDetails requestDetails =
        new NsiRequestDetails(parameters.getReplyTo(), parameters.getCorrelationId());

    connectionService.asyncTerminate(
        connection.getId(),
        parameters.getTerminate().getRequesterNSA(),
        requestDetails,
        Security.getUserDetails());

    return createGenericAcknowledgment(requestDetails.getCorrelationId());
  }