com.orbitz.consul.model.kv.Value.getLockIndex()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(74)

本文整理了Java中com.orbitz.consul.model.kv.Value.getLockIndex()方法的一些代码示例,展示了Value.getLockIndex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Value.getLockIndex()方法的具体详情如下:
包路径:com.orbitz.consul.model.kv.Value
类名称:Value
方法名:getLockIndex

Value.getLockIndex介绍

暂无

代码示例

代码示例来源:origin: org.apache.tamaya.ext/tamaya-consul

props.put(reqKey+".createIndex", String.valueOf(value.getCreateIndex()));
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;
}

相关文章