java.lang.Object
org.gcube.informationsystem.resourceregistry.environments.Environment
Direct Known Subclasses:
HierarchicalEnvironment, SystemEnvironment

public abstract class Environment extends Object
Author:
Luca Frosini (ISTI - CNR) Base class for any environment. In the current implementation it represents a portion of a graph which in OrientDB is implemented via security.
  • Field Details

  • Constructor Details

    • Environment

      protected Environment(UUID context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
  • Method Details

    • getAllOperationsAllowedRoles

      public static Set<String> getAllOperationsAllowedRoles()
    • getAllowedRoles

      public Set<String> getAllowedRoles()
    • getPool

      protected com.orientechnologies.orient.core.db.ODatabasePool getPool(Environment.PermissionMode permissionMode, boolean recreate)
    • getUUID

      public UUID getUUID()
    • getRoleOrUserName

      public static String getRoleOrUserName(Environment.PermissionMode permissionMode, Environment.SecurityType securityType)
    • getSecurityRoleOrUserName

      public String getSecurityRoleOrUserName(Environment.PermissionMode permissionMode, Environment.SecurityType securityType)
    • addElement

      public void addElement(com.orientechnologies.orient.core.record.OElement element) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
    • allow

      protected void allow(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, com.orientechnologies.orient.core.record.impl.ODocument oDocument)
    • isElementInContext

      public boolean isElementInContext(com.orientechnologies.orient.core.record.OElement element) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
    • addElement

      public void addElement(com.orientechnologies.orient.core.record.OElement element, com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument)
    • removeElement

      public void removeElement(com.orientechnologies.orient.core.record.OElement element) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
    • deny

      protected void deny(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, com.orientechnologies.orient.core.record.impl.ODocument oDocument)
    • removeElement

      public void removeElement(com.orientechnologies.orient.core.record.OElement element, com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument)
    • allowed

      protected boolean allowed(com.orientechnologies.orient.core.metadata.security.ORole role, com.orientechnologies.orient.core.record.impl.ODocument oDocument)
    • isUserAllowed

      public boolean isUserAllowed(Collection<String> allowedRoles)
    • create

      public void create() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
    • addExtraRules

      protected com.orientechnologies.orient.core.metadata.security.ORole addExtraRules(com.orientechnologies.orient.core.metadata.security.ORole role, Environment.PermissionMode permissionMode)
    • getSuperRole

      protected com.orientechnologies.orient.core.metadata.security.ORole getSuperRole(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, Environment.PermissionMode permissionMode)
    • createRolesAndUsers

      protected void createRolesAndUsers(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity)
    • create

      public void create(com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument)
    • drop

      protected void drop(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, String name, Environment.SecurityType securityType)
    • delete

      public void delete() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
    • deleteRolesAndUsers

      protected void deleteRolesAndUsers(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity)
    • delete

      public void delete(com.orientechnologies.orient.core.db.document.ODatabaseDocument orientGraph)
    • getDatabaseDocument

      public com.orientechnologies.orient.core.db.document.ODatabaseDocument getDatabaseDocument(Environment.PermissionMode permissionMode) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
    • toString

      public String toString()
      Overrides:
      toString in class Object