1 package org.collectionspace.services.intake.nuxeo;
\r
3 import org.collectionspace.services.client.PoxPayloadIn;
\r
4 import org.collectionspace.services.client.PoxPayloadOut;
\r
5 import org.collectionspace.services.common.document.InvalidDocumentException;
\r
6 import org.collectionspace.services.common.document.ValidatorHandlerImpl;
\r
7 import org.collectionspace.services.intake.IntakesCommon;
\r
9 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
\r
10 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
\r
12 import org.slf4j.Logger;
\r
13 import org.slf4j.LoggerFactory;
\r
15 public class IntakeValidatorHandler extends ValidatorHandlerImpl<PoxPayloadIn, PoxPayloadOut> {
\r
18 private final Logger logger = LoggerFactory.getLogger(IntakeValidatorHandler.class);
\r
20 /** Error Messages **/
\r
21 private static final String VALIDATION_ERROR = "The intake record payload was invalid. See log file for more details.";
\r
25 protected Class<?> getCommonPartClass() {
\r
26 return IntakesCommon.class;
\r
30 protected void handleCreate() throws InvalidDocumentException {
\r
32 IntakesCommon intakesCommon = (IntakesCommon)getCommonPart();
\r
33 assert(intakesCommon != null);
\r
34 } catch (AssertionError e) {
\r
35 if (logger.isErrorEnabled() == true) {
\r
36 logger.error(e.getMessage(), e);
\r
38 throw new InvalidDocumentException(VALIDATION_ERROR, e);
\r
43 protected void handleGet() throws InvalidDocumentException {
\r
44 // TODO Auto-generated method stub
\r
49 protected void handleGetAll() throws InvalidDocumentException {
\r
50 // TODO Auto-generated method stub
\r
55 protected void handleUpdate() throws InvalidDocumentException {
\r
56 // TODO Auto-generated method stub
\r
61 protected void handleDelete() throws InvalidDocumentException {
\r
62 // TODO Auto-generated method stub
\r