001/* 002 * The contents of this file are subject to the license and copyright 003 * detailed in the LICENSE and NOTICE files at the root of the source 004 * tree. 005 */ 006package org.fcrepo.http.commons.responses; 007 008import com.fasterxml.jackson.annotation.JsonInclude; 009import org.fcrepo.kernel.api.exception.ConcurrentUpdateException; 010 011/** 012 * Response body for {@link ConcurrentUpdateException}. The message always is returned, and the transaction ids are 013 * returned if the fcrepo.response.include.transaction property is set. 014 * 015 * @author mikejritter 016 */ 017@JsonInclude(JsonInclude.Include.NON_NULL) 018public class ConcurrentExceptionResponse { 019 020 private final String message; 021 022 private String existingTransactionId; 023 024 private String conflictingTransactionId; 025 026 /** 027 * Response for {@link org.fcrepo.kernel.api.exception.ConcurrentUpdateException} 028 * 029 * @param message the exception message 030 */ 031 public ConcurrentExceptionResponse(final String message) { 032 this.message = message; 033 } 034 035 public String getMessage() { 036 return message; 037 } 038 039 public String getExistingTransactionId() { 040 return existingTransactionId; 041 } 042 043 public String getConflictingTransactionId() { 044 return conflictingTransactionId; 045 } 046 047 public void setExistingTransactionId(final String existingTransactionId) { 048 this.existingTransactionId = existingTransactionId; 049 } 050 051 public void setConflictingTransactionId(final String conflictingTransactionId) { 052 this.conflictingTransactionId = conflictingTransactionId; 053 } 054}