public void removeRelationships(IdentityStoreInvocationContext invocationCtx, IdentityObject identity1, IdentityObject identity2, boolean named) throws IdentityException
{
IdentityStore fromStore = resolveIdentityStore(identity1);
IdentityStore toStore = resolveIdentityStore(identity2);
IdentityStoreInvocationContext toTargetCtx = resolveInvocationContext(toStore, invocationCtx);
IdentityStoreInvocationContext defaultTargetCtx = resolveInvocationContext(defaultIdentityStore, invocationCtx);
if (fromStore == toStore)
{
fromStore.removeRelationships(toTargetCtx, identity1, identity2, named);
return;
}
if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, identity1))
{
defaultIdentityStore.createIdentityObject(defaultTargetCtx, identity1.getName(), identity1.getIdentityType());
}
if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, identity2))
{
defaultIdentityStore.createIdentityObject(defaultTargetCtx, identity2.getName(), identity2.getIdentityType());
}
defaultIdentityStore.removeRelationships(defaultTargetCtx, identity1, identity2, named);
}