io.nats.client.api.KeyValueConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jnats Show documentation
Show all versions of jnats Show documentation
Client library for working with the NATS messaging system.
// Copyright 2021 The NATS Authors
// 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 io.nats.client.api;
import io.nats.client.support.JsonValue;
import io.nats.client.support.JsonValueUtils;
import io.nats.client.support.NatsKeyValueUtil;
import java.time.Duration;
import java.util.*;
import static io.nats.client.support.NatsKeyValueUtil.*;
import static io.nats.client.support.Validator.*;
/**
* The KeyValueConfiguration class contains the configuration for of a Key Value bucket.
*/
public class KeyValueConfiguration extends FeatureConfiguration {
KeyValueConfiguration(StreamConfiguration sc) {
super(sc, extractBucketName(sc.getName()));
}
/**
* Gets the maximum number of history for any one key. Includes the current value.
* @return the maximum number of values for any one key.
*/
public long getMaxHistoryPerKey() {
return sc.getMaxMsgsPerSubject();
}
/**
* Gets the maximum size for an individual value in the bucket.
* @deprecated the server value is a 32-bit signed value. Use {@link #getMaximumValueSize()} instead.
* @return the maximum size for a value.
*/
@Deprecated
public long getMaxValueSize() {
return sc.getMaximumMessageSize();
}
/**
* Gets the maximum size for an individual value in the bucket.
* @return the maximum size for a value.
*/
public int getMaximumValueSize() {
return sc.getMaximumMessageSize();
}
/**
* Get the republish configuration. Might be null.
* @return the republish object
*/
public Republish getRepublish() {
return sc.getRepublish();
}
/**
* The mirror definition for this configuration
* @return the mirror
*/
public Mirror getMirror() {
return sc.getMirror();
}
/**
* The sources for this configuration
* @return the sources
*/
public List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy