Ignore:
Timestamp:
03/12/14 15:56:47 (10 years ago)
Author:
olhsha
Message:

debugging and testing

File:
1 edited

Legend:

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

    r4670 r4671  
    4848
    4949    private MessageStatus _NOT_LOGGED_IN(String adminName, String adminEmail) {
    50         return new MessageStatus(" The user is not logged-in or its remote login is corrupted by setting to null. In the latter case contact the admin "+adminName+" via the e-mail "+adminEmail, HttpServletResponse.SC_UNAUTHORIZED);
     50        return new MessageStatus(" The user is not logged-in or its remote login is corrupted by setting to null. In the latter case contact the admin " + adminName + " via the e-mail " + adminEmail, HttpServletResponse.SC_UNAUTHORIZED);
    5151    }
    5252
    5353    private MessageStatus _FORBIDDEN_RESOURCE_ACTION(String identifier, String resource, String action, String ownerName, String ownerEMail) {
    54         return new MessageStatus(" The logged-in principal cannot "+action+" the "+resource+" with the identifier " + identifier+ ". Contact the resource's owner "+ownerName+" via the e-mail "+ownerEMail, HttpServletResponse.SC_FORBIDDEN);
    55     }
    56 
     54        return new MessageStatus(" The logged-in principal cannot " + action + " the " + resource + " with the identifier " + identifier + ". Contact the resource's owner " + ownerName + " via the e-mail " + ownerEMail, HttpServletResponse.SC_FORBIDDEN);
     55    }
    5756
    5857    private MessageStatus _ILLEGAL_UUID(String identifier) {
     
    6160
    6261    private MessageStatus _REMOTE_PRINCIPAL_NOT_FOUND(String remoteID, String adminName, String adminEmail) {
    63         return new MessageStatus("The logged in principal with the remote ID " + remoteID + " is not found in the database or his/her internal DB identifier is corrupted by setting to null. Contact the database admin "+adminName+" by the e-mail "+adminEmail, HttpServletResponse.SC_NOT_FOUND);
     62        return new MessageStatus("The logged in principal with the remote ID " + remoteID + " is not found in the database or his/her internal DB identifier is corrupted by setting to null. Contact the database admin " + adminName + " by the e-mail " + adminEmail, HttpServletResponse.SC_NOT_FOUND);
    6463    }
    6564
     
    6867    }
    6968
    70  
    7169    private MessageStatus _PRINCIPAL_NOT_FOUND(String externalIdentifier) {
    7270        return resourceNotFound(externalIdentifier, "principal");
     
    8987    }
    9088
     89    private MessageStatus _CACHED_REPRESENTATION_IS_NULL() {
     90        return new MessageStatus("The cached representation with the give ID exist in the DB, however its BLOB is null.", HttpServletResponse.SC_NO_CONTENT);
     91
     92    }
     93
    9194    private MessageStatus _INVALID_PERMISSION_MODE(String permissionMode) {
    9295        return new MessageStatus(permissionMode + " is an invalid permission value, which must be either owner, or reader, or writer.", HttpServletResponse.SC_BAD_REQUEST);
     
    98101
    99102    private MessageStatus _ADMIN_RIGHTS_EXPECTED(String adminName, String adminEmail) {
    100         return new MessageStatus("The request can be performed only by the principal with the admin rights. Contact the admin "+adminName+" via e-mail "+adminEmail, HttpServletResponse.SC_FORBIDDEN);
     103        return new MessageStatus("The request can be performed only by the principal with the admin rights. Contact the admin " + adminName + " via e-mail " + adminEmail, HttpServletResponse.SC_FORBIDDEN);
    101104    }
    102105
     
    116119        return new MessageStatus("The account is not updated", HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    117120    }
    118    
     121
    119122    private MessageStatus _LOGOUT() {
    120123        return new MessageStatus("You are logged out.", HttpServletResponse.SC_UNAUTHORIZED);
    121124    }
    122    
     125
    123126    private MessageStatus _ANONYMOUS_PRINCIPAL() {
    124127        return new MessageStatus("Shibboleth fall-back.  Logged in as 'anonymous' with no rights.", HttpServletResponse.SC_UNAUTHORIZED);
     
    140143
    141144    public void FORBIDDEN_NOTEBOOK_WRITING(String identifier, String ownerName, String ownerEMail) throws IOException {
    142          this.sendMessage(this._FORBIDDEN_RESOURCE_ACTION(identifier, "notebook", "write", ownerName, ownerEMail));
     145        this.sendMessage(this._FORBIDDEN_RESOURCE_ACTION(identifier, "notebook", "write", ownerName, ownerEMail));
    143146    }
    144147
    145148    public void FORBIDDEN_ANNOTATION_READING(String identifier, String ownerName, String ownerEMail) throws IOException {
    146          this.sendMessage(this._FORBIDDEN_RESOURCE_ACTION(identifier, "annotation", "read", ownerName, ownerEMail));;
     149        this.sendMessage(this._FORBIDDEN_RESOURCE_ACTION(identifier, "annotation", "read", ownerName, ownerEMail));;
    147150    }
    148151
    149152    public void FORBIDDEN_ANNOTATION_WRITING(String identifier, String ownerName, String ownerEMail) throws IOException {
    150          this.sendMessage(this._FORBIDDEN_RESOURCE_ACTION(identifier, "annotation", "write", ownerName, ownerEMail));
     153        this.sendMessage(this._FORBIDDEN_RESOURCE_ACTION(identifier, "annotation", "write", ownerName, ownerEMail));
    151154    }
    152155
    153156    public void FORBIDDEN_PERMISSION_CHANGING(String identifier, String ownerName, String ownerEMail) throws IOException {
    154          this.sendMessage(this._FORBIDDEN_RESOURCE_ACTION(identifier, "resource","change", ownerName, ownerEMail));
     157        this.sendMessage(this._FORBIDDEN_RESOURCE_ACTION(identifier, "resource", "change", ownerName, ownerEMail));
    155158    }
    156159
     
    183186    }
    184187
     188    public void CACHED_REPRESENTATION_IS_NULL() throws IOException {
     189        this.sendMessage(this._CACHED_REPRESENTATION_IS_NULL());
     190    }
     191
    185192    public void INVALID_PERMISSION_MODE(String permissionMode) throws IOException {
    186193        this.sendMessage(this._INVALID_PERMISSION_MODE(permissionMode));
     
    210217        this.sendMessage(this._ACCOUNT_IS_NOT_UPDATED());
    211218    }
    212    
     219
    213220    public void LOGOUT() throws IOException {
    214221        this.sendMessage(this._LOGOUT());
    215222    }
    216    
     223
    217224    public void ANONYMOUS_PRINCIPAL() throws IOException {
    218225        this.sendMessage(this._ANONYMOUS_PRINCIPAL());
    219226    }
    220    
    221227}
Note: See TracChangeset for help on using the changeset viewer.