Search in sources :

Example 6 with IPRangeConfig

use of com.cloud.test.IPRangeConfig in project cloudstack by apache.

the class ConfigurationManagerImpl method savePublicIPRange.

@DB
protected boolean savePublicIPRange(final String startIP, final String endIP, final long zoneId, final long vlanDbId, final long sourceNetworkid, final long physicalNetworkId, final boolean forSystemVms) {
    final long startIPLong = NetUtils.ip2Long(startIP);
    final long endIPLong = NetUtils.ip2Long(endIP);
    final List<String> problemIps = Transaction.execute(new TransactionCallback<List<String>>() {

        @Override
        public List<String> doInTransaction(final TransactionStatus status) {
            final IPRangeConfig config = new IPRangeConfig();
            return config.savePublicIPRange(TransactionLegacy.currentTxn(), startIPLong, endIPLong, zoneId, vlanDbId, sourceNetworkid, physicalNetworkId, forSystemVms);
        }
    });
    return CollectionUtils.isEmpty(problemIps);
}
Also used : IPRangeConfig(com.cloud.test.IPRangeConfig) TransactionStatus(com.cloud.utils.db.TransactionStatus) ArrayList(java.util.ArrayList) List(java.util.List) DB(com.cloud.utils.db.DB)

Aggregations

IPRangeConfig (com.cloud.test.IPRangeConfig)6 TransactionStatus (com.cloud.utils.db.TransactionStatus)6 DB (com.cloud.utils.db.DB)4 ArrayList (java.util.ArrayList)4 List (java.util.List)4 Config (com.cloud.configuration.Config)2 VlanVO (com.cloud.dc.VlanVO)2 TransactionCallbackNoReturn (com.cloud.utils.db.TransactionCallbackNoReturn)2 ApiServiceConfiguration (com.cloud.config.ApiServiceConfiguration)1 ConfigurationVO (com.cloud.framework.config.impl.ConfigurationVO)1 Vector (java.util.Vector)1 ApiServiceConfiguration (org.apache.cloudstack.config.ApiServiceConfiguration)1 ConfigurationVO (org.apache.cloudstack.framework.config.impl.ConfigurationVO)1