<reponame>nbwhite/dai-ds
// Copyright (C) 2018-2021 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0

package com.intel.dai.dsapi;

import com.intel.dai.dsapi.pojo.Dimm;
import com.intel.dai.dsapi.pojo.FruHost;
import com.intel.dai.dsapi.pojo.SubFru;
import com.intel.dai.exceptions.DataStoreException;
import org.apache.commons.lang3.tuple.ImmutablePair;

import java.util.Map;

public interface InventorySnapshot {
    ImmutablePair<Long, String> getCharacteristicsOfLastRawSubFruIngested();

    /**
     * The last json document ingested is characterized by its timestamp and serial, where
     * timestamp is in epoch seconds, and serial is a string.
     *
     * @return immutable pair of timestamp and serial of the last ingested dimm.
     */
    ImmutablePair<Long, String> getCharacteristicsOfLastRawDimmIngested();

    ImmutablePair<Long, String> getCharacteristicsOfLastRawFruHostIngested();

    String getSourceFromRawFruHostTableForGivenMac(String mac);

    void ingestFruHostSnapshot(Map<String, FruHost> macToFruHostMap) throws DataStoreException;

    void ingest(Dimm dimm) throws DataStoreException;

    void ingest(SubFru subFru) throws DataStoreException;
}
