]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.api.cms/src/org/argeo/api/cms/CmsSessionId.java
Fix deployment versions
[lgpl/argeo-commons.git] / org.argeo.api.cms / src / org / argeo / api / cms / CmsSessionId.java
1 package org.argeo.api.cms;
2
3 import java.util.UUID;
4
5 import javax.security.auth.Subject;
6
7 /**
8 * The ID of a {@link CmsSession}, which must be available in the private
9 * credentials of an authenticated {@link Subject}.
10 */
11 public class CmsSessionId {
12 private final UUID uuid;
13
14 public CmsSessionId(UUID value) {
15 if (value == null)
16 throw new IllegalArgumentException("Value cannot be null");
17 this.uuid = value;
18 }
19
20 public UUID getUuid() {
21 return uuid;
22 }
23
24 @Override
25 public int hashCode() {
26 return uuid.hashCode();
27 }
28
29 @Override
30 public boolean equals(Object obj) {
31 return obj instanceof CmsSessionId && ((CmsSessionId) obj).getUuid().equals(uuid);
32 }
33
34 @Override
35 public String toString() {
36 return "Node Session " + uuid;
37 }
38
39 }