Commit e9e1c6fc authored by Cristina Cocho's avatar Cristina Cocho

Added setConfigurationMode

parent a413aa55
......@@ -374,7 +374,17 @@ public class ServantManagerAccessor {
Common.ServantDeleteResponse response;
try {
response = Common.ServantDeleteResponse.parseFrom(servantManagerRequester.receive());
if(response.hasError()) {
// Retrieve data about not configured servants
for (UnconfiguredServantData servantData : response.getUnconfiguredServantDataList()) {
int unconfiguredServantID = servantData.getUnconfiguredServantID();
List<String> unconfiguredReferencesRoles = servantData.getRoleOfUnconfiguredReferenceList();
// Update ServantDatabase content
unconfigureControllerReferences(unconfiguredServantID, unconfiguredReferencesRoles);
}
if (response.hasError()) {
// Add the error in the list.
removedDriverIds.add(ERROR);
}
......@@ -518,6 +528,19 @@ public class ServantManagerAccessor {
servantManagerRequester.receive();
}
public void setConfigurationMode(boolean mode) {
// Create the message type
ServantManagerRequest.Message messageType = ServantManagerRequest.Message.newBuilder().setType(ServantManagerRequest.Message.Type.SetConfigurationMode).build();
// Create the request
ServantManagerRequest.SetConfigurationModeRequest request = ServantManagerRequest.SetConfigurationModeRequest.newBuilder().setMode(mode).build();
servantManagerRequester.sendTwoParts(messageType.toByteArray(), request.toByteArray());
// Get response even if we do not treat it
servantManagerRequester.receive();
}
public String setServantName(int servantID, String servantName) {
// Create the message type
ServantManagerRequest.Message messageType = ServantManagerRequest.Message.newBuilder().setType(ServantManagerRequest.Message.Type.SetServantName).build();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment