Search in sources :

Example 21 with NetworkOfferingServiceMapVO

use of com.cloud.offerings.NetworkOfferingServiceMapVO in project cloudstack by apache.

the class NetworkOfferingServiceMapDaoImpl method persist.

@Override
public NetworkOfferingServiceMapVO persist(NetworkOfferingServiceMapVO entity) {
    SearchCriteria<NetworkOfferingServiceMapVO> sc = AllFieldsSearch.create();
    sc.setParameters("networkOfferingId", entity.getNetworkOfferingId());
    sc.setParameters("service", entity.getService());
    sc.setParameters("provider", entity.getProvider());
    NetworkOfferingServiceMapVO mappingInDb = findOneBy(sc);
    return mappingInDb != null ? mappingInDb : super.persist(entity);
}
Also used : NetworkOfferingServiceMapVO(com.cloud.offerings.NetworkOfferingServiceMapVO)

Aggregations

NetworkOfferingServiceMapVO (com.cloud.offerings.NetworkOfferingServiceMapVO)21 Service (com.cloud.network.Network.Service)11 HashMap (java.util.HashMap)9 NetworkOfferingVO (com.cloud.offerings.NetworkOfferingVO)8 Network (com.cloud.network.Network)6 Provider (com.cloud.network.Network.Provider)6 NetworkService (com.cloud.network.NetworkService)6 DB (com.cloud.utils.db.DB)6 ResourceLimitService (com.cloud.user.ResourceLimitService)5 ArrayList (java.util.ArrayList)5 HashSet (java.util.HashSet)5 List (java.util.List)5 Set (java.util.Set)5 NetworkOrchestrationService (org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService)5 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)4 PhysicalNetwork (com.cloud.network.PhysicalNetwork)4 TransactionStatus (com.cloud.utils.db.TransactionStatus)4 Capability (com.cloud.network.Network.Capability)3 NetworkOffering (com.cloud.offering.NetworkOffering)3 ManagementService (com.cloud.server.ManagementService)3