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

com.couchbase.transactions.log.TransactionsStarted Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2021 Couchbase, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.couchbase.transactions.log;

import com.couchbase.transactions.Transactions;
import com.couchbase.transactions.config.MergedTransactionConfig;
import com.couchbase.transactions.config.TransactionConfig;
import com.couchbase.transactions.config.TransactionConfigBuilder;

/**
 * An event that's fired when a {@link Transactions} object is successfully created.  The main intent is for the user
 * to be able to verify that the event bus logging is configured correctly.
 */
public class TransactionsStarted extends TransactionEvent {
  private final MergedTransactionConfig config;

  public TransactionsStarted(MergedTransactionConfig config) {
    super(Severity.INFO, TransactionLogEvent.DEFAULT_CATEGORY);
    this.config = config;
  }

  @Override
  public String description() {
    return "Transactions successfully started, regular cleanup enabled="
            + config.runRegularAttemptsCleanupThread() + ", lost cleanup enabled=" + config.runLostAttemptsCleanupThread();
  }

  @Override
  public boolean success() {
    return true;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy