1 package org.collectionspace.services.index.nuxeo;
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;
9 import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory;
12 public class IndexValidatorHandler extends ValidatorHandlerImpl<PoxPayloadIn, PoxPayloadOut> {
15 private final Logger logger = LoggerFactory.getLogger(IndexValidatorHandler.class);
17 /** Error Messages **/
18 private static final String VALIDATION_ERROR = "The intake record payload was invalid. See log file for more details.";
22 protected Class<?> getCommonPartClass() {
23 return IndexCommon.class;
27 protected void handleCreate() throws InvalidDocumentException {
29 IndexCommon intakesCommon = (IndexCommon)getCommonPart();
30 assert(intakesCommon != null);
31 } catch (AssertionError e) {
32 if (logger.isErrorEnabled() == true) {
33 logger.error(e.getMessage(), e);
35 throw new InvalidDocumentException(VALIDATION_ERROR, e);
40 protected void handleGet() throws InvalidDocumentException {
41 // TODO Auto-generated method stub
46 protected void handleGetAll() throws InvalidDocumentException {
47 // TODO Auto-generated method stub
52 protected void handleUpdate() throws InvalidDocumentException {
53 // TODO Auto-generated method stub
58 protected void handleDelete() throws InvalidDocumentException {
59 // TODO Auto-generated method stub