Merge branch 'master' of github.com:thingsboard/thingsboard
This commit is contained in:
commit
5db6a186c4
@ -32,6 +32,7 @@ import org.thingsboard.server.actors.rpc.RpcManagerActor;
|
|||||||
import org.thingsboard.server.actors.rpc.RpcSessionCreateRequestMsg;
|
import org.thingsboard.server.actors.rpc.RpcSessionCreateRequestMsg;
|
||||||
import org.thingsboard.server.actors.session.SessionManagerActor;
|
import org.thingsboard.server.actors.session.SessionManagerActor;
|
||||||
import org.thingsboard.server.actors.stats.StatsActor;
|
import org.thingsboard.server.actors.stats.StatsActor;
|
||||||
|
import org.thingsboard.server.common.data.Device;
|
||||||
import org.thingsboard.server.common.data.id.DeviceId;
|
import org.thingsboard.server.common.data.id.DeviceId;
|
||||||
import org.thingsboard.server.common.data.id.EntityId;
|
import org.thingsboard.server.common.data.id.EntityId;
|
||||||
import org.thingsboard.server.common.data.id.TenantId;
|
import org.thingsboard.server.common.data.id.TenantId;
|
||||||
@ -48,6 +49,7 @@ import org.thingsboard.server.gen.cluster.ClusterAPIProtos;
|
|||||||
import org.thingsboard.server.service.cluster.discovery.DiscoveryService;
|
import org.thingsboard.server.service.cluster.discovery.DiscoveryService;
|
||||||
import org.thingsboard.server.service.cluster.discovery.ServerInstance;
|
import org.thingsboard.server.service.cluster.discovery.ServerInstance;
|
||||||
import org.thingsboard.server.service.cluster.rpc.ClusterRpcService;
|
import org.thingsboard.server.service.cluster.rpc.ClusterRpcService;
|
||||||
|
import org.thingsboard.server.service.state.DeviceStateService;
|
||||||
import scala.concurrent.Await;
|
import scala.concurrent.Await;
|
||||||
import scala.concurrent.Future;
|
import scala.concurrent.Future;
|
||||||
import scala.concurrent.duration.Duration;
|
import scala.concurrent.duration.Duration;
|
||||||
@ -81,6 +83,9 @@ public class DefaultActorService implements ActorService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DiscoveryService discoveryService;
|
private DiscoveryService discoveryService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DeviceStateService deviceStateService;
|
||||||
|
|
||||||
private ActorSystem system;
|
private ActorSystem system;
|
||||||
|
|
||||||
private ActorRef appActor;
|
private ActorRef appActor;
|
||||||
@ -254,4 +259,8 @@ public class DefaultActorService implements ActorService {
|
|||||||
rpcManagerActor.tell(msg, ActorRef.noSender());
|
rpcManagerActor.tell(msg, ActorRef.noSender());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDeviceAdded(Device device) {
|
||||||
|
deviceStateService.onDeviceAdded(device);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,11 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.thingsboard.server.common.transport;
|
package org.thingsboard.server.common.transport;
|
||||||
|
|
||||||
import org.thingsboard.server.common.data.security.DeviceCredentialsFilter;
|
import org.thingsboard.server.common.data.Device;
|
||||||
import org.thingsboard.server.common.msg.aware.SessionAwareMsg;
|
import org.thingsboard.server.common.msg.aware.SessionAwareMsg;
|
||||||
|
|
||||||
public interface SessionMsgProcessor {
|
public interface SessionMsgProcessor {
|
||||||
|
|
||||||
void process(SessionAwareMsg msg);
|
void process(SessionAwareMsg msg);
|
||||||
|
|
||||||
|
void onDeviceAdded(Device device);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,9 +67,9 @@ public abstract class AbstractCassandraCluster {
|
|||||||
private long initTimeout;
|
private long initTimeout;
|
||||||
@Value("${cassandra.init_retry_interval_ms}")
|
@Value("${cassandra.init_retry_interval_ms}")
|
||||||
private long initRetryInterval;
|
private long initRetryInterval;
|
||||||
@Value("${cassandra.max_requests_per_connection_local:128}")
|
@Value("${cassandra.max_requests_per_connection_local:32768}")
|
||||||
private int max_requests_local;
|
private int max_requests_local;
|
||||||
@Value("${cassandra.max_requests_per_connection_remote:128}")
|
@Value("${cassandra.max_requests_per_connection_remote:32768}")
|
||||||
private int max_requests_remote;
|
private int max_requests_remote;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@ -130,6 +130,13 @@ public class CoapServerTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDeviceAdded(Device device) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -92,6 +92,7 @@ public class GatewaySessionCtx {
|
|||||||
device.setType(deviceType);
|
device.setType(deviceType);
|
||||||
device = deviceService.saveDevice(device);
|
device = deviceService.saveDevice(device);
|
||||||
relationService.saveRelationAsync(new EntityRelation(gateway.getId(), device.getId(), "Created"));
|
relationService.saveRelationAsync(new EntityRelation(gateway.getId(), device.getId(), "Created"));
|
||||||
|
processor.onDeviceAdded(device);
|
||||||
}
|
}
|
||||||
GatewayDeviceSessionCtx ctx = new GatewayDeviceSessionCtx(this, device);
|
GatewayDeviceSessionCtx ctx = new GatewayDeviceSessionCtx(this, device);
|
||||||
devices.put(deviceName, ctx);
|
devices.put(deviceName, ctx);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user