test_class.declarator: _dcDao
test_class.modifier: @Mock
test_class.original_string: @Mock
      DataCenterDao _dcDao;
test_class.type: DataCenterDao
test_class.var_name: _dcDao
test_class.declarator: _routerDao
test_class.modifier: @Mock private
test_class.original_string: @Mock private DomainRouterDao _routerDao;
test_class.type: DomainRouterDao
test_class.var_name: _routerDao
test_class.declarator: _entityMgr
test_class.modifier: @Mock
test_class.original_string: @Mock
      EntityManager _entityMgr;
test_class.type: EntityManager
test_class.var_name: _entityMgr
test_class.declarator: networkTopologyContext
test_class.modifier: @Mock
test_class.original_string: @Mock
      NetworkTopologyContext networkTopologyContext;
test_class.type: NetworkTopologyContext
test_class.var_name: networkTopologyContext
test_class.declarator: _vpcRouterMgr
test_class.modifier: @InjectMocks
test_class.original_string: @InjectMocks
      VpcVirtualNetworkApplianceManagerImpl _vpcRouterMgr;
test_class.type: VpcVirtualNetworkApplianceManagerImpl
test_class.var_name: _vpcRouterMgr
test_class.declarator: vpcVirtualRouterElement
test_class.modifier: @InjectMocks
test_class.original_string: @InjectMocks
      VpcVirtualRouterElement vpcVirtualRouterElement;
test_class.type: VpcVirtualRouterElement
test_class.var_name: vpcVirtualRouterElement
test_class.file: server/src/test/java/com/cloud/network/element/VpcVirtualRouterElementTest.java
test_class.identifier: VpcVirtualRouterElementTest
test_case.body: @Test
      public void testApplyVpnUsersException2() {
          vpcVirtualRouterElement._vpcRouterMgr = _vpcRouterMgr;
  
          final AdvancedNetworkTopology advancedNetworkTopology = Mockito.mock(AdvancedNetworkTopology.class);
          final BasicNetworkTopology basicNetworkTopology = Mockito.mock(BasicNetworkTopology.class);
  
          networkTopologyContext.setAdvancedNetworkTopology(advancedNetworkTopology);
          networkTopologyContext.setBasicNetworkTopology(basicNetworkTopology);
          networkTopologyContext.init();
  
          final RemoteAccessVpn remoteAccessVpn = Mockito.mock(RemoteAccessVpn.class);
  
          final List<VpnUser> users = new ArrayList<VpnUser>();
  
          final Long vpcId = new Long(1l);
  
          when(remoteAccessVpn.getVpcId()).thenReturn(vpcId);
          when(_vpcRouterMgr.getVpcRouters(vpcId)).thenReturn(null);
  
          try {
              final String [] results = vpcVirtualRouterElement.applyVpnUsers(remoteAccessVpn, users);
  
              assertNull(results);
          } catch (final ResourceUnavailableException e) {
              fail(e.getMessage());
          }
  
          verify(remoteAccessVpn, times(1)).getVpcId();
      }
test_case.class_method_signature: VpcVirtualRouterElementTest.testApplyVpnUsersException2()
test_case.full_signature: @Test public void testApplyVpnUsersException2()
test_case.identifier: testApplyVpnUsersException2
test_case.invocations: mock mock setAdvancedNetworkTopology setBasicNetworkTopology init mock thenReturn when getVpcId thenReturn when getVpcRouters applyVpnUsers assertNull fail getMessage getVpcId verify times
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testApplyVpnUsersException2()
focal_class.declarator: s_logger = LoggerFactory.getLogger(VpcVirtualRouterElement.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger s_logger = LoggerFactory.getLogger(VpcVirtualRouterElement.class);
focal_class.type: Logger
focal_class.var_name: s_logger
focal_class.declarator: capabilities = setCapabilities()
focal_class.modifier: private static final
focal_class.original_string: private static final Map<Service, Map<Capability, String>> capabilities = setCapabilities();
focal_class.type: Map<Service, Map<Capability, String>>
focal_class.var_name: capabilities
focal_class.declarator: _vpcMgr
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      VpcManager _vpcMgr;
focal_class.type: VpcManager
focal_class.var_name: _vpcMgr
focal_class.declarator: _vpcRouterMgr
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      VpcVirtualNetworkApplianceManager _vpcRouterMgr;
focal_class.type: VpcVirtualNetworkApplianceManager
focal_class.var_name: _vpcRouterMgr
focal_class.declarator: _vpnGatewayDao
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      Site2SiteVpnGatewayDao _vpnGatewayDao;
focal_class.type: Site2SiteVpnGatewayDao
focal_class.var_name: _vpnGatewayDao
focal_class.declarator: _ipAddressDao
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      IPAddressDao _ipAddressDao;
focal_class.type: IPAddressDao
focal_class.var_name: _ipAddressDao
focal_class.declarator: _ntwkModel
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      NetworkModel _ntwkModel;
focal_class.type: NetworkModel
focal_class.var_name: _ntwkModel
focal_class.declarator: _networkDao
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      NetworkDao _networkDao;
focal_class.type: NetworkDao
focal_class.var_name: _networkDao
focal_class.declarator: _vpcGatewayDao
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      VpcGatewayDao _vpcGatewayDao;
focal_class.type: VpcGatewayDao
focal_class.var_name: _vpcGatewayDao
focal_class.declarator: _networkACLItemDao
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      NetworkACLItemDao _networkACLItemDao;
focal_class.type: NetworkACLItemDao
focal_class.var_name: _networkACLItemDao
focal_class.declarator: _entityMgr
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      EntityManager _entityMgr;
focal_class.type: EntityManager
focal_class.var_name: _entityMgr
focal_class.declarator: _itMgr
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      VirtualMachineManager _itMgr;
focal_class.type: VirtualMachineManager
focal_class.var_name: _itMgr
focal_class.declarator: _ipAddrMgr
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      IpAddressManager _ipAddrMgr;
focal_class.type: IpAddressManager
focal_class.var_name: _ipAddrMgr
focal_class.declarator: _vpcDao
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      VpcDao _vpcDao;
focal_class.type: VpcDao
focal_class.var_name: _vpcDao
focal_class.declarator: _vpcNetWprkHelper
focal_class.modifier: @Autowired
      @Qualifier("vpcNetworkHelper")
      private
focal_class.original_string: @Autowired
      @Qualifier("vpcNetworkHelper")
      private VpcNetworkHelperImpl _vpcNetWprkHelper;
focal_class.type: VpcNetworkHelperImpl
focal_class.var_name: _vpcNetWprkHelper
focal_class.declarator: routerDeploymentDefinitionBuilder
focal_class.modifier: @Inject
focal_class.original_string: @Inject RouterDeploymentDefinitionBuilder routerDeploymentDefinitionBuilder;
focal_class.type: RouterDeploymentDefinitionBuilder
focal_class.var_name: routerDeploymentDefinitionBuilder
focal_class.file: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
focal_class.identifier: VpcVirtualRouterElement
focal_class.interfaces: implements VpcProvider, Site2SiteVpnServiceProvider, NetworkACLServiceProvider
focal_class.class_method_signature: VpcVirtualRouterElement.canHandle(final Network network, final Service service)
focal_class.full_signature: @Override protected boolean canHandle(final Network network, final Service service)
focal_class.identifier: canHandle
focal_class.modifiers: @Override protected
focal_class.parameters: (final Network network, final Service service)
focal_class.return: boolean
focal_class.signature: boolean canHandle(final Network network, final Service service)
focal_class.class_method_signature: VpcVirtualRouterElement.implementVpc(final Vpc vpc, final DeployDestination dest, final ReservationContext context)
focal_class.full_signature: @Override public boolean implementVpc(final Vpc vpc, final DeployDestination dest, final ReservationContext context)
focal_class.identifier: implementVpc
focal_class.modifiers: @Override public
focal_class.parameters: (final Vpc vpc, final DeployDestination dest, final ReservationContext context)
focal_class.return: boolean
focal_class.signature: boolean implementVpc(final Vpc vpc, final DeployDestination dest, final ReservationContext context)
focal_class.class_method_signature: VpcVirtualRouterElement.shutdownVpc(final Vpc vpc, final ReservationContext context)
focal_class.full_signature: @Override public boolean shutdownVpc(final Vpc vpc, final ReservationContext context)
focal_class.identifier: shutdownVpc
focal_class.modifiers: @Override public
focal_class.parameters: (final Vpc vpc, final ReservationContext context)
focal_class.return: boolean
focal_class.signature: boolean shutdownVpc(final Vpc vpc, final ReservationContext context)
focal_class.class_method_signature: VpcVirtualRouterElement.implement(final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context)
focal_class.full_signature: @Override public boolean implement(final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context)
focal_class.identifier: implement
focal_class.modifiers: @Override public
focal_class.parameters: (final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context)
focal_class.return: boolean
focal_class.signature: boolean implement(final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context)
focal_class.class_method_signature: VpcVirtualRouterElement.configureGuestNetwork(final Network network, final List<DomainRouterVO> routers )
focal_class.full_signature: protected void configureGuestNetwork(final Network network, final List<DomainRouterVO> routers )
focal_class.identifier: configureGuestNetwork
focal_class.modifiers: protected
focal_class.parameters: (final Network network, final List<DomainRouterVO> routers )
focal_class.return: void
focal_class.signature: void configureGuestNetwork(final Network network, final List<DomainRouterVO> routers )
focal_class.class_method_signature: VpcVirtualRouterElement.prepare(final Network network, final NicProfile nic, final VirtualMachineProfile vm, final DeployDestination dest, final ReservationContext context)
focal_class.full_signature: @Override public boolean prepare(final Network network, final NicProfile nic, final VirtualMachineProfile vm, final DeployDestination dest, final ReservationContext context)
focal_class.identifier: prepare
focal_class.modifiers: @Override public
focal_class.parameters: (final Network network, final NicProfile nic, final VirtualMachineProfile vm, final DeployDestination dest, final ReservationContext context)
focal_class.return: boolean
focal_class.signature: boolean prepare(final Network network, final NicProfile nic, final VirtualMachineProfile vm, final DeployDestination dest, final ReservationContext context)
focal_class.class_method_signature: VpcVirtualRouterElement.shutdown(final Network network, final ReservationContext context, final boolean cleanup)
focal_class.full_signature: @Override public boolean shutdown(final Network network, final ReservationContext context, final boolean cleanup)
focal_class.identifier: shutdown
focal_class.modifiers: @Override public
focal_class.parameters: (final Network network, final ReservationContext context, final boolean cleanup)
focal_class.return: boolean
focal_class.signature: boolean shutdown(final Network network, final ReservationContext context, final boolean cleanup)
focal_class.class_method_signature: VpcVirtualRouterElement.destroy(final Network config, final ReservationContext context)
focal_class.full_signature: @Override public boolean destroy(final Network config, final ReservationContext context)
focal_class.identifier: destroy
focal_class.modifiers: @Override public
focal_class.parameters: (final Network config, final ReservationContext context)
focal_class.return: boolean
focal_class.signature: boolean destroy(final Network config, final ReservationContext context)
focal_class.class_method_signature: VpcVirtualRouterElement.getProvider()
focal_class.full_signature: @Override public Provider getProvider()
focal_class.identifier: getProvider
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Provider
focal_class.signature: Provider getProvider()
focal_class.class_method_signature: VpcVirtualRouterElement.getRouters(final Network network, final DeployDestination dest)
focal_class.full_signature: @Override protected List<DomainRouterVO> getRouters(final Network network, final DeployDestination dest)
focal_class.identifier: getRouters
focal_class.modifiers: @Override protected
focal_class.parameters: (final Network network, final DeployDestination dest)
focal_class.return: List<DomainRouterVO>
focal_class.signature: List<DomainRouterVO> getRouters(final Network network, final DeployDestination dest)
focal_class.class_method_signature: VpcVirtualRouterElement.setCapabilities()
focal_class.full_signature: private static Map<Service, Map<Capability, String>> setCapabilities()
focal_class.identifier: setCapabilities
focal_class.modifiers: private static
focal_class.parameters: ()
focal_class.return: Map<Service, Map<Capability, String>>
focal_class.signature: Map<Service, Map<Capability, String>> setCapabilities()
focal_class.class_method_signature: VpcVirtualRouterElement.getCapabilities()
focal_class.full_signature: @Override public Map<Service, Map<Capability, String>> getCapabilities()
focal_class.identifier: getCapabilities
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Map<Service, Map<Capability, String>>
focal_class.signature: Map<Service, Map<Capability, String>> getCapabilities()
focal_class.class_method_signature: VpcVirtualRouterElement.createPrivateGateway(final PrivateGateway gateway)
focal_class.full_signature: @Override public boolean createPrivateGateway(final PrivateGateway gateway)
focal_class.identifier: createPrivateGateway
focal_class.modifiers: @Override public
focal_class.parameters: (final PrivateGateway gateway)
focal_class.return: boolean
focal_class.signature: boolean createPrivateGateway(final PrivateGateway gateway)
focal_class.class_method_signature: VpcVirtualRouterElement.deletePrivateGateway(final PrivateGateway gateway)
focal_class.full_signature: @Override public boolean deletePrivateGateway(final PrivateGateway gateway)
focal_class.identifier: deletePrivateGateway
focal_class.modifiers: @Override public
focal_class.parameters: (final PrivateGateway gateway)
focal_class.return: boolean
focal_class.signature: boolean deletePrivateGateway(final PrivateGateway gateway)
focal_class.class_method_signature: VpcVirtualRouterElement.applyIps(final Network network, final List<? extends PublicIpAddress> ipAddress, final Set<Service> services)
focal_class.full_signature: @Override public boolean applyIps(final Network network, final List<? extends PublicIpAddress> ipAddress, final Set<Service> services)
focal_class.identifier: applyIps
focal_class.modifiers: @Override public
focal_class.parameters: (final Network network, final List<? extends PublicIpAddress> ipAddress, final Set<Service> services)
focal_class.return: boolean
focal_class.signature: boolean applyIps(final Network network, final List<? extends PublicIpAddress> ipAddress, final Set<Service> services)
focal_class.class_method_signature: VpcVirtualRouterElement.applyNetworkACLs(final Network network, final List<? extends NetworkACLItem> rules)
focal_class.full_signature: @Override public boolean applyNetworkACLs(final Network network, final List<? extends NetworkACLItem> rules)
focal_class.identifier: applyNetworkACLs
focal_class.modifiers: @Override public
focal_class.parameters: (final Network network, final List<? extends NetworkACLItem> rules)
focal_class.return: boolean
focal_class.signature: boolean applyNetworkACLs(final Network network, final List<? extends NetworkACLItem> rules)
focal_class.class_method_signature: VpcVirtualRouterElement.getVirtualRouterProvider()
focal_class.full_signature: @Override protected Type getVirtualRouterProvider()
focal_class.identifier: getVirtualRouterProvider
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: Type
focal_class.signature: Type getVirtualRouterProvider()
focal_class.class_method_signature: VpcVirtualRouterElement.applyStaticRoutes(final Vpc vpc, final List<StaticRouteProfile> routes)
focal_class.full_signature: @Override public boolean applyStaticRoutes(final Vpc vpc, final List<StaticRouteProfile> routes)
focal_class.identifier: applyStaticRoutes
focal_class.modifiers: @Override public
focal_class.parameters: (final Vpc vpc, final List<StaticRouteProfile> routes)
focal_class.return: boolean
focal_class.signature: boolean applyStaticRoutes(final Vpc vpc, final List<StaticRouteProfile> routes)
focal_class.class_method_signature: VpcVirtualRouterElement.applyACLItemsToPrivateGw(final PrivateGateway gateway, final List<? extends NetworkACLItem> rules)
focal_class.full_signature: @Override public boolean applyACLItemsToPrivateGw(final PrivateGateway gateway, final List<? extends NetworkACLItem> rules)
focal_class.identifier: applyACLItemsToPrivateGw
focal_class.modifiers: @Override public
focal_class.parameters: (final PrivateGateway gateway, final List<? extends NetworkACLItem> rules)
focal_class.return: boolean
focal_class.signature: boolean applyACLItemsToPrivateGw(final PrivateGateway gateway, final List<? extends NetworkACLItem> rules)
focal_class.class_method_signature: VpcVirtualRouterElement.startSite2SiteVpn(final Site2SiteVpnConnection conn)
focal_class.full_signature: @Override public boolean startSite2SiteVpn(final Site2SiteVpnConnection conn)
focal_class.identifier: startSite2SiteVpn
focal_class.modifiers: @Override public
focal_class.parameters: (final Site2SiteVpnConnection conn)
focal_class.return: boolean
focal_class.signature: boolean startSite2SiteVpn(final Site2SiteVpnConnection conn)
focal_class.class_method_signature: VpcVirtualRouterElement.stopSite2SiteVpn(final Site2SiteVpnConnection conn)
focal_class.full_signature: @Override public boolean stopSite2SiteVpn(final Site2SiteVpnConnection conn)
focal_class.identifier: stopSite2SiteVpn
focal_class.modifiers: @Override public
focal_class.parameters: (final Site2SiteVpnConnection conn)
focal_class.return: boolean
focal_class.signature: boolean stopSite2SiteVpn(final Site2SiteVpnConnection conn)
focal_class.class_method_signature: VpcVirtualRouterElement.applyVpnUsers(final RemoteAccessVpn vpn, final List<? extends VpnUser> users)
focal_class.full_signature: @Override public String[] applyVpnUsers(final RemoteAccessVpn vpn, final List<? extends VpnUser> users)
focal_class.identifier: applyVpnUsers
focal_class.modifiers: @Override public
focal_class.parameters: (final RemoteAccessVpn vpn, final List<? extends VpnUser> users)
focal_class.return: String[]
focal_class.signature: String[] applyVpnUsers(final RemoteAccessVpn vpn, final List<? extends VpnUser> users)
focal_class.class_method_signature: VpcVirtualRouterElement.startVpn(final RemoteAccessVpn vpn)
focal_class.full_signature: @Override public boolean startVpn(final RemoteAccessVpn vpn)
focal_class.identifier: startVpn
focal_class.modifiers: @Override public
focal_class.parameters: (final RemoteAccessVpn vpn)
focal_class.return: boolean
focal_class.signature: boolean startVpn(final RemoteAccessVpn vpn)
focal_class.class_method_signature: VpcVirtualRouterElement.stopVpn(final RemoteAccessVpn vpn)
focal_class.full_signature: @Override public boolean stopVpn(final RemoteAccessVpn vpn)
focal_class.identifier: stopVpn
focal_class.modifiers: @Override public
focal_class.parameters: (final RemoteAccessVpn vpn)
focal_class.return: boolean
focal_class.signature: boolean stopVpn(final RemoteAccessVpn vpn)
focal_class.superclass: extends VirtualRouterElement
focal_method.body: @Override
      public String[] applyVpnUsers(final RemoteAccessVpn vpn, final List<? extends VpnUser> users) throws ResourceUnavailableException {
          final Long vpcId = vpn.getVpcId();
          if (vpcId == null) {
              return null;
          }
  
          final List<DomainRouterVO> routers = _vpcRouterMgr.getVpcRouters(vpcId);
          if (routers == null) {
              s_logger.debug("Cannot apply vpn users on the backend; virtual router doesn't exist in the network " + vpcId);
              return null;
          }
  
          final Vpc vpc = _entityMgr.findById(Vpc.class, vpcId);
          final DataCenterVO dcVO = _dcDao.findById(vpc.getZoneId());
          final NetworkTopology networkTopology = networkTopologyContext.retrieveNetworkTopology(dcVO);
  
          String[] result = null;
          final List<String> combinedResults = new ArrayList<String>();
          for (final DomainRouterVO domainRouterVO : routers) {
              result = networkTopology.applyVpnUsers(vpn, users, domainRouterVO);
              combinedResults.addAll(Arrays.asList(result));
          }
          result = new String[combinedResults.size()];
          final Object [] resultCast = combinedResults.toArray();
          System.arraycopy(resultCast, 0, result, 0, resultCast.length);
  
          return result;
      }
focal_method.class_method_signature: VpcVirtualRouterElement.applyVpnUsers(final RemoteAccessVpn vpn, final List<? extends VpnUser> users)
focal_method.full_signature: @Override public String[] applyVpnUsers(final RemoteAccessVpn vpn, final List<? extends VpnUser> users)
focal_method.identifier: applyVpnUsers
focal_method.invocations: getVpcId getVpcRouters debug findById findById getZoneId retrieveNetworkTopology applyVpnUsers addAll asList size toArray arraycopy
focal_method.modifiers: @Override public
focal_method.parameters: (final RemoteAccessVpn vpn, final List<? extends VpnUser> users)
focal_method.return: String[]
focal_method.signature: String[] applyVpnUsers(final RemoteAccessVpn vpn, final List<? extends VpnUser> users)