public class GatewayWrapper extends Object implements Client
Contains the gateway, the security context, and the current user.
Constructor and Description |
---|
GatewayWrapper()
Constructor of the GatewayWrapper class.
|
GatewayWrapper(Gateway gateway,
SecurityContext ctx,
Experimenter user)
Constructor of the GatewayWrapper class.
|
Modifier and Type | Method and Description |
---|---|
void |
connect(LoginCredentials credentials)
Connects the user to OMERO.
|
void |
disconnect()
Disconnects the user
|
SecurityContext |
getCtx()
Contains the permissions of the user in the group.
|
Gateway |
getGateway()
Returns the Gateway.
|
Experimenter |
getUser()
Returns the current user.
|
Client |
sudo(String username)
Returns a Client associated with the given username.
|
void |
switchGroup(long groupId)
Change the current group used by the current user;
|
String |
toString()
Overridden to return the host name, the group ID, the username and the connection status.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAdminFacility, getBrowseFacility, getDMFacility, getMetadataFacility, getQueryService, getRoiFacility, getTablesFacility
connect, connect, connect, getCurrentGroupId, getId, getImportStore, getSessionId, isConnected
findByQuery, getDataset, getDatasets, getDatasets, getDatasets, getDatasets, getFolder, getFolders, getFolders, getImage, getImages, getImages, getImages, getImages, getImages, getImagesLike, getImagesWithKey, getImagesWithKeyValuePair, getMapAnnotation, getMapAnnotations, getMapAnnotations, getMapAnnotations, getPlate, getPlates, getPlates, getPlates, getProject, getProjects, getProjects, getProjects, getProjects, getScreen, getScreens, getScreens, getScreens, getTag, getTags, getTags, getWell, getWells, getWells, getWells, loadFolders
delete, delete, delete, delete, delete, deleteFile, save
getGroup, getUser
public GatewayWrapper()
public GatewayWrapper(Gateway gateway, SecurityContext ctx, Experimenter user)
Null arguments will be replaced with default empty objects.
gateway
- The Gateway
.ctx
- The security context.user
- The user.public Gateway getGateway()
getGateway
in interface ConnectionHandler
public Experimenter getUser()
getUser
in interface ConnectionHandler
public SecurityContext getCtx()
getCtx
in interface AdminManager
getCtx
in interface Browser
getCtx
in interface ConnectionHandler
getCtx
in interface DataManager
SecurityContext
of the user.public void connect(LoginCredentials credentials) throws ServiceException
connect
in interface ConnectionHandler
credentials
- User credentials.ServiceException
- Cannot connect to OMERO.public void disconnect()
disconnect
in interface ConnectionHandler
public void switchGroup(long groupId)
switchGroup
in interface ConnectionHandler
groupId
- The group ID.public Client sudo(String username) throws ServiceException, AccessException, ExecutionException
All actions realized with the returned Client will be considered as his.
The user calling this function needs to have administrator rights.
sudo
in interface Client
sudo
in interface ConnectionHandler
username
- The user name.ServiceException
- Cannot connect to OMERO.AccessException
- Cannot access data.ExecutionException
- A Facility can't be retrieved or instantiated.NoSuchElementException
- The requested user does not exist.Copyright © 2020–2023 GReD. All rights reserved.