Class NodeProviderWrapper<P extends NodeProvider & ReadOnlyStatus.IsAware>

  • Type Parameters:
    P - node providers that adjust according to read-only status
    All Implemented Interfaces:
    NodeProvider

    public class NodeProviderWrapper<P extends NodeProvider & ReadOnlyStatus.IsAware>
    extends java.lang.Object
    implements NodeProvider
    A node provider that offers a unified view of multiple underlying node providers.
    Since:
    5.4.6
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ome.model.meta.Node addManager​(java.lang.String managerUuid, java.lang.String proxyString)
      Adds a manager node.
      int closeSessionsForManager​(java.lang.String managerUuid)
      Closes all sessions for a given manager node.
      ome.model.meta.Node getManagerByUuid​(java.lang.String managerUuid, ome.system.ServiceFactory sf)
      Retrieves a given manager node.
      long getManagerIdByUuid​(java.lang.String managerUuid, ome.util.SqlAction sql)
      Retrieves a given manager node ID.
      java.util.Set<java.lang.String> getManagerList​(boolean onlyActive)  
      ome.system.Principal principal()
      Retrieves the current active principal.
      void setManagerDown​(java.lang.String managerUuid)
      Sets a given manager node as down.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NodeProviderWrapper

        public NodeProviderWrapper​(ReadOnlyStatus readOnly,
                                   java.util.List<P> providers)
        Construct a new node provider.
        Parameters:
        readOnly - the read-only status
        providers - the node providers to wrap: the earlier providers are tried first and at least one provider must support write operations according to ReadOnlyStatus.IsAware.isReadOnly(ReadOnlyStatus)
    • Method Detail

      • getManagerList

        public java.util.Set<java.lang.String> getManagerList​(boolean onlyActive)
        Specified by:
        getManagerList in interface NodeProvider
      • getManagerIdByUuid

        public long getManagerIdByUuid​(java.lang.String managerUuid,
                                       ome.util.SqlAction sql)
        Description copied from interface: NodeProvider
        Retrieves a given manager node ID.
        Specified by:
        getManagerIdByUuid in interface NodeProvider
        Parameters:
        managerUuid - manager node UUID to retrieve
        sql - active SQL context which can be used to make queries
        Returns:
        See above.
      • getManagerByUuid

        public ome.model.meta.Node getManagerByUuid​(java.lang.String managerUuid,
                                                    ome.system.ServiceFactory sf)
        Description copied from interface: NodeProvider
        Retrieves a given manager node.
        Specified by:
        getManagerByUuid in interface NodeProvider
        Parameters:
        managerUuid - manager node UUID to retrieve
        sf - current session's service factory
        Returns:
        See above.
      • closeSessionsForManager

        public int closeSessionsForManager​(java.lang.String managerUuid)
        Description copied from interface: NodeProvider
        Closes all sessions for a given manager node.
        Specified by:
        closeSessionsForManager in interface NodeProvider
        Parameters:
        managerUuid - manager node UUID to close sessions for
        Returns:
        number of sessions affected by the closure
      • setManagerDown

        public void setManagerDown​(java.lang.String managerUuid)
        Description copied from interface: NodeProvider
        Sets a given manager node as down.
        Specified by:
        setManagerDown in interface NodeProvider
        Parameters:
        managerUuid - manager node UUID to set as down
      • addManager

        public ome.model.meta.Node addManager​(java.lang.String managerUuid,
                                              java.lang.String proxyString)
        Description copied from interface: NodeProvider
        Adds a manager node.
        Specified by:
        addManager in interface NodeProvider
        Parameters:
        managerUuid - manager node UUID to add
        proxyString - manager node proxy connection string
        Returns:
        populated node entity.
      • principal

        public ome.system.Principal principal()
        Description copied from interface: NodeProvider
        Retrieves the current active principal.
        Specified by:
        principal in interface NodeProvider
        Returns:
        See above.