this.handles = new int[resourceCount];
TIntObjectMap<Identity> identityMap = TransferableGraphUtils.mapIdentities(identities);
+ // We must process roots first, because internal identifiers depend on them.
+ for(Identity identity : identities) {
+ IdentityDefinition definition = identity.definition;
+ if (definition instanceof Root) {
+ Root root = (Root) definition;
+ if (root.name.equals(""))
+ handles[identity.resource] = builder.handle(RootLibrary);
+ else {
+ Resource existing = advisor.analyzeRoot(graph, root);
+ if (existing != null)
+ handles[identity.resource] = builder.handle(existing);
+ }
+ }
+ }
+
for(Identity identity : identities) {
IdentityDefinition definition = identity.definition;
if(definition instanceof External) {
existingInternalMap.put(identity.resource, existing);
}
}
- else if(definition instanceof Root) {
- Root root = (Root)definition;
- if(root.name.equals(""))
- handles[identity.resource] = builder.handle(RootLibrary);
- else {
- Resource existing = advisor.analyzeRoot(graph, root);
- if(existing != null)
- handles[identity.resource] = builder.handle(existing);
- }
- }
else if(definition instanceof Optional) {
External def = (External)definition;
Resource parent = builder.resource(handles[def.parent]);
}
int[] getClustering() {
+ if (vg != null)
+ return null;
Variant v = extensions.get(Extensions.CLUSTERING);
if(v == null) return null;
try {
}
int[] getClusterSets() {
+ if (vg != null)
+ return null;
Variant v = extensions.get(Extensions.CLUSTER_SETS);
if(v == null) return null;
try {
tg.forValues2(null, new ValueProcedure());
for(Resource r : existingInternalMap.valueCollection()) {
- graph.deny(r, InstanceOf, null, ExternalEntity, null);
+ try {
+ graph.deny(r, InstanceOf, null, ExternalEntity, null);
+ } catch (DatabaseException e) {
+ graph.deny(r, InstanceOf, null, ExternalEntity, vg);
+ }
}
}