Changeset 4671 for DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/VerboseOutput.java
- Timestamp:
- 03/12/14 15:56:47 (10 years ago)
- 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 48 48 49 49 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); 51 51 } 52 52 53 53 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 } 57 56 58 57 private MessageStatus _ILLEGAL_UUID(String identifier) { … … 61 60 62 61 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); 64 63 } 65 64 … … 68 67 } 69 68 70 71 69 private MessageStatus _PRINCIPAL_NOT_FOUND(String externalIdentifier) { 72 70 return resourceNotFound(externalIdentifier, "principal"); … … 89 87 } 90 88 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 91 94 private MessageStatus _INVALID_PERMISSION_MODE(String permissionMode) { 92 95 return new MessageStatus(permissionMode + " is an invalid permission value, which must be either owner, or reader, or writer.", HttpServletResponse.SC_BAD_REQUEST); … … 98 101 99 102 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); 101 104 } 102 105 … … 116 119 return new MessageStatus("The account is not updated", HttpServletResponse.SC_INTERNAL_SERVER_ERROR); 117 120 } 118 121 119 122 private MessageStatus _LOGOUT() { 120 123 return new MessageStatus("You are logged out.", HttpServletResponse.SC_UNAUTHORIZED); 121 124 } 122 125 123 126 private MessageStatus _ANONYMOUS_PRINCIPAL() { 124 127 return new MessageStatus("Shibboleth fall-back. Logged in as 'anonymous' with no rights.", HttpServletResponse.SC_UNAUTHORIZED); … … 140 143 141 144 public void FORBIDDEN_NOTEBOOK_WRITING(String identifier, String ownerName, String ownerEMail) throws IOException { 142 145 this.sendMessage(this._FORBIDDEN_RESOURCE_ACTION(identifier, "notebook", "write", ownerName, ownerEMail)); 143 146 } 144 147 145 148 public void FORBIDDEN_ANNOTATION_READING(String identifier, String ownerName, String ownerEMail) throws IOException { 146 149 this.sendMessage(this._FORBIDDEN_RESOURCE_ACTION(identifier, "annotation", "read", ownerName, ownerEMail));; 147 150 } 148 151 149 152 public void FORBIDDEN_ANNOTATION_WRITING(String identifier, String ownerName, String ownerEMail) throws IOException { 150 153 this.sendMessage(this._FORBIDDEN_RESOURCE_ACTION(identifier, "annotation", "write", ownerName, ownerEMail)); 151 154 } 152 155 153 156 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)); 155 158 } 156 159 … … 183 186 } 184 187 188 public void CACHED_REPRESENTATION_IS_NULL() throws IOException { 189 this.sendMessage(this._CACHED_REPRESENTATION_IS_NULL()); 190 } 191 185 192 public void INVALID_PERMISSION_MODE(String permissionMode) throws IOException { 186 193 this.sendMessage(this._INVALID_PERMISSION_MODE(permissionMode)); … … 210 217 this.sendMessage(this._ACCOUNT_IS_NOT_UPDATED()); 211 218 } 212 219 213 220 public void LOGOUT() throws IOException { 214 221 this.sendMessage(this._LOGOUT()); 215 222 } 216 223 217 224 public void ANONYMOUS_PRINCIPAL() throws IOException { 218 225 this.sendMessage(this._ANONYMOUS_PRINCIPAL()); 219 226 } 220 221 227 }
Note: See TracChangeset
for help on using the changeset viewer.