diff --git a/elections-ejb/src/main/java/net/lacnic/elections/ejb/impl/ElectionsManagerEJBBean.java b/elections-ejb/src/main/java/net/lacnic/elections/ejb/impl/ElectionsManagerEJBBean.java index 8a55467..fb98858 100644 --- a/elections-ejb/src/main/java/net/lacnic/elections/ejb/impl/ElectionsManagerEJBBean.java +++ b/elections-ejb/src/main/java/net/lacnic/elections/ejb/impl/ElectionsManagerEJBBean.java @@ -80,13 +80,15 @@ public ElectionsManagerEJBBean() { } /** - * Logs an user to the application and persists audit information in the activity table + * Logs an user to the application and persists audit information in the + * activity table * * @param userAdminId Login id * @param password User password * @param ip Ip of the user login in * - * @return returns a UserAdmin entity if the id and password exists and null otherwise. + * @return returns a UserAdmin entity if the id and password exists and null + * otherwise. */ @Override public UserAdmin userAdminLogin(String userAdminId, String password, String ip) { @@ -120,7 +122,8 @@ public List getUserAdminsAll() { * * @param userAdminId The id of the user needed * - * @return returns an UserAdmin entity containing the information of the user id if found or null if it does not exists + * @return returns an UserAdmin entity containing the information of the user id + * if found or null if it does not exists */ @Override public UserAdmin getUserAdmin(String userAdminId) { @@ -134,21 +137,33 @@ public UserAdmin getUserAdmin(String userAdminId) { * * @return returns true if the captcha is valid, false if it is not */ + private boolean parseCaptchaResponse(String response) { + JsonReader jsonReader = Json.createReader(new StringReader(response)); + try { + JsonObject jsonObject = jsonReader.readObject(); + appLogger.info(jsonObject.getBoolean("success")); + return jsonObject.getBoolean("success"); + } catch (Exception e) { + appLogger.error("Error parsing JSON response", e); + return false; + } finally { + jsonReader.close(); + } + } + @Override public boolean isValidCaptchaResponse(String reCaptchaResponse) { - try (CloseableHttpClient httpClient = HttpClients.createDefault();) { - appLogger.info("start verifying ..."); - appLogger.info("reCAPTCHA response value : " + reCaptchaResponse); + appLogger.info("Start verifying reCAPTCHA response"); + appLogger.info("reCAPTCHA response value: " + reCaptchaResponse); String skGoogleApiReCaptcha = EJBFactory.getInstance().getElectionsParametersEJB().getParameter(Constants.SK_GOOGLE_API_RECAPTCHA); String checkURL = "https://www.google.com/recaptcha/api/siteverify" + "?secret=" + skGoogleApiReCaptcha + "&response=" + reCaptchaResponse; - appLogger.info("check URL : " + checkURL); + appLogger.info("Check URL: " + checkURL); HttpPost post = new HttpPost("https://www.google.com/recaptcha/api/siteverify"); - // add headerype post.setHeader("User-Agent", "Mozilla/5.0"); List urlParameters = new ArrayList<>(); @@ -159,31 +174,22 @@ public boolean isValidCaptchaResponse(String reCaptchaResponse) { HttpResponse httpClientResponse = httpClient.execute(post); - appLogger.info("\nSending 'POST' request to URL : https://www.google.com/recaptcha/api/siteverify"); - appLogger.info("Post parameters : " + post.getEntity()); - appLogger.info("Response Code : " + httpClientResponse.getStatusLine().getStatusCode()); + appLogger.info("Sending 'POST' request to URL: https://www.google.com/recaptcha/api/siteverify"); + appLogger.info("Post parameters: " + post.getEntity()); + appLogger.info("Response Code: " + httpClientResponse.getStatusLine().getStatusCode()); BufferedReader bufferReader = new BufferedReader(new InputStreamReader(httpClientResponse.getEntity().getContent())); StringBuilder result = new StringBuilder(); - String line = ""; + String line; while ((line = bufferReader.readLine()) != null) { result.append(line); } - JsonReader jsonReader = Json.createReader(new StringReader(result.toString())); - try { - JsonObject jsonObject = jsonReader.readObject(); - appLogger.info(jsonObject.getBoolean("success")); - return jsonObject.getBoolean("success"); - } catch (Exception e) { - appLogger.error(e); - return false; - } finally { - jsonReader.close(); - } + return parseCaptchaResponse(result.toString()); + } catch (Exception e) { - appLogger.error(e); + appLogger.error("Error verifying reCAPTCHA response", e); return false; } } @@ -250,12 +256,15 @@ else if (election.isRandomOrderCandidates()) { } /** - * Deletes an election removing all its related resources (admins, auditors, candidates, emails, votes and user voters) + * Deletes an election removing all its related resources (admins, auditors, + * candidates, emails, votes and user voters) * * @param electionId identifier of the election * @param electionTitle title of the election used for logging purposes - * @param userAdminId id of the user deleting the election, used for logging purposes - * @param ip ip of the user deleting the election, used for logging purposes + * @param userAdminId id of the user deleting the election, used for logging + * purposes + * @param ip ip of the user deleting the election, used for logging + * purposes */ @Override public void removeElection(long electionId, String electionTitle, String userAdminId, String ip) throws ElectionException { @@ -327,7 +336,8 @@ public UserVoter getUserVoter(long userVoterId) { /** * Updates or creates (if it does not exists) an election * - * @param election An election entity with the information to update the election. + * @param election An election entity with the information to update the + * election. * @param userAdminId Id of the user, used for logging purposes * @param ip Ip of the user, used for logging purposes * @@ -425,7 +435,8 @@ public void setAuditLinkStatus(Long electionId, Boolean status, String userAdmin /** * Gets all the commissioners from the system. * - * @return returns a list of commissioner entity containing all the commissioners in the system. + * @return returns a list of commissioner entity containing all the + * commissioners in the system. */ @Override @@ -438,8 +449,10 @@ public List getCommissionersAll() { * * @param userVoter Entity containing the information of the voter * @param electionTitle Title of the election used for logging purposes - * @param userAdminId Identifier of the user performing the action used for logging purposes - * @param ip Ip of the user performing the action, used for logging purposes + * @param userAdminId Identifier of the user performing the action used for + * logging purposes + * @param ip Ip of the user performing the action, used for logging + * purposes */ @Override public void removeUserVoter(UserVoter userVoter, String electionTitle, String userAdminId, String ip) { @@ -459,7 +472,8 @@ public void removeUserVoter(UserVoter userVoter, String electionTitle, String us /** * Gets all the activity log of the system. * - * @return returns a list of activity entity which contains all the activities on the system + * @return returns a list of activity entity which contains all the activities + * on the system */ @Override public List getActivitiesAll() { @@ -471,7 +485,8 @@ public List getActivitiesAll() { * * @param electionId Identifier of the election * - * @return returns a list of activity entity which contains all the activities of the election. + * @return returns a list of activity entity which contains all the activities + * of the election. */ @Override public List getElectionActivities(long electionId) { @@ -483,7 +498,8 @@ public List getElectionActivities(long electionId) { * * @param electionId Identifier of the election * - * @return returns a list of uservoter entity which contains the voters of the election. + * @return returns a list of uservoter entity which contains the voters of the + * election. */ @Override public List getElectionUserVoters(long electionId) { @@ -496,8 +512,10 @@ public List getElectionUserVoters(long electionId) { * @param userVoterId Identifier of the voter * * @param electionTitle Title of the election used for logging purposes - * @param userAdminId Identifier of the user performing the action used for logging purposes - * @param ip Ip of the user performing the action, used for logging purposes + * @param userAdminId Identifier of the user performing the action used for + * logging purposes + * @param ip Ip of the user performing the action, used for logging + * purposes * * */ @@ -514,8 +532,10 @@ public void updateUserVoterToken(long userVoterId, String name, String electionT * Deletes a user admin from the system. * * @param userAdminToDeleteId Identifier of the user to be deleted - * @param userAdminId Identifier of the user performing the action used for logging purposes - * @param ip Ip of the user performing the action, used for logging purposes + * @param userAdminId Identifier of the user performing the action used + * for logging purposes + * @param ip Ip of the user performing the action, used for + * logging purposes */ @Override public void removeUserAdmin(String userAdminToDeleteId, String userAdminId, String ip) { @@ -530,8 +550,10 @@ public void removeUserAdmin(String userAdminToDeleteId, String userAdminId, Stri * * @param electionId Identifier of the election * @param content Excel file containing the voters to upload - * @param userAdminId Identifier of the user performing the action used for logging purposes - * @param ip Ip of the user performing the action, used for logging purposes + * @param userAdminId Identifier of the user performing the action used for + * logging purposes + * @param ip Ip of the user performing the action, used for logging + * purposes */ @Override public void updateElectionCensus(String contentType, long electionId, byte[] content, String userAdminId, String ip) throws CensusValidationException { @@ -576,8 +598,10 @@ public List getElectionsLightThisYear() { * * @param electionId Identifier of the election * @param userVoter Entity containing the voter information. - * @param userAdminId Identifier of the user performing the action used for logging purposes - * @param ip Ip of the user performing the action, used for logging purposes + * @param userAdminId Identifier of the user performing the action used for + * logging purposes + * @param ip Ip of the user performing the action, used for logging + * purposes * * @return returns true if the operation succeeds * @@ -605,8 +629,10 @@ public boolean addUserVoter(long electionId, UserVoter userVoter, String userAdm * Updates the information of a voter. * * @param userVoter entity with the voter information - * @param userAdminId Identifier of the user performing the action used for logging purposes - * @param ip Ip of the user performing the action, used for logging purposes + * @param userAdminId Identifier of the user performing the action used for + * logging purposes + * @param ip Ip of the user performing the action, used for logging + * purposes * */ @Override @@ -627,7 +653,8 @@ public void editUserVoter(UserVoter userVoter, String userAdminId, String ip) th * * @param electionId Identifier of the election * - * @return returns a list of election email template entity containing the information. + * @return returns a list of election email template entity containing the + * information. */ @Override public List getElectionEmailTemplates(long electionId) { @@ -702,11 +729,13 @@ public ElectionEmailTemplate getEmailTemplate(String templateType, long election } /** - * Updates the information of an admin user, including giving him/her privileges over a particular election + * Updates the information of an admin user, including giving him/her privileges + * over a particular election * * @param userAdmin Entity with the information of the user. * @param email Original email of the user - * @param authorizedElectionId Identifier of the election that user will have authorization + * @param authorizedElectionId Identifier of the election that user will have + * authorization * @param userAdminId Id of the user, used for logging purposes * @param ip Ip of the user, used for logging purposes */ @@ -771,7 +800,8 @@ public void editAdminUserPassword(String userAdminToUpdateId, String password, S * Creates a new admin user * * @param userAdmin Entity with the information of the new user. - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes */ @Override @@ -801,7 +831,8 @@ public boolean addUserAdmin(UserAdmin userAdmin, String userAdminId, String ip) * * @param electionId Identifier of the election * @param candidate Entity with the information of the new candidate - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes */ @Override @@ -821,7 +852,8 @@ public void addCandidate(long electionId, Candidate candidate, String userAdminI * Deletes a candidate * * @param candidateId Identifier of the candidate - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes */ @Override @@ -852,7 +884,8 @@ public Candidate getCandidate(long candidateId) { * Updates the information of a candidate * * @param candidateId Identifier of the candidate - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes */ @Override @@ -871,8 +904,10 @@ public void editCandidate(Candidate candidate, String userAdminId, String ip) { * * @param electionId Identifier of the election * @param auditor Entity containing the auditor information - * @param electionTitle Title of the election where the auditor will be added, used for logging purposes - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param electionTitle Title of the election where the auditor will be added, + * used for logging purposes + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes */ @Override @@ -888,7 +923,8 @@ public void addAuditor(long electionId, Auditor auditor, String electionTitle, S * Deletes an auditor * * @param auditorId identifier of the auditor - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes */ @Override @@ -915,7 +951,8 @@ public Auditor getAuditor(long auditorId) { * Updates an auditor information * * @param auditor Entity containing the auditor information - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes */ @Override @@ -934,7 +971,8 @@ public void editAuditor(Auditor auditor, String userAdminId, String ip) { * * @param electionId Identifier of the election * @param electionTitle Title of the election, used for logging purposes - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes */ @Override @@ -953,7 +991,8 @@ public void persistElectionAuditorsSet(long electionId, String electionTitle, St /** * Gets a list with all the parameters * - * @return returns a list of parameter entity with all the parameters on the system. + * @return returns a list of parameter entity with all the parameters on the + * system. */ @Override public List getParametersAll() { @@ -975,7 +1014,8 @@ public List getAllDisabledIPs() { * * @param key Parameter key. * @param value Value of the parameter. - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes */ @Override @@ -993,7 +1033,8 @@ public boolean addParameter(String key, String value, String userAdminId, String * Edit the value of a parameter * * @param parameter entity with the parameter to update and the new value - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes */ @Override @@ -1011,7 +1052,8 @@ public void editParameter(Parameter parameter, String userAdminId, String ip) { * Deletes a parameter from the system. * * @param key Key of the parameter to delete - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes */ @Override @@ -1027,11 +1069,15 @@ public void removeParameter(String key, String userAdminId, String ip) { } /** - * Get list of the recipients an email template. Depending on the template it can be a list of voters or auditors + * Get list of the recipients an email template. Depending on the template it + * can be a list of voters or auditors * - * @param electionEmailTemplate Entity of the email template with the information of the email template to get the recipients + * @param electionEmailTemplate Entity of the email template with the + * information of the email template to get the + * recipients * - * @return returns a list, it may be of voters entity or auditors entity depending on the email template. + * @return returns a list, it may be of voters entity or auditors entity + * depending on the email template. */ @Override public List getRecipientsByRecipientType(ElectionEmailTemplate electionEmailTemplate) throws ElectionException { @@ -1121,7 +1167,9 @@ public List getRecipientsByRecipientType(ElectionEmailTemplate electionEmailTemp } /** - * Creates email templates for all the elections. It iterates the election and for every election it iterated the templates and for each template it creates an email template linked to the election + * Creates email templates for all the elections. It iterates the election and + * for every election it iterated the templates and for each template it creates + * an email template linked to the election * * @return returns the number of template created. */ @@ -1145,10 +1193,13 @@ public Integer createMissingEmailTemplates() { } /** - * Sends emails to the list of voters/auditor using an email template, also creates the information on the mail table. + * Sends emails to the list of voters/auditor using an email template, also + * creates the information on the mail table. * - * @param users List of voter or auditor entity with the recipients of the email - * @param electionEmailTemplate Entity with the information of the election and email template. + * @param users List of voter or auditor entity with the + * recipients of the email + * @param electionEmailTemplate Entity with the information of the election and + * email template. */ @Override public void queueMassiveSending(List users, ElectionEmailTemplate electionEmailTemplate) { @@ -1204,7 +1255,8 @@ public void fixCandidateToBottom(long candidateId) { } /** - * Moves a candidate up in the order, by switching the order with the candidate immediate above. + * Moves a candidate up in the order, by switching the order with the candidate + * immediate above. * * @param candidateId Identifier of the candidate. */ @@ -1224,7 +1276,8 @@ public void moveCandidateUp(long candidateId) { } /** - * Moves a candidate down in the order, by switching the order with the candidate immediate below. + * Moves a candidate down in the order, by switching the order with the + * candidate immediate below. * * @param candidateId Identifier of the candidate. */ @@ -1244,10 +1297,12 @@ public void moveCandidateDown(long candidateId) { } /** - * Enables/Disables the random order attribute so as to order the candidates randomly or not + * Enables/Disables the random order attribute so as to order the candidates + * randomly or not * * @param electionId Identifier of the election - * @param value Boolean value to be set, true for the order to be random, false to leave the order defined. + * @param value Boolean value to be set, true for the order to be random, + * false to leave the order defined. */ @Override public void setSortCandidatesRandomly(Long electionId, Boolean value) { @@ -1321,10 +1376,12 @@ public Commissioner getCommissioner(long commissionerId) { * * @param name Name of the commissioner * @param mail Mail of the commissioner - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes * - * @return returns true if the commissioner was correctly added, false if the mail was null or an exception is thrown. + * @return returns true if the commissioner was correctly added, false if the + * mail was null or an exception is thrown. */ @Override public boolean addCommissioner(String name, String mail, String userAdminId, String ip) { @@ -1351,7 +1408,8 @@ public boolean addCommissioner(String name, String mail, String userAdminId, Str * * @param commissionerId Identifier of the commissioner. * @param name Name of the commissioner, used for logging purposes - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes */ @Override @@ -1365,8 +1423,10 @@ public void removeCommissioner(long commissionerId, String name, String userAdmi /** * Updated the information of a commissioner * - * @param commissioner Entity containing the information of the commissioner to be updated. - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param commissioner Entity containing the information of the commissioner to + * be updated. + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes */ @Override @@ -1408,11 +1468,13 @@ public void createElectionEmailTemplates(Election election) { } /** - * Resends a voter the election started and election created mails using the templates defined for the election. + * Resends a voter the election started and election created mails using the + * templates defined for the election. * * @param userVoter Entity with the voter information * @param election Entity with the election information - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes */ @Override @@ -1455,11 +1517,14 @@ public Parameter getParameter(String key) { } /** - * Enables/Disables the revision flag for an election, also, if the revision is disabled, it updates the elections auditor to disable the revision. + * Enables/Disables the revision flag for an election, also, if the revision is + * disabled, it updates the elections auditor to disable the revision. * * @param electionId Identifier of the election - * @param status The value of the revision status, true - enabled, false - disabled - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param status The value of the revision status, true - enabled, false - + * disabled + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes */ @Override @@ -1506,10 +1571,12 @@ public List getElectionVotes(Long electionId) { * Validates if an election has the revision active * * @param electionId Identifier of the election - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes * - * @return returns true if the election has the revision active and all the auditors too, false otherwise. + * @return returns true if the election has the revision active and all the + * auditors too, false otherwise. */ @Override public boolean isRevisionActive(long electionId, String userAdminId, String ip) { @@ -1531,9 +1598,11 @@ public boolean isRevisionActive(long electionId, String userAdminId, String ip) /** * Returns the candidate orderer immediately above the parameter * - * @param candidate Entity with the candidate from which the immediately above will be looked. + * @param candidate Entity with the candidate from which the immediately above + * will be looked. * - * @return returns a candidate entity with the information with the candidate ordered immediately above to the one passed, null if there's none. + * @return returns a candidate entity with the information with the candidate + * ordered immediately above to the one passed, null if there's none. */ @Override public Candidate getNextAboveCandidate(Candidate candidate) { @@ -1543,9 +1612,11 @@ public Candidate getNextAboveCandidate(Candidate candidate) { /** * Returns the candidate orderer immediately below the parameter * - * @param candidate Entity with the candidate from which the immediately below will be looked. + * @param candidate Entity with the candidate from which the immediately below + * will be looked. * - * @return returns a candidate entity with the information with the candidate ordered immediately below to the one passed, null if there's none. + * @return returns a candidate entity with the information with the candidate + * ordered immediately below to the one passed, null if there's none. */ @Override public Candidate getNextBelowCandidate(Candidate candidate) { @@ -1558,7 +1629,8 @@ public Candidate getNextBelowCandidate(Candidate candidate) { * @param name Name of the searched commissioner * @param mail Mail of the searched commissioner * - * @return returns true if a commissioner with the name and mail exists, false if not + * @return returns true if a commissioner with the name and mail exists, false + * if not */ @Override public boolean commissionerExists(String name, String mail) { @@ -1572,7 +1644,8 @@ public boolean commissionerExists(String name, String mail) { * @param name Name of the searched auditor * @param mail Mail of the searched auditor * - * @return returns true if there is an auditor with the name and mail associated to the election, false if not. + * @return returns true if there is an auditor with the name and mail associated + * to the election, false if not. */ @Override public boolean auditorExists(long electionId, String name, String mail) { @@ -1603,7 +1676,8 @@ public String getDefaultWebsite() { * Adds or updates a base email template * * @param electionEmailTemplate Entity with the email template - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param userAdminId Id of the user performing the action, used for + * logging purposes * @param ip Ip of the user, used for logging purposes * * @return returns true if la operation succeeds or false if there's an error @@ -1625,7 +1699,8 @@ public boolean createBaseEmailTemplate(ElectionEmailTemplate electionEmailTempla /** * Get a list of the the joint elections on the system. * - * @return returns a collection of joint election entity containing the information. + * @return returns a collection of joint election entity containing the + * information. */ @Override public List getJointElectionsAll() { @@ -1637,7 +1712,8 @@ public List getJointElectionsAll() { * * @param electionId Identifier of an election searched * - * @return returns a joint election entity on which one of the elections is the one searched by or null if it does not find it. + * @return returns a joint election entity on which one of the elections is the + * one searched by or null if it does not find it. */ @Override public JointElection getJointElectionForElection(long electionId) { @@ -1647,7 +1723,8 @@ public JointElection getJointElectionForElection(long electionId) { /** * Creates or update (an existing) joint election. * - * @param jointElection Entity containing the joint election information to be add/updated + * @param jointElection Entity containing the joint election information to be + * add/updated */ @Override public void updateJointElection(JointElection jointElection) { @@ -1670,7 +1747,8 @@ public void removeJointElection(JointElection jointElection) { * * @param electionId Identifier of the election searched. * - * @return returns true if the election searched is joint with another, false if not. + * @return returns true if the election searched is joint with another, false if + * not. */ @Override public boolean isJointElection(long electionId) { @@ -1678,9 +1756,11 @@ public boolean isJointElection(long electionId) { } /** - * Validates if the census of both elections in a joint election contains the same voters + * Validates if the census of both elections in a joint election contains the + * same voters * - * @param jointElection Entity with the joint election information (contains two elections) + * @param jointElection Entity with the joint election information (contains two + * elections) * * @return returns true if both census are the same, false if they differ. */ @@ -1692,7 +1772,8 @@ public boolean electionsCensusEqual(JointElection jointElection) { /** * Gets a list with the identifier and title of all the system's elections * - * @return reutns a collection of string, on each string containing the id and title of the elections. + * @return reutns a collection of string, on each string containing the id and + * title of the elections. */ @Override public List getElectionsAllIdAndTitle() { @@ -1739,7 +1820,8 @@ public boolean updateCustomization(Customization customization) { * @param userAdminId Identifier of the user who performs the activity * @param activityType Enumerate containing the type of the activity * @param description A string with the description of the activity - * @param ip A string with the ip address of the user performing the activity + * @param ip A string with the ip address of the user performing the + * activity * @param electionId Identifier of the election. */ @Override @@ -1798,7 +1880,8 @@ public boolean electionCanBeClosed(long electionId) { * * @param electionId Identifier of the election searched. * - * @param userAdminId Id of the user performing the action, used for logging purposes + * @param userAdminId Id of the user performing the action, used for logging + * purposes * @param ip Ip of the user, used for logging purposes * * @return returns true if the operation succeeds or false if there's an error