KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > cms > rc > FileReservedCheckOutException


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17
18 /* $Id: FileReservedCheckOutException.java 42598 2004-03-01 16:18:28Z gregor $ */
19
20 package org.apache.lenya.cms.rc;
21
22 import java.util.Date JavaDoc;
23
24
25 public class FileReservedCheckOutException extends Exception JavaDoc {
26     private String JavaDoc source = null;
27     private Date JavaDoc checkOutDate = null;
28     private String JavaDoc checkOutUsername = null;
29
30     /**
31      * Creates a new FileReservedCheckOutException object.
32      *
33      * @param source DOCUMENT ME!
34      * @param rcml DOCUMENT ME!
35      *
36      * @throws Exception DOCUMENT ME!
37      */

38     public FileReservedCheckOutException(String JavaDoc source, RCML rcml)
39         throws Exception JavaDoc {
40         this.source = source;
41
42         try {
43             CheckOutEntry coe = rcml.getLatestCheckOutEntry();
44
45             checkOutUsername = coe.getIdentity();
46             checkOutDate = new Date JavaDoc(coe.getTime());
47         } catch (Exception JavaDoc exception) {
48             throw new Exception JavaDoc("Unable to create FileReservedCheckOutException object!");
49         }
50     }
51     
52     /**
53      * Get the date of the checkout.
54      *
55      * @return the date of the checkout
56      */

57     public Date JavaDoc getCheckOutDate() {
58         return checkOutDate;
59     }
60
61     /**
62      * Get the user name who did this checkout.
63      *
64      * @return the user name of this checkout
65      */

66     public String JavaDoc getCheckOutUsername() {
67         return checkOutUsername;
68     }
69
70 }
71
Popular Tags