use of org.codice.alliance.nsili.common.GIAS.Query in project alliance by codice.
the class SubmitStandingQueryRequestImplTest method setupStandingQueryRequest.
private void setupStandingQueryRequest() throws InvalidInputParameter, SystemFault, ProcessingFault, WrongPolicy, ServantAlreadyActive, ObjectAlreadyActive {
Query query = getQuery();
String[] resultAttributes = new String[0];
SortAttribute[] sortAttributes = new SortAttribute[0];
QueryLifeSpan lifespan = getEmptyLifespan();
NameValue[] properties = new NameValue[0];
// Set artificially low for for test cases.
long defaultUpdateFrequencyMsec = 2000;
int maxPendingResults = 10000;
long maxWaitToStartTimeMsecs = TimeUnit.MINUTES.toMillis(5);
standingQueryRequest = new SubmitStandingQueryRequestImpl(query, resultAttributes, sortAttributes, lifespan, properties, mockFramework, filterBuilder, defaultUpdateFrequencyMsec, null, maxPendingResults, true, false, maxWaitToStartTimeMsecs);
standingQueryRequest.register_callback(mockCallback2);
String managerId = UUID.randomUUID().toString();
rootPOA.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), standingQueryRequest);
rootPOA.create_reference_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), CreationMgrHelper.id());
}
use of org.codice.alliance.nsili.common.GIAS.Query in project alliance by codice.
the class NsiliSourceTest method testQueryByContentType.
@Test
public void testQueryByContentType() throws Exception {
QueryImpl propertyIsLikeQuery = new QueryImpl(builder.attribute(Metacard.CONTENT_TYPE).is().equalTo().text(GMTI));
SourceResponse sourceResponse = source.query(new QueryRequestImpl(propertyIsLikeQuery));
ArgumentCaptor<Query> argumentCaptor = ArgumentCaptor.forClass(Query.class);
verify(catalogMgr).submit_query(argumentCaptor.capture(), any(String[].class), any(SortAttribute[].class), any(NameValue[].class));
assertThat(sourceResponse.getHits(), is(LONG));
assertThat(argumentCaptor.getValue().bqs_query, is(GMTI_EQ_FILTER));
}
use of org.codice.alliance.nsili.common.GIAS.Query in project alliance by codice.
the class NsiliSourceTest method testQueryAnyTextWildcardRepl.
@Test
public void testQueryAnyTextWildcardRepl() throws Exception {
QueryImpl propertyIsLikeQuery = new QueryImpl(builder.attribute(Metacard.ANY_TEXT).is().like().text("*"));
SourceResponse sourceResponse = source.query(new QueryRequestImpl(propertyIsLikeQuery));
ArgumentCaptor<Query> argumentCaptor = ArgumentCaptor.forClass(Query.class);
verify(catalogMgr).submit_query(argumentCaptor.capture(), any(String[].class), any(SortAttribute[].class), any(NameValue[].class));
assertThat(sourceResponse.getHits(), is(LONG));
assertThat(argumentCaptor.getValue().bqs_query, is(GMTI_LIKE_FILTER));
}
use of org.codice.alliance.nsili.common.GIAS.Query in project alliance by codice.
the class SampleNsiliClient method logDetails.
private void logDetails(NameValue nameValue) {
if (nameValue.aname != null && nameValue.value != null) {
String value = getString(nameValue.value);
if (nameValue.aname.equalsIgnoreCase("query")) {
Query q = QueryHelper.extract(nameValue.value);
value = q.bqs_query;
}
if (value != null) {
LOGGER.info("\t\t {} = {}", nameValue.aname, value);
} else {
LOGGER.info("\t\t {} = {} (non-string)", nameValue.aname, nameValue.value);
}
}
}
Aggregations