Package ome.security.basic
Class NodeProviderInDb
- java.lang.Object
-
- ome.security.basic.NodeProviderInDb
-
- All Implemented Interfaces:
NodeProvider,ReadOnlyStatus.IsAware
public class NodeProviderInDb extends java.lang.Object implements NodeProvider, ReadOnlyStatus.IsAware
Provider forNodeobjects which is responsible for persisting and populating such entities. Used by Blitz'some.services.blitz.fire.Ring.- Since:
- 5.3.0
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringuuidUUID for this cluster node.
-
Constructor Summary
Constructors Constructor Description NodeProviderInDb(java.lang.String uuid, Executor executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ome.model.meta.NodeaddManager(java.lang.String managerUuid, java.lang.String proxyString)Adds a manager node.intcloseSessionsForManager(java.lang.String managerUuid)Assumes that the given manager is no longer available and so will not attempt to call cache.removeSession() since that requires the session to be in memory.ome.model.meta.NodegetManagerByUuid(java.lang.String managerUuid, ome.system.ServiceFactory sf)Retrieves a given manager node.longgetManagerIdByUuid(java.lang.String managerUuid, ome.util.SqlAction sql)Retrieves a given manager node ID.java.util.Set<java.lang.String>getManagerList(boolean onlyActive)booleanisReadOnly(ReadOnlyStatus readOnly)ome.system.Principalprincipal()Retrieves the current active principal.voidsetManagerDown(java.lang.String managerUuid)Sets a given manager node as down.
-
-
-
Constructor Detail
-
NodeProviderInDb
public NodeProviderInDb(java.lang.String uuid, Executor executor)
-
-
Method Detail
-
principal
public ome.system.Principal principal()
Description copied from interface:NodeProviderRetrieves the current active principal.- Specified by:
principalin interfaceNodeProvider- Returns:
- See above.
-
getManagerIdByUuid
public long getManagerIdByUuid(java.lang.String managerUuid, ome.util.SqlAction sql)Description copied from interface:NodeProviderRetrieves a given manager node ID.- Specified by:
getManagerIdByUuidin interfaceNodeProvider- Parameters:
managerUuid- manager node UUID to retrievesql- 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:NodeProviderRetrieves a given manager node.- Specified by:
getManagerByUuidin interfaceNodeProvider- Parameters:
managerUuid- manager node UUID to retrievesf- current session's service factory- Returns:
- See above.
-
getManagerList
public java.util.Set<java.lang.String> getManagerList(boolean onlyActive)
- Specified by:
getManagerListin interfaceNodeProvider
-
closeSessionsForManager
public int closeSessionsForManager(java.lang.String managerUuid)
Assumes that the given manager is no longer available and so will not attempt to call cache.removeSession() since that requires the session to be in memory. Instead directly modifies the database to set the session to closed.- Specified by:
closeSessionsForManagerin interfaceNodeProvider- 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:NodeProviderSets a given manager node as down.- Specified by:
setManagerDownin interfaceNodeProvider- 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:NodeProviderAdds a manager node.- Specified by:
addManagerin interfaceNodeProvider- Parameters:
managerUuid- manager node UUID to addproxyString- manager node proxy connection string- Returns:
- populated node entity.
-
isReadOnly
public boolean isReadOnly(ReadOnlyStatus readOnly)
- Specified by:
isReadOnlyin interfaceReadOnlyStatus.IsAware- Parameters:
readOnly- a read-only status, typically the current one- Returns:
- if that status puts this class into read-only mode
-
-