ServiceArchive.java [tools/MetaModelTools/src/archives] Revision: ec5f4cade4553a8341e1cd241b111bfdb77a87a8  Date: Fri Jan 10 10:59:55 MST 2020
/*
 * $Id$
 *
 * This file is part of the Cloud Services Integration Platform (CSIP),
 * a Model-as-a-Service framework, API, and application suite.
 *
 * 2012-2019, 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 archives;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;
import org.bson.conversions.Bson;
import org.codehaus.jettison.json.JSONObject;
import models.ModelArchive;

/**
 *
 * @author <a href="mailto:shaun.case@colostate.edu">Shaun Case</a>
 */
public interface ServiceArchive {

  public ArrayList<ModelArchive> getArchiveByReqIP(String ip, String service) throws Exception;

  public ModelArchive getArchiveBySUID(String suid) throws Exception;

  public default ArrayList<ModelArchive> getArchivesByFilter(String key, String value, int limit) throws Exception {
    return getArchivesByFilter(key, value, limit, false);
  }

  public ArrayList<ModelArchive> getArchivesByFilter(String key, String value, int limit, boolean basicArchiveFunctionalaity) throws Exception;

  public ArrayList<ModelArchive> getArchivesByFilters(Iterable<Bson> filters, int limit) throws Exception;

  public JSONObject getServiceRequest(String suid) throws Exception;

  public JSONObject getServiceResponse(String suid) throws Exception;

  public void shutdown() throws Exception;

  public long getCount();

  public Set<String> keys(int skip, int limit, String sortby, boolean sortAsc);

  public boolean hasArchive(String suid) throws Exception;

  public ArrayList<String> getSUIDsByFilter(String key, String value);
}