Skip to content

Commit

Permalink
removed matchObject method
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed May 6, 2014
1 parent 485a220 commit 0b39efe
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 43 deletions.
Expand Up @@ -324,23 +324,6 @@ public <T extends ObjectType> void searchObjectsIterative(Class<T> type, ObjectQ
public <T extends ObjectType> int countObjects(Class<T> type, ObjectQuery query, OperationResult parentResult)
throws SchemaException;

/**
* Matches object to the specified search filter, returns true if the object matches or false otherwise.
* This is supposed to be a very cheap operation. It actually does not use an underlying database unless it
* needs to (which is usually required only for query parts related to the organizational structure).
* This is very lightweight operation. Therefore also the usual operation result is omitted here. All error
* conditions are communicated just by throwing the exceptions.
*
* The object which is provided to this operation is assumed to be fresh (up to date).
*
* @param object object to be matched
* @param query search query
* @return true if the object matches specified object filter or false otherwise
* @throws SchemaException
* specified object or search filter contain data that violate the schema
*/
<T extends ObjectType> boolean matchObject(PrismObject<T> object, ObjectQuery query) throws SchemaException;

boolean isAnySubordinate(String upperOrgOid, Collection<String> lowerObjectOids) throws SchemaException;

/**
Expand Down
Expand Up @@ -305,12 +305,6 @@ private <T extends ObjectType> void cacheObject(Map<String, PrismObject<ObjectTy
}
}

@Override
public <T extends ObjectType> boolean matchObject(PrismObject<T> object, ObjectQuery query)
throws SchemaException {
return repository.matchObject(object, query);
}

@Override
public boolean isAnySubordinate(String upperOrgOid, Collection<String> lowerObjectOids)
throws SchemaException {
Expand Down
Expand Up @@ -279,21 +279,6 @@ private void assertSubordinate(boolean expected, String upperOrgOid, String... l
}
}

private ObjectFilter createOrgNameFilter(String name) throws SchemaException {
return EqualsFilter.createEqual(OrgType.F_NAME, OrgType.class, prismContext, PrismTestUtil.createPolyString(name));
}

private ObjectFilter createOrgDisplayNameFilter(String name) throws SchemaException {
return EqualsFilter.createEqual(OrgType.F_DISPLAY_NAME, OrgType.class, prismContext, PrismTestUtil.createPolyString(name));
}

private <O extends ObjectType> void assertMatch(PrismObject<O> obj, ObjectFilter filter, boolean expected) throws SchemaException {
ObjectQuery query = new ObjectQuery();
query.setFilter(filter);
boolean actual = repositoryService.matchObject(obj, query);
assertEquals("Wrong match for "+obj+" and "+filter, expected, actual);
}

@SuppressWarnings({"unchecked"})
@Test
public void test001addOrgStructObjectsIncorrect() throws Exception {
Expand Down
Expand Up @@ -1845,9 +1845,4 @@ private boolean isAnySubordinateAttempt(String upperOrgOid, Collection<String> l

throw new SystemException("isAnySubordinateAttempt failed somehow, this really should not happen.");
}

@Override
public <T extends ObjectType> boolean matchObject(PrismObject<T> object, ObjectQuery query) throws SchemaException {
throw new NotImplementedException("Not yet implemented.");
}
}

0 comments on commit 0b39efe

Please sign in to comment.