]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.api.uuid/src/org/argeo/api/uuid/BasicNameUuid.java
Kerberos does not try to use shared state
[lgpl/argeo-commons.git] / org.argeo.api.uuid / src / org / argeo / api / uuid / BasicNameUuid.java
1 package org.argeo.api.uuid;
2
3 import java.util.UUID;
4
5 /** A name based UUID (v3 or v5) whose construction values are not known. */
6 public class BasicNameUuid extends TypedUuid {
7 private static final long serialVersionUID = APM.SERIAL;
8
9 public BasicNameUuid(UUID uuid) {
10 super(uuid);
11 if ((uuid.version() != 5 && uuid.version() != 3) || uuid.variant() != 2)
12 throw new IllegalArgumentException("The provided UUID is not a name-based UUID.");
13 }
14
15 /**
16 * Always returns <code>true</code> since it is unknown from which values it was
17 * constructed..
18 */
19 @Override
20 public boolean isOpaque() {
21 return true;
22 }
23
24 /**
25 * Whether the hash of this name UUID was generated with SHA-1 (v5) or with MD5
26 * (v3).
27 */
28 public boolean isSha1() {
29 return uuid.version() == 5;
30 }
31 }