Search in sources :

Example 1 with LibraryDescription

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

the class SampleNsiliClient method getManagerTypes.

private String[] getManagerTypes() throws Exception {
    LibraryDescription libraryDescription = library.get_library_description();
    LOGGER.info("NAME : {} \n DESCRIPTION : {} \n VERSION : {}", libraryDescription.library_name, libraryDescription.library_description, libraryDescription.library_version_number);
    String[] types = library.get_manager_types();
    LOGGER.info("Got Manager Types from  {} : ", libraryDescription.library_name);
    for (String type : types) {
        LOGGER.info(TAB_LOG_MSG, type);
    }
    return types;
}
Also used : LibraryDescription(org.codice.alliance.nsili.common.GIAS.LibraryDescription)

Example 2 with LibraryDescription

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

the class NsiliSource method setSourceDescription.

/**
 * Obtains the sourceDescription of the source from the Library interface.
 *
 * @return a sourceDescription of the source
 */
private void setSourceDescription() {
    StringBuilder stringBuilder = new StringBuilder();
    try {
        LibraryDescription libraryDescription = library.get_library_description();
        stringBuilder.append(libraryDescription.library_name + " : ");
        stringBuilder.append(libraryDescription.library_description);
    } catch (ProcessingFault | SystemFault e) {
        LOGGER.debug("{} : Unable to retrieve source sourceDescription.", sourceId, e);
    }
    String description = stringBuilder.toString();
    if (StringUtils.isBlank(description)) {
        LOGGER.debug("{} :  Unable to retrieve source sourceDescription.", getId());
    }
    this.sourceDescription = description;
}
Also used : LibraryDescription(org.codice.alliance.nsili.common.GIAS.LibraryDescription) SystemFault(org.codice.alliance.nsili.common.UCO.SystemFault) ProcessingFault(org.codice.alliance.nsili.common.UCO.ProcessingFault)

Example 3 with LibraryDescription

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

the class NsiliLibraryImplTest method testLibraryDescription.

@Test
public void testLibraryDescription() throws ProcessingFault, SystemFault {
    LibraryDescription libraryDescription = library.get_library_description();
    assertThat(libraryDescription.library_name, is(TEST_HOSTNAME));
    assertThat(libraryDescription.library_description, containsString(TEST_ORGANIZATION));
    assertThat(libraryDescription.library_version_number, containsString(TEST_VERSION));
}
Also used : LibraryDescription(org.codice.alliance.nsili.common.GIAS.LibraryDescription) Test(org.junit.Test)

Aggregations

LibraryDescription (org.codice.alliance.nsili.common.GIAS.LibraryDescription)3 ProcessingFault (org.codice.alliance.nsili.common.UCO.ProcessingFault)1 SystemFault (org.codice.alliance.nsili.common.UCO.SystemFault)1 Test (org.junit.Test)1