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

com.ibm.cp4waiops.connectors.sdk.VaultHelper Maven / Gradle / Ivy

There is a newer version: 2.2.8
Show newest version
package com.ibm.cp4waiops.connectors.sdk;

import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.atomic.AtomicReference;

import io.micrometer.core.instrument.MeterRegistry;

/**
 * A helper class to handle setting up a VaultInstance and recreating it when the config changes. Also handles token
 * renewal.
 * 
 * @deprecated Do not use vault as it has been removed from CPAIOps
 */
@Deprecated(since = "1.5.0")
public class VaultHelper implements AutoCloseable {
    AtomicReference _instance;

    /**
     * Constructs a new vault instance
     * 
     * @deprecated Do not use vault as it has been removed from CPAIOps
     * 
     * @param config
     *            source of configuration values
     * @param scheduler
     *            handles periodic tasks
     * @param registry
     *            stores request metrics
     */
    public VaultHelper(ConnectorManagerConfig config, ScheduledExecutorService scheduler, MeterRegistry registry) {
        // Vault will be deprecated, for the first stage, the class cannot be removed
        // So the logic will be removed here
    }

    @Override
    public void close() {
        // Do nothing, since the task to auto renew was removed from
    }

    /**
     * @deprecated Do not use vault as it has been removed from CPAIOps
     * 
     * @return the current vault instance
     */
    public VaultInstance getInstance() {
        return _instance.get();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy