01: /*
02: * Copyright 2004 Outerthought bvba and Schaubroeck nv
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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.outerj.daisy.repository.user;
17:
18: import java.util.Date;
19:
20: import org.outerx.daisy.x10.RoleDocument;
21: import org.outerj.daisy.repository.RepositoryException;
22:
23: /**
24: * A role that a user can have.
25: */
26: public interface Role {
27: /**
28: * ID of the Administrator role. The Administrator is a built-in
29: * role required for the correct operation of the repository.
30: * Some operations can only be done by users having the Administrator
31: * role.
32: */
33: long ADMINISTRATOR = 1;
34:
35: /**
36: * Gets the name of this role.
37: */
38: String getName();
39:
40: /**
41: * Sets the name of this role.
42: */
43: void setName(String roleName);
44:
45: /**
46: * Gets the description of this role, which can be null.
47: */
48: String getDescription();
49:
50: /**
51: * Sets the description of this role. Can be set to null.
52: */
53: void setDescription(String description);
54:
55: /**
56: * Gets the id of this role, or -1 if this role object hasn't been saved yet.
57: */
58: long getId();
59:
60: /**
61: * Persist this Role to the data store. If this is the first time
62: * the role is saved, its id will be assigned.
63: */
64: void save() throws RepositoryException;
65:
66: /**
67: * Gets the last modified date of this role object.
68: *
69: * <p>Returns null if this object hasn't been saved to the data store yet.
70: */
71: Date getLastModified();
72:
73: /**
74: * Gets the data store id of the last modifier of this role object.
75: *
76: * <p>Returns null if this object hasn't been saved to the data store yet.
77: */
78: long getLastModifier();
79:
80: /**
81: * Gets an XML representation of this object.
82: */
83: RoleDocument getXml();
84:
85: long getUpdateCount();
86: }
|