public Set<Integer> getBlobClusterIds() { return getMetadata().getSchema().getBlobClusters(); }
public OEdge newLightweightEdge(String iClassName, OVertex from, OVertex to) { OClass clazz = getMetadata().getSchema().getClass(iClassName); OEdgeDelegate result = new OEdgeDelegate(from, to, clazz, iClassName); return result; }
@Override public boolean isClusterVertex(int cluster) { OClass clazz = getMetadata().getImmutableSchemaSnapshot().getClassByClusterId(cluster); if (clazz != null && clazz.isVertexType()) return true; return false; } }
@Override public boolean isClusterEdge(int cluster) { OClass clazz = getMetadata().getImmutableSchemaSnapshot().getClassByClusterId(cluster); if (clazz != null && clazz.isEdgeType()) return true; return false; }
/** * {@inheritDoc} */ public ORecordIteratorClass<ODocument> browseClass(final String iClassName, final boolean iPolymorphic) { if (getMetadata().getImmutableSchemaSnapshot().getClass(iClassName) == null) throw new IllegalArgumentException("Class '" + iClassName + "' not found in current database"); checkSecurity(ORule.ResourceGeneric.CLASS, ORole.PERMISSION_READ, iClassName); return new ORecordIteratorClass<ODocument>(this, iClassName, iPolymorphic, false); }
public void checkForClusterPermissions(final String iClusterName) { // CHECK FOR ORESTRICTED final Set<OClass> classes = getMetadata().getImmutableSchemaSnapshot().getClassesRelyOnCluster(iClusterName); for (OClass c : classes) { if (c.isSubClassOf(OSecurityShared.RESTRICTED_CLASSNAME)) throw new OSecurityException( "Class '" + c.getName() + "' cannot be truncated because has record level security enabled (extends '" + OSecurityShared.RESTRICTED_CLASSNAME + "')"); } }
/** * {@inheritDoc} */ public void setUser(final OSecurityUser user) { checkIfActive(); if (user instanceof OUser) { OMetadata metadata = getMetadata(); if (metadata != null) { final OSecurity security = metadata.getSecurity(); this.user = new OImmutableUser(security.getVersion(), (OUser) user); } else this.user = new OImmutableUser(-1, (OUser) user); } else this.user = (OImmutableUser) user; }
final OClass cls = getMetadata().getImmutableSchemaSnapshot().getClass(iClassName);
getMetadata().makeThreadLocalSchemaSnapshot(); if (record instanceof ODocument) ODocumentInternal.checkClass((ODocument) record, this); } finally { ORecordSerializationContext.pullContext(); getMetadata().clearThreadLocalSchemaSnapshot();
public void reloadUser() { if (user != null) { activateOnCurrentThread(); if (user.checkIfAllowed(ORule.ResourceGeneric.CLASS, OUser.CLASS_NAME, ORole.PERMISSION_READ) != null) { OMetadata metadata = getMetadata(); if (metadata != null) { final OSecurity security = metadata.getSecurity(); OUser secGetUser = security.getUser(user.getName()); if (secGetUser != null) user = new OImmutableUser(security.getVersion(), secGetUser); else user = new OImmutableUser(-1, new OUser()); } else user = new OImmutableUser(-1, new OUser()); } } }
OVertex from = currentVertex; OSchema schema = getMetadata().getSchema(); final OClass edgeType = schema.getClass(iClassName); if (edgeType == null)
return getDefaultClusterId(); case TYPE: return getMetadata().getImmutableSchemaSnapshot().existsClass("V") ? "graph" : "document"; case DATEFORMAT: return storage.getConfiguration().getDateFormat();
final OSchema schema = database.getMetadata().getSchema(); final OClass clazz = schema.getClassByClusterId(clusterId); if (clazz == null) {
checkIfActive(); getMetadata().makeThreadLocalSchemaSnapshot(); ORecordSerializationContext.pushContext(); try { } finally { ORecordSerializationContext.pullContext(); getMetadata().clearThreadLocalSchemaSnapshot();