@Override protected void doRemove(Relationship relationship) { IdentityContext identityContext = getIdentityContext(); getStoreSelector().getStoreForRelationshipOperation(identityContext, relationship.getClass(), relationship, IdentityOperation.delete) .remove(identityContext, relationship); }
@Override protected void doRemove(Relationship relationship) { IdentityContext identityContext = getIdentityContext(); getStoreSelector().getStoreForRelationshipOperation(identityContext, relationship.getClass(), relationship, IdentityOperation.delete) .remove(identityContext, relationship); }
@Override public void remove(IdentityType identityType) { Feature feature; IdentityStoreInvocationContext ctx = createContext(); if (User.class.isInstance(identityType)) { feature = Feature.deleteUser; } else if (Agent.class.isInstance(identityType)) { feature = Feature.deleteAgent; } else if (Group.class.isInstance(identityType)) { if (ctx.getRealm() != null && ctx.getTier() != null) { throw new IllegalStateException("Ambiguous context state - Group may only be managed in either the " + "scope of a Realm or a Tier, however both have been set."); } feature = Feature.deleteGroup; } else if (Role.class.isInstance(identityType)) { if (ctx.getRealm() != null && ctx.getTier() != null) { throw new IllegalStateException("Ambiguous context state - Role may only be managed in either the " + "scope of a Realm or a Tier, however both have been set."); } feature = Feature.deleteRole; } else { throw new IllegalArgumentException("Unsupported IdentityType"); } getContextualStoreForFeature(ctx, feature).remove(identityType); }
@Override protected void doRemove(IdentityType attributedType) { RelationshipQuery<Relationship> query = this.relationshipManager.createRelationshipQuery(Relationship.class); query.setParameter(Relationship.IDENTITY, attributedType); for (Relationship relationship : query.getResultList()) { this.relationshipManager.remove(relationship); } if (this.permissionManager != null) { List<Permission> permissions = this.permissionManager.listPermissions(attributedType); for (Permission permission : permissions) { this.permissionManager.revokePermission(attributedType, permission.getResourceClass(), permission.getOperation()); } } IdentityContext identityContext = getIdentityContext(); getStoreSelector().getStoreForIdentityOperation(identityContext, IdentityStore.class, attributedType.getClass(), IdentityOperation.delete) .remove(identityContext, attributedType); }
@Override protected void doRemove(IdentityType attributedType) { RelationshipQuery<Relationship> query = this.relationshipManager.createRelationshipQuery(Relationship.class); query.setParameter(Relationship.IDENTITY, attributedType); for (Relationship relationship : query.getResultList()) { this.relationshipManager.remove(relationship); } if (this.permissionManager != null) { List<Permission> permissions = this.permissionManager.listPermissions(attributedType); for (Permission permission : permissions) { this.permissionManager.revokePermission(attributedType, permission.getResourceClass(), permission.getOperation()); } } IdentityContext identityContext = getIdentityContext(); getStoreSelector().getStoreForIdentityOperation(identityContext, IdentityStore.class, attributedType.getClass(), IdentityOperation.delete) .remove(identityContext, attributedType); }