1 package org.collectionspace.services.intake.nuxeo;
\r
3 import org.collectionspace.services.common.document.InvalidDocumentException;
\r
4 import org.collectionspace.services.common.document.ValidatorHandlerImpl;
\r
5 import org.collectionspace.services.intake.IntakesCommon;
\r
7 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
\r
8 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
\r
10 import org.slf4j.Logger;
\r
11 import org.slf4j.LoggerFactory;
\r
13 public class IntakeValidatorHandler extends ValidatorHandlerImpl<MultipartInput, MultipartOutput> {
\r
16 private final Logger logger = LoggerFactory.getLogger(IntakeValidatorHandler.class);
\r
18 /** Error Messages **/
\r
19 private static final String VALIDATION_ERROR = "The intake record payload was invalid. See log file for more details.";
\r
23 protected Class<?> getCommonPartClass() {
\r
24 return IntakesCommon.class;
\r
28 protected void handleCreate() throws InvalidDocumentException {
\r
30 IntakesCommon intakesCommon = (IntakesCommon)getCommonPart();
\r
31 assert(intakesCommon != null);
\r
32 } catch (AssertionError e) {
\r
33 if (logger.isErrorEnabled() == true) {
\r
34 logger.error(e.getMessage(), e);
\r
36 throw new InvalidDocumentException(VALIDATION_ERROR, e);
\r
41 protected void handleGet() throws InvalidDocumentException {
\r
42 // TODO Auto-generated method stub
\r
47 protected void handleGetAll() throws InvalidDocumentException {
\r
48 // TODO Auto-generated method stub
\r
53 protected void handleUpdate() throws InvalidDocumentException {
\r
54 // TODO Auto-generated method stub
\r
59 protected void handleDelete() throws InvalidDocumentException {
\r
60 // TODO Auto-generated method stub
\r