use of org.codice.alliance.nsili.endpoint.requests.GetRelatedFilesRequestImpl in project alliance by codice.
the class GetRelatedFilesRequestImplTest method testCompleteNoPort.
@Test
public void testCompleteNoPort() throws Exception {
NameListHolder locations = new NameListHolder();
GetRelatedFilesRequestImpl noPortRequest = new GetRelatedFilesRequestImpl(getTestMetacards(), getTestFileLocation(), "THUMBNAIL", null);
noPortRequest.setHttpClient(mockHttpClient);
State state = noPortRequest.complete(locations);
assertValidState(state, locations);
}
use of org.codice.alliance.nsili.endpoint.requests.GetRelatedFilesRequestImpl in project alliance by codice.
the class GetRelatedFilesRequestImplTest method setUp.
@Before
public void setUp() throws Exception {
List<Metacard> testMetacards = getTestMetacards();
FileLocation location = getTestFileLocation();
relatedFilesRequest = new GetRelatedFilesRequestImpl(testMetacards, location, "THUMBNAIL", TEST_PORT);
relatedFilesRequest.setHttpClient(mockHttpClient);
setupMocks();
}
use of org.codice.alliance.nsili.endpoint.requests.GetRelatedFilesRequestImpl in project alliance by codice.
the class GetRelatedFilesRequestImplTest method testNotThumbnailType.
@Test
public void testNotThumbnailType() throws Exception {
NameListHolder locations = new NameListHolder();
GetRelatedFilesRequestImpl noPortRequest = new GetRelatedFilesRequestImpl(getBadMetacards(), getTestFileLocation(), "OVERVIEW", null);
noPortRequest.setHttpClient(mockHttpClient);
State state = noPortRequest.complete(locations);
assertValidStateNoLocs(state, locations);
}
use of org.codice.alliance.nsili.endpoint.requests.GetRelatedFilesRequestImpl in project alliance by codice.
the class ProductMgrImpl method get_related_files.
@Override
public GetRelatedFilesRequest get_related_files(Product[] products, FileLocation location, String type, NameValue[] properties) throws ProcessingFault, InvalidInputParameter, SystemFault {
String id = UUID.randomUUID().toString();
try {
List<Metacard> metacards = new ArrayList<>();
AccessManagerImpl accessMgr = getAccessManager();
for (Product product : products) {
Metacard metacard = accessMgr.getMetacard(accessMgr.getProductId(product));
if (metacard != null) {
metacards.add(metacard);
}
}
Integer port = getPort(properties);
GetRelatedFilesRequestImpl getRelatedFilesRequest = new GetRelatedFilesRequestImpl(metacards, location, type, port);
_poa().activate_object_with_id(id.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), getRelatedFilesRequest);
} catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy | WrongAdapter | UnsupportedEncodingException e) {
LOGGER.debug("get_related_files : Unable to activate getRelatedFilesRequest object.", e);
}
org.omg.CORBA.Object obj = _poa().create_reference_with_id(id.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), GetRelatedFilesRequestHelper.id());
GetRelatedFilesRequest queryRequest = GetRelatedFilesRequestHelper.narrow(obj);
return queryRequest;
}
use of org.codice.alliance.nsili.endpoint.requests.GetRelatedFilesRequestImpl in project alliance by codice.
the class GetRelatedFilesRequestImplTest method testNoThumbnail.
@Test
public void testNoThumbnail() throws Exception {
NameListHolder locations = new NameListHolder();
GetRelatedFilesRequestImpl noPortRequest = new GetRelatedFilesRequestImpl(getBadMetacards(), getTestFileLocation(), "THUMBNAIL", null);
noPortRequest.setHttpClient(mockHttpClient);
State state = noPortRequest.complete(locations);
assertValidStateNoLocs(state, locations);
}
Aggregations