]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
4c378e76373908d27081bf5baaccece0505142e4
[tmp/jakarta-migration.git] /
1 package org.collectionspace.services.index.nuxeo;
2
3 import org.collectionspace.services.client.PoxPayloadIn;
4 import org.collectionspace.services.client.PoxPayloadOut;
5 import org.collectionspace.services.common.document.InvalidDocumentException;
6 import org.collectionspace.services.common.document.ValidatorHandlerImpl;
7 import org.collectionspace.services.index.IndexCommon;
8
9 import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory;
11
12 public class IndexValidatorHandler extends ValidatorHandlerImpl<PoxPayloadIn, PoxPayloadOut> {
13
14     /** The logger. */
15     private final Logger logger = LoggerFactory.getLogger(IndexValidatorHandler.class);
16     
17     /** Error Messages **/
18     private static final String VALIDATION_ERROR = "The intake record payload was invalid. See log file for more details.";
19     
20         
21     @Override
22     protected Class<?> getCommonPartClass() {
23         return IndexCommon.class;
24     }
25         
26         @Override
27         protected void handleCreate() throws InvalidDocumentException {
28                 try {
29                         IndexCommon intakesCommon = (IndexCommon)getCommonPart();
30                         assert(intakesCommon != null);
31         } catch (AssertionError e) {
32                 if (logger.isErrorEnabled() == true) {
33                         logger.error(e.getMessage(), e);
34                 }
35                 throw new InvalidDocumentException(VALIDATION_ERROR, e);
36         }
37         }
38
39         @Override
40         protected void handleGet() throws InvalidDocumentException {
41                 // TODO Auto-generated method stub
42                 
43         }
44
45         @Override
46         protected void handleGetAll() throws InvalidDocumentException {
47                 // TODO Auto-generated method stub
48                 
49         }
50
51         @Override
52         protected void handleUpdate() throws InvalidDocumentException {
53                 // TODO Auto-generated method stub
54                 
55         }
56
57         @Override
58         protected void handleDelete() throws InvalidDocumentException {
59                 // TODO Auto-generated method stub
60                 
61         }
62
63 }