Minor imrovements
This commit is contained in:
parent
27b4c99609
commit
afeca4cc59
@ -67,7 +67,7 @@ public class LwM2mSessionMsgListener implements GenericFutureListener<Future<? s
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onToTransportUpdateCredentials(ToTransportUpdateCredentialsProto updateCredentials) {
|
public void onToTransportUpdateCredentials(ToTransportUpdateCredentialsProto updateCredentials) {
|
||||||
this.handler.onToTransportUpdateCredentials(updateCredentials);
|
this.handler.onToTransportUpdateCredentials(sessionInfo, updateCredentials);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -56,4 +56,6 @@ public interface LwM2mClientContext {
|
|||||||
void registerClient(Registration registration, ValidateDeviceCredentialsResponse credentials);
|
void registerClient(Registration registration, ValidateDeviceCredentialsResponse credentials);
|
||||||
|
|
||||||
void update(LwM2mClient lwM2MClient);
|
void update(LwM2mClient lwM2MClient);
|
||||||
|
|
||||||
|
void removeCredentials(TransportProtos.SessionInfoProto sessionInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -228,6 +228,11 @@ public class LwM2mClientContextImpl implements LwM2mClientContext {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeCredentials(TransportProtos.SessionInfoProto sessionInfo) {
|
||||||
|
//TODO: implement
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<LwM2mClient> getLwM2mClients() {
|
public Collection<LwM2mClient> getLwM2mClients() {
|
||||||
return lwM2mClientsByEndpoint.values();
|
return lwM2mClientsByEndpoint.values();
|
||||||
|
|||||||
@ -132,7 +132,7 @@ public class DefaultLwM2mDownlinkMsgHandler extends LwM2MExecutorAwareService im
|
|||||||
log.info("[{}] Send observation: {}.", client.getEndpoint(), request.getVersionedId());
|
log.info("[{}] Send observation: {}.", client.getEndpoint(), request.getVersionedId());
|
||||||
sendRequest(client, downlink, request.getTimeout(), callback);
|
sendRequest(client, downlink, request.getTimeout(), callback);
|
||||||
} else {
|
} else {
|
||||||
callback.onError("Observation is already registered!", new RuntimeException());
|
callback.onValidationError(resultIds.toString(), "Observation is already registered!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -824,12 +824,13 @@ public class DefaultLwM2MUplinkMsgHandler extends LwM2MExecutorAwareService impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param sessionInfo
|
||||||
* @param updateCredentials - Credentials include config only security Client (without config attr/telemetry...)
|
* @param updateCredentials - Credentials include config only security Client (without config attr/telemetry...)
|
||||||
* config attr/telemetry... in profile
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onToTransportUpdateCredentials(TransportProtos.ToTransportUpdateCredentialsProto updateCredentials) {
|
public void onToTransportUpdateCredentials(SessionInfoProto sessionInfo, TransportProtos.ToTransportUpdateCredentialsProto updateCredentials) {
|
||||||
log.info("[{}] idList [{}] valueList updateCredentials", updateCredentials.getCredentialsIdList(), updateCredentials.getCredentialsValueList());
|
log.info("[{}] idList [{}] valueList updateCredentials", updateCredentials.getCredentialsIdList(), updateCredentials.getCredentialsValueList());
|
||||||
|
this.clientContext.removeCredentials(sessionInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -52,7 +52,7 @@ public interface LwM2mUplinkMsgHandler {
|
|||||||
|
|
||||||
void onWriteResponseOk(LwM2mClient client, String path, WriteRequest request);
|
void onWriteResponseOk(LwM2mClient client, String path, WriteRequest request);
|
||||||
|
|
||||||
void onToTransportUpdateCredentials(TransportProtos.ToTransportUpdateCredentialsProto updateCredentials);
|
void onToTransportUpdateCredentials(TransportProtos.SessionInfoProto sessionInfo, TransportProtos.ToTransportUpdateCredentialsProto updateCredentials);
|
||||||
|
|
||||||
LwM2MTransportServerConfig getConfig();
|
LwM2MTransportServerConfig getConfig();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user