01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.jetspeed.security;
18:
19: import java.util.prefs.Preferences;
20:
21: import javax.security.auth.Subject;
22:
23: /**
24: * <p>A user made of a {@link Subject} and the user {@link Preferences}.</p>
25: * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>
26: */
27: public interface User {
28: /**
29: * <p>
30: * The default user attributes property set.
31: * </p>
32: */
33: final static String USER_INFO_PROPERTY_SET = "userinfo";
34:
35: /**
36: * the subsite path for a given user stored as a user attribute
37: */
38: final static String USER_INFO_SUBSITE = "subsite";
39:
40: /**
41: * <p>Getter for the user {@link Subject} populated with the
42: * application principals.</p>
43: * @return The {@link Subject}.
44: */
45: Subject getSubject();
46:
47: /**
48: * <p>Setter for the user {@link Subject} populated with the
49: * application principals.</p>
50: * @param subject The {@link Subject}.
51: */
52: void setSubject(Subject subject);
53:
54: /**
55: * <p>Getter for the user {@link Preferences} node, providing access to the
56: * user preferences properties.</p>
57: * @return The {@link Preferences}.
58: */
59: Preferences getPreferences();
60:
61: /**
62: * <p>Setter for the user {@link Preferences} node, providing access to the
63: * user preferences properties.</p>
64: *
65: * @param preferences The {@link Preferences}.
66: */
67: void setPreferences(Preferences preferences);
68:
69: /**
70: * Get the user attributes for a given user
71: * @return a preference set of user attributes for a given user
72: */
73: Preferences getUserAttributes();
74:
75: }
|