Package org.intermine.api.util
Class AnonProfile
- java.lang.Object
-
- org.intermine.api.profile.Profile
-
- org.intermine.api.util.AnonProfile
-
public final class AnonProfile extends Profile
A null-object for profiles for use with the web services. This profile will act as through the user has no history of any kind. Any attempt to save history will be discarded.- Author:
- Alex Kalderimis
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
USERNAME
The user name of the anonymous user.-
Fields inherited from class org.intermine.api.profile.Profile
isSuperUser, manager, NO_BAGS, NO_QUERIES, NO_TEMPLATES, password, queryHistory, savedBags, savedInvalidBags, savedQueries, savedTemplates, savingDisabled, userId, username
-
-
Constructor Summary
Constructors Constructor Description AnonProfile()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InterMineBag
createBag(java.lang.String name, java.lang.String type, java.lang.String desc, java.util.Map classKeys)
Create a bag and save it to the userprofile database.void
enableSaving()
Re-enable saving when saveTemplate(), deleteQuery() etc.java.lang.String
getDayToken()
Get a token with at least an hour of validity, and up to 24 hours.java.lang.String
getUsername()
Get the value of usernameboolean
isLoggedIn()
Return true if and only if the user is logged is (and the Profile will be written to the userprofile).boolean
isSuperuser()
Return true if and only if the user logged is superuser-
Methods inherited from class org.intermine.api.profile.Profile
deleteBag, deleteHistory, deleteQuery, deleteTemplate, disableSaving, fixInvalidBag, getAllBags, getApiKey, getCurrentSavedBags, getEmailAddress, getHistory, getInvalidBags, getName, getPassword, getPreferences, getProfileManager, getSavedBags, getSavedBagsByStatus, getSavedQueries, getSavedTemplates, getSearchRepository, getSharedBags, getSingleUseKey, getSuperuser, getTemplate, getUserId, getWebSearchablesByType, invalidateTemplateCacheIfRequired, isLocal, prefers, renameBag, renameHistory, saveBag, saveBag, saveHistory, saveQueries, saveQuery, saveTemplate, setApiKey, setSuperuser, setUserId, updateBagDescription, updateBagType, updateTemplate, updateUserRepositoryWithSharedBags
-
-
-
-
Field Detail
-
USERNAME
public static final java.lang.String USERNAME
The user name of the anonymous user.- See Also:
- Constant Field Values
-
-
Method Detail
-
enableSaving
public void enableSaving()
Description copied from class:Profile
Re-enable saving when saveTemplate(), deleteQuery() etc. are called. Also calls ProfileManager.saveProfile() to write this Profile to the database and rebuilds the template description index.- Overrides:
enableSaving
in classProfile
-
isSuperuser
public boolean isSuperuser()
Description copied from class:Profile
Return true if and only if the user logged is superuser- Overrides:
isSuperuser
in classProfile
- Returns:
- Return true if superuser
-
isLoggedIn
public boolean isLoggedIn()
Description copied from class:Profile
Return true if and only if the user is logged is (and the Profile will be written to the userprofile).- Overrides:
isLoggedIn
in classProfile
- Returns:
- Return true if logged in
-
createBag
public InterMineBag createBag(java.lang.String name, java.lang.String type, java.lang.String desc, java.util.Map classKeys)
Description copied from class:Profile
Create a bag and save it to the userprofile database.
-
getUsername
public java.lang.String getUsername()
Description copied from class:Profile
Get the value of username- Overrides:
getUsername
in classProfile
- Returns:
- the value of username
-
getDayToken
public java.lang.String getDayToken()
Description copied from class:Profile
Get a token with at least an hour of validity, and up to 24 hours.- Overrides:
getDayToken
in classProfile
- Returns:
- A token for web-service use.
-
-