use of org.codice.alliance.nsili.common.GIAS.SubmitStandingQueryRequest in project alliance by codice.
the class StandingQueryMgrImplTest method testSubmitStandingQuery.
@Test
public void testSubmitStandingQuery() throws InvalidInputParameter, SystemFault, ProcessingFault {
String[] resultAttributes = new String[0];
SortAttribute[] sortAttributes = new SortAttribute[0];
LifeEvent start = new LifeEvent();
start.at(LifeEventType.ABSOLUTE_TIME, new AbsTime(new Date((short) 2016, (short) 05, (short) 01), new Time((short) 00, (short) 00, (short) 00)));
LifeEvent stop = new LifeEvent();
stop.at(LifeEventType.ABSOLUTE_TIME, new AbsTime(new Date((short) 2050, (short) 05, (short) 01), new Time((short) 00, (short) 00, (short) 00)));
LifeEvent frequency1 = new LifeEvent();
frequency1.rt(LifeEventType.RELATIVE_TIME, new Time((short) 00, (short) 01, (short) 00));
LifeEvent[] frequency = new LifeEvent[] { frequency1 };
QueryLifeSpan lifeSpan = new QueryLifeSpan(start, stop, frequency);
Query query = new Query(NsiliConstants.NSIL_ALL_VIEW, bqsQuery);
SubmitStandingQueryRequest request = standingQueryMgr.submit_standing_query(query, resultAttributes, sortAttributes, lifeSpan, new NameValue[0]);
assertThat(request, notNullValue());
}
use of org.codice.alliance.nsili.common.GIAS.SubmitStandingQueryRequest in project alliance by codice.
the class StandingQueryMgrImpl method submit_standing_query.
@Override
public SubmitStandingQueryRequest submit_standing_query(Query aQuery, String[] result_attributes, SortAttribute[] sort_attributes, QueryLifeSpan lifespan, NameValue[] properties) throws InvalidInputParameter, ProcessingFault, SystemFault {
if (aQuery == null) {
InvalidInputParameter except = new InvalidInputParameter();
exception_details details = new exception_details();
details.exception_name = "No Query Specified";
details.exception_desc = "Query must be specified for standing query request";
except.details = details;
throw except;
}
LOGGER.debug("Registering Standing Query View: {}, BQS: {}", aQuery.view, aQuery.bqs_query);
SubmitStandingQueryRequestImpl standingQueryRequest = new SubmitStandingQueryRequestImpl(aQuery, result_attributes, sort_attributes, lifespan, properties, catalogFramework, filterBuilder, defaultUpdateFrequencyMsec, querySources, maxPendingResults, removeSourceLibrary, outgoingValidationEnabled, maxWaitToStartTimeMsecs);
String id = UUID.randomUUID().toString();
try {
_poa().activate_object_with_id(id.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), standingQueryRequest);
} catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
LOGGER.debug("submit_standing_query : Unable to activate submitStandingQueryRequest object.", e);
}
org.omg.CORBA.Object obj = _poa().create_reference_with_id(id.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), SubmitStandingQueryRequestHelper.id());
SubmitStandingQueryRequest submitStandingQueryRequest = SubmitStandingQueryRequestHelper.narrow(obj);
return submitStandingQueryRequest;
}
Aggregations