PayloadRequest.java [src/csip/api/server] Revision:   Date:
/*
 * $Id$
 *
 * This file is part of the Cloud Services Integration Platform (CSIP),
 * a Model-as-a-Service framework, API and application suite.
 *
 * 2012-2022, Olaf David and others, OMSLab, Colorado State University.
 *
 * OMSLab licenses this file to you under the MIT license.
 * See the LICENSE file in the project root for more information.
 */
package csip.api.server;

import org.codehaus.jettison.json.JSONObject;

/**
 * Payload Request Access.
 *
 * @author od
 */
public interface PayloadRequest {

  /**
   * Check if the request was submitted asynchronously.
   * @return true if request is a async request.
   */
  boolean isAsync();


  /**
   * The request ip.
   * @return the request ip
   */
  String getRemoteAddr();


  /**
   * Get the codebase without the model service path.
   * @return the codebase of the URL as String
   */
  String getCodebase();


  /**
   * Get the complete request URL.
   * @return the full request URL
   */
  String getURL();


  /**
   * Get the request Host.
   * @return the request host (IP)
   */
  String getHost();


  /**
   * Get the webapp context name.
   * @return the context name
   */
  String getContext();


  /**
   * Get the webapp context name.
   * @return the context name
   */
  String getScheme();


  /**
   * Get the webapp context name.
   * @return the context name
   */
  JSONObject getRequest();


  /**
   * Get the request authorization token.
   * @return The token or null if there is none.
   */
  String getAuthToken();

}