Changeset 6044 for DASISH


Ignore:
Timestamp:
02/24/15 18:53:22 (9 years ago)
Author:
olhsha@mpi.nl
Message:

Revising javadoc is completed

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

Legend:

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

    r6038 r6044  
    2929import eu.dasish.annotation.schema.ObjectFactory;
    3030import eu.dasish.annotation.schema.Access;
     31import eu.dasish.annotation.schema.AnnotationInfo;
    3132import eu.dasish.annotation.schema.PermissionList;
    3233import eu.dasish.annotation.schema.ReferenceList;
     
    5960
    6061/**
    61  * REST class for GETting, POSTing, PUTting and DELETing annotations or their substructures (child elements);
    62  * Every REST method in the case of successful completion of its action outputs the declared output type
     62 * A REST class for GETting, POSTing, PUTting and DELETing annotations or their substructures (child elements).
     63 * Every REST method in the case of successful completion produces the object of the declared output type
    6364 * (a JAXB-element or a message string) or sends a HTTP-error with the corresponding diagnostics otherwise.
    6465 * @author olhsha
     
    7273    final private String[] admissibleMatchModes = {"exact", "starts_with", "ends_with", "contains"};
    7374
    74    /**
    75     *
    76     * @param httpServletResponse a {@link HttpServletResponse} object, setting us used in unit tests.
    77     */
    78     public void setHttpServletResponse(HttpServletResponse httpServletResponse) {
    79         this.httpServletResponse = httpServletResponse;
    80     }
    81    
    82     /**
    83      *
    84      * @param httpServletRequest a {@link HttpServletRequest} object, setting is used in the unit tests.
     75 
     76    /**
     77     *
     78     * @param httpServletRequest a {@link HttpServletRequest} object; set explicitely in the unit tests.
    8579     */
    8680    public void setHttpServletRequest(HttpServletRequest httpServletRequest) {
     
    9084    /**
    9185     *
    92      * @param providers a {@link Providers} object, to be set to "this" object and to be used to force
    93      * validation of the input/output xml files w.r.t. the dasish schema.
     86     * @param providers a {@link Providers} object, used by JAXB, also
     87     * to validate input and output xml files w.r.t. the dasish schema.
    9488     */
    9589    public void setProviders(Providers providers) {
     
    10397    /**
    10498     *
    105      * @param externalIdentifier the string representing the UUID of an annotation.
     99     * @param externalIdentifier the UUID of an annotation.
    106100     * @return the xml-element representing the annotation with "externalIdentifier" built up
    107101     * from the "annotation" table and the corresponding junction tables.
    108      * @throws IOException if sending the error fails.
     102     * @throws IOException if sending an error fails.
    109103     */
    110104    @GET
     
    141135     *
    142136     * @param externalIdentifier the string representing the UUID of an annotation.
    143      * @return the xml element representing the list of h-references of the annotation with "externalIdentifier".
    144      * @throws IOException if sending the error fails.
     137     * @return the xml element representing the list of h-references of the targets of the annotation with "externalIdentifier".
     138     * @throws IOException if sending an error fails.
    145139     */
    146140    @GET
     
    177171     *
    178172     * @param link the link representing one of the target sources of the annotation.
    179      * @param matchMode the relation of the actual target-source link to "link" parameter: "exact", "starts_with", "ends_with", "contains"
     173     * @param matchMode the relation of the actual target-source link to the "link" parameter: "exact", "starts_with", "ends_ith", "contains".
    180174     * @param text the text fragment that must be present in the annotation body.
    181175     * @param access the access mode of the logged in user to the requested annotations.
     
    186180     * @return the xml-element representing the list of {@link AnnotationInfo} objects representing
    187181     * the annotations satisfying the requirements defined by the parameters.
    188      * @throws IOException if sending the error fails.
     182     * @throws IOException if sending an error fails.
    189183     */
    190184    @GET
     
    238232   
    239233    /**
    240      *
    241      * @param n # of requested annotations (to which logged in principal has "read" access.
    242      * @return the external UUIDs of some n annotations to which the logged in principal has "read" access,
    243      * if the principal has "admin" or "developer" type of account.
    244      * @throws IOException if sending the error fails.
     234     * The request can be sent by principals with "developer" or "admin" account.
     235     * @param n # of threads.
     236     * @return a message reporting test success.
     237     * @throws IOException if sending an error fails.
    245238     * @throws NotInDataBaseException if getting annotation fails.
    246239     */
     
    288281    * @return the xml-element representing the list of permissions, i.e. pairs (principalId, accessMode),
    289282    * built upon the table "annotations_principals_accesses".
    290     * @throws IOException if sending the error fails.
     283    * @throws IOException if sending an error fails.
    291284    */
    292285    @GET
     
    323316     *
    324317     * @param externalIdentifier the external UUID of the annotation to be deleted.
    325      * @return the message if the annotation is deleted or not.
    326      * @throws IOException if sending the error fails.
     318     * @return the message telling if the annotation is deleted or not.
     319     * @throws IOException if sending an error fails.
    327320     */
    328321    @DELETE
     
    356349    /**
    357350     *
    358      * @param annotation an {@link Annotation} object,
     351     * @param annotation an {@link Annotation} object.
    359352     * @return the {@link ResponseBody} element that contains the xml element representing
    360      * the fresh annotation (with its generated by the method external UUID), and the list
     353     * the fresh annotation (with its freshly generated by the back-end external UUID), and the list
    361354     * of action-elements representing the actions the client should care for,
    362355     * e.g. add a cached representation for a certain target.
    363      * @throws IOException if sending the error fails.
     356     * @throws IOException if sending an error fails.
    364357     */
    365358    @POST
     
    401394    *
    402395    * @param externalId the external UUID of the annotation to be updated.
    403     * @param annotation the {@link Annotation} object that represent the new annotation that should replace the annotation with "externalId".
     396    * @param annotation the {@link Annotation} object representing the new annotation that should replace the annotation with "externalId".
    404397    * @return the {@link ResponseBody} element that contains the xml element representing
    405398     * the updated annotation, and the list of action-elements representing the actions the client should care for,
    406399     * e.g. add a cached representation for a certain target.
    407      * @throws IOException if sending the error fails.
     400     * @throws IOException if sending an error fails.
    408401    */
    409402    @PUT
     
    459452    * @return the {@link ResponseBody} element that contains the xml element representing
    460453    * the updated annotation, and the list of action-elements representing the actions the client should care for.
    461     * @throws IOException if sending the error fails. 
     454    * @throws IOException if sending an error fails. 
    462455    */
    463456    @PUT
     
    500493     *
    501494     * @param externalIdentifier the external UUID of the annotation whose headline is to be updated.
    502      * @param newHeadline the string representing the new headline.
     495     * @param newHeadline a new headline.
    503496     * @return the {@link ResponseBody} element that contains the xml element representing
    504497     * the updated annotation, and the list of action-elements representing the actions the client should care for.
    505      * @throws IOException if sending the error fails. 
     498     * @throws IOException if sending an error fails. 
    506499     */
    507500    @PUT
     
    546539    * @param annotationHeadline the annotation's headline.
    547540    * @param access the new value for the public attribute of the annotation.
    548     * @return the message if the database has been updated and how many rows have been updated;
     541    * @return the message telling if the database has been updated and how many rows have been updated;
    549542    * if "annotationDatabaseId" == null or empty then all the annotations with "annotationHeadline"
    550     * must be updated,
    551     * @throws IOException if sending the error fails.
     543    * must be updated.
     544    * @throws IOException if sending an error fails.
    552545    */
    553546    @POST
     
    615608     * @param annotationExternalId the external UUID of an annotation.
    616609     * @param principalExternalId the external UUID of a principal whose access mode to the annotation must be updated.
    617      * @param access the access mode that should assigned to the principal.
     610     * @param access the access mode that should be assigned to the principal.
    618611     * @return the message about the amount of updated rows.
    619      * @throws IOException if sending the error fails.
     612     * @throws IOException if sending an error fails.
    620613     */
    621614    @PUT
     
    637630
    638631    /**
    639      * One of 3 principal-related parameters must be non-null and non-empty; one of 2 annotation related parameters must be non-null and non-empty.
     632     * One of 3 principal-related parameters must be non-null and non-empty; one of 2 annotation-related parameters must be non-null and non-empty.
    640633     * @param remoteID the remote ID of the principal whose access mode to the annotation (see below) must be updated.
    641634     * @param fullName the full name of the principal whose access mode to the annotation must be updated.
     
    645638     * @param access the new access mode.
    646639     * @return the message explaining how many rows have been updated.
    647      * @throws IOException  if sending error message fails.
     640     * @throws IOException  if sending an error fails.
    648641     */
    649642    @POST
     
    738731     * the updated annotation, and the list of action-elements representing the actions the client should care for,
    739732     * e.g. add the e-mail of a certain principal.
    740      * @throws IOException if sending the error fails.
     733     * @throws IOException if sending an error fails.
    741734     */
    742735    @PUT
     
    781774     * @param annotationId the external UUID of the annotation.
    782775     * @param principalId the external UUID of a principal whose access mode must be deleted.
    783      * @return the amount of updated/removed rows in the database.
    784      * @throws IOException if sending the error fails.
     776     * @return the amount of removed rows in the database.
     777     * @throws IOException if sending an error fails.
    785778     */
    786779    @DELETE
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AutheticationResource.java

    r6038 r6044  
    3535
    3636/**
    37  * REST class for GETting a logged in principal, log-in and log-out;
    38  * Every REST method in the case of successful completion of its action outputs the declared output type
     37 * A REST class for GETting a logged in principal, log-in and log-out.
     38 * Every REST method in the case of successful completion produces the object of the declared output type
    3939 * (a JAXB-element or a message string) or sends a HTTP-error with the corresponding diagnostics otherwise.
    4040 * @author olhsha
     
    4747    /**
    4848     *
    49      * @return the {@link Principal} object representing the current logged-on principal.
    50      * @throws IOException if sending the error fails.
     49     * @return the {@link Principal} object representing the current logged-in principal.
     50     * @throws IOException if sending an error fails.
    5151     */
    5252    @GET
     
    8484    /**
    8585     *
    86      * @throws IOException if sending redirect fails.
     86     * @throws IOException if sending the redirect to logout page fails.
    8787     */
    8888    @GET
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/CachedRepresentationResource.java

    r6038 r6044  
    5252
    5353/**
    54  * REST class for GETting, POSTing and PUTting cached representations;
    55  * DELETing cached representation is provided by TargetRsource class;
    56  * Every REST method in the case of successful completion of its action outputs the declared output type
     54 * A REST class for GETting, POSTing and PUTting cached representations.
     55 * DELETing cached representation is provided by {@link TargetRsource} class.
     56 * Every REST method in the case of successful completion produces an object of the declared output type
    5757 * (a JAXB-element or a message string) or sends a HTTP-error with the corresponding diagnostics otherwise.
    5858 * @author olhsha
     
    6363public class CachedRepresentationResource extends ResourceResource {
    6464   
    65     /**
    66      *
    67      * @param request a {@link HttpServletRequest} object representing request; the set parameter is used in unit tests.
    68      */
    69     public void setHttpRequest(HttpServletRequest request) {
    70         this.httpServletRequest = request;
    71     }
    72 
    73     /**
    74      *
    75      * @param externalId the external UUID of a cached representations.
    76      * @return a {@link CachedRepresentationInfo} representing the metadata for the cached representation with the "externalId".
    77      * @throws IOException if sending the error fails.
     65   
     66    /**
     67     *
     68     * @param externalId the external UUID of a cached representation.
     69     * @return a {@link CachedRepresentationInfo} object representing the metadata for the cached representation with the "externalId".
     70     * @throws IOException if sending an error fails.
    7871     */
    7972    @GET
     
    112105     * @param externalId the external UUID of a cached representation.
    113106     * @return the image-blob if the cached-representation's blob is an image file.
    114      * @throws IOException if logging the error fails (should be changed to sending httpResponse error message).
     107     * @throws IOException if logging an error fails (should be changed to sending httpResponse error message).
    115108     */
    116109    @GET
     
    150143     * @param externalId the external UUID of a cached representation.
    151144     * @return the cached-representation's blob.
    152      * @throws IOException is sending the error fails.
     145     * @throws IOException is sending an error fails.
    153146     */
    154147    @GET
     
    180173    /**
    181174     *
    182      * @param cachedIdentifier the external uuid of a cached representation.
    183      * @param multiPart a {@link MultiPart} object containing two parts: a {@linkCachedRepresentationInfo} object for the cached-representation's metadata, and its blob.
    184      * @return a message about how many rows in "cached_representation" table have been update; "1" if updated, and "0" otherwisee.
    185      * @throws IOException if sending the error fails.
     175     * @param cachedIdentifier the external UUID of a cached representation.
     176     * @param multiPart a {@link MultiPart} object containing two parts: a {@link CachedRepresentationInfo} object for the cached-representation's metadata, and its blob.
     177     * @return a message about how many rows in "cached_representation" table have been updated; "1" if updated, and "0" otherwisee.
     178     * @throws IOException if sending an error fails.
    186179     */
    187180    @PUT
     
    263256    /**
    264257     *
    265      * @param cachedInfo a {@link CachedRepresentationInfo} representing the new metadata.
    266      * @return a message about how many rows in "cached_representation" table, "1" if updated, "0" otherwise.
    267      * @throws IOException if sending the error fails.
     258     * @param cachedInfo a {@link CachedRepresentationInfo} object representing the new metadata.
     259     * @return a message about how many rows in "cached_representation" table have been updated: "1" if updated, "0" otherwise.
     260     * @throws IOException if sending an error fails.
    268261     */
    269262    @PUT
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/DebugResource.java

    r6038 r6044  
    4444
    4545/**
    46  * REST class for GETting information useful for debugging the back-end or a front-end;
    47  * Every REST method in the case of successful completion of its action outputs the declared output type
    48  * (a JAXB-element or a message string) or sends a HTTP-error with the corresponding diagnostics otherwise;
    49  * The class is used only by "admin" and "developer" principals; these account types are set in "principal" table.
     46 * A REST class for GETting information useful for debugging the back-end or a front-end.
     47 * Every REST method in the case of successful completion produces the object of the declared output type
     48 * (a JAXB-element or a message string) or sends a HTTP-error with the corresponding diagnostics otherwise.
     49 * The class is used only by "admin" and "developer" principals; these account types are set in the "principal" table.
    5050 * @author olhsha
    5151 */
     
    6969    /**
    7070     *
    71      * @return An {@link AnnotationInfoList}-element containing the list of {@link AnnotationInfo} objects of ALL the annotations,
     71     * @return An {@link AnnotationInfoList}-element containing the list of {@link AnnotationInfo} elements of ALL the annotations,
    7272     * with the latest (youngest) annotation on the top.
    73      * @throws IOException if sending the error fails.
     73     * @throws IOException if sending an error fails.
    7474     */
    7575    @GET
     
    9898     * @param n # of strings.
    9999     * @return the latest n strings of the dasish database log file.
    100      * @throws IOException if sending the error fails.
     100     * @throws IOException if sending an error fails.
    101101     */
    102102    @GET
     
    135135    * @param n # of strings
    136136    * @return the last n strings of the dasish server logger (non-SQL-request logs).
    137     * @throws IOException if sending the error fails.
     137    * @throws IOException if sending an error fails.
    138138    */
    139139    @GET
     
    158158    /**
    159159     *
    160      * @param principalId the external UUID of a principal whose account type must be updated,
     160     * @param principalId the external UUID of a principal whose account type must be updated.
    161161     * @param account the new account type (admin, developer, user).
    162      * @return a message if the account has been updated or not.
    163      * @throws IOException if sending the error fails.
     162     * @return a message telling if the account has been updated or not.
     163     * @throws IOException if sending an error fails.
    164164     */
    165165    @PUT
     
    194194     * @param oldExternalId the old external UUID of the resource.
    195195     * @param newExternalId the new UUID of the resource
    196      * @return the message if the "newExternalIdentifier" has replaced the "oldExternalIdentifier" or not,
    197      * @throws IOException is sending the error fails.
     196     * @return a message telling if the "newExternalIdentifier" has replaced the "oldExternalIdentifier" or not.
     197     * @throws IOException is sending an error fails.
    198198     */
    199199    @PUT
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/GetThread.java

    r6018 r6044  
    2222
    2323/**
    24  * A helper class used by an "admin" or a "dedeloper" in "stress testing" method AnnotationResource.getAnnotationsMultithread(..)
     24 * A helper class used by an "admin" or a "dedeloper" in "stress testing" method AnnotationResource.getAnnotationsMultithread(..). Check {@link AnnotationResource} class.
    2525 * @author olhsha
    2626 */
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/JaxbUnmarshallerFactory.java

    r6018 r6044  
    2929
    3030/**
    31  * Implemented to deserialise xml-elements into java objects, used to validate XML data.
     31 * Implemented to deserialise xml-elements into java objects, used by JAXB, also to validate input XML files.
    3232 * @author olhsha
    3333 */
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/NotebookResource.java

    r6038 r6044  
    4747
    4848/**
    49  * REST interface for GETting, POSTing, PUTting and DELETing notebooks or their substructures (child elements);
    50  * Every REST method in the case of successful completion of its action outputs the declared output type
     49 * A REST interface for GETting, POSTing, PUTting and DELETing notebooks or their substructures (child elements).
     50 * Every REST method in the case of successful completion produces the object of the declared output type
    5151 * (a JAXB-element or a message string) or sends a HTTP-error with the corresponding diagnostics otherwise.
    52  * @author Peter Withers <peter.withers@mpi.nl>, olhsha@mpi.nl
     52 * @author olhsha@mpi.nl
    5353 */
    5454@Component
     
    6565    * @return the {@link NotebookInfoList} element containing the list of {@link NotebookInfo} elements
    6666    * of all the notebooks to which the in-logged principal has "access" access.
    67     * @throws IOException if sending the error fails.
     67    * @throws IOException if sending an error fails.
    6868    */
    6969    @GET
     
    8787     *
    8888     * @return the {@link ReferenceList} element containing the list of h-references of all the notebooks owned by the in-logged principal.
    89      * @throws IOException if sending the error fails.
     89     * @throws IOException if sending an error fails.
    9090     */
    9191    @GET
     
    105105     *
    106106     * @param externalIdentifier the external UUID identifier of a notebook.
    107      * @param accessMode the access mode on which principals must be filtered,
     107     * @param accessMode the access mode on which principals must be filtered;
    108108     * can be "none", "read", "write", "all".
    109109     * @return a {@link ReferenceList} element representing the list of h-references of the
    110      * principal that have access "accessMode"
    111      * @throws IOException if sending the error fails.
     110     * principals that have access "accessMode".
     111     * @throws IOException if sending an error fails.
    112112     */
    113113    @GET
     
    140140   *
    141141   * @param externalIdentifier the external UUID identifier of a notebook.
    142    * @return a {@link Notebook} element built up on the whole information
    143    * ("notebook" table and the corresponding junction tables) for the notebook with "externalIdentifier".
    144    * @throws IOException if sending the error fails.
     142   * @return a {@link Notebook} element representing the notebook with "externalIdentifier"; built up on the whole information
     143   * (the "notebook" table and the corresponding junction tables) for the notebook with "externalIdentifier".
     144   * @throws IOException if sending an error fails.
    145145   */
    146146   
     
    174174    /**
    175175     *
    176      * @param externalIdentifier the external UUID identifier of a notebook.
    177      * @param maximumAnnotations the maximum amount of annotations from this notebook to output
     176     * @param externalIdentifier the external UUID of a notebook.
     177     * @param maximumAnnotations the maximum amount of annotations from this notebook to output;
    178178     * if the amount of annotations in the notebook is more than  (startAnnotations-1) + maximumAnnotations,
    179      * then exactly maximumAnnotations will be output, otherwise  the amount of annotations of
    180      * output is limited by "# of annotations in the notebook" - startAnnotation
     179     * then exactly maximumAnnotations will be output, otherwise  the amount of annotations is limited by "# of annotations in the notebook" - (startAnnotation-1)
    181180     * @param startAnnotations the index of the first annotation, min value is "1".
    182181     * @param orderBy the field in the table "notebook" on which annotations must be ordered.
    183182     * @param desc if true then the annotations in the list must be ordered in descending order, otherwise in ascending order.
    184      * @return a {@link ReferenceList} element representing the list of (maximum) maximumAnnotations
    185      * @throws IOException if sending the error fails.
     183     * @return a {@link ReferenceList} element representing the list of annotations filtered according to the parameters.
     184     * @throws IOException if sending an error fails.
    186185     */
    187186    @GET
     
    222221     * @param notebookInfo the fresh {@link NotebookInfo} object.
    223222     * @return a {@link ResponseBody} element containing the just updated {@link Notebook} element
    224      * and the list of actions, which are not yet specified for the notebooks.
    225      * @throws IOException if sending the error fails.
     223     * and the list of actions (which are not yet specified for the notebooks).
     224     * @throws IOException if sending an error fails.
    226225     */
    227226    @PUT
     
    229228    @Produces(MediaType.APPLICATION_XML)
    230229    @Path("{notebookid: " + BackendConstants.regExpIdentifier + "}")
    231     public JAXBElement<ResponseBody> updateNotebookInfo(@PathParam("notebookid") String externalIdentifier, NotebookInfo notebookInfo) throws IOException, HTTPException {
     230    public JAXBElement<ResponseBody> updateNotebookInfo(@PathParam("notebookid") String externalIdentifier, NotebookInfo notebookInfo) throws IOException{
    232231        Number remotePrincipalID = this.getPrincipalID();
    233232        if (remotePrincipalID == null) {
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/PrincipalResource.java

    r6038 r6044  
    5353
    5454/**
    55  * REST class for GETting, POSTing, PUTting and DELETing principals or their substructures (child elements);
    56  * Every REST method in the case of successful completion of its action outputs the declared output type
     55 * A REST class for GETting, POSTing, PUTting and DELETing principals or their substructures (child elements).
     56 * Every REST method in the case of successful completion produces an object of the declared output type
    5757 * (a JAXB-element or a message string) or sends a HTTP-error with the corresponding diagnostics otherwise.
    5858* @author olhsha
     
    6565    int shaStrength = 512;
    6666
    67    
    68     /**
    69      *
    70      * @param request a {@link HttpServletRequest} object; set object is used in unit tests.
    71      */
    72     public void setHttpRequest(HttpServletRequest request) {
    73         this.httpServletRequest = request;
    74     }
    75 
     67 
    7668    public PrincipalResource() {
    7769    }
     
    8173     * @param externalIdentifier the external UUID of a principal.
    8274     * @return the {@link Principal} element representing the principal object with the "externalIdentifier".
    83      * @throws IOException is sending the error fails.
     75     * @throws IOException is sending an error fails.
    8476     */
    8577    @GET
     
    113105    /**
    114106     *
    115      * @return a message containing the fill name and the e-mail of the admin.
    116      * @throws IOException if sending the error in the call of "this.getPrincipalID()".
     107     * @return a message containing the full name and the e-mail of the admin.
     108     * @throws IOException if sending an error in the call of "this.getPrincipalID()" fails.
    117109     */
    118110    @GET
     
    130122   /**
    131123    *
    132     * @param email a string representing the e-mail of a principal.
     124    * @param email the e-mail of a principal.
    133125    * @return a {@link Principal} representing the principal with the "email",
    134126    * if such a principal is found; otherwise "SC_NOT_FOUND" error is sent.
    135     * @throws IOException if sending the error fails.
     127    * @throws IOException if sending an error fails.
    136128    */
    137129    @GET
     
    168160     * @return a {@link CurrentPrincipalInfo} element containing "true" if the principal
    169161     * with externalIdentifier is logged-in in this session;
    170      * withe the current implementation does not make that much sense for me,
     162     * with the current implementation does not make that much sense for me,
    171163     * because the logged-in user knows his/her externalIDdentifier and knows that the other UUIDs
    172      * will be "not logged in", and therefore "false" is expected,
    173      * @throws IOException if sending the error fails.
     164     * will be "not logged in", and therefore "false" is expected.
     165     * @throws IOException if sending an error fails.
    174166     */
    175167    @GET
     
    261253     * @param remoteId the  remote id of the principal to be registered.
    262254     * @param password the password selected by the principal to be registered.
    263      * @param email an email of the principal to be registered.
    264      * @return a @Link Principal} element representing the just registered principal.
    265      * @throws IOException if sending the error fails.
     255     * @param email the email of the principal to be registered.
     256     * @return a {@link Principal} element representing the just registered principal.
     257     * @throws IOException if sending an error fails.
    266258     */
    267259    @POST
     
    310302    /**
    311303     *
    312      * @param name the name of the principal to be registered
     304     * @param name the name of the principal to be registered.
    313305     * @param remoteId the remote shibboleth id.
    314306     * @param email the email.
    315      * @return a @Link Principal} element representing the just registered principal.
    316      * @throws IOException if sending the error fails.
     307     * @return a {@link Principal} element representing the just registered principal.
     308     * @throws IOException if sending an error fails.
    317309     */
    318310    @POST
     
    353345
    354346    /**
    355      * It is of a good convenience method limiting proliferation of user profiles, however
     347     * It is a convenience method limiting proliferation of user profiles, however
    356348     * the method is currently not used till security issues will be discussed with the LAT
    357349     * system administrators.
     
    359351     * @param password a shibboleth password which will be set as a basic-authentication password.
    360352     * @return a message about amount of records; which must be 2 if everything goes well:
    361      * 1 record for the principal, another for the authorities table
    362      * @throws IOException if sending the error fails.
     353     * 1 record for the "principal" table, 1is for the "authorities" tabl.
     354     * @throws IOException if sending an error fails.
    363355     */
    364356    @POST
     
    381373     *
    382374     * @param principal a {@link Principal} object representing new information (name, e-mail) about the principal
    383      * with the eternal UUID given in the object,
    384      * @return a @Link Principal} element representing the just updated principal.
    385      * @throws IOException if sending the error message fails.
     375     * with the eternal UUID given in the object.
     376     * @return a {@link Principal} element representing the just updated principal.
     377     * @throws IOException if sending an error message fails.
    386378     */
    387379    @PUT
     
    418410     *
    419411     * @param name a new full name.
    420      * @param email a new email
    421      * @return a @Link Principal} element representing the just updated principal.
    422      * @throws IOException if sending the error fails.
     412     * @param email a new email.
     413     * @return a {@link Principal} element representing the just updated principal.
     414     * @throws IOException if sending an error fails.
    423415     * @throws NotInDataBaseException if the in-logged principal is not found in the database
    424      * or updated fails.
     416     * or update fails.
    425417     */
    426418    @POST
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/ProjectInfoResource.java

    r6038 r6044  
    4141     *
    4242     * @return a message string containing the number of the version of the backend.
    43      * @throws IOException if getting a principal or sending the error fails.s
     43     * @throws IOException if getting a principal or sending an error fails.
    4444     */
    4545    @GET
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/RequestWrappers.java

    r6038 r6044  
    3333
    3434/**
    35  * Different requests for different resources still have some steps in common and therefore
    36  * can be wrapped in a class whose higher-order methods performs the common steps and then call
     35 * Different requests for different resources have some steps in common and therefore
     36 * can be wrapped in a class whose higher-order methods perform the common steps and then call
    3737 * the methods performing the specific part; the specific-part object is passed as a parameter.
    3838 * @author olhsha
     
    4848    /**
    4949     * Set the instance of a specific REST class.
    50      * @param resourceResource
     50     * @param resourceResource a {@link ResourceResource} object representing one of the rest resource classes of this package.
    5151     */
    5252    public RequestWrappers(ResourceResource resourceResource) {
     
    5959     * @param resource a type of resource: "annotation", "principal", "cached representation", "notebook", "target".
    6060     * @param action a string naming the action that should have been performed.
    61      * @return
     61     * @return a string representing a tuned error message.
    6262     */
    6363    public String FORBIDDEN_RESOURCE_ACTION(String identifier, String resource, String action) {
     
    7070     * @param dbRequestor the object that will be performing the specific part of the request ("continuation").
    7171     * @return the requested resource.
    72      * @throws IOException if sending error message fails in the called methods.
     72     * @throws IOException if sending an error fails in the called methods.
    7373     * @throws NotInDataBaseException if thrown by the specific part of the request.
    7474     * @throws ForbiddenException if the action is forbidden for the inlogged user.
     
    8787     * @param params list of parameters that will be used by a specific part of the request (in "the continuation").
    8888     * @param dbRequestor the object that will be performing the specific part of the request ("continuation").
    89      * @param resource a {@link Resource} object, representing the type of a resource  "annotation", "principal", "cached representation", "notebook", "target".
     89     * @param resource a {@link Resource} object, representing the type of a resource:  "annotation", "principal", "cached representation", "notebook", "target".
    9090     * @param action an {@link Access} object representing the type ("mightiness")  of the action.
    9191     * @param externalId the external UUID of the resource.
    9292     * @return the resource.
    93      * @throws IOException if sending error message fails in the called methods.
     93     * @throws IOException if sending an error fails in the called methods.
    9494     * @throws NotInDataBaseException if thrown by the specific part of the request.
    9595     * @throws ForbiddenException if the action is forbidden for the inlogged user.
     
    120120     * @param dbRequestor the object that will be performing the specific part of the request ("continuation").
    121121     * @return a {@link Principal} element.
    122      * @throws IOException if sending error message fails in the called methods.
     122     * @throws IOException if sending an error fails in the called methods.
    123123     * @throws NotInDataBaseException if thrown by the specific part of the request.
    124124     * @throws PrincipalExists if a principal with the given e-mail or name is already exist in the database
    125      * (thrown if the request is to add or update a principal)
     125     * (can be sthrown if the request is to add or update a principal).
    126126     */
    127127    public JAXBElement<Principal> wrapAddPrincipalRequest(Map params, ILambdaPrincipal<Map, Principal> dbRequestor) throws IOException, NotInDataBaseException, PrincipalExists {
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/ResourceResource.java

    r6038 r6044  
    3434
    3535/**
    36  * This class is a super-class of any [SpecificPart]Resource of this REST package and contains the methods
    37  * and field common for each of them.
     36 * This class is a super-class of any [SpecificPart]Resource class of this package and contains the methods
     37 * and fields common for each of them.
    3838 * @author olhsha
    3939 */
     
    6060     * @return the internal database id of the logged in principal if the authentication went well,
    6161     * otherwise sends a corresponding error message.
    62      * @throws IOException  if sending the error fails.
     62     * @throws IOException  if sending an error fails.
    6363     */
    6464    public Number getPrincipalID() throws IOException {
     
    101101   
    102102   
    103 
    104     protected void ADMIN_RIGHTS_EXPECTED() throws IOException {
     103 
     104    protected void ADMIN_RIGHTS_EXPECTED(){
    105105        loggerServer.debug("The request can be performed only by the principal with the admin rights.");
    106106    }
    107107
    108     protected void INVALID_ACCESS_MODE(String accessMode) throws IOException {
     108    protected void INVALID_ACCESS_MODE(String accessMode) {
    109109        loggerServer.debug(accessMode + " is an invalid access value, which must be either owner, or read, or write.");
    110110    }
    111111   
     112    /**
     113     *
     114     * @return concatenation of the context-path and servlet-path.
     115     */
    112116    protected String getRelativeServiceURI(){
    113117        return httpServletRequest.getContextPath()+httpServletRequest.getServletPath();
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/TargetResource.java

    r6038 r6044  
    3636import java.util.Map;
    3737import java.util.UUID;
    38 import javax.servlet.http.HttpServletRequest;
    3938import javax.servlet.http.HttpServletResponse;
    4039import javax.ws.rs.Consumes;
     
    4948import javax.xml.bind.JAXBElement;
    5049import javax.xml.parsers.ParserConfigurationException;
    51 import javax.xml.ws.http.HTTPException;
    5250import org.springframework.stereotype.Component;
    5351import org.springframework.transaction.annotation.Transactional;
    5452
    5553/**
    56  * REST class for GETting, POSTing, PUTting and DELETing targets or their substructures (child elements);
    57  * Every REST method in the case of successful completion of its action outputs the declared output type
     54 * A REST class for GETting, POSTing, PUTting and DELETing targets or their substructures (child elements).
     55 * Every REST method in the case of successful completion produces the object of the declared output type
    5856 * (a JAXB-element or a message string) or sends a HTTP-error with the corresponding diagnostics otherwise.
    59 
    6057 * @author olhsha
    6158 */
     
    6663public class TargetResource extends ResourceResource {
    6764
    68     /**
    69      * Sets {@link HttpServletRequest} object, to be used in unit tests.
    70      * @param request  a @link HttpServletRequest} object to be set.
    71      */
    72     public void setHttpRequest(HttpServletRequest request) {
    73         this.httpServletRequest = request;
    74     }
    75 
    7665    public TargetResource() {
    7766    }
     
    7968    /**
    8069     *
    81      * @param externalIdentifier the external UUId of the target.
     70     * @param externalIdentifier the external UUId of a target.
    8271     * @return a {@link Target} element representing a target object with "externalIdentifier".
    8372     * @throws IOException if sending an error fails.
     
    117106     *
    118107     * @param externalIdentifier the external UUID of a target.
    119      * @return a {@link ReferenceList} element representing the list of he-references of the targets that
    120      * refer to the same link.
    121      * @throws IOException if sending the error fails.
     108     * @return a {@link ReferenceList} element representing the list of h-references of the targets that
     109     * refer to the same link as the target with "externalIdentifier".
     110     * @throws IOException if sending an error fails.
    122111     */
    123112    @GET
     
    157146     * @param fragmentDescriptor a string representing the location of the target within the cached-representation's content.
    158147     * @param multiPart a {@link MultiPart} object representing two-part request body, containing the cached representation metadata
    159      * ({@link CachedRepresentationInfo} element} and a blob for a cached representation content.
     148     * {@link CachedRepresentationInfo} element} and a blob for a cached representation content.
    160149     * @return a {@link CachedRepresentationInfo} element containing the metadata of the just added cached representation;
    161150     * the difference with the input metadata is that a persistent external UUID is assigned, and the last-updated
    162151     * attribute is changed.
    163      * @throws IOException  if sending the error fails.
     152     * @throws IOException  if sending an error fails.
    164153     */
    165154    @POST
     
    215204     * @param cachedIdentifier the external UUID of a cached representation.
    216205     * @param fragmentDescriptor the new fragment descriptor locating the target within the cached representation.
    217      * @return a message about the updated; should be "1 row is updated" in a case of success.
     206     * @return a message about the # of updated rows; should be "1 row is updated" in a case of success.
    218207     * @throws IOException if sending an error fails.
    219208     */
     
    251240     * @return a message reporting how deletion went; in the case of success it tells
    252241     * how many pairing (target, cached) have been deleted.
    253      * @throws IOException if sending the error fails.
     242     * @throws IOException if sending an error fails.
    254243     */
    255244    @DELETE
Note: See TracChangeset for help on using the changeset viewer.