Search in sources :

Example 36 with AttributeInformation

use of org.codice.alliance.nsili.common.GIAS.AttributeInformation in project alliance by codice.

the class NsiliAttributesGenerator method getNsilMessageAttributes.

public static List<AttributeInformation> getNsilMessageAttributes() {
    String prefix = NsiliConstants.NSIL_MESSAGE + ".";
    Domain domain;
    List<AttributeInformation> attributes = new ArrayList<>();
    domain = new Domain();
    domain.t(200);
    attributes.add(new AttributeInformation(prefix + NsiliConstants.RECIPIENT, AttributeType.TEXT, domain, "", "", RequirementMode.MANDATORY, "Identify the receiving entity of the message. This will typically be an XMPP conference room identifier (including the fully qualified domain name extension), but could also be an individual/personal XMPP or e- mail account. In the case a message is sent to more than one recipient, this shall be supported by separating the recipients by BCS Comma. Note that the 'from' information is captured in NSIL_COMMON.source", false, true));
    domain = new Domain();
    domain.t(200);
    attributes.add(new AttributeInformation(prefix + NsiliConstants.SUBJECT, AttributeType.TEXT, domain, "", "", RequirementMode.OPTIONAL, "Data that specifies the topic of the message.", false, true));
    domain = new Domain();
    domain.t(2048);
    attributes.add(new AttributeInformation(prefix + NsiliConstants.MESSAGE_BODY, AttributeType.TEXT, domain, "", "", RequirementMode.MANDATORY, "The body of the message. In case the message body text exceeds the maximum length of this metadata attribute the message text will be truncated. . The complete message is available through the URL in NSIL_FILE entity, but only the characters stored in this attribute can be used for free text search.", false, true));
    domain = new Domain();
    domain.l(getMessageTypeOptions());
    attributes.add(new AttributeInformation(prefix + NsiliConstants.MESSAGE_TYPE, AttributeType.TEXT, domain, "", "", RequirementMode.MANDATORY, "Identification of message type (protocol). Initially only XMPP is recognized.", false, true));
    return attributes;
}
Also used : AttributeInformation(org.codice.alliance.nsili.common.GIAS.AttributeInformation) ArrayList(java.util.ArrayList) Domain(org.codice.alliance.nsili.common.GIAS.Domain)

Example 37 with AttributeInformation

use of org.codice.alliance.nsili.common.GIAS.AttributeInformation in project alliance by codice.

the class NsiliAttributesGenerator method getNsilRelationAttributes.

public static List<AttributeInformation> getNsilRelationAttributes() {
    String prefix = NsiliConstants.NSIL_RELATION + ".";
    Domain domain;
    List<AttributeInformation> attributes = new ArrayList<>();
    domain = new Domain();
    domain.t(0);
    attributes.add(new AttributeInformation(prefix + NsiliConstants.AMPLIFICATION, AttributeType.TEXT, domain, "", "", RequirementMode.OPTIONAL, "Additional information on the association. This could be used to add additional information for very specific associations. This information is set through the 'assoc_info' parameter of 'create_association' method, where name=\"amplification\".", true, true));
    domain = new Domain();
    domain.t(30);
    attributes.add(new AttributeInformation(prefix + NsiliConstants.CONTRIBUTOR, AttributeType.TEXT, domain, "", "", RequirementMode.OPTIONAL, "An entity responsible for contributing the reference. This will be removed in a later edition.", true, true));
    domain = new Domain();
    domain.d(DATE_RANGE);
    attributes.add(new AttributeInformation(prefix + NsiliConstants.DATE_TIME_DECLARED, AttributeType.UCOS_ABS_TIME, domain, "", "", RequirementMode.OPTIONAL, "Date and time when the relationship was created. Note that this value must not change when synchronizing the metadata to another library.", true, false));
    domain = new Domain();
    domain.t(255);
    attributes.add(new AttributeInformation(prefix + NsiliConstants.DESCRIPTION, AttributeType.TEXT, domain, "", "", RequirementMode.OPTIONAL, "Further describes or explains the relationship between the products. This information is set through the 'assoc_info' parameter of 'create_association' method, where name=\"description\"", true, true));
    domain = new Domain();
    domain.l(getRelationshipOptions());
    attributes.add(new AttributeInformation(prefix + NsiliConstants.RELATIONSHIP, AttributeType.TEXT, domain, "", "", RequirementMode.OPTIONAL, "Defines the kind of relationship between the described product and the associated product. This value is specified by the 'assoc_name' parameter of 'create_association' method.", true, true));
    return attributes;
}
Also used : AttributeInformation(org.codice.alliance.nsili.common.GIAS.AttributeInformation) ArrayList(java.util.ArrayList) Domain(org.codice.alliance.nsili.common.GIAS.Domain)

Example 38 with AttributeInformation

use of org.codice.alliance.nsili.common.GIAS.AttributeInformation in project alliance by codice.

the class NsiliAttributesGenerator method getNsilMetadataSecurityAttributes.

public static List<AttributeInformation> getNsilMetadataSecurityAttributes() {
    String prefix = NsiliConstants.NSIL_METADATA_SECURITY + ".";
    Domain domain;
    List<AttributeInformation> attributes = new ArrayList<>();
    domain = new Domain();
    domain.l(getClassificationOptions());
    attributes.add(new AttributeInformation(prefix + NsiliConstants.CLASSIFICATION, AttributeType.TEXT, domain, "", "", RequirementMode.MANDATORY, "NATO Security markings that determine the physical security given to the metadata.", true, true));
    domain = new Domain();
    domain.t(20);
    attributes.add(new AttributeInformation(prefix + NsiliConstants.POLICY, AttributeType.TEXT, domain, "", "", RequirementMode.MANDATORY, "This field shall contain valid values indicating the national or multinational security policies used to classify the metadata. To indicate a national security policy, Country Codes per STANAG 1059 shall be used. In cases where the country is not listed by a three character country code, but as a six character region code, the six character province code from STANAG 1059 shall be used (e.g. Kosovo is listed as a region in Yugoslavia with six character province code YUKM-). In all cases when STANAG 1059 is not sufficient to describe the security policy, additional enumeration labels can be used (e.g. 'NATO/PFP' and 'NATO/EU'). Note: Although STANAG 1059 includes the 'XXN' entry for NATO, the full 'NATO' name shall be used to indicate NATO security policy to avoid any confusion from established and common used terms.", true, true));
    domain = new Domain();
    domain.t(50);
    attributes.add(new AttributeInformation(prefix + NsiliConstants.RELEASABILITY, AttributeType.TEXT, domain, "", "", RequirementMode.MANDATORY, "An additional marking to limit the dissemination of the product metadata information. Typical values include one or more country codes as found in STANAG 1059 separated by the BCS Comma (code 0x2C) character. Default value should be 'NATO'. Note: Although STANAG 1059 includes the 'XXN' entry for NATO, the full 'NATO' name shall be used to indicate NATO releasability to avoid any confusion from established and common used terms.", true, true));
    return attributes;
}
Also used : AttributeInformation(org.codice.alliance.nsili.common.GIAS.AttributeInformation) ArrayList(java.util.ArrayList) Domain(org.codice.alliance.nsili.common.GIAS.Domain)

Example 39 with AttributeInformation

use of org.codice.alliance.nsili.common.GIAS.AttributeInformation in project alliance by codice.

the class NsiliDataModelTest method testNsiliAmd2Attributes.

@Test
public void testNsiliAmd2Attributes() {
    List<AttributeInformation> attributesForView = nsiliDataModel.getAttributesForView(NsiliConstants.NSIL_ALL_VIEW);
    assertThat(attributesForView, notNullValue());
    boolean advancedGeoSpatialExists = false;
    int numEntityNodeAttrs = 0;
    for (AttributeInformation attributeInformation : attributesForView) {
        if (attributeInformation.attribute_name.contains(NsiliConstants.ADVANCED_GEOSPATIAL)) {
            advancedGeoSpatialExists = true;
        } else if (attributeInformation.attribute_name.contains(NsiliConstants.NSIL_ENTITY)) {
            numEntityNodeAttrs++;
        }
    }
    assertThat(advancedGeoSpatialExists, is(true));
    assertThat(numEntityNodeAttrs, is(3));
}
Also used : AttributeInformation(org.codice.alliance.nsili.common.GIAS.AttributeInformation) Test(org.junit.Test)

Example 40 with AttributeInformation

use of org.codice.alliance.nsili.common.GIAS.AttributeInformation in project alliance by codice.

the class SampleNsiliClient method getSortableAttributes.

private SortAttribute[] getSortableAttributes() throws InvalidInputParameter, SystemFault, ProcessingFault {
    List<SortAttribute> sortableAttributesList = new ArrayList<>();
    AttributeInformation[] attributeInformationArray = dataModelMgr.get_attributes(NsiliConstants.NSIL_ALL_VIEW, new NameValue[0]);
    for (AttributeInformation attributeInformation : attributeInformationArray) {
        if (attributeInformation.sortable) {
            sortableAttributesList.add(new SortAttribute(attributeInformation.attribute_name, Polarity.DESCENDING));
        }
    }
    return sortableAttributesList.toArray(new SortAttribute[sortableAttributesList.size()]);
}
Also used : AttributeInformation(org.codice.alliance.nsili.common.GIAS.AttributeInformation) SortAttribute(org.codice.alliance.nsili.common.GIAS.SortAttribute) ArrayList(java.util.ArrayList)

Aggregations

AttributeInformation (org.codice.alliance.nsili.common.GIAS.AttributeInformation)40 ArrayList (java.util.ArrayList)36 Domain (org.codice.alliance.nsili.common.GIAS.Domain)29 IntegerRange (org.codice.alliance.nsili.common.GIAS.IntegerRange)7 HashMap (java.util.HashMap)5 List (java.util.List)5 Matchers.containsString (org.hamcrest.Matchers.containsString)3 Test (org.junit.Test)3 Objects (java.util.Objects)1 Association (org.codice.alliance.nsili.common.GIAS.Association)1 DateRange (org.codice.alliance.nsili.common.GIAS.DateRange)1 FloatingPointRange (org.codice.alliance.nsili.common.GIAS.FloatingPointRange)1 SortAttribute (org.codice.alliance.nsili.common.GIAS.SortAttribute)1 EntityGraph (org.codice.alliance.nsili.common.UCO.EntityGraph)1 EntityNode (org.codice.alliance.nsili.common.UCO.EntityNode)1 InvalidInputParameter (org.codice.alliance.nsili.common.UCO.InvalidInputParameter)1 ProcessingFault (org.codice.alliance.nsili.common.UCO.ProcessingFault)1 SystemFault (org.codice.alliance.nsili.common.UCO.SystemFault)1 Matchers.anyString (org.mockito.Matchers.anyString)1