use of org.codice.alliance.nsili.common.GIAS.AttributeInformation in project alliance by codice.
the class NsiliFilterDelegateTest method testPropertyLike.
@Test
public void testPropertyLike() {
String filter = filterDelegate.propertyIsLike(ANY_TEXT, ATTRIBUTE, false);
List<AttributeInformation> attributeInformationList = generateAttributeInformation().get(NsiliConstants.NSIL_ALL_VIEW);
StringBuilder result = new StringBuilder();
for (AttributeInformation attributeInformation : attributeInformationList) {
if (attributeInformation.attribute_type.equals(AttributeType.TEXT) && attributeInformation.attribute_domain.discriminator() == DomainType.TEXT_VALUE) {
result.append(getPrimary(attributeInformation.attribute_name, NsiliFilterFactory.LIKE, NsiliFilterDelegate.SQ + NsiliFilterDelegate.WILDCARD + ATTRIBUTE + NsiliFilterDelegate.WILDCARD + NsiliFilterDelegate.SQ) + NsiliFilterFactory.OR);
}
}
String resultString = result.toString();
resultString = resultString.substring(0, result.length() - 4);
assertThat(filter, is(resultString));
assertThat(filter, not(containsString(NsiliConstants.ADVANCED_GEOSPATIAL)));
}
use of org.codice.alliance.nsili.common.GIAS.AttributeInformation in project alliance by codice.
the class NsiliFilterDelegateTest method testPropertyLikeEmptyAttributesForView.
@Test
public void testPropertyLikeEmptyAttributesForView() {
Map<String, List<AttributeInformation>> map = new HashMap<>();
List<AttributeInformation> list = new ArrayList<>();
map.put(NsiliConstants.NSIL_ALL_VIEW, list);
NsiliFilterDelegate filterDelegate = new NsiliFilterDelegate(map, NsiliConstants.NSIL_ALL_VIEW);
String filter = filterDelegate.propertyIsLike(ANY_TEXT, ATTRIBUTE, false);
assertThat(filter, is(NsiliFilterDelegate.EMPTY_STRING));
}
use of org.codice.alliance.nsili.common.GIAS.AttributeInformation in project alliance by codice.
the class NsiliFilterDelegateTest method generateAttributeInformation.
private static Map<String, List<AttributeInformation>> generateAttributeInformation() {
List<AttributeInformation> attributeInformationList = new ArrayList<>();
Domain domain = new Domain();
domain.t(36);
attributeInformationList.add(createAttributeInformation(NsiliConstants.NSIL_COMMON + "." + NsiliConstants.IDENTIFIER_UUID, AttributeType.TEXT, domain, NsiliFilterDelegate.EMPTY_STRING, NsiliFilterDelegate.EMPTY_STRING, RequirementMode.MANDATORY, NsiliFilterDelegate.EMPTY_STRING, false, true));
domain = new Domain();
DateRange dateRange = new DateRange();
domain.d(dateRange);
attributeInformationList.add(createAttributeInformation(NsiliConstants.NSIL_CARD + "." + NsiliConstants.DATE_TIME_MODIFIED, AttributeType.TEXT, domain, NsiliFilterDelegate.EMPTY_STRING, NsiliFilterDelegate.EMPTY_STRING, RequirementMode.MANDATORY, NsiliFilterDelegate.EMPTY_STRING, false, true));
domain = new Domain();
domain.g(RECTANGLE_DOMAIN);
attributeInformationList.add(createAttributeInformation(NsiliConstants.NSIL_COVERAGE + "." + NsiliConstants.SPATIAL_GEOGRAPHIC_REF_BOX, AttributeType.UCOS_RECTANGLE, domain, NsiliFilterDelegate.EMPTY_STRING, NsiliFilterDelegate.EMPTY_STRING, RequirementMode.OPTIONAL, NsiliFilterDelegate.EMPTY_STRING, true, true));
domain = new Domain();
domain.ir(new IntegerRange(0, 100));
attributeInformationList.add(createAttributeInformation(NsiliConstants.NSIL_IMAGERY + "." + NsiliConstants.NUMBER_OF_BANDS, AttributeType.INTEGER, domain, NsiliFilterDelegate.EMPTY_STRING, NsiliFilterDelegate.EMPTY_STRING, RequirementMode.MANDATORY, NsiliFilterDelegate.EMPTY_STRING, true, true));
HashMap<String, List<AttributeInformation>> map = new HashMap<>();
map.put(NsiliConstants.NSIL_ALL_VIEW, attributeInformationList);
return map;
}
use of org.codice.alliance.nsili.common.GIAS.AttributeInformation in project alliance by codice.
the class NsiliAttributesGenerator method getNsilGmtiAttributes.
public static List<AttributeInformation> getNsilGmtiAttributes() {
String prefix = NsiliConstants.NSIL_GMTI + ".";
Domain domain;
List<AttributeInformation> attributes = new ArrayList<>();
domain = new Domain();
domain.fr(new FloatingPointRange(0.0, 4294967295.0));
attributes.add(new AttributeInformation(prefix + NsiliConstants.IDENTIFIER_JOB, AttributeType.FLOATING_POINT, domain, "", "", RequirementMode.MANDATORY, "A platform-assigned number identifying the specific requestor task to which the packet pertains. The Job ID shall be unique within a mission.", false, true));
domain = new Domain();
domain.ir(POSITIVE_INT_RANGE);
attributes.add(new AttributeInformation(prefix + NsiliConstants.NUMBER_OF_TARGET_REPORTS, AttributeType.INTEGER, domain, "", "", RequirementMode.MANDATORY, "The total number of target reports within all the dwells in the file.", false, true));
return attributes;
}
use of org.codice.alliance.nsili.common.GIAS.AttributeInformation in project alliance by codice.
the class NsiliAttributesGenerator method getNsilTaskAttributes.
public static List<AttributeInformation> getNsilTaskAttributes() {
String prefix = NsiliConstants.NSIL_TASK + ".";
Domain domain;
List<AttributeInformation> attributes = new ArrayList<>();
domain = new Domain();
domain.t(255);
attributes.add(new AttributeInformation(prefix + NsiliConstants.COMMENTS, AttributeType.TEXT, domain, "", "", RequirementMode.OPTIONAL, "Status of the task", false, true));
domain = new Domain();
domain.l(getTaskStatusOptions());
attributes.add(new AttributeInformation(prefix + NsiliConstants.STATUS, AttributeType.TEXT, domain, "", "", RequirementMode.MANDATORY, "Status of the task", false, true));
return attributes;
}
Aggregations