public Set<IdentityObjectRelationship> resolveRelationships(
      IdentityStoreInvocationContext invocationCtx,
      IdentityObject identity,
      IdentityObjectRelationshipType relationshipType,
      boolean parent,
      boolean named,
      String name)
      throws IdentityException {

    IdentityObjectRelationshipSearchImpl search = new IdentityObjectRelationshipSearchImpl();
    if (identity != null) {
      search.setIoName(identity.getName());
      search.setIoType(identity.getIdentityType().getName());
    }
    if (relationshipType != null) {
      search.setRelationshipType(relationshipType.getName());
    }
    search.setParent(parent);
    search.setNamed(named);
    search.setName(name);

    Set<IdentityObjectRelationship> results =
        cacheSupport.getIdentityObjectRelationshipSearch(getCacheNS(invocationCtx), search);

    if (results != null) {
      return results;
    }

    results =
        identityStore.resolveRelationships(
            invocationCtx, identity, relationshipType, parent, named, name);

    cacheSupport.putIdentityObjectRelationshipSearch(getCacheNS(invocationCtx), search, results);

    return results;
  }