class AddUserTask extends Task {

	@Override
	public void execute(final ImmutableMultimap<String, String> args, final PrintWriter printer) throws AuthenticationException {
		printer.println("Adding/update credentials ...");
        final DbCredential credential = new DbCredential();
		credential.setUser(args.get(ServerAPI.USER_PARAM).asList().get(0));
		credential.setPassword(GrapesAuthenticator.encrypt(args.get(ServerAPI.PASSWORD_PARAM).asList().get(0)));
        
        if(!credential.isHealthy()){
            printer.println("ERROR: Bad request! The provided credential are unhealthy or incomplete.");
            return;
        }
        
		repoHandler.store(credential);

		printer.println("Task performed successfully.");
	}

	public  AddUserTask(final RepositoryHandler repoHandler);

}