Class HierarchicalInstanceEnvironment
java.lang.Object
org.gcube.informationsystem.resourceregistry.environments.Environment
org.gcube.informationsystem.resourceregistry.environments.HierarchicalEnvironment
org.gcube.informationsystem.resourceregistry.environments.instances.HierarchicalInstanceEnvironment
- Direct Known Subclasses:
InstanceEnvironment
- Author:
- Luca Frosini (ISTI - CNR)
Abstract base for all
HierarchicalEnvironmentsubclasses that store Resource and Facet instances. Provides a dedicated branch in the environment hierarchy so that instance environments are clearly separated from context-partition environments (HierarchicalContextEnvironment) at the type level, preventing accidental mixing of the two chains.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.gcube.informationsystem.resourceregistry.environments.Environment
Environment.PermissionMode, Environment.SecurityType -
Field Summary
Fields inherited from class org.gcube.informationsystem.resourceregistry.environments.HierarchicalEnvironment
activeOnlyHierarchicalMode, children, H, HA, hierarchicalMode, parentEnvironmentFields inherited from class org.gcube.informationsystem.resourceregistry.environments.Environment
allOperationAllowedRoles, CONTEXT_MANAGER, contextSubtreeOperationAllowedRoles, DEFAULT_READER_ROLE, DEFAULT_WRITER_ROLE, environmentUUID, INFRASTRUCTURE_MANAGER, instanceOperationAllowedRoles, IS_INSTANCE_OPERATOR, IS_MANAGER -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newHierarchicalInstanceEnvironmentinstance for the specified Context UUID. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddElement(com.orientechnologies.orient.core.record.OElement element, com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Adds an element to this environment within the specified database transaction.protected voidcreateRolesAndUsers(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) TheHierarchicalEnvironment.HA(active-only hierarchical reader) permission channel only makes sense for this branch of the environment hierarchy - per-Context instance data, whose visibility must track the Context'seffectiveState- not for the Context-partition branch (HierarchicalContextEnvironment) sharing the sameHierarchicalEnvironmentbase class, which has no such notion.protected voiddeleteRolesAndUsers(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) Deletes both the non-hierarchical and theHierarchicalEnvironment.Hhierarchical roles/users for this environment, overridingEnvironment.deleteRolesAndUsers(OSecurity).voidremoveElement(com.orientechnologies.orient.core.record.OElement element, com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Removes an element from this environment within the specified database transaction.Methods inherited from class org.gcube.informationsystem.resourceregistry.environments.HierarchicalEnvironment
addActiveReaderRoleToParent, addHierarchicalRoleToParent, allow, allowActiveReader, allowed, changeParentEnvironment, createActiveReaderRoleAndUser, createRolesAndUsers, deny, denyActiveReader, getChildren, getContexts, getOSecurity, getParentEnvironment, getPool, getRoleOrUserName, getRoleOrUserName, getRoleOrUserName, getSecurityRoleOrUserName, getSecurityRoleOrUserName, grantActiveReaderRoleToAncestors, grantActiveReaderRoleToAncestors, isActiveOnlyHierarchicalMode, isHierarchicalMode, removeActiveReaderRoleFromMyHAUser, removeChildrenHRolesFromMyHUsers, removeChildrenHRolesFromParents, removeChildrenHRolesFromParents, removeHierarchicRoleFromMyHUser, revokeActiveReaderRoleFromAncestors, revokeActiveReaderRoleFromAncestors, setActiveOnlyHierarchicalMode, setHierarchicalMode, setParentEnvironmentMethods inherited from class org.gcube.informationsystem.resourceregistry.environments.Environment
addElement, addExtraRules, allow, create, create, delete, delete, deny, drop, getAllOperationsAllowedRoles, getAllowedRoles, getDatabaseDocument, getInstanceOperationAllowedRoles, getOrCreateRole, getOrCreateUser, getSecurityRoleOrUserName, getSuperRole, getUUID, isElementInContext, isUserAllowed, removeElement, toString
-
Constructor Details
-
HierarchicalInstanceEnvironment
public HierarchicalInstanceEnvironment(UUID uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Creates a newHierarchicalInstanceEnvironmentinstance for the specified Context UUID.- Parameters:
uuid- the Context UUID- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the environment cannot be initialized
-
-
Method Details
-
createRolesAndUsers
protected void createRolesAndUsers(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) TheHierarchicalEnvironment.HA(active-only hierarchical reader) permission channel only makes sense for this branch of the environment hierarchy - per-Context instance data, whose visibility must track the Context'seffectiveState- not for the Context-partition branch (HierarchicalContextEnvironment) sharing the sameHierarchicalEnvironmentbase class, which has no such notion. So it is layered on top by overriding the relevant lifecycle methods here, rather than adding HA-awareness to the shared base class itself.- Overrides:
createRolesAndUsersin classHierarchicalEnvironment- Parameters:
oSecurity- the OrientDB security manager
-
deleteRolesAndUsers
protected void deleteRolesAndUsers(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) Description copied from class:HierarchicalEnvironmentDeletes both the non-hierarchical and theHierarchicalEnvironment.Hhierarchical roles/users for this environment, overridingEnvironment.deleteRolesAndUsers(OSecurity). Before dropping the hierarchical roles/users themselves, first revokes this environment's own children's hierarchical roles from every ancestor's hierarchical user, viaHierarchicalEnvironment.removeChildrenHRolesFromParents(OSecurity). Does not touch theHierarchicalEnvironment.HAactive-only reader role/user.- Overrides:
deleteRolesAndUsersin classHierarchicalEnvironment- Parameters:
oSecurity- the OrientDB security manager
-
addElement
public void addElement(com.orientechnologies.orient.core.record.OElement element, com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Description copied from class:EnvironmentAdds an element to this environment within the specified database transaction.- Overrides:
addElementin classHierarchicalEnvironment- Parameters:
element- the element to addoDatabaseDocument- the database connection
-
removeElement
public void removeElement(com.orientechnologies.orient.core.record.OElement element, com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Description copied from class:EnvironmentRemoves an element from this environment within the specified database transaction.- Overrides:
removeElementin classHierarchicalEnvironment- Parameters:
element- the element to removeoDatabaseDocument- the database connection
-