Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
feat(feedback): send status for task id on password minimum lower case
Browse files Browse the repository at this point in the history
Signed-off-by: Rafa Hernandez <rhernandez@teclib.com>
  • Loading branch information
rafaelje authored and ajsb85 committed Mar 26, 2018
1 parent 7eea147 commit cee3fae
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Expand Up @@ -515,11 +515,8 @@ public void messageArrived(String topic, MqttMessage message) throws Exception {
int minimum = jsonObj.getInt(PASSWORD_MIN_LOWERCASE);
String taskId = jsonObj.getString("taskId");

// return the status of the task
policiesController.sendTaskStatus(taskId, FEEDBACK_RECEIVED);

// execute the policy
policiesController.passwordMinLowerCase(minimum);
policiesController.passwordMinLowerCase(taskId, minimum);
}
} catch (Exception ex) {
FlyveLog.e(ex.getMessage());
Expand Down
Expand Up @@ -600,10 +600,20 @@ public void passwordMinSymbols(int minimum) {
broadcastReceivedLog(Helpers.broadCastMessage(MQTT_SEND, "passwordMinSymbols", String.valueOf(minimum)));
}

public void passwordMinLowerCase(int minimum) {
PoliciesDeviceManager mdm = new PoliciesDeviceManager(this.context);
mdm.setPasswordMinimumLowerCase(minimum);
broadcastReceivedLog(Helpers.broadCastMessage(MQTT_SEND, "passwordMinLowerCase", String.valueOf(minimum)));
public void passwordMinLowerCase(String taskId, int minimum) {
try {
PoliciesDeviceManager mdm = new PoliciesDeviceManager(this.context);
mdm.setPasswordMinimumLowerCase(minimum);
broadcastReceivedLog(Helpers.broadCastMessage(MQTT_SEND, "passwordMinLowerCase", String.valueOf(minimum)));

// return the status of the task
sendTaskStatus(taskId, FEEDBACK_DONE);
} catch (Exception ex) {
FlyveLog.e(ex.getMessage());

// return the status of the task
sendTaskStatus(taskId, FEEDBACK_FAILED);
}
}

public void passwordMinUpperCase(int minimum) {
Expand Down

0 comments on commit cee3fae

Please sign in to comment.