use of org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkinformationNetworkInformation in project so by onap.
the class GeneralTopologyObjectMapper method buildNetworkInformation.
/*
* Build GenericResourceApiNetworkinformationNetworkInformation
*/
public GenericResourceApiNetworkinformationNetworkInformation buildNetworkInformation(L3Network network) {
GenericResourceApiNetworkinformationNetworkInformation networkInformation = new GenericResourceApiNetworkinformationNetworkInformation();
GenericResourceApiOnapmodelinformationOnapModelInformation onapModelInformation = new GenericResourceApiOnapmodelinformationOnapModelInformation();
if (network.getModelInfoNetwork() != null) {
onapModelInformation.setModelInvariantUuid(network.getModelInfoNetwork().getModelInvariantUUID());
onapModelInformation.setModelName(network.getModelInfoNetwork().getModelName());
onapModelInformation.setModelVersion(network.getModelInfoNetwork().getModelVersion());
onapModelInformation.setModelUuid(network.getModelInfoNetwork().getModelUUID());
onapModelInformation.setModelCustomizationUuid(network.getModelInfoNetwork().getModelCustomizationUUID());
networkInformation.setOnapModelInformation(onapModelInformation);
}
networkInformation.setFromPreload(null);
networkInformation.setNetworkId(network.getNetworkId());
networkInformation.setNetworkType(network.getNetworkType());
networkInformation.setNetworkTechnology(network.getNetworkTechnology());
return networkInformation;
}
use of org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkinformationNetworkInformation in project so by onap.
the class GeneralTopologyObjectMapperTest method buildNetworkInformationTest.
@Test
public void buildNetworkInformationTest() {
L3Network network = new L3Network();
ModelInfoNetwork modelInfoNetwork = new ModelInfoNetwork();
modelInfoNetwork.setModelInvariantUUID("my-uuid");
modelInfoNetwork.setModelName("my-model-name");
modelInfoNetwork.setModelVersion("my-model-version");
modelInfoNetwork.setModelUUID("my-model-uuid");
modelInfoNetwork.setModelCustomizationUUID("my-customization-uuid");
network.setModelInfoNetwork(modelInfoNetwork);
network.setNetworkId("my-network-id");
network.setNetworkType("my-network-type");
network.setNetworkTechnology("my-network-technology");
GenericResourceApiNetworkinformationNetworkInformation networkInformation = new GenericResourceApiNetworkinformationNetworkInformation();
GenericResourceApiOnapmodelinformationOnapModelInformation onapModelInformation = new GenericResourceApiOnapmodelinformationOnapModelInformation();
networkInformation.setNetworkId("my-network-id");
networkInformation.setNetworkType("my-network-type");
networkInformation.networkTechnology("my-network-technology");
networkInformation.setFromPreload(null);
onapModelInformation.setModelInvariantUuid("my-uuid");
onapModelInformation.setModelName("my-model-name");
onapModelInformation.setModelVersion("my-model-version");
onapModelInformation.setModelUuid("my-model-uuid");
onapModelInformation.setModelCustomizationUuid("my-customization-uuid");
networkInformation.setOnapModelInformation(onapModelInformation);
assertThat(networkInformation, sameBeanAs(genObjMapper.buildNetworkInformation(network)));
}
use of org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkinformationNetworkInformation in project so by onap.
the class NetworkTopologyOperationRequestMapper method reqMapper.
public GenericResourceApiNetworkOperationInformation reqMapper(SDNCSvcOperation svcOperation, SDNCSvcAction svcAction, GenericResourceApiRequestActionEnumeration reqAction, L3Network network, ServiceInstance serviceInstance, Customer customer, RequestContext requestContext, CloudRegion cloudRegion) {
GenericResourceApiNetworkOperationInformation req = new GenericResourceApiNetworkOperationInformation();
String sdncReqId = UUID.randomUUID().toString();
String msoRequestId = UUID.randomUUID().toString();
if (requestContext != null && requestContext.getMsoRequestId() != null) {
msoRequestId = requestContext.getMsoRequestId();
}
GenericResourceApiSdncrequestheaderSdncRequestHeader sdncRequestHeader = generalTopologyObjectMapper.buildSdncRequestHeader(svcAction, sdncReqId);
GenericResourceApiRequestinformationRequestInformation requestInformation = generalTopologyObjectMapper.buildGenericResourceApiRequestinformationRequestInformation(msoRequestId, reqAction);
GenericResourceApiServiceinformationServiceInformation serviceInformation = generalTopologyObjectMapper.buildServiceInformation(serviceInstance, requestContext, customer, true);
GenericResourceApiNetworkinformationNetworkInformation networkInformation = generalTopologyObjectMapper.buildNetworkInformation(network);
GenericResourceApiNetworkrequestinputNetworkRequestInput networkRequestInput = buildNetworkRequestInput(network, serviceInstance, cloudRegion);
req.setRequestInformation(requestInformation);
req.setSdncRequestHeader(sdncRequestHeader);
req.setServiceInformation(serviceInformation);
req.setNetworkInformation(networkInformation);
if (requestContext != null && requestContext.getUserParams() != null) {
for (Map.Entry<String, Object> entry : requestContext.getUserParams().entrySet()) {
GenericResourceApiParam networkInputParameters = new GenericResourceApiParam();
GenericResourceApiParamParam paramItem = new GenericResourceApiParamParam();
paramItem.setName(entry.getKey());
paramItem.setValue(generalTopologyObjectMapper.mapUserParamValue(entry.getValue()));
networkInputParameters.addParamItem(paramItem);
networkRequestInput.setNetworkInputParameters(networkInputParameters);
}
}
req.setNetworkRequestInput(networkRequestInput);
return req;
}
use of org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkinformationNetworkInformation in project so by onap.
the class GeneralTopologyObjectMapperTest method buildNetworkInformationNoModelTest.
@Test
public void buildNetworkInformationNoModelTest() {
L3Network network = new L3Network();
network.setNetworkId("my-network-id");
network.setNetworkType("my-network-type");
network.setNetworkTechnology("my-network-technology");
GenericResourceApiNetworkinformationNetworkInformation networkInformation = new GenericResourceApiNetworkinformationNetworkInformation();
networkInformation.setNetworkId("my-network-id");
networkInformation.setNetworkType("my-network-type");
networkInformation.networkTechnology("my-network-technology");
networkInformation.setFromPreload(null);
assertThat(networkInformation, sameBeanAs(genObjMapper.buildNetworkInformation(network)));
}
Aggregations