use of org.codice.ddf.spatial.ogc.csw.catalog.endpoint.mappings.SourceIdFilterVisitor in project ddf by codice.
the class CswQueryFactory method getQueryRequest.
private QueryRequest getQueryRequest(Query query, boolean isEnterprise, Map<String, Serializable> properties) {
QueryRequest request;
SourceIdFilterVisitor sourceIdFilterVisitor = new SourceIdFilterVisitor();
query.accept(sourceIdFilterVisitor, new FilterFactoryImpl());
if (isEnterprise && CollectionUtils.isEmpty(sourceIdFilterVisitor.getSourceIds())) {
request = new QueryRequestImpl(query, true, null, properties);
} else if (isEnterprise && CollectionUtils.isNotEmpty(sourceIdFilterVisitor.getSourceIds())) {
request = new QueryRequestImpl(query, false, sourceIdFilterVisitor.getSourceIds(), properties);
} else {
request = new QueryRequestImpl(query, false, null, properties);
}
return request;
}
use of org.codice.ddf.spatial.ogc.csw.catalog.endpoint.mappings.SourceIdFilterVisitor in project ddf by codice.
the class SourceIdFilterVisitorTest method testSourceIdsAreRemovedFromFilter.
@Test
public void testSourceIdsAreRemovedFromFilter() {
Filter filter = buildFilter(SOURCE_IDS);
Filter result = (Filter) filter.accept(sourceIdFilter, new FilterFactoryImpl());
SourceIdFilterVisitor visitor = new SourceIdFilterVisitor();
result.accept(visitor, new FilterFactoryImpl());
assertThat(visitor.getSourceIds(), equalTo(Collections.emptyList()));
}
use of org.codice.ddf.spatial.ogc.csw.catalog.endpoint.mappings.SourceIdFilterVisitor in project ddf by codice.
the class SourceIdFilterVisitorTest method setUp.
@Before
public void setUp() {
sourceIdFilter = new SourceIdFilterVisitor();
filterBuilder = new GeotoolsFilterBuilder();
filterWithoutSourceIds = buildFilter(Collections.emptyList());
}
Aggregations