View Javadoc

1   /* $HeadURL::                                                                            $
2    * $Id$
3    *
4    * Copyright (c) 2009-2010 DuraSpace
5    * http://duraspace.org
6    *
7    * In collaboration with Topaz Inc.
8    * http://www.topazproject.org
9    *
10   * Licensed under the Apache License, Version 2.0 (the "License");
11   * you may not use this file except in compliance with the License.
12   * You may obtain a copy of the License at
13   *
14   *     http://www.apache.org/licenses/LICENSE-2.0
15   *
16   * Unless required by applicable law or agreed to in writing, software
17   * distributed under the License is distributed on an "AS IS" BASIS,
18   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19   * See the License for the specific language governing permissions and
20   * limitations under the License.
21   */
22  package org.akubraproject.txn;
23  
24  import java.net.URI;
25  import org.akubraproject.AkubraBlobException;
26  
27  /**
28   * This exception is thrown by a transactional blob store when the same blob is created, deleted,
29   * or modified by two separate concurrent transactions.
30   *
31   * @author Ronald Tschalär
32   */
33  public class ConcurrentBlobUpdateException extends AkubraBlobException {
34    public static final long serialVersionUID = 1L;
35  
36    /**
37     * Exception indicating there is duplicate blob in the store associated with the blob-id.
38     *
39     * @param blobId the blob-id
40     */
41    public ConcurrentBlobUpdateException(URI blobId) {
42      this(blobId, "Concurrent modification of blob with id = '" + blobId + "'", null);
43    }
44  
45    /**
46     * Exception indicating there is duplicate blob in the store associated with the blob-id.
47     *
48     * @param blobId the blob-id
49     * @param msg the details about the exception
50     */
51    public ConcurrentBlobUpdateException(URI blobId, String msg) {
52      this(blobId, msg, null);
53    }
54  
55    /**
56     * Exception indicating there is duplicate blob in the store associated with the blob-id.
57     *
58     * @param blobId the blob-id
59     * @param msg    the details about the exception
60     * @param cause  the underlying exception that caused this exception
61     */
62    public ConcurrentBlobUpdateException(URI blobId, String msg, Throwable cause) {
63      super(blobId, msg, cause);
64    }
65  }