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;
  }
  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;
  }