21 package org.opensplice.dds.core.policy;
23 import java.util.concurrent.TimeUnit;
35 private static final long serialVersionUID = -3906397729567497050L;
36 private final Duration serviceCleanupDelay;
38 private final int maxSamples;
39 private final int maxInstances;
40 private final int maxSamplesPerInstance;
47 this.maxInstances = -1;
48 this.maxSamplesPerInstance = -1;
52 Duration serviceCleanupDelay,
Kind historyKind,
int historyDepth,
53 int maxSamples,
int maxInstances,
int maxSamplesPerInstance) {
55 this.serviceCleanupDelay = serviceCleanupDelay;
56 this.history =
new HistoryImpl(environment, historyKind, historyDepth);
57 this.maxSamples = maxSamples;
58 this.maxInstances = maxInstances;
59 this.maxSamplesPerInstance = maxSamplesPerInstance;
61 if (serviceCleanupDelay == null) {
63 "Supplied invalid service cleanup delay.");
69 return this.serviceCleanupDelay;
84 return this.maxSamples;
89 return this.maxInstances;
94 return this.maxSamplesPerInstance;
102 this.maxInstances, this.maxSamplesPerInstance);
109 .getSPI().newDuration(serviceCleanupDelay, unit),
111 this.maxInstances, this.maxSamplesPerInstance);
117 this.serviceCleanupDelay, historyKind, this.history.
getDepth(),
118 this.maxSamples, this.maxInstances, this.maxSamplesPerInstance);
124 this.serviceCleanupDelay, this.history.
getKind(), historyDepth,
125 this.maxSamples, this.maxInstances, this.maxSamplesPerInstance);
131 this.serviceCleanupDelay, this.history.
getKind(), this.history.
getDepth(),
132 maxSamples, this.maxInstances, this.maxSamplesPerInstance);
138 this.serviceCleanupDelay, this.history.
getKind(), this.history.
getDepth(),
139 this.maxSamples, maxInstances, this.maxSamplesPerInstance);
145 this.serviceCleanupDelay, this.history.
getKind(), this.history.
getDepth(),
146 this.maxSamples, this.maxInstances, maxSamplesPerInstance);
161 if (!this.history.equals(d.history)) {
164 if (this.maxInstances != d.maxInstances) {
167 if (this.maxSamples != d.maxSamples) {
170 if (this.maxSamplesPerInstance != d.maxSamplesPerInstance) {
173 return this.serviceCleanupDelay.equals(d.serviceCleanupDelay);
178 final int prime = 31;
181 result = prime * result + this.history.hashCode();
182 result = prime * result + this.maxInstances;
183 result = prime * result + this.maxSamples;
184 result = prime * result + this.maxSamplesPerInstance;
185 result = prime * result + this.serviceCleanupDelay.hashCode();
Specifies the configuration of the durability service.
DurabilityServiceImpl(OsplServiceEnvironment environment)
DurabilityService withServiceCleanupDelay(Duration serviceCleanupDelay)
Copy this policy and override the value of the property.
Duration getServiceCleanupDelay()
DurabilityServiceImpl(OsplServiceEnvironment environment, Duration serviceCleanupDelay, Kind historyKind, int historyDepth, int maxSamples, int maxInstances, int maxSamplesPerInstance)
DurabilityService withMaxSamples(int maxSamples)
Copy this policy and override the value of the property.
OsplServiceEnvironment environment
boolean equals(Object other)
DurabilityService withHistoryKind(Kind historyKind)
DurabilityService withMaxInstances(int maxInstances)
Copy this policy and override the value of the property.
DurabilityService withMaxSamplesPerInstance(int maxSamplesPerInstance)
Copy this policy and override the value of the property.
DurabilityService withHistoryDepth(int historyDepth)
Copy this policy and override the value of the property.
DurabilityService withServiceCleanupDelay(long serviceCleanupDelay, TimeUnit unit)
Copy this policy and override the value of the property.
ServiceProviderInterface getSPI()
This class is the abstract root for all the QoS policies.
Class<? extends QosPolicy > getPolicyClass()
A span of elapsed time expressed with nanosecond precision.
int getMaxSamplesPerInstance()
Specifies the behavior of the Service in the case where the value of a sample changes (one or more ti...