RelationshipKind kind) {
if (kind == null) {
throw new ClientRuntimeException("Type cannot be null");
}
DirectoryService directoryService = Framework.getLocalService(DirectoryService.class);
Session relationshipsDirectory = null;
try {
relationshipsDirectory = directoryService.open(RELATIONSHIP_DIRECTORY_NAME);
// try to get an existing entry
Map<String, Serializable> relationship = new HashMap<String, Serializable>();
relationship.put(RELATIONSHIP_FIELD_ACTOR, actorId);
relationship.put(RELATIONSHIP_FIELD_TARGET, targetId);
relationship.put(RELATIONSHIP_FIELD_KIND, kind.toString());