Search in sources :

Example 1 with Candidate

use of org.onap.so.bpmn.servicedecomposition.homingobjects.Candidate in project so by onap.

the class SniroHomingV2IT method beforeVpnBondingLink.

public void beforeVpnBondingLink(String id) {
    VpnBondingLink bondingLink = new VpnBondingLink();
    bondingLink.setVpnBondingLinkId("testVpnBondingId" + id);
    bondingLink.getServiceProxies().add(setServiceProxy("1", "transport"));
    ServiceProxy sp2 = setServiceProxy("2", "infrastructure");
    Candidate requiredCandidate = new Candidate();
    requiredCandidate.setIdentifierType(CandidateType.VNF_ID);
    List<String> c = new ArrayList<String>();
    c.add("testVnfId");
    requiredCandidate.setIdentifiers(c);
    sp2.addRequiredCandidates(requiredCandidate);
    bondingLink.getServiceProxies().add(sp2);
    serviceInstance.getVpnBondingLinks().add(bondingLink);
}
Also used : Candidate(org.onap.so.bpmn.servicedecomposition.homingobjects.Candidate) VpnBondingLink(org.onap.so.bpmn.servicedecomposition.bbobjects.VpnBondingLink) ServiceProxy(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceProxy) ArrayList(java.util.ArrayList)

Example 2 with Candidate

use of org.onap.so.bpmn.servicedecomposition.homingobjects.Candidate in project so by onap.

the class SniroHomingV2 method getCandidates.

private List<org.onap.so.client.sniro.beans.Candidate> getCandidates(List<Candidate> candidates) {
    List<org.onap.so.client.sniro.beans.Candidate> candidateList = new ArrayList<>();
    if (!candidates.isEmpty()) {
        for (Candidate c : candidates) {
            org.onap.so.client.sniro.beans.Candidate can = new org.onap.so.client.sniro.beans.Candidate();
            can.setIdentifierType(org.onap.so.client.sniro.beans.CandidateType.valueOf(c.getIdentifierType().name()));
            can.setIdentifiers(c.getIdentifiers());
            can.setCloudOwner(c.getCloudOwner());
            candidateList.add(can);
        }
    }
    return candidateList;
}
Also used : Candidate(org.onap.so.bpmn.servicedecomposition.homingobjects.Candidate) ArrayList(java.util.ArrayList)

Example 3 with Candidate

use of org.onap.so.bpmn.servicedecomposition.homingobjects.Candidate in project so by onap.

the class OofHomingV2IT method beforeVpnBondingLink.

public void beforeVpnBondingLink(String id) {
    VpnBondingLink bondingLink = new VpnBondingLink();
    bondingLink.setVpnBondingLinkId("testVpnBondingId" + id);
    bondingLink.getServiceProxies().add(setServiceProxy("1", "transport"));
    ServiceProxy sp2 = setServiceProxy("2", "infrastructure");
    Candidate requiredCandidate = new Candidate();
    requiredCandidate.setIdentifierType(CandidateType.VNF_ID);
    List<String> c = new ArrayList<String>();
    c.add("testVnfId");
    requiredCandidate.setIdentifiers(c);
    sp2.addRequiredCandidates(requiredCandidate);
    bondingLink.getServiceProxies().add(sp2);
    serviceInstance.getVpnBondingLinks().add(bondingLink);
}
Also used : Candidate(org.onap.so.bpmn.servicedecomposition.homingobjects.Candidate) VpnBondingLink(org.onap.so.bpmn.servicedecomposition.bbobjects.VpnBondingLink) ServiceProxy(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceProxy) ArrayList(java.util.ArrayList)

Example 4 with Candidate

use of org.onap.so.bpmn.servicedecomposition.homingobjects.Candidate in project so by onap.

the class SniroHomingV2IT method beforeServiceProxy.

public void beforeServiceProxy() {
    ServiceProxy sp = setServiceProxy("1", "infrastructure");
    Candidate filteringAttributes = new Candidate();
    filteringAttributes.setIdentifierType(CandidateType.CLOUD_REGION_ID);
    List<String> c = new ArrayList<String>();
    c.add("testCloudRegionId");
    filteringAttributes.setCloudOwner("att");
    filteringAttributes.setIdentifiers(c);
    sp.getFilteringAttributes().add(filteringAttributes);
    serviceInstance.getServiceProxies().add(sp);
}
Also used : Candidate(org.onap.so.bpmn.servicedecomposition.homingobjects.Candidate) ServiceProxy(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceProxy) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)4 Candidate (org.onap.so.bpmn.servicedecomposition.homingobjects.Candidate)4 ServiceProxy (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceProxy)3 VpnBondingLink (org.onap.so.bpmn.servicedecomposition.bbobjects.VpnBondingLink)2