Changeset 6024


Ignore:
Timestamp:
02/23/15 16:28:19 (9 years ago)
Author:
olhsha@mpi.nl
Message:

Javadocs are updated for PrincipalResource? and AnnotationResource?, + very minor correction for retrieval of annotations for notebooks.

Location:
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AnnotationResource.java

    r6009 r6024  
    7272   /**
    7373    *
    74     * @param httpServletResponse a {@link HttpServletResponse} object, to be set to "this" object and to be used to send error messages.
     74    * @param httpServletResponse a {@link HttpServletResponse} object, setting us used in unit tests.
    7575    */
    7676    public void setHttpServletResponse(HttpServletResponse httpServletResponse) {
     
    8080    /**
    8181     *
    82      * @param httpServletRequest a {@link HttpServletRequest} object, to be set to "this" object and to be used in the unit tests.
     82     * @param httpServletRequest a {@link HttpServletRequest} object, setting is used in the unit tests.
    8383     */
    8484    public void setHttpServletRequest(HttpServletRequest httpServletRequest) {
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/PrincipalResource.java

    r5850 r6024  
    6363    int shaStrength = 512;
    6464
     65   
     66    /**
     67     *
     68     * @param request a {@link HttpServletRequest} object; set object is used in unit tests.
     69     */
    6570    public void setHttpRequest(HttpServletRequest request) {
    6671        this.httpServletRequest = request;
     
    7075    }
    7176
     77    /**
     78     *
     79     * @param externalIdentifier the external UUID of a principal.
     80     * @return the {@link Principal} element representing the principal object with the "externalIdentifier".
     81     * @throws IOException is sending the error fails.
     82     */
    7283    @GET
    7384    @Produces(MediaType.TEXT_XML)
     
    98109    }
    99110
    100     /////////////////////////////////
     111    /**
     112     *
     113     * @return a message containing the fill name and the e-mail of the admin.
     114     * @throws IOException if sending the error in the call of "this.getPrincipalID()".
     115     */
    101116    @GET
    102117    @Produces(MediaType.TEXT_PLAIN)
     
    111126    }
    112127
    113     /////////////////////////////////////////
     128   /**
     129    *
     130    * @param email a string representing the e-mail of a principal.
     131    * @return a {@link Principal} representing the principal with the "email",
     132    * if such a principal is found; otherwise "SC_NOT_FOUND" error is sent.
     133    * @throws IOException if sending the error fails.
     134    */
    114135    @GET
    115136    @Produces(MediaType.TEXT_XML)
     
    139160    }
    140161
    141     ////////////////////////////////////////
     162 
     163    /**
     164     *
     165     * @param externalIdentifier the external UUID of a principal.
     166     * @return a {@link CurrentPrincipalInfo} element containing "true" if the principal
     167     * with externalIdentifier is logged-in in this session;
     168     * withe the current implementation does not make that much sense for me,
     169     * because the logged-in user knows his/her externalIDdentifier and knows that the other UUIDs
     170     * will be "not logged in", and therefore "false" is expected,
     171     * @throws IOException if sending the error fails.
     172     */
    142173    @GET
    143174    @Produces(MediaType.TEXT_XML)
     
    223254//
    224255//    }
    225     /////////////////////////////////////
     256    /**
     257     *
     258     * @param name the name of the principal to be registered as a basic-authentication user.
     259     * @param remoteId the  remote id of the principal to be registered.
     260     * @param password the password selected by the principal to be registered.
     261     * @param email an email of the principal to be registered.
     262     * @return a @Link Principal} element representing the just registered principal.
     263     * @throws IOException if sending the error fails.
     264     */
    226265    @POST
    227266    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
     
    267306    }
    268307
    269     ///////////////////////////////////////////////
     308    /**
     309     *
     310     * @param name the name of the principal to be registered
     311     * @param remoteId the remote shibboleth id.
     312     * @param email the email.
     313     * @return a @Link Principal} element representing the just registered principal.
     314     * @throws IOException if sending the error fails.
     315     */
    270316    @POST
    271317    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
     
    304350    }
    305351
    306     ///////////////////////////////////////////////////
     352    /**
     353     * It is of a good convenience method limiting proliferation of user profiles, however
     354     * the method is currently not used till security issues will be discussed with the LAT
     355     * system administrators.
     356     * @param remoteId a shibboleth remote id, which will be set as a basic-authentication remote id as well.
     357     * @param password a shibboleth password which will be set as a basic-authentication password.
     358     * @return a message about amount of records; which must be 2 if everything goes well:
     359     * 1 record for the principal, another for the authorities table
     360     * @throws IOException if sending the error fails.
     361     */
    307362    @POST
    308363    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
     
    320375        }
    321376    }
    322 
     377   
     378    /**
     379     *
     380     * @param principal a {@link Principal} object representing new information (name, e-mail) about the principal
     381     * with the eternal UUID given in the object,
     382     * @return a @Link Principal} element representing the just updated principal.
     383     * @throws IOException if sending the error message fails.
     384     */
    323385    @PUT
    324386    @Consumes(MediaType.APPLICATION_XML)
     
    351413    /////////////////////////////////
    352414
    353     // logged in user can update his/her account
    354     // or account can be updated by the admin in a separate request, see above
     415    /**
     416     *
     417     * @param name a new full name.
     418     * @param email a new email
     419     * @return a @Link Principal} element representing the just updated principal.
     420     * @throws IOException if sending the error fails.
     421     * @throws NotInDataBaseException if the in-logged principal is not found in the database
     422     * or updated fails.
     423     */
    355424    @POST
    356425    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
     
    389458    }
    390459
    391     //////////////////////////////////////
     460   /**
     461    *
     462    * @param externalId the external UUID of a principal.
     463    * @param accountType an account type: "user", "developer", "admin".
     464    * @return a message telling if and how the account is updated; this action can be performed only by admin.
     465    * @throws IOException
     466    */
    392467    @PUT
    393468    @Produces(MediaType.TEXT_PLAIN)
     
    421496    }
    422497
     498    /**
     499     *
     500     * @param externalIdentifier the external UUID of a principal to be deleted.
     501     * @return a message informing if deletion has been successful; see "error" messages if deletion
     502     * has not taken place.
     503     * @throws IOException if sending error messages fails.
     504     */
    423505    @DELETE
    424506    @Path("{principalId}")
Note: See TracChangeset for help on using the changeset viewer.