Merge branch 'master' of github.com:thingsboard/thingsboard

This commit is contained in:
Igor Kulikov 2017-09-19 16:46:42 +03:00
commit ea63f72eb6
2 changed files with 2 additions and 1 deletions

View File

@ -76,6 +76,7 @@ public class ServerSideRpcCallAction extends SimpleRuleLifecycleComponent implem
toDeviceRelationTemplate.ifPresent(t -> builder.toDeviceRelation(VelocityUtils.merge(t, context))); toDeviceRelationTemplate.ifPresent(t -> builder.toDeviceRelation(VelocityUtils.merge(t, context)));
rpcCallMethodTemplate.ifPresent(t -> builder.rpcCallMethod(VelocityUtils.merge(t, context))); rpcCallMethodTemplate.ifPresent(t -> builder.rpcCallMethod(VelocityUtils.merge(t, context)));
rpcCallBodyTemplate.ifPresent(t -> builder.rpcCallBody(VelocityUtils.merge(t, context))); rpcCallBodyTemplate.ifPresent(t -> builder.rpcCallBody(VelocityUtils.merge(t, context)));
builder.rpcCallTimeoutInSec(configuration.getRpcCallTimeoutInSec());
return Optional.of(new ServerSideRpcCallRuleToPluginActionMsg(toDeviceActorMsg.getTenantId(), toDeviceActorMsg.getCustomerId(), toDeviceActorMsg.getDeviceId(), return Optional.of(new ServerSideRpcCallRuleToPluginActionMsg(toDeviceActorMsg.getTenantId(), toDeviceActorMsg.getCustomerId(), toDeviceActorMsg.getDeviceId(),
builder.build())); builder.build()));
} else { } else {

View File

@ -70,7 +70,7 @@ public class RpcRuleMsgHandler implements RuleMsgHandler {
deviceIds = relations.stream().map(EntityRelation::getFrom).collect(Collectors.toList()); deviceIds = relations.stream().map(EntityRelation::getFrom).collect(Collectors.toList());
} }
ToDeviceRpcRequestBody body = new ToDeviceRpcRequestBody(msg.getRpcCallMethod(), msg.getRpcCallBody()); ToDeviceRpcRequestBody body = new ToDeviceRpcRequestBody(msg.getRpcCallMethod(), msg.getRpcCallBody());
long expirationTime = System.currentTimeMillis() + msg.getRpcCallTimeoutInSec(); long expirationTime = System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(msg.getRpcCallTimeoutInSec());
for (EntityId address : deviceIds) { for (EntityId address : deviceIds) {
DeviceId tmpId = new DeviceId(address.getId()); DeviceId tmpId = new DeviceId(address.getId());
ctx.checkAccess(tmpId, new PluginCallback<Void>() { ctx.checkAccess(tmpId, new PluginCallback<Void>() {