Search in sources :

Example 1 with SecurityClassificationKlvProcessor

use of org.codice.alliance.libs.klv.SecurityClassificationKlvProcessor in project alliance by codice.

the class MpegTsInputTransformer method setSecurityClassificationDefault.

public void setSecurityClassificationDefault(String classification) {
    notNull(classification, CLASSIFICATION_MUST_BE_NON_NULL);
    klvProcessor.accept(new BaseKlvProcessorVisitor() {

        @Override
        public void visit(SecurityClassificationKlvProcessor securityClassificationKlvProcessor) {
            securityClassificationKlvProcessor.setDefaultSecurityClassification(classification);
        }
    });
}
Also used : BaseKlvProcessorVisitor(org.codice.alliance.libs.klv.BaseKlvProcessorVisitor) SecurityClassificationKlvProcessor(org.codice.alliance.libs.klv.SecurityClassificationKlvProcessor)

Example 2 with SecurityClassificationKlvProcessor

use of org.codice.alliance.libs.klv.SecurityClassificationKlvProcessor in project alliance by codice.

the class MpegTsInputTransformerTest method testSetSecurityClassificationCodeDefault.

@Test
public void testSetSecurityClassificationCodeDefault() {
    SecurityClassificationKlvProcessor processor = spy(new SecurityClassificationKlvProcessor(mock(SecurityClassificationService.class), Collections.emptyMap(), ""));
    MpegTsInputTransformer transformer = new MpegTsInputTransformer(inputTransformer, metacardTypes, stanag4609Processor, klvHandlerFactory, defaultKlvHandler, stanagParserFactory, processor, DISTANCE_TOLERANCE);
    transformer.setSecurityClassificationDefault(CLASSIFICATION);
    verify(processor).setDefaultSecurityClassification(CLASSIFICATION);
}
Also used : SecurityClassificationKlvProcessor(org.codice.alliance.libs.klv.SecurityClassificationKlvProcessor) Test(org.junit.Test)

Example 3 with SecurityClassificationKlvProcessor

use of org.codice.alliance.libs.klv.SecurityClassificationKlvProcessor in project alliance by codice.

the class MpegTsInputTransformerTest method assertSecurityClassificationCode.

private void assertSecurityClassificationCode(Consumer<MpegTsInputTransformer> c, short code) {
    SecurityClassificationKlvProcessor processor = spy(new SecurityClassificationKlvProcessor(mock(SecurityClassificationService.class), Collections.emptyMap(), ""));
    MpegTsInputTransformer transformer = new MpegTsInputTransformer(inputTransformer, metacardTypes, stanag4609Processor, klvHandlerFactory, defaultKlvHandler, stanagParserFactory, processor, DISTANCE_TOLERANCE);
    c.accept(transformer);
    verify(processor).setSecurityClassification(code, CLASSIFICATION);
}
Also used : SecurityClassificationKlvProcessor(org.codice.alliance.libs.klv.SecurityClassificationKlvProcessor)

Aggregations

SecurityClassificationKlvProcessor (org.codice.alliance.libs.klv.SecurityClassificationKlvProcessor)3 BaseKlvProcessorVisitor (org.codice.alliance.libs.klv.BaseKlvProcessorVisitor)1 Test (org.junit.Test)1