Search in sources :

Example 1 with GenericResourceApiConfigurationinformationConfigurationInformation

use of org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation in project so by onap.

the class GeneralTopologyObjectMapper method buildConfigurationInformation.

/**
 * Build ConfigurationInformation
 *
 * @param configuration
 * @param includeModelInformation
 * @return
 */
public GenericResourceApiConfigurationinformationConfigurationInformation buildConfigurationInformation(Configuration configuration, boolean includeModelInformation) {
    GenericResourceApiConfigurationinformationConfigurationInformation configurationInformation = new GenericResourceApiConfigurationinformationConfigurationInformation();
    configurationInformation.setConfigurationId(configuration.getConfigurationId());
    configurationInformation.setConfigurationName(configuration.getConfigurationName());
    configurationInformation.setConfigurationType(configuration.getConfigurationType());
    if (includeModelInformation) {
        GenericResourceApiOnapmodelinformationOnapModelInformation onapModelInformation = new GenericResourceApiOnapmodelinformationOnapModelInformation();
        onapModelInformation.setModelInvariantUuid(configuration.getModelInfoConfiguration().getModelInvariantId());
        onapModelInformation.setModelUuid(configuration.getModelInfoConfiguration().getModelVersionId());
        onapModelInformation.setModelCustomizationUuid(configuration.getModelInfoConfiguration().getModelCustomizationId());
        configurationInformation.setOnapModelInformation(onapModelInformation);
    }
    return configurationInformation;
}
Also used : GenericResourceApiConfigurationinformationConfigurationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation) GenericResourceApiOnapmodelinformationOnapModelInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiOnapmodelinformationOnapModelInformation)

Example 2 with GenericResourceApiConfigurationinformationConfigurationInformation

use of org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation in project so by onap.

the class GeneralTopologyObjectMapperTest method buildConfigurationInformationTest_excludesOnapModelInfo.

@Test
public void buildConfigurationInformationTest_excludesOnapModelInfo() {
    Configuration configuration = new Configuration();
    configuration.setConfigurationId("testConfigurationId");
    configuration.setConfigurationType("VNR");
    configuration.setConfigurationName("VNRCONF");
    GenericResourceApiConfigurationinformationConfigurationInformation configurationInformation = genObjMapper.buildConfigurationInformation(configuration, false);
    assertEquals(configuration.getConfigurationId(), configurationInformation.getConfigurationId());
    assertEquals(configuration.getConfigurationType(), configurationInformation.getConfigurationType());
    assertEquals(configuration.getConfigurationName(), configurationInformation.getConfigurationName());
    assertNull(configurationInformation.getOnapModelInformation());
}
Also used : GenericResourceApiConfigurationinformationConfigurationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation) Configuration(org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration) ModelInfoConfiguration(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration) Test(org.junit.Test)

Example 3 with GenericResourceApiConfigurationinformationConfigurationInformation

use of org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation in project so by onap.

the class GeneralTopologyObjectMapperTest method buildConfigurationInformationTest_includesOnapModelInfo.

@Test
public void buildConfigurationInformationTest_includesOnapModelInfo() {
    Configuration configuration = new Configuration();
    configuration.setConfigurationId("testConfigurationId");
    configuration.setConfigurationType("VNR");
    configuration.setConfigurationName("VNRCONF");
    ModelInfoConfiguration modelInfoConfiguration = new ModelInfoConfiguration();
    modelInfoConfiguration.setModelVersionId("modelVersionId");
    modelInfoConfiguration.setModelInvariantId("modelInvariantId");
    modelInfoConfiguration.setModelCustomizationId("modelCustomizationId");
    configuration.setModelInfoConfiguration(modelInfoConfiguration);
    GenericResourceApiConfigurationinformationConfigurationInformation configurationInformation = genObjMapper.buildConfigurationInformation(configuration, true);
    assertEquals(configuration.getConfigurationId(), configurationInformation.getConfigurationId());
    assertEquals(configuration.getConfigurationType(), configurationInformation.getConfigurationType());
    assertEquals(configuration.getConfigurationName(), configurationInformation.getConfigurationName());
    assertNotNull(configurationInformation.getOnapModelInformation());
    assertEquals(configuration.getModelInfoConfiguration().getModelVersionId(), configurationInformation.getOnapModelInformation().getModelUuid());
    assertEquals(configuration.getModelInfoConfiguration().getModelInvariantId(), configurationInformation.getOnapModelInformation().getModelInvariantUuid());
    assertEquals(configuration.getModelInfoConfiguration().getModelCustomizationId(), configurationInformation.getOnapModelInformation().getModelCustomizationUuid());
}
Also used : ModelInfoConfiguration(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration) GenericResourceApiConfigurationinformationConfigurationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation) Configuration(org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration) ModelInfoConfiguration(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration) Test(org.junit.Test)

Example 4 with GenericResourceApiConfigurationinformationConfigurationInformation

use of org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation in project so by onap.

the class GCTopologyOperationRequestMapper method assignOrActivateVnrReqMapper.

public GenericResourceApiGcTopologyOperationInformation assignOrActivateVnrReqMapper(SDNCSvcAction svcAction, GenericResourceApiRequestActionEnumeration reqAction, ServiceInstance serviceInstance, RequestContext requestContext, Customer customer, Configuration vnrConfiguration, GenericVnf voiceVnf, String sdncReqId, URI callbackUri) {
    String msoRequestId = UUID.randomUUID().toString();
    if (requestContext != null && requestContext.getMsoRequestId() != null) {
        msoRequestId = requestContext.getMsoRequestId();
    }
    GenericResourceApiGcTopologyOperationInformation req = new GenericResourceApiGcTopologyOperationInformation();
    GenericResourceApiSdncrequestheaderSdncRequestHeader sdncRequestHeader = generalTopologyObjectMapper.buildSdncRequestHeader(svcAction, sdncReqId, callbackUri.toString());
    GenericResourceApiRequestinformationRequestInformation requestInformation = generalTopologyObjectMapper.buildGenericResourceApiRequestinformationRequestInformation(msoRequestId, reqAction);
    GenericResourceApiServiceinformationServiceInformation serviceInformation = generalTopologyObjectMapper.buildServiceInformation(serviceInstance, requestContext, customer, false);
    GenericResourceApiConfigurationinformationConfigurationInformation configurationInformation = generalTopologyObjectMapper.buildConfigurationInformation(vnrConfiguration, true);
    GenericResourceApiGcrequestinputGcRequestInput gcRequestInput = generalTopologyObjectMapper.buildGcRequestInformation(voiceVnf, null);
    req.setRequestInformation(requestInformation);
    req.setSdncRequestHeader(sdncRequestHeader);
    req.setServiceInformation(serviceInformation);
    req.setConfigurationInformation(configurationInformation);
    req.setGcRequestInput(gcRequestInput);
    return req;
}
Also used : GenericResourceApiServiceinformationServiceInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiServiceinformationServiceInformation) GenericResourceApiSdncrequestheaderSdncRequestHeader(org.onap.sdnc.northbound.client.model.GenericResourceApiSdncrequestheaderSdncRequestHeader) GenericResourceApiConfigurationinformationConfigurationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation) GenericResourceApiGcrequestinputGcRequestInput(org.onap.sdnc.northbound.client.model.GenericResourceApiGcrequestinputGcRequestInput) GenericResourceApiRequestinformationRequestInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiRequestinformationRequestInformation) GenericResourceApiGcTopologyOperationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiGcTopologyOperationInformation)

Example 5 with GenericResourceApiConfigurationinformationConfigurationInformation

use of org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation in project so by onap.

the class GCTopologyOperationRequestMapper method deactivateOrUnassignVnrReqMapper.

public GenericResourceApiGcTopologyOperationInformation deactivateOrUnassignVnrReqMapper(SDNCSvcAction svcAction, ServiceInstance serviceInstance, RequestContext requestContext, Configuration vnrConfiguration, String sdncReqId, URI callbackUri) {
    String msoRequestId = null;
    if (requestContext != null) {
        msoRequestId = requestContext.getMsoRequestId();
    }
    GenericResourceApiGcTopologyOperationInformation req = new GenericResourceApiGcTopologyOperationInformation();
    GenericResourceApiSdncrequestheaderSdncRequestHeader sdncRequestHeader = generalTopologyObjectMapper.buildSdncRequestHeader(svcAction, sdncReqId, callbackUri.toString());
    GenericResourceApiRequestinformationRequestInformation requestInformation = generalTopologyObjectMapper.buildGenericResourceApiRequestinformationRequestInformation(msoRequestId, GenericResourceApiRequestActionEnumeration.DELETEGENERICCONFIGURATIONINSTANCE);
    GenericResourceApiServiceinformationServiceInformation serviceInformation = new GenericResourceApiServiceinformationServiceInformation();
    serviceInformation.setServiceInstanceId(serviceInstance.getServiceInstanceId());
    GenericResourceApiConfigurationinformationConfigurationInformation configurationInformation = new GenericResourceApiConfigurationinformationConfigurationInformation();
    configurationInformation.setConfigurationId(vnrConfiguration.getConfigurationId());
    configurationInformation.setConfigurationType(vnrConfiguration.getConfigurationType());
    req.setRequestInformation(requestInformation);
    req.setSdncRequestHeader(sdncRequestHeader);
    req.setServiceInformation(serviceInformation);
    req.setConfigurationInformation(configurationInformation);
    return req;
}
Also used : GenericResourceApiServiceinformationServiceInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiServiceinformationServiceInformation) GenericResourceApiSdncrequestheaderSdncRequestHeader(org.onap.sdnc.northbound.client.model.GenericResourceApiSdncrequestheaderSdncRequestHeader) GenericResourceApiConfigurationinformationConfigurationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation) GenericResourceApiRequestinformationRequestInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiRequestinformationRequestInformation) GenericResourceApiGcTopologyOperationInformation(org.onap.sdnc.northbound.client.model.GenericResourceApiGcTopologyOperationInformation)

Aggregations

GenericResourceApiConfigurationinformationConfigurationInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation)5 Test (org.junit.Test)2 GenericResourceApiGcTopologyOperationInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiGcTopologyOperationInformation)2 GenericResourceApiRequestinformationRequestInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiRequestinformationRequestInformation)2 GenericResourceApiSdncrequestheaderSdncRequestHeader (org.onap.sdnc.northbound.client.model.GenericResourceApiSdncrequestheaderSdncRequestHeader)2 GenericResourceApiServiceinformationServiceInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiServiceinformationServiceInformation)2 Configuration (org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration)2 ModelInfoConfiguration (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration)2 GenericResourceApiGcrequestinputGcRequestInput (org.onap.sdnc.northbound.client.model.GenericResourceApiGcrequestinputGcRequestInput)1 GenericResourceApiOnapmodelinformationOnapModelInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiOnapmodelinformationOnapModelInformation)1