1 package edu.internet2.middleware.shibboleth.hs
3 import edu.internet2.middleware.shibboleth.*;
4 import edu.internet2.middleware.shibboleth.common.*;
7 import HandleException;
8 import org.doomdark.uuid.*;
11 * Object all user information is kept in
13 * @author Barbara Jensen
15 public class HandleEntry {
16 /** opaque handle, based off MAC address and time */
17 protected String handle;
18 /** username, passed in from RemoteUser */
19 protected String username;
20 /** authentication type, passed from AuthType */
21 protected String authType;
22 /** instant of handle creation */
23 protected long authInstant;
24 /** instant of handle expiration, based on ticket length */
25 protected long expInstant;
28 * HandleEntry object, created from HandleService
31 public HandleEntry ( String username, String authType,
33 throws HandleException
35 if (username == null || username.length() == 0)
36 throw new HandleException(HandleException.ERR, "HandleEntry() requires username");
37 if (authType == null || authType.length() == 0)
38 throw new HandleException(HandleException.ERR, "HandleEntry() requires authType");
40 handle = UUIDGenerator.getInstance().generateRandomBasedUUID().toString();
41 this.username = username;
42 this.authType = authType;
43 this.authInstant= System.currentTimeMillis();
44 this.expInstant = authInstant+ticketLength;
48 * HandleEntry object, created from all parts
51 public HandleEntry ( String handle, String username, String authType,
52 long authInstant, long expInstant )
53 throws HandleException
55 if (handle == null || handle.length() == 0)
56 throw new HandleException(HandleException.ERR, "HandleEntry() requires handle");
57 if (username == null || username.length() == 0)
58 throw new HandleException(HandleException.ERR, "HandleEntry() requires username");
59 if (authType == null || authType.length() == 0)
60 throw new HandleException(HandleException.ERR, "HandleEntry() requires authType");
63 this.username = username;
64 this.authType = authType;
65 this.authInstant = authInstant;
66 this.expInstant = expInstant;
70 * Gets the HandleEntry's handle string
73 public String getHandle () {
78 * Gets the HandleEntry's username
81 public String getUsername () {
86 * Gets the HandleEntry's authentication type
89 public String getAuthType () {
94 * Gets the HandleEntry's creation/authentication date
97 public long getAuthInstant () {
102 * Gets the HandleEntry's expiration date
105 public long getExpInstant () {