package lc.esp.eo;

import com.mongodb.client.MongoClients;
import lc.esp.eo.sdk.schema.Model;

/**
 * This class implements access ot the back-end storage for the ESP/EO system.
 *
 * @author Alex Leigh
 * @since mk20 (TOKYO PROTOCOL)
 */
public class EOClient implements AutoCloseable {

    public EOTransaction getTransaction(String lparName) {
        return getTransaction(lparName, null);
    }

    public EOTransaction getTransaction(String lparName, Model model) {
        return new EOTransaction(MongoClients.create("mongodb://mgr0.gdn.leigh-co.com"), lparName, model);
    }

    @Override
    public void close() {
        // Do nothing
    }
}
