class TransactionLogStorageFactory {

    public static TransactionLogStorage createTransactionLogStorage(final TransactionLogDataSource transactionLogDataSource) {
        switch (transactionLogDataSource.getType()) {
            case MEMORY:
                return new MemoryTransactionLogStorage();
            case RDB:
                return new RdbTransactionLogStorage(transactionLogDataSource.getDataSource());
            default:
                throw new UnsupportedOperationException();
        }
    }

}