use of io.joynr.provider.Promise in project joynr by bmwcarit.
the class DummyCapabilitiesDirectory method remove.
@Override
public Promise<DeferredVoid> remove(String participantId) {
DeferredVoid deferred = new DeferredVoid();
logger.info("!!!!!!!!!!!!!!!removeCapabilities");
deferred.resolve();
return new Promise<DeferredVoid>(deferred);
}
use of io.joynr.provider.Promise in project joynr by bmwcarit.
the class DummyCapabilitiesDirectory method add.
@Override
public Promise<DeferredVoid> add(DiscoveryEntry discoveryEntry) {
DeferredVoid deferred = new DeferredVoid();
registeredCapabilities.add(CapabilityUtils.convertToDiscoveryEntryWithMetaInfo(true, discoveryEntry));
notifyCapabilityAdded(discoveryEntry);
deferred.resolve();
return new Promise<DeferredVoid>(deferred);
}
use of io.joynr.provider.Promise in project joynr by bmwcarit.
the class IltProvider method methodWithMultipleStructParameters.
/*
* methodWithMultipleStructParameters
*/
@Override
public Promise<MethodWithMultipleStructParametersDeferred> methodWithMultipleStructParameters(ExtendedStructOfPrimitives extendedStructOfPrimitivesArg, BaseStruct baseStructArg) {
MethodWithMultipleStructParametersDeferred deferred = new MethodWithMultipleStructParametersDeferred();
logger.warn("*******************************************************");
logger.warn("* IltProvider.methodWithMultipleStructParameters called");
logger.warn("*******************************************************");
// check input parameter
if (!IltUtil.checkExtendedStructOfPrimitives(extendedStructOfPrimitivesArg)) {
deferred.reject(new ProviderRuntimeException("methodWithMultipleStructParameters: invalid parameter extendedStructOfPrimitivesArg"));
return new Promise<MethodWithMultipleStructParametersDeferred>(deferred);
}
if (!IltUtil.checkBaseStruct(baseStructArg)) {
deferred.reject(new ProviderRuntimeException("methodWithMultipleStructParameters: invalid parameter baseStructArg"));
return new Promise<MethodWithMultipleStructParametersDeferred>(deferred);
}
// set output values
BaseStructWithoutElements baseStructWithoutElementsOut = IltUtil.createBaseStructWithoutElements();
ExtendedExtendedBaseStruct extendedExtendedBaseStructOut = IltUtil.createExtendedExtendedBaseStruct();
deferred.resolve(baseStructWithoutElementsOut, extendedExtendedBaseStructOut);
return new Promise<MethodWithMultipleStructParametersDeferred>(deferred);
}
use of io.joynr.provider.Promise in project joynr by bmwcarit.
the class IltProvider method methodWithSingleMapParameters.
@Override
public Promise<MethodWithSingleMapParametersDeferred> methodWithSingleMapParameters(MapStringString mapArg) {
MethodWithSingleMapParametersDeferred deferred = new MethodWithSingleMapParametersDeferred();
if (mapArg == null) {
deferred.resolve(null);
} else {
MapStringString mapOut = new MapStringString();
Iterator<Map.Entry<String, String>> iterator = mapArg.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<String, String> entry = (Entry<String, String>) iterator.next();
mapOut.put(entry.getValue(), entry.getKey());
}
deferred.resolve(mapOut);
}
return new Promise<MethodWithSingleMapParametersDeferred>(deferred);
}
use of io.joynr.provider.Promise in project joynr by bmwcarit.
the class IltProvider method setAttributeByteBuffer.
@Override
public Promise<DeferredVoid> setAttributeByteBuffer(Byte[] attributeByteBuffer) {
DeferredVoid deferred = new DeferredVoid();
this.attributeByteBuffer = attributeByteBuffer;
attributeByteBufferChanged(attributeByteBuffer);
deferred.resolve();
return new Promise<DeferredVoid>(deferred);
}
Aggregations