本文整理汇总了Java中org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.MAX_VALUE属性的典型用法代码示例。如果您正苦于以下问题:Java UInteger.MAX_VALUE属性的具体用法?Java UInteger.MAX_VALUE怎么用?Java UInteger.MAX_VALUE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger
的用法示例。
在下文中一共展示了UInteger.MAX_VALUE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTimeoutHint
private UInteger getTimeoutHint() {
double minKeepAlive = subscriptions.values().stream()
.map(s -> s.getRevisedPublishingInterval() * s.getRevisedMaxKeepAliveCount().doubleValue())
.min(Comparator.naturalOrder())
.orElse(client.getConfig().getRequestTimeout().doubleValue());
long maxPendingPublishes = getMaxPendingPublishes();
double timeoutHint = maxPendingPublishes * minKeepAlive * 1.25;
if (Double.isInfinite(timeoutHint)) {
timeoutHint = UInteger.MAX_VALUE;
} else if (timeoutHint > UInteger.MAX_VALUE) {
timeoutHint = UInteger.MAX_VALUE;
}
logger.debug(
"getTimeoutHint() minKeepAlive={} maxPendingPublishes={} timeoutHint={}",
minKeepAlive, maxPendingPublishes, timeoutHint);
return uint((long) timeoutHint);
}
示例2: setMaxKeepAliveCount
private void setMaxKeepAliveCount(long maxKeepAliveCount) {
if (maxKeepAliveCount == 0) maxKeepAliveCount = 3;
double keepAliveInterval = maxKeepAliveCount * publishingInterval;
// keep alive interval cannot be longer than the max subscription lifetime.
if (keepAliveInterval > MAX_LIFETIME) {
maxKeepAliveCount = (long) (MAX_LIFETIME / publishingInterval);
if (maxKeepAliveCount < UInteger.MAX_VALUE) {
if (MAX_LIFETIME % publishingInterval != 0) {
maxKeepAliveCount++;
}
}
keepAliveInterval = maxKeepAliveCount * publishingInterval;
}
// the time between publishes cannot exceed the max publishing interval.
if (keepAliveInterval > MAX_PUBLISHING_INTERVAL) {
maxKeepAliveCount = (long) (MAX_PUBLISHING_INTERVAL / publishingInterval);
if (maxKeepAliveCount < UInteger.MAX_VALUE) {
if (MAX_PUBLISHING_INTERVAL % publishingInterval != 0) {
maxKeepAliveCount++;
}
}
}
this.maxKeepAliveCount = maxKeepAliveCount;
}
示例3: setLifetimeCount
private void setLifetimeCount(long lifetimeCount) {
double lifetimeInterval = lifetimeCount * publishingInterval;
// lifetime cannot be longer than the max subscription lifetime.
if (lifetimeInterval > MAX_LIFETIME) {
lifetimeCount = (long) (MAX_LIFETIME / publishingInterval);
if (lifetimeCount < UInteger.MAX_VALUE) {
if (MAX_LIFETIME % publishingInterval != 0) {
lifetimeCount++;
}
}
}
// the lifetime must be greater than the keepalive.
if (maxKeepAliveCount < UInteger.MAX_VALUE / 3) {
if (maxKeepAliveCount * 3 > lifetimeCount) {
lifetimeCount = maxKeepAliveCount * 3;
}
lifetimeInterval = lifetimeCount * publishingInterval;
} else {
lifetimeCount = UInteger.MAX_VALUE;
lifetimeInterval = Double.MAX_VALUE;
}
// apply the minimum.
if (MIN_LIFETIME > publishingInterval && MIN_LIFETIME > lifetimeInterval) {
lifetimeCount = (long) (MIN_LIFETIME / publishingInterval);
if (lifetimeCount < UInteger.MAX_VALUE) {
if (MIN_LIFETIME % publishingInterval != 0) {
lifetimeCount++;
}
}
}
this.lifetimeCount = lifetimeCount;
}