You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2009/04/02 14:59:20 UTC
svn commit: r761279 - in
/jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283:
InvalidLifecycleTransitionException.java Node.java
Author: jukka
Date: Thu Apr 2 12:59:20 2009
New Revision: 761279
URL: http://svn.apache.org/viewvc?rev=761279&view=rev
Log:
JCR-1565: JSR 283 lifecycle management
Add lifecycle management methods defined in JSR 283 PFD.
Added:
jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/InvalidLifecycleTransitionException.java (with props)
Modified:
jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/Node.java
Added: jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/InvalidLifecycleTransitionException.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/InvalidLifecycleTransitionException.java?rev=761279&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/InvalidLifecycleTransitionException.java (added)
+++ jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/InvalidLifecycleTransitionException.java Thu Apr 2 12:59:20 2009
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.api.jsr283;
+
+import javax.jcr.RepositoryException;
+
+/**
+ * Exception thrown by Lifecycle management-related methods.
+ *
+ * @since JCR 2.0
+ */
+public class InvalidLifecycleTransitionException extends RepositoryException {
+ /**
+ * Constructs a new instance of this class with <code>null</code> as its
+ * detail message.
+ */
+ public InvalidLifecycleTransitionException() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with the specified detail
+ * message.
+ *
+ * @param message the detail message. The detail message is saved for
+ * later retrieval by the {@link #getMessage()} method.
+ */
+ public InvalidLifecycleTransitionException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new instance of this class with the specified detail
+ * message and root cause.
+ *
+ * @param message the detail message. The detail message is saved for
+ * later retrieval by the {@link #getMessage()} method.
+ * @param rootCause root failure cause
+ */
+ public InvalidLifecycleTransitionException(String message, Throwable rootCause) {
+ super(message, rootCause);
+ }
+
+ /**
+ * Constructs a new instance of this class with the specified root cause.
+ *
+ * @param rootCause root failure cause
+ */
+ public InvalidLifecycleTransitionException(Throwable rootCause) {
+ super(rootCause);
+ }
+}
+
Propchange: jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/InvalidLifecycleTransitionException.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/Node.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/Node.java?rev=761279&r1=761278&r2=761279&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/Node.java (original)
+++ jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/Node.java Thu Apr 2 12:59:20 2009
@@ -19,6 +19,7 @@
import javax.jcr.NodeIterator;
import javax.jcr.RepositoryException;
import javax.jcr.PropertyIterator;
+import javax.jcr.UnsupportedRepositoryOperationException;
import javax.jcr.lock.LockException;
import javax.jcr.nodetype.ConstraintViolationException;
import javax.jcr.nodetype.NoSuchNodeTypeException;
@@ -197,4 +198,50 @@
*/
public void removeSharedSet() throws VersionException, LockException, ConstraintViolationException, RepositoryException;
+ /**
+ * Causes the lifecycle state of this node to undergo the specified
+ * <code>transition</code>.
+ * <p>
+ * This method may change the value of the <code>jcr:currentLifecycleState</code>
+ * property, in most cases it is expected that the implementation will change
+ * the value to that of the passed <code>transition</code> parameter, though
+ * this is an implementation-specific issue. If the <code>jcr:currentLifecycleState</code>
+ * property is changed the change is persisted immediately, there is no need
+ * to call <code>save</code>.
+ * <p>
+ * Throws an <code>UnsupportedRepositoryOperationException</code> if this
+ * implementation does not support lifecycle actions or if this node does
+ * not have the <code>mix:lifecycle</code> mixin.
+ * <p>
+ * Throws <code>InvalidLifecycleTransitionException</code> if the lifecycle
+ * transition is not successful.
+ *
+ * @param transition a state transition
+ * @throws UnsupportedRepositoryOperationException
+ * if this implementation does
+ * not support lifecycle actions or if this node does not have the
+ * <code>mix:lifecycle</code> mixin.
+ * @throws InvalidLifecycleTransitionException
+ * if the lifecycle transition is not successful.
+ * @throws RepositoryException if another error occurs.
+ * @since JCR 2.0
+ */
+ public void followLifecycleTransition(String transition)
+ throws UnsupportedRepositoryOperationException,
+ InvalidLifecycleTransitionException, RepositoryException;
+
+ /**
+ * Returns the list of valid state transitions for this node.
+ *
+ * @return a <code>String</code> array.
+ * @throws UnsupportedRepositoryOperationException
+ * if this implementation does
+ * not support lifecycle actions or if this node does not have the
+ * <code>mix:lifecycle</code> mixin.
+ * @throws RepositoryException if another error occurs.
+ * @since JCR 2.0
+ */
+ public String[] getAllowedLifecycleTransistions()
+ throws UnsupportedRepositoryOperationException, RepositoryException;
+
}