public class UserProjectCacheMapAdapter extends Object implements UserProjectCache
| Constructor and Description |
|---|
UserProjectCacheMapAdapter(org.elasticsearch.common.settings.Settings settings) |
| Modifier and Type | Method and Description |
|---|---|
void |
expire() |
Set<String> |
getAllProjects()
Retrieve names of all projects that users belong to
|
Map<AbstractMap.SimpleImmutableEntry<String,String>,Set<String>> |
getUserProjects()
Retrieve an unmodifiable mapping of users to their projects
|
boolean |
hasUser(String user,
String token) |
boolean |
isOperationsUser(String user,
String token) |
void |
update(String user,
String token,
Set<String> projects,
boolean operationsUser)
Add users for a project
|
@Inject public UserProjectCacheMapAdapter(org.elasticsearch.common.settings.Settings settings)
public Map<AbstractMap.SimpleImmutableEntry<String,String>,Set<String>> getUserProjects()
UserProjectCachegetUserProjects in interface UserProjectCachepublic boolean hasUser(String user, String token)
hasUser in interface UserProjectCacheuser - The user to check in the cachetoken - The user's token to check in the cachepublic boolean isOperationsUser(String user, String token)
isOperationsUser in interface UserProjectCachepublic void update(String user, String token, Set<String> projects, boolean operationsUser)
UserProjectCacheupdate in interface UserProjectCacheuser - the usertoken - the token that the user used to authenticateprojects - the projects to add the user tooperationsUser - boolean whether or not the user is an operationsUserpublic void expire()
expire in interface UserProjectCachepublic Set<String> getAllProjects()
UserProjectCachegetAllProjects in interface UserProjectCacheCopyright © 2015–2017 Red Hat. All rights reserved.