mirror of https://github.com/apache/cloudstack.git
bug 6361: further name changes from network to security group
This commit is contained in:
parent
6bd7caa9c2
commit
523862f571
|
|
@ -32,7 +32,7 @@ import com.cloud.network.dao.IPAddressDao;
|
|||
import com.cloud.network.dao.LoadBalancerDao;
|
||||
import com.cloud.network.dao.NetworkRuleConfigDao;
|
||||
import com.cloud.network.dao.SecurityGroupDao;
|
||||
import com.cloud.network.security.NetworkGroupManager;
|
||||
import com.cloud.network.security.SecurityGroupManager;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.server.Criteria;
|
||||
import com.cloud.server.ManagementServer;
|
||||
|
|
@ -84,7 +84,7 @@ public class ApiDBUtils {
|
|||
private static AccountManager _accountMgr;
|
||||
private static AgentManager _agentMgr;
|
||||
private static AsyncJobManager _asyncMgr;
|
||||
private static NetworkGroupManager _networkGroupMgr;
|
||||
private static SecurityGroupManager _networkGroupMgr;
|
||||
private static SnapshotManager _snapMgr;
|
||||
private static StorageManager _storageMgr;
|
||||
private static UserVmManager _userVmMgr;
|
||||
|
|
@ -123,7 +123,7 @@ public class ApiDBUtils {
|
|||
_accountMgr = locator.getManager(AccountManager.class);
|
||||
_agentMgr = locator.getManager(AgentManager.class);
|
||||
_asyncMgr = locator.getManager(AsyncJobManager.class);
|
||||
_networkGroupMgr = locator.getManager(NetworkGroupManager.class);
|
||||
_networkGroupMgr = locator.getManager(SecurityGroupManager.class);
|
||||
_snapMgr = locator.getManager(SnapshotManager.class);
|
||||
_storageMgr = locator.getManager(StorageManager.class);
|
||||
_userVmMgr = locator.getManager(UserVmManager.class);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import com.cloud.consoleproxy.ConsoleProxyManager;
|
|||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.PermissionDeniedException;
|
||||
import com.cloud.network.NetworkManager;
|
||||
import com.cloud.network.security.NetworkGroupManager;
|
||||
import com.cloud.network.security.SecurityGroupManager;
|
||||
import com.cloud.server.ManagementServer;
|
||||
import com.cloud.storage.StorageManager;
|
||||
import com.cloud.storage.snapshot.SnapshotManager;
|
||||
|
|
@ -59,7 +59,7 @@ public class ApiDispatcher {
|
|||
private ConfigurationManager _configMgr;
|
||||
private ConsoleProxyManager _consoleProxyMgr;
|
||||
private ManagementServer _mgmtServer;
|
||||
private NetworkGroupManager _networkGroupMgr;
|
||||
private SecurityGroupManager _networkGroupMgr;
|
||||
private NetworkManager _networkMgr;
|
||||
private SnapshotManager _snapshotMgr;
|
||||
private StorageManager _storageMgr;
|
||||
|
|
@ -80,7 +80,7 @@ public class ApiDispatcher {
|
|||
_agentMgr = locator.getManager(AgentManager.class);
|
||||
_configMgr = locator.getManager(ConfigurationManager.class);
|
||||
_consoleProxyMgr = locator.getManager(ConsoleProxyManager.class);
|
||||
_networkGroupMgr = locator.getManager(NetworkGroupManager.class);
|
||||
_networkGroupMgr = locator.getManager(SecurityGroupManager.class);
|
||||
_networkMgr = locator.getManager(NetworkManager.class);
|
||||
_snapshotMgr = locator.getManager(SnapshotManager.class);
|
||||
_storageMgr = locator.getManager(StorageManager.class);
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.response.SuccessResponse;
|
||||
|
||||
@Implementation(method="deleteNetworkGroup", manager=Manager.NetworkGroupManager)
|
||||
public class DeleteNetworkGroupCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteNetworkGroupCmd.class.getName());
|
||||
public class DeleteSecurityGroupCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteSecurityGroupCmd.class.getName());
|
||||
private static final String s_name = "deletenetworkgroupresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -41,15 +41,15 @@ import com.cloud.network.security.dao.NetworkGroupWorkDao;
|
|||
* Listens for answers to ingress rules modification commands
|
||||
*
|
||||
*/
|
||||
public class NetworkGroupListener implements Listener {
|
||||
public static final Logger s_logger = Logger.getLogger(NetworkGroupListener.class.getName());
|
||||
public class SecurityGroupListener implements Listener {
|
||||
public static final Logger s_logger = Logger.getLogger(SecurityGroupListener.class.getName());
|
||||
|
||||
SecurityGroupManagerImpl _networkGroupManager;
|
||||
AgentManager _agentMgr;
|
||||
NetworkGroupWorkDao _workDao;
|
||||
|
||||
|
||||
public NetworkGroupListener(SecurityGroupManagerImpl networkGroupManager,
|
||||
public SecurityGroupListener(SecurityGroupManagerImpl networkGroupManager,
|
||||
AgentManager agentMgr, NetworkGroupWorkDao workDao) {
|
||||
super();
|
||||
_networkGroupManager = networkGroupManager;
|
||||
|
|
@ -22,7 +22,7 @@ import java.util.List;
|
|||
|
||||
import com.cloud.api.commands.AuthorizeNetworkGroupIngressCmd;
|
||||
import com.cloud.api.commands.CreateSecurityGroupCmd;
|
||||
import com.cloud.api.commands.DeleteNetworkGroupCmd;
|
||||
import com.cloud.api.commands.DeleteSecurityGroupCmd;
|
||||
import com.cloud.api.commands.ListNetworkGroupsCmd;
|
||||
import com.cloud.api.commands.RevokeNetworkGroupIngressCmd;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
|
|
@ -37,7 +37,7 @@ import com.cloud.vm.State;
|
|||
* Ensures that network firewall rules stay updated as VMs go up and down
|
||||
*
|
||||
*/
|
||||
public interface NetworkGroupManager extends Manager {
|
||||
public interface SecurityGroupManager extends Manager {
|
||||
|
||||
public static final String DEFAULT_GROUP_NAME = "default";
|
||||
public static final String DEFAULT_GROUP_DESCRIPTION = "Default Network Group";
|
||||
|
|
@ -63,7 +63,7 @@ public interface NetworkGroupManager extends Manager {
|
|||
|
||||
boolean revokeNetworkGroupIngress(RevokeNetworkGroupIngressCmd cmd);
|
||||
|
||||
public void deleteNetworkGroup(DeleteNetworkGroupCmd cmd) throws ResourceInUseException, PermissionDeniedException, InvalidParameterValueException;
|
||||
public void deleteNetworkGroup(DeleteSecurityGroupCmd cmd) throws ResourceInUseException, PermissionDeniedException, InvalidParameterValueException;
|
||||
|
||||
/**
|
||||
* Search for network groups and associated ingress rules for the given account, domain, group name, and/or keyword.
|
||||
|
|
@ -47,7 +47,7 @@ import com.cloud.api.BaseCmd;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.commands.AuthorizeNetworkGroupIngressCmd;
|
||||
import com.cloud.api.commands.CreateSecurityGroupCmd;
|
||||
import com.cloud.api.commands.DeleteNetworkGroupCmd;
|
||||
import com.cloud.api.commands.DeleteSecurityGroupCmd;
|
||||
import com.cloud.api.commands.ListNetworkGroupsCmd;
|
||||
import com.cloud.api.commands.RevokeNetworkGroupIngressCmd;
|
||||
import com.cloud.configuration.dao.ConfigurationDao;
|
||||
|
|
@ -86,8 +86,8 @@ import com.cloud.vm.State;
|
|||
import com.cloud.vm.UserVmVO;
|
||||
import com.cloud.vm.dao.UserVmDao;
|
||||
|
||||
@Local(value={NetworkGroupManager.class})
|
||||
public class SecurityGroupManagerImpl implements NetworkGroupManager {
|
||||
@Local(value={SecurityGroupManager.class})
|
||||
public class SecurityGroupManagerImpl implements SecurityGroupManager {
|
||||
public static final Logger s_logger = Logger.getLogger(SecurityGroupManagerImpl.class.getName());
|
||||
|
||||
@Inject NetworkGroupDao _networkGroupDao;
|
||||
|
|
@ -110,7 +110,7 @@ public class SecurityGroupManagerImpl implements NetworkGroupManager {
|
|||
|
||||
|
||||
boolean _enabled = false;
|
||||
NetworkGroupListener _answerListener;
|
||||
SecurityGroupListener _answerListener;
|
||||
|
||||
|
||||
private final class NetworkGroupVOComparator implements
|
||||
|
|
@ -945,7 +945,7 @@ public class SecurityGroupManagerImpl implements NetworkGroupManager {
|
|||
if (!_enabled) {
|
||||
return false;
|
||||
}
|
||||
_answerListener = new NetworkGroupListener(this, _agentMgr, _workDao);
|
||||
_answerListener = new SecurityGroupListener(this, _agentMgr, _workDao);
|
||||
_agentMgr.registerForHostEvents(_answerListener, true, true, true);
|
||||
|
||||
_serverId = ((ManagementServer)ComponentLocator.getComponent(ManagementServer.Name)).getId();
|
||||
|
|
@ -983,11 +983,11 @@ public class SecurityGroupManagerImpl implements NetworkGroupManager {
|
|||
if (!_enabled) {
|
||||
return null;
|
||||
}
|
||||
NetworkGroupVO groupVO = _networkGroupDao.findByAccountAndName(accountId, NetworkGroupManager.DEFAULT_GROUP_NAME);
|
||||
NetworkGroupVO groupVO = _networkGroupDao.findByAccountAndName(accountId, SecurityGroupManager.DEFAULT_GROUP_NAME);
|
||||
if (groupVO == null ) {
|
||||
Account accVO = _accountDao.findById(accountId);
|
||||
if (accVO != null) {
|
||||
return createNetworkGroup(NetworkGroupManager.DEFAULT_GROUP_NAME, NetworkGroupManager.DEFAULT_GROUP_DESCRIPTION, accVO.getDomainId(), accVO.getId(), accVO.getAccountName());
|
||||
return createNetworkGroup(SecurityGroupManager.DEFAULT_GROUP_NAME, SecurityGroupManager.DEFAULT_GROUP_DESCRIPTION, accVO.getDomainId(), accVO.getId(), accVO.getAccountName());
|
||||
}
|
||||
}
|
||||
return groupVO;
|
||||
|
|
@ -1111,7 +1111,7 @@ public class SecurityGroupManagerImpl implements NetworkGroupManager {
|
|||
|
||||
@DB
|
||||
@Override
|
||||
public void deleteNetworkGroup(DeleteNetworkGroupCmd cmd) throws ResourceInUseException, PermissionDeniedException, InvalidParameterValueException{
|
||||
public void deleteNetworkGroup(DeleteSecurityGroupCmd cmd) throws ResourceInUseException, PermissionDeniedException, InvalidParameterValueException{
|
||||
String name = cmd.getName();
|
||||
String accountName = cmd.getAccountName();
|
||||
Long domainId = cmd.getDomainId();
|
||||
|
|
@ -1171,7 +1171,7 @@ public class SecurityGroupManagerImpl implements NetworkGroupManager {
|
|||
return;
|
||||
}
|
||||
|
||||
if (group.getName().equalsIgnoreCase(NetworkGroupManager.DEFAULT_GROUP_NAME)) {
|
||||
if (group.getName().equalsIgnoreCase(SecurityGroupManager.DEFAULT_GROUP_NAME)) {
|
||||
txn.rollback();
|
||||
throw new PermissionDeniedException("The network group default is reserved");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ import com.cloud.network.dao.LoadBalancerVMMapDao;
|
|||
import com.cloud.network.dao.NetworkRuleConfigDao;
|
||||
import com.cloud.network.dao.SecurityGroupDao;
|
||||
import com.cloud.network.dao.SecurityGroupVMMapDao;
|
||||
import com.cloud.network.security.NetworkGroupManager;
|
||||
import com.cloud.network.security.SecurityGroupManager;
|
||||
import com.cloud.network.security.NetworkGroupVO;
|
||||
import com.cloud.network.security.dao.NetworkGroupDao;
|
||||
import com.cloud.offering.NetworkOffering;
|
||||
|
|
@ -368,7 +368,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
private final AsyncJobManager _asyncMgr;
|
||||
private final TemplateManager _tmpltMgr;
|
||||
private final SnapshotManager _snapMgr;
|
||||
private final NetworkGroupManager _networkGroupMgr;
|
||||
private final SecurityGroupManager _networkGroupMgr;
|
||||
private final int _purgeDelay;
|
||||
private final boolean _directAttachNetworkExternalIpAllocator;
|
||||
private final PreallocatedLunDao _lunDao;
|
||||
|
|
@ -463,7 +463,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
_asyncMgr = locator.getManager(AsyncJobManager.class);
|
||||
_tmpltMgr = locator.getManager(TemplateManager.class);
|
||||
_snapMgr = locator.getManager(SnapshotManager.class);
|
||||
_networkGroupMgr = locator.getManager(NetworkGroupManager.class);
|
||||
_networkGroupMgr = locator.getManager(SecurityGroupManager.class);
|
||||
_uploadMonitor = locator.getManager(UploadMonitor.class);
|
||||
|
||||
_userAuthenticators = locator.getAdapters(UserAuthenticator.class);
|
||||
|
|
@ -1874,7 +1874,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
}
|
||||
Set<String> nameSet = new HashSet<String>(); //handle duplicate names -- allowed
|
||||
nameSet.addAll(Arrays.asList(networkGroups));
|
||||
nameSet.add(NetworkGroupManager.DEFAULT_GROUP_NAME);
|
||||
nameSet.add(SecurityGroupManager.DEFAULT_GROUP_NAME);
|
||||
networkGroups = nameSet.toArray(new String[nameSet.size()]);
|
||||
List<NetworkGroupVO> networkGroupVOs = _networkSecurityGroupDao.findByAccountAndNames(accountId, networkGroups);
|
||||
if (networkGroupVOs.size() != nameSet.size()) {
|
||||
|
|
@ -1882,7 +1882,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
}
|
||||
} else { //create a default group if necessary
|
||||
if (offering.getGuestIpType() != NetworkOffering.GuestIpType.Virtualized && _networkGroupsEnabled) {
|
||||
networkGroups = new String[]{NetworkGroupManager.DEFAULT_GROUP_NAME};
|
||||
networkGroups = new String[]{SecurityGroupManager.DEFAULT_GROUP_NAME};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ import com.cloud.network.dao.LoadBalancerDao;
|
|||
import com.cloud.network.dao.LoadBalancerVMMapDao;
|
||||
import com.cloud.network.dao.SecurityGroupDao;
|
||||
import com.cloud.network.dao.SecurityGroupVMMapDao;
|
||||
import com.cloud.network.security.NetworkGroupManager;
|
||||
import com.cloud.network.security.SecurityGroupManager;
|
||||
import com.cloud.network.security.NetworkGroupVO;
|
||||
import com.cloud.offering.NetworkOffering;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
|
|
@ -246,7 +246,7 @@ public class UserVmManagerImpl implements UserVmManager {
|
|||
@Inject AccountVlanMapDao _accountVlanMapDao;
|
||||
@Inject StoragePoolDao _storagePoolDao;
|
||||
@Inject VMTemplateHostDao _vmTemplateHostDao;
|
||||
@Inject NetworkGroupManager _networkGroupManager;
|
||||
@Inject SecurityGroupManager _networkGroupManager;
|
||||
@Inject ServiceOfferingDao _serviceOfferingDao;
|
||||
@Inject EventDao _eventDao = null;
|
||||
@Inject InstanceGroupDao _vmGroupDao;
|
||||
|
|
|
|||
Loading…
Reference in New Issue