3030import com .cloud .offering .DiskOffering ;
3131import com .cloud .offering .ServiceOffering ;
3232import com .cloud .template .VirtualMachineTemplate ;
33+ import org .apache .cloudstack .resourcelimit .Reserver ;
3334
3435public interface ResourceLimitService {
3536
@@ -185,6 +186,7 @@ public interface ResourceLimitService {
185186 */
186187 public void checkResourceLimit (Account account , ResourceCount .ResourceType type , long ... count ) throws ResourceAllocationException ;
187188 public void checkResourceLimitWithTag (Account account , ResourceCount .ResourceType type , String tag , long ... count ) throws ResourceAllocationException ;
189+ public void checkResourceLimitWithTag (Account account , Long domainId , boolean considerSystemAccount , ResourceCount .ResourceType type , String tag , long ... count ) throws ResourceAllocationException ;
188190
189191 /**
190192 * Gets the count of resources for a resource type and account
@@ -245,12 +247,12 @@ public interface ResourceLimitService {
245247 List <String > getResourceLimitStorageTags (DiskOffering diskOffering );
246248 void updateTaggedResourceLimitsAndCountsForAccounts (List <AccountResponse > responses , String tag );
247249 void updateTaggedResourceLimitsAndCountsForDomains (List <DomainResponse > responses , String tag );
248- void checkVolumeResourceLimit (Account owner , Boolean display , Long size , DiskOffering diskOffering ) throws ResourceAllocationException ;
249-
250+ void checkVolumeResourceLimit (Account owner , Boolean display , Long size , DiskOffering diskOffering , List < Reserver > reservations ) throws ResourceAllocationException ;
251+ List < String > getResourceLimitStorageTagsForResourceCountOperation ( Boolean display , DiskOffering diskOffering );
250252 void checkVolumeResourceLimitForDiskOfferingChange (Account owner , Boolean display , Long currentSize , Long newSize ,
251- DiskOffering currentOffering , DiskOffering newOffering ) throws ResourceAllocationException ;
253+ DiskOffering currentOffering , DiskOffering newOffering , List < Reserver > reservations ) throws ResourceAllocationException ;
252254
253- void checkPrimaryStorageResourceLimit (Account owner , Boolean display , Long size , DiskOffering diskOffering ) throws ResourceAllocationException ;
255+ void checkPrimaryStorageResourceLimit (Account owner , Boolean display , Long size , DiskOffering diskOffering , List < Reserver > reservations ) throws ResourceAllocationException ;
254256
255257 void incrementVolumeResourceCount (long accountId , Boolean display , Long size , DiskOffering diskOffering );
256258 void decrementVolumeResourceCount (long accountId , Boolean display , Long size , DiskOffering diskOffering );
@@ -267,21 +269,20 @@ void updateVolumeResourceCountForDiskOfferingChange(long accountId, Boolean disp
267269
268270 void incrementVolumePrimaryStorageResourceCount (long accountId , Boolean display , Long size , DiskOffering diskOffering );
269271 void decrementVolumePrimaryStorageResourceCount (long accountId , Boolean display , Long size , DiskOffering diskOffering );
270- void checkVmResourceLimit (Account owner , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template ) throws ResourceAllocationException ;
272+ void checkVmResourceLimit (Account owner , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , List < Reserver > reservations ) throws ResourceAllocationException ;
271273 void incrementVmResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template );
272274 void decrementVmResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template );
273275
274276 void checkVmResourceLimitsForServiceOfferingChange (Account owner , Boolean display , Long currentCpu , Long newCpu ,
275- Long currentMemory , Long newMemory , ServiceOffering currentOffering , ServiceOffering newOffering , VirtualMachineTemplate template ) throws ResourceAllocationException ;
277+ Long currentMemory , Long newMemory , ServiceOffering currentOffering , ServiceOffering newOffering , VirtualMachineTemplate template , List < Reserver > reservations ) throws ResourceAllocationException ;
276278
277279 void checkVmResourceLimitsForTemplateChange (Account owner , Boolean display , ServiceOffering offering ,
278- VirtualMachineTemplate currentTemplate , VirtualMachineTemplate newTemplate ) throws ResourceAllocationException ;
280+ VirtualMachineTemplate currentTemplate , VirtualMachineTemplate newTemplate , List < Reserver > reservations ) throws ResourceAllocationException ;
279281
280- void checkVmCpuResourceLimit (Account owner , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long cpu ) throws ResourceAllocationException ;
281282 void incrementVmCpuResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long cpu );
282283 void decrementVmCpuResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long cpu );
283- void checkVmMemoryResourceLimit (Account owner , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long memory ) throws ResourceAllocationException ;
284284 void incrementVmMemoryResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long memory );
285285 void decrementVmMemoryResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long memory );
286286
287+ long recalculateDomainResourceCount (final long domainId , final ResourceType type , String tag );
287288}
0 commit comments