AccessLog.java [src/csip] 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;

import org.codehaus.jettison.json.JSONObject;

/**
 * Access Logger. Called on service completion.
 *
 * @author od
 */
interface AccessLog extends AutoCloseable {

  /**
   * Add a record (usually metadata)
   *
   * @param metainfo the meta info to log
   */
  void log(JSONObject metainfo);


  @Override
  default void close() throws Exception {
  }

  /**
   * Default AccessLog, doing nothing.
   */
  AccessLog NONE = new AccessLog() {
    @Override
    public void log(JSONObject data) {
    }
  };

}