use of io.joynr.provider.DeferredVoid in project joynr by bmwcarit.
the class IltProvider method setAttributeWithExceptionFromSetter.
@Override
public Promise<DeferredVoid> setAttributeWithExceptionFromSetter(Boolean attributeWithExceptionFromSetter) {
DeferredVoid deferred = new DeferredVoid();
deferred.reject(new ProviderRuntimeException("Exception from setAttributeWithExceptionFromSetter"));
return new Promise<DeferredVoid>(deferred);
}
use of io.joynr.provider.DeferredVoid in project joynr by bmwcarit.
the class IltProvider method setAttributeStringNoSubscriptions.
@Override
public Promise<DeferredVoid> setAttributeStringNoSubscriptions(String attributeStringNoSubscriptions) {
DeferredVoid deferred = new DeferredVoid();
this.attributeStringNoSubscriptions = attributeStringNoSubscriptions;
deferred.resolve();
return new Promise<DeferredVoid>(deferred);
}
use of io.joynr.provider.DeferredVoid in project joynr by bmwcarit.
the class CapabilitiesDirectoryImpl method add.
@Override
public Promise<DeferredVoid> add(GlobalDiscoveryEntry globalDiscoveryEntry) {
DeferredVoid deferred = new DeferredVoid();
Promise<DeferredVoid> promise = new Promise<DeferredVoid>(deferred);
Address address = CapabilityUtils.getAddressFromGlobalDiscoveryEntry(globalDiscoveryEntry);
String clusterControllerId;
if (address instanceof MqttAddress) {
clusterControllerId = ((MqttAddress) address).getTopic();
} else if (address instanceof ChannelAddress) {
clusterControllerId = ((ChannelAddress) address).getChannelId();
} else {
deferred.reject(new ProviderRuntimeException(""));
return promise;
}
GlobalDiscoveryEntryPersisted discoveryEntry = new GlobalDiscoveryEntryPersisted(globalDiscoveryEntry, clusterControllerId);
logger.debug("registered discovery entry: {}", discoveryEntry);
discoveryEntryStore.add(discoveryEntry);
deferred.resolve();
return promise;
}
use of io.joynr.provider.DeferredVoid in project joynr by bmwcarit.
the class CapabilitiesDirectoryImpl method remove.
@Override
public Promise<DeferredVoid> remove(String participantId) {
DeferredVoid deferred = new DeferredVoid();
logger.debug("removed discovery entry with participantId: {}", participantId);
discoveryEntryStore.remove(participantId);
deferred.resolve();
return new Promise<DeferredVoid>(deferred);
}
use of io.joynr.provider.DeferredVoid in project joynr by bmwcarit.
the class CapabilitiesDirectoryImpl method add.
@Override
public Promise<DeferredVoid> add(GlobalDiscoveryEntry[] globalDiscoveryEntries) {
DeferredVoid deferred = new DeferredVoid();
for (GlobalDiscoveryEntry globalDiscoveryEntry : globalDiscoveryEntries) {
add(globalDiscoveryEntry);
}
deferred.resolve();
return new Promise<DeferredVoid>(deferred);
}
Aggregations