Package com.cloud.vm

Examples of com.cloud.vm.ReservationContext


    when(netmodel.findPhysicalNetworkId(anyLong(), (String) any(), (TrafficType) any())).thenReturn(42L);
    Domain dom = mock(Domain.class);
    when(dom.getName()).thenReturn("domain");
    Account acc = mock(Account.class);
    when(acc.getAccountName()).thenReturn("accountname");
    ReservationContext res = mock(ReservationContext.class);
    when(res.getDomain()).thenReturn(dom);
    when(res.getAccount()).thenReturn(acc);
   
    CreateLogicalSwitchAnswer answer = mock(CreateLogicalSwitchAnswer.class);
    when(answer.getResult()).thenReturn(true);
    when(answer.getLogicalSwitchUuid()).thenReturn("aaaaa");
     when(agentmgr.easySend(eq(42L), (Command)any())).thenReturn(answer);   
View Full Code Here


    when(netmodel.findPhysicalNetworkId(anyLong(), (String) any(), (TrafficType) any())).thenReturn(42L);
    Domain dom = mock(Domain.class);
    when(dom.getName()).thenReturn("domain");
    Account acc = mock(Account.class);
    when(acc.getAccountName()).thenReturn("accountname");
    ReservationContext res = mock(ReservationContext.class);
    when(res.getDomain()).thenReturn(dom);
    when(res.getAccount()).thenReturn(acc);
   
    CreateLogicalSwitchAnswer answer = mock(CreateLogicalSwitchAnswer.class);
    when(answer.getResult()).thenReturn(true);
    when(answer.getLogicalSwitchUuid()).thenReturn("aaaaa");
     when(agentmgr.easySend(eq(42L), (Command)any())).thenReturn(answer);   
View Full Code Here

    when(netmodel.findPhysicalNetworkId(anyLong(), (String) any(), (TrafficType) any())).thenReturn(42L);
    Domain dom = mock(Domain.class);
    when(dom.getName()).thenReturn("domain");
    Account acc = mock(Account.class);
    when(acc.getAccountName()).thenReturn("accountname");
    ReservationContext res = mock(ReservationContext.class);
    when(res.getDomain()).thenReturn(dom);
    when(res.getAccount()).thenReturn(acc);
   
    CreateLogicalSwitchAnswer answer = mock(CreateLogicalSwitchAnswer.class);
    when(answer.getResult()).thenReturn(true);
    //when(answer.getLogicalSwitchUuid()).thenReturn("aaaaa");
     when(agentmgr.easySend(eq(42L), (Command)any())).thenReturn(answer);   
View Full Code Here

    when(netmodel.findPhysicalNetworkId(anyLong(), (String) any(), (TrafficType) any())).thenReturn(42L);
    Domain dom = mock(Domain.class);
    when(dom.getName()).thenReturn("domain");
    Account acc = mock(Account.class);
    when(acc.getAccountName()).thenReturn("accountname");
    ReservationContext res = mock(ReservationContext.class);
    when(res.getDomain()).thenReturn(dom);
    when(res.getAccount()).thenReturn(acc);
   
    DeleteLogicalSwitchAnswer answer = mock(DeleteLogicalSwitchAnswer.class);
    when(answer.getResult()).thenReturn(true);
     when(agentmgr.easySend(eq(42L), (Command)any())).thenReturn(answer);   
View Full Code Here

        Domain dom = mock(Domain.class);
        when(dom.getName()).thenReturn("domain");
        Account acc = mock(Account.class);
        when(acc.getAccountName()).thenReturn("accountname");
        ReservationContext context = mock(ReservationContext.class);
        when(context.getDomain()).thenReturn(dom);
        when(context.getAccount()).thenReturn(acc);

        // assertTrue(_element.implement(network, offering, dest, context));
    }
View Full Code Here

        Domain dom = mock(Domain.class);
        when(dom.getName()).thenReturn("d1");
        Account acc = mock(Account.class);
        when(acc.getAccountName()).thenReturn("a1");
        ReservationContext context = mock(ReservationContext.class);
        when(context.getDomain()).thenReturn(dom);
        when(context.getAccount()).thenReturn(acc);

        DataCenter dc = mock(DataCenter.class);
        when(dc.getNetworkType()).thenReturn(NetworkType.Advanced);
        when(_configMgr.getZone(network.getDataCenterId())).thenReturn(dc);
View Full Code Here

        when(network.getId()).thenReturn(1L);
        when(network.getBroadcastDomainType()).thenReturn(BroadcastDomainType.Vlan);
        when(network.getDataCenterId()).thenReturn(1L);
        when(network.getBroadcastUri()).thenReturn(uri);

        ReservationContext context = mock(ReservationContext.class);

        when(_networkAsa1000vMapDao.findByNetworkId(network.getId())).thenReturn(mock(NetworkAsa1000vMapVO.class));

        List<CiscoVnmcControllerVO> devices = new ArrayList<CiscoVnmcControllerVO>();
        devices.add(mock(CiscoVnmcControllerVO.class));
View Full Code Here

        _accountMgr.checkAccess(caller, null, false, vpc);
       
        DataCenter dc = _configMgr.getZone(vpc.getZoneId());
    
        DeployDestination dest = new DeployDestination(dc, null, null, null);
        ReservationContext context = new ReservationContextImpl(null, null, callerUser,
                _accountMgr.getAccount(vpc.getAccountId()));
       
        boolean result = true;
        try {
            if (!startVpc(vpc, dest, context)) {
View Full Code Here

        s_logger.debug("Shutting down vpc " + vpc);
        //TODO - shutdown all vpc resources here (ACLs, gateways, etc)

        boolean success = true;
        List<Provider> providersToImplement = getVpcProviders(vpc.getId());
        ReservationContext context = new ReservationContextImpl(null, null, _accountMgr.getActiveUser(ctx.getCallerUserId()), caller);
        for (VpcProvider element: getVpcElements()){
            if(providersToImplement.contains(element.getProvider())){
                if (element.shutdownVpc(vpc, context)) {
                    s_logger.debug("Vpc " + vpc + " has been shutdown succesfully");
                } else {
View Full Code Here

        }
       
        if (deleteNetwork) {
            User callerUser = _accountMgr.getActiveUser(UserContext.current().getCallerUserId());
            Account owner = _accountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM);
            ReservationContext context = new ReservationContextImpl(null, null, callerUser, owner);
            _ntwkMgr.destroyNetwork(networkId, context);
            s_logger.debug("Deleted private network id=" + networkId);
        }
       
        _vpcGatewayDao.remove(gateway.getId());
View Full Code Here

TOP

Related Classes of com.cloud.vm.ReservationContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.