[exo-jcr-commits] exo-jcr SVN: r452 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Oct 30 07:11:43 EDT 2009
Author: areshetnyak
Date: 2009-10-30 07:11:43 -0400 (Fri, 30 Oct 2009)
New Revision: 452
Added:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/JCRItemExistsException.java
Log:
EXOJCR-218 : Add exception JCRItemExistsException.
Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/JCRItemExistsException.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/JCRItemExistsException.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/JCRItemExistsException.java 2009-10-30 11:11:43 UTC (rev 452)
@@ -0,0 +1,130 @@
+package org.exoplatform.services.jcr.impl.storage;
+
+import javax.jcr.ItemExistsException;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>
+ * Date: 29.10.2009
+ *
+ * @author <a href="mailto:alex.reshetnyak at exoplatform.com.ua">Alex Reshetnyak</a>
+ * @version $Id$
+ */
+public class JCRItemExistsException
+ extends ItemExistsException
+{
+ /**
+ * serialVersionUID - autogenerated.
+ */
+ private static final long serialVersionUID = -5201442796959443584L;
+
+ /**
+ * Context Item Id.
+ */
+ private final String itemId;
+
+ /**
+ * Context Item state.
+ */
+ private final int itemState;
+
+ /**
+ * JCRItemExistsException constructor.
+ *
+ * @param message
+ * - context message
+ */
+ public JCRItemExistsException(String message)
+ {
+ super(message);
+ this.itemId = null;
+ this.itemState = -1;
+ }
+
+ /**
+ * JCRItemExistsException constructor.
+ *
+ * @param message
+ * - context message
+ * @param itemId
+ * - context Item id
+ */
+ public JCRItemExistsException(String message, String itemId)
+ {
+ super(message);
+ this.itemId = itemId;
+ this.itemState = -1;
+ }
+
+ /**
+ * JCRItemExistsException constructor.
+ *
+ * @param message
+ * - context message
+ * @param itemId
+ * - context Item id
+ * @param itemState
+ * - context Item state
+ */
+ public JCRItemExistsException(String message, String itemId, int itemState)
+ {
+ super(message);
+ this.itemId = itemId;
+ this.itemState = itemState;
+ }
+
+ /**
+ * JCRItemExistsException constructor.
+ *
+ *@param message
+ * - context message
+ * @param itemId
+ * - context Item id
+ * @param e - cause error
+ */
+ public JCRItemExistsException(String message, String itemId, Throwable e)
+ {
+ super(message, e);
+ this.itemId = itemId;
+ this.itemState = -1;
+ }
+
+ /**
+ * JCRItemExistsException constructor.
+ *
+ * @param message
+ * - context message
+ * @param itemId
+ * - context Item id
+ * @param itemState
+ * - context Item state
+ * @param e - cause error
+ */
+ public JCRItemExistsException(String message, String itemId, int itemState, Throwable e)
+ {
+ super(message, e);
+ this.itemId = itemId;
+ this.itemState = itemState;
+ }
+
+ /**
+ * Get context Item Id.
+ *
+ * @return String Item id
+ */
+ public String getIdentifier()
+ {
+ return itemId;
+ }
+
+ /**
+ * Get context Item state.
+ *
+ * @return int state
+ */
+ public int getState()
+ {
+ return itemState;
+ }
+}
\ No newline at end of file
Property changes on: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/JCRItemExistsException.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
More information about the exo-jcr-commits
mailing list