All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ibm.fhir.persistence.jdbc.connection.FHIRTestTransactionFactory Maven / Gradle / Ivy

There is a newer version: 4.11.1
Show newest version
/*
 * (C) Copyright IBM Corp. 2020
 *
 * SPDX-License-Identifier: Apache-2.0
 */

package com.ibm.fhir.persistence.jdbc.connection;

import com.ibm.fhir.database.utils.api.IConnectionProvider;
import com.ibm.fhir.persistence.FHIRPersistenceTransaction;

/**
 * Factory/strategy to instantiate FHIRTestTransactionHandler implementations
 * of the {@link FHIRPersistenceTransaction} interface. Typically used
 * to support unit-tests
 */
public class FHIRTestTransactionFactory implements FHIRTransactionFactory {

    private final IConnectionProvider connectionProvider;
    
    /**
     * Public constructor
     * @param cp the {@link IConnectionProvider}
     */
    public FHIRTestTransactionFactory(IConnectionProvider cp) {
        this.connectionProvider = cp;
    }
    
    @Override
    public FHIRPersistenceTransaction create() {
        return new FHIRTestTransactionAdapter(connectionProvider);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy