KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > source > helpers > SourceLock


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 package org.apache.cocoon.components.source.helpers;
17
18 import java.util.Date JavaDoc;
19
20 /**
21  * This interface for lock of a source
22  *
23  * @author <a HREF="mailto:stephan@vern.chem.tu-berlin.de">Stephan Michels</a>
24  * @version CVS $Id: SourceLock.java 30932 2004-07-29 17:35:38Z vgritsenko $
25  */

26 public class SourceLock {
27
28     private String JavaDoc subject;
29     private String JavaDoc type;
30     private Date JavaDoc expiration;
31     private boolean inheritable;
32     private boolean exclusive;
33
34     /**
35      * Creates a new lock for a source
36      *
37      * @param subject Which user should be locked
38      * @param type Type of lock
39      * @param expiration When the lock expires
40      * @param inheritable If the lock is inheritable
41      * @param exclusive If the lock is exclusive
42      */

43     public SourceLock(String JavaDoc subject, String JavaDoc type, Date JavaDoc expiration,
44                       boolean inheritable, boolean exclusive) {
45
46         this.subject = subject;
47         this.type = type;
48         this.expiration = expiration;
49         this.inheritable = inheritable;
50         this.exclusive = exclusive;
51     }
52
53     /**
54      * Sets the subject for this lock
55      *
56      * @param subject Which user should be locked
57      */

58     public void setSubject(String JavaDoc subject) {
59         this.subject = subject;
60     }
61
62     /**
63      * return the subject of the lock
64      *
65      * @return Which user should be locked
66      */

67     public String JavaDoc getSubject() {
68         return this.subject;
69     }
70
71     /**
72      * Sets the type of the lock
73      *
74      * @param type Type of lock
75      */

76     public void setType(String JavaDoc type) {
77         this.type = type;
78     }
79
80     /**
81      * Return ths type of the lock
82      *
83      * @return Type of lock
84      */

85     public String JavaDoc getType() {
86         return this.type;
87     }
88
89     /**
90      * Set the expiration date
91      *
92      * @param expiration Expiration date
93      */

94     public void setExpiration(Date JavaDoc expiration) {
95         this.expiration = expiration;
96     }
97
98     /**
99      * Returns the expiration date
100      *
101      * @return Expiration date
102      */

103     public Date JavaDoc getExpiration() {
104         return this.expiration;
105     }
106
107     /**
108      * Sets the inheritable flag
109      *
110      * @param inheritable If the lock is inheritable
111      */

112     public void setInheritable(boolean inheritable) {
113         this.inheritable = inheritable;
114     }
115
116     /**
117      * Returns the inheritable flag
118      *
119      * @return If the lock is inheritable
120      */

121     public boolean isInheritable() {
122         return this.inheritable;
123     }
124
125     /**
126      * Sets the exclusive flag
127      *
128      * @param exclusive If the lock is exclusive
129      */

130     public void setExclusive(boolean exclusive) {
131         this.exclusive = exclusive;
132     }
133
134     /**
135      * Returns the exclusive flag
136      *
137      * @return If the lock is exclusive
138      */

139     public boolean isExclusive() {
140         return this.exclusive;
141     }
142 }
143
Popular Tags