- /** Whether the contexts have already been loaded. */
- private volatile boolean contextsLoaded = false;
-
- /** The properties of the identity. */
- private final Map<String, String> properties = Collections.synchronizedMap(new HashMap<String, String>());
-
- /**
- * Creates a new identity.
- *
- * @param webOfTrustConnector
- * The Web of Trust connector
- * @param id
- * The ID of the identity
- * @param nickname
- * The nickname of the identity
- * @param requestUri
- * The request URI of the identity
- */
- public Identity(WebOfTrustConnector webOfTrustConnector, String id, String nickname, String requestUri) {
- this.webOfTrustConnector = webOfTrustConnector;
- this.id = id;
- this.nickname = nickname;
- this.requestUri = requestUri;
- }
+ public static final Function<Identity, Set<String>> TO_CONTEXTS = new Function<Identity, Set<String>>() {
+ @Override
+ public Set<String> apply(Identity identity) {
+ return (identity == null) ? Collections.<String>emptySet() : identity.getContexts();
+ }
+ };