Search in sources :

Example 1 with GenericResourceApiNetworkinformationNetworkInformation

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;
}
Also used : GenericResourceApiOnapmodelinformationOnapModelInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiOnapmodelinformationOnapModelInformation) GenericResourceApiNetworkinformationNetworkInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkinformationNetworkInformation)

Example 2 with GenericResourceApiNetworkinformationNetworkInformation

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)));
}
Also used : L3Network(org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network) GenericResourceApiOnapmodelinformationOnapModelInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiOnapmodelinformationOnapModelInformation) ModelInfoNetwork(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoNetwork) GenericResourceApiNetworkinformationNetworkInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkinformationNetworkInformation) Test(org.junit.Test)

Example 3 with GenericResourceApiNetworkinformationNetworkInformation

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;
}
Also used : GenericResourceApiServiceinformationServiceInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiServiceinformationServiceInformation) GenericResourceApiSdncrequestheaderSdncRequestHeader(org.onap.sdnc.northbound.client.model.GenericResourceApiSdncrequestheaderSdncRequestHeader) GenericResourceApiRequestinformationRequestInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiRequestinformationRequestInformation) GenericResourceApiParam(org.onap.sdnc.northbound.client.model.GenericResourceApiParam) GenericResourceApiNetworkOperationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation) GenericResourceApiParamParam(org.onap.sdnc.northbound.client.model.GenericResourceApiParamParam) Map(java.util.Map) GenericResourceApiNetworkinformationNetworkInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkinformationNetworkInformation) GenericResourceApiNetworkrequestinputNetworkRequestInput(org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkrequestinputNetworkRequestInput)

Example 4 with GenericResourceApiNetworkinformationNetworkInformation

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)));
}
Also used : L3Network(org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network) GenericResourceApiNetworkinformationNetworkInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkinformationNetworkInformation) Test(org.junit.Test)

Aggregations

GenericResourceApiNetworkinformationNetworkInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkinformationNetworkInformation)4 Test (org.junit.Test)2 GenericResourceApiOnapmodelinformationOnapModelInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiOnapmodelinformationOnapModelInformation)2 L3Network (org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network)2 Map (java.util.Map)1 GenericResourceApiNetworkOperationInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation)1 GenericResourceApiNetworkrequestinputNetworkRequestInput (org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkrequestinputNetworkRequestInput)1 GenericResourceApiParam (org.onap.sdnc.northbound.client.model.GenericResourceApiParam)1 GenericResourceApiParamParam (org.onap.sdnc.northbound.client.model.GenericResourceApiParamParam)1 GenericResourceApiRequestinformationRequestInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiRequestinformationRequestInformation)1 GenericResourceApiSdncrequestheaderSdncRequestHeader (org.onap.sdnc.northbound.client.model.GenericResourceApiSdncrequestheaderSdncRequestHeader)1 GenericResourceApiServiceinformationServiceInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiServiceinformationServiceInformation)1 ModelInfoNetwork (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoNetwork)1