use of com.cloud.network.vpc.VpcOfferingServiceMapVO in project cloudstack by apache.
the class NuageVspElement method implementVpc.
@Override
public boolean implementVpc(Vpc vpc, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
List<VpcOfferingServiceMapVO> vpcOfferingServices = _vpcOfferingSrvcDao.listByVpcOffId(vpc.getVpcOfferingId());
Map<Network.Service, Set<Network.Provider>> supportedVpcServices = NuageVspManagerImpl.NUAGE_VSP_VPC_SERVICE_MAP;
for (VpcOfferingServiceMapVO vpcOfferingService : vpcOfferingServices) {
Network.Service service = Network.Service.getService(vpcOfferingService.getService());
if (!supportedVpcServices.containsKey(service)) {
s_logger.warn(String.format("NuageVsp doesn't support service %s for VPCs", service.getName()));
return false;
}
Network.Provider provider = Network.Provider.getProvider(vpcOfferingService.getProvider());
if (!supportedVpcServices.get(service).contains(provider)) {
s_logger.warn(String.format("NuageVsp doesn't support provider %s for service %s for VPCs", provider.getName(), service.getName()));
return false;
}
}
return true;
}
use of com.cloud.network.vpc.VpcOfferingServiceMapVO in project cloudstack by apache.
the class VpcOfferingServiceMapDaoImpl method areServicesSupportedByNetworkOffering.
@Override
public boolean areServicesSupportedByNetworkOffering(long networkOfferingId, Service... services) {
SearchCriteria<VpcOfferingServiceMapVO> sc = MultipleServicesSearch.create();
sc.setParameters("vpcOffId", networkOfferingId);
if (services != null) {
String[] servicesStr = new String[services.length];
int i = 0;
for (Service service : services) {
servicesStr[i] = service.getName();
i++;
}
sc.setParameters("service", (Object[]) servicesStr);
}
List<VpcOfferingServiceMapVO> offeringServices = listBy(sc);
if (services != null) {
if (offeringServices.size() == services.length) {
return true;
}
} else if (!offeringServices.isEmpty()) {
return true;
}
return false;
}
Aggregations