public Set<IdentityObjectRelationship> resolveRelationships(
      IdentityStoreInvocationContext invocationCxt,
      IdentityObject fromIdentity,
      IdentityObject toIdentity,
      IdentityObjectRelationshipType relationshipType)
      throws IdentityException {

    IdentityObjectRelationshipSearchImpl search = new IdentityObjectRelationshipSearchImpl();
    if (fromIdentity != null) {
      search.setFromIOName(fromIdentity.getName());
      search.setFromIOType(fromIdentity.getIdentityType().getName());
    }
    if (toIdentity != null) {
      search.setToIOName(toIdentity.getName());
      search.setToIOType(toIdentity.getIdentityType().getName());
    }
    if (relationshipType != null) {
      search.setRelationshipType(relationshipType.getName());
    }

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

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

    results =
        identityStore.resolveRelationships(
            invocationCxt, fromIdentity, toIdentity, relationshipType);

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

    return results;
  }