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

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

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

import java.net.URI;
import java.net.URISyntaxException;
import java.util.Arrays;
import java.util.Objects;

/**
 * @deprecated Do not use vault as it has been removed from CPAIOps
 */
@Deprecated(since = "1.5.0")
public class VaultAccessInfo {
    public String protocol = "https://";
    public String host = null;
    public int port = 0;
    public String pathPrefix = null;
    public byte[] certificate = null;
    public String token = null;
    public int tokenRefreshPeriod;

    public URI getVaultURL(String path) throws URISyntaxException {
        return new URI(protocol + host + ":" + String.valueOf(port) + pathPrefix + path).normalize();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof VaultAccessInfo)) {
            return false;
        }
        VaultAccessInfo other = (VaultAccessInfo) obj;
        return Objects.equals(this.protocol, other.protocol) && Objects.equals(this.host, other.host)
                && Objects.equals(this.port, other.port) && Objects.equals(this.pathPrefix, other.pathPrefix)
                && Objects.deepEquals(this.certificate, other.certificate) && Objects.equals(this.token, other.token)
                && Objects.equals(this.tokenRefreshPeriod, other.tokenRefreshPeriod);
    }

    @Override
    public int hashCode() {
        return Objects.hash(protocol, host, port, pathPrefix, token, tokenRefreshPeriod) + Arrays.hashCode(certificate);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy