KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > exceptions > JahiaUpdateLockException


1 // $Id: JahiaUpdateLockException.java 3567 2003-06-30 22:32:03Z shuber $
2
//
3
//
4
// ____.
5
// __/\ ______| |__/\. _______
6
// __ .____| | \ | +----+ \
7
// _______| /--| | | - \ _ | : - \_________
8
// \\______: :---| : : | : | \________>
9
// |__\---\_____________:______: :____|____:_____\
10
// /_____|
11
//
12
// . . . i n j a h i a w e t r u s t . . .
13
//
14

15
16 package org.jahia.exceptions;
17
18 import org.jahia.data.containers.JahiaContainer;
19 import org.jahia.services.pages.JahiaPage;
20
21 /**
22  * This exception is raised when an object is requested for updating and is
23  * already locked by another user.
24  *
25  * @author Fulco Houkes
26  * @version 1.1
27  */

28 public class JahiaUpdateLockException extends JahiaException
29 {
30
31     private JahiaPage mPageRef = null;
32     private JahiaContainer mContainerRef = null;
33
34
35     //-------------------------------------------------------------------------
36
/** Default constructor
37      *
38      * @param page
39      * The page reference.
40      */

41     public JahiaUpdateLockException (JahiaPage page)
42     {
43         super ("The page is currently locked by another user.",
44                "The page ["+page.getID()+"] is locked by another user.",
45                LOCK_ERROR, ERROR_SEVERITY);
46         mPageRef = page;
47     }
48
49
50     //-------------------------------------------------------------------------
51
/** Default constructor
52      *
53      * @param container
54      * The reference container.
55      */

56     public JahiaUpdateLockException (JahiaContainer container)
57     {
58         super ("The container is currently locked by another user.",
59                "The container ["+container.getID()+"] is locked by another user.",
60                LOCK_ERROR, ERROR_SEVERITY);
61         mContainerRef = container;
62     }
63
64     //-------------------------------------------------------------------------
65
/** Return the page's reference which is currently locked.
66      *
67      * @return
68      * Return the page reference. Return null if it was not a page which
69      * is locked.
70      */

71     public JahiaPage getPage () {
72         return mPageRef;
73     }
74
75     //-------------------------------------------------------------------------
76
/** Return the container's reference which is locked.
77      *
78      * @return
79      * Return the container reference. Return null if it was not a
80      * container which is locked.
81      */

82     public JahiaContainer getContainer () {
83         return mContainerRef;
84     }
85
86 }
87
Popular Tags