Class GatewayWrapper

  • All Implemented Interfaces:
    AdminManager, Browser, Client, ConnectionHandler, DataManager

    public class GatewayWrapper
    extends java.lang.Object
    implements Client
    Allows the user to connect to OMERO and browse through all the data accessible to the user.

    Contains the gateway, the security context, and the current user.

    • Constructor Detail

      • GatewayWrapper

        public GatewayWrapper()
        Constructor of the GatewayWrapper class. Initializes the gateway.
      • GatewayWrapper

        protected GatewayWrapper​(Gateway gateway,
                                 SecurityContext ctx,
                                 Experimenter user)
        Constructor of the GatewayWrapper class.

        Null arguments will be replaced with default empty objects.

        Parameters:
        gateway - The Gateway.
        ctx - The security context.
        user - The user.
    • Method Detail

      • switchGroup

        public void switchGroup​(long groupId)
        Change the current group used by the current user;
        Specified by:
        switchGroup in interface ConnectionHandler
        Parameters:
        groupId - The group ID.
      • sudo

        public Client sudo​(java.lang.String username)
                    throws ServiceException,
                           AccessException,
                           java.util.concurrent.ExecutionException
        Returns a Client associated with the given username.

        All actions realized with the returned Client will be considered as his.

        The user calling this function needs to have administrator rights.

        Specified by:
        sudo in interface Client
        Specified by:
        sudo in interface ConnectionHandler
        Parameters:
        username - The user name.
        Returns:
        The connection and context corresponding to the new user.
        Throws:
        ServiceException - Cannot connect to OMERO.
        AccessException - Cannot access data.
        java.util.concurrent.ExecutionException - A Facility can't be retrieved or instantiated.
        java.util.NoSuchElementException - The requested user does not exist.
      • toString

        public java.lang.String toString()
        Overridden to return the host name, the group ID, the username and the connection status.
        Overrides:
        toString in class java.lang.Object
        Returns:
        See above.