use of io.joynr.provider.Promise in project joynr by bmwcarit.
the class IltProvider method methodWithMultipleArrayParameters.
/*
* methodWithMultipleArrayParameters
*
* return the byte array as int64array
* return the string list as list of string arrays with 1 element each, where this element
* refers to the one from input
*/
@Override
public Promise<MethodWithMultipleArrayParametersDeferred> methodWithMultipleArrayParameters(String[] stringArrayArg, Byte[] int8ArrayArg, ExtendedInterfaceEnumerationInTypeCollection[] enumArrayArg, StructWithStringArray[] structWithStringArrayArrayArg) {
logger.warn("******************************************************");
logger.warn("* IltProvider.methodWithMultipleArrayParameters called");
logger.warn("******************************************************");
MethodWithMultipleArrayParametersDeferred deferred = new MethodWithMultipleArrayParametersDeferred();
if (!IltUtil.checkStringArray(stringArrayArg)) {
deferred.reject(new ProviderRuntimeException("methodWithMultipleArrayParameters: invalid stringArrayArg"));
return new Promise<MethodWithMultipleArrayParametersDeferred>(deferred);
}
if (!IltUtil.checkByteArray(int8ArrayArg)) {
deferred.reject(new ProviderRuntimeException("methodWithMultipleArrayParameters: invalid int8ArrayArg"));
return new Promise<MethodWithMultipleArrayParametersDeferred>(deferred);
}
if (!IltUtil.checkExtendedInterfaceEnumerationInTypeCollectionArray(enumArrayArg)) {
deferred.reject(new ProviderRuntimeException("methodWithMultipleArrayParameters: invalid enumArrayArg"));
return new Promise<MethodWithMultipleArrayParametersDeferred>(deferred);
}
if (!IltUtil.checkStructWithStringArrayArray(structWithStringArrayArrayArg)) {
deferred.reject(new ProviderRuntimeException("methodWithMultipleArrayParameters: invalid structWithStringArrayArrayArg"));
return new Promise<MethodWithMultipleArrayParametersDeferred>(deferred);
}
Long[] uInt64ArrayOut = IltUtil.createUInt64Array();
StructWithStringArray[] structWithStringArrayArrayOut = new StructWithStringArray[2];
structWithStringArrayArrayOut[0] = IltUtil.createStructWithStringArray();
structWithStringArrayArrayOut[1] = IltUtil.createStructWithStringArray();
deferred.resolve(uInt64ArrayOut, structWithStringArrayArrayOut);
return new Promise<MethodWithMultipleArrayParametersDeferred>(deferred);
}
use of io.joynr.provider.Promise in project joynr by bmwcarit.
the class IltProvider method setAttributeArrayOfStringImplicit.
@Override
public Promise<DeferredVoid> setAttributeArrayOfStringImplicit(String[] attributeArrayOfStringImplicit) {
DeferredVoid deferred = new DeferredVoid();
this.attributeArrayOfStringImplicit = attributeArrayOfStringImplicit;
attributeArrayOfStringImplicitChanged(attributeArrayOfStringImplicit);
deferred.resolve();
return new Promise<DeferredVoid>(deferred);
}
use of io.joynr.provider.Promise in project joynr by bmwcarit.
the class IltProvider method methodWithoutOutputParameter.
/*
* methodWithoutOutputParameter
*
* can only resolve or reject since there is no output parameter
*/
@Override
public Promise<DeferredVoid> methodWithoutOutputParameter(Boolean booleanArg) {
logger.warn("*************************************************");
logger.warn("* IltProvider.methodWithoutOutputParameter called");
logger.warn("*************************************************");
DeferredVoid deferred = new DeferredVoid();
if (booleanArg != false) {
logger.warn("methodWithoutOutputParameter: invalid argument booleanArg");
deferred.reject(new ProviderRuntimeException("methodWithoutOutputParameter: received wrong argument"));
return new Promise<DeferredVoid>(deferred);
}
deferred.resolve();
return new Promise<DeferredVoid>(deferred);
}
use of io.joynr.provider.Promise in project joynr by bmwcarit.
the class IltProvider method methodToFireBroadcastWithSingleByteBufferParameter.
/*
* methodToFireBroadcastWithSingleByteBufferParameter
*/
@Override
public Promise<DeferredVoid> methodToFireBroadcastWithSingleByteBufferParameter(Byte[] byteBufferIn, String[] partitions) {
logger.info("***********************************************************************");
logger.info("* IltProvider.methodToFireBroadcastWithSingleByteBufferParameter called");
logger.info("***********************************************************************");
DeferredVoid deferred = new DeferredVoid();
fireBroadcastWithSingleByteBufferParameter(byteBufferIn, partitions);
deferred.resolve();
return new Promise<DeferredVoid>(deferred);
}
use of io.joynr.provider.Promise in project joynr by bmwcarit.
the class IltProvider method methodWithSinglePrimitiveParameters.
/*
* methodWithSinglePrimitiveParameters
*
* returns the integer parameter as string
*/
@Override
public Promise<MethodWithSinglePrimitiveParametersDeferred> methodWithSinglePrimitiveParameters(Short uInt16Arg) {
logger.warn("********************************************************");
logger.warn("* IltProvider.methodWithSinglePrimitiveParameters called");
logger.warn("********************************************************");
MethodWithSinglePrimitiveParametersDeferred deferred = new MethodWithSinglePrimitiveParametersDeferred();
// if (Short.toUnsignedInt(uInt16Arg) != 65535) {
if (uInt16Arg != 32767) {
logger.warn("methodWithSinglePrimitiveParameters: invalid argument uInt16Arg");
deferred.reject(new ProviderRuntimeException("methodWithSinglePrimitiveParameters: received wrong argument"));
return new Promise<MethodWithSinglePrimitiveParametersDeferred>(deferred);
}
// send back the input converted to a string
deferred.resolve(new Integer(Short.toUnsignedInt(uInt16Arg)).toString());
return new Promise<MethodWithSinglePrimitiveParametersDeferred>(deferred);
}
Aggregations