本文整理了Java中com.orbitz.consul.model.kv.Value.getFlags()
方法的一些代码示例,展示了Value.getFlags()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Value.getFlags()
方法的具体详情如下:
包路径:com.orbitz.consul.model.kv.Value
类名称:Value
方法名:getFlags
暂无
代码示例来源:origin: liaokailin/springcloud
@Override
public void run() {
KeyValueClient keyValueClient = consul.keyValueClient();
Optional<Value> optValue = keyValueClient.getValue("com/lkl/consul/kvs");
if (optValue.isPresent()) {
Value value = optValue.get();
long flag = value.getFlags();
System.out.println("flag:" + flag);
String propString = new String(Base64.decodeBase64(value.getValue().get()));
System.out.println(propString);
}
}
}
代码示例来源:origin: org.apache.tamaya.ext/tamaya-consul
props.put(reqKey+".modifyIndex", String.valueOf(value.getModifyIndex()));
props.put(reqKey+".lockIndex", String.valueOf(value.getLockIndex()));
props.put(reqKey+".flags", String.valueOf(value.getFlags()));
return new PropertyValueBuilder(key, value.getValue().get(), getName()).setContextData(props).build();
代码示例来源:origin: org.apache.camel/camel-consul
protected void onValue(Value value) {
final Exchange exchange = endpoint.createExchange();
final Message message = exchange.getIn();
message.setHeader(ConsulConstants.CONSUL_KEY, value.getKey());
message.setHeader(ConsulConstants.CONSUL_RESULT, true);
message.setHeader(ConsulConstants.CONSUL_FLAGS, value.getFlags());
message.setHeader(ConsulConstants.CONSUL_CREATE_INDEX, value.getCreateIndex());
message.setHeader(ConsulConstants.CONSUL_LOCK_INDEX, value.getLockIndex());
message.setHeader(ConsulConstants.CONSUL_MODIFY_INDEX, value.getModifyIndex());
if (value.getSession().isPresent()) {
message.setHeader(ConsulConstants.CONSUL_SESSION, value.getSession().get());
}
message.setBody(configuration.isValueAsString() ? value.getValueAsString().orElse(null) : value.getValue().orElse(null));
try {
getProcessor().process(exchange);
} catch (Exception e) {
getExceptionHandler().handleException("Error processing exchange", exchange, e);
}
}
代码示例来源:origin: rickfast/consul-client
/**
* Fill a builder with attribute values from the provided {@code Value} instance.
* Regular attribute values will be replaced with those from the given instance.
* Absent optional values will not replace present values.
* @param instance The instance from which to copy values
* @return {@code this} builder for use in a chained invocation
*/
public final Builder from(Value instance) {
Preconditions.checkNotNull(instance, "instance");
createIndex(instance.getCreateIndex());
modifyIndex(instance.getModifyIndex());
lockIndex(instance.getLockIndex());
key(instance.getKey());
flags(instance.getFlags());
Optional<String> valueOptional = instance.getValue();
if (valueOptional.isPresent()) {
value(valueOptional);
}
Optional<String> sessionOptional = instance.getSession();
if (sessionOptional.isPresent()) {
session(sessionOptional);
}
return this;
}
内容来源于网络,如有侵权,请联系作者删除!