Package com.cloud.network

Examples of com.cloud.network.Network$Provider


        // Send commands to elbVm
        return sendCommandsToRouter(elbVm, cmds);
    }
   
    protected DomainRouterVO findElbVmForLb(LoadBalancingRule lb) {//TODO: use a table to lookup
        Network ntwk = _networkModel.getNetwork(lb.getNetworkId());
        long sourceIpId = _networkModel.getPublicIpAddress(lb.getSourceIp().addr(), ntwk.getDataCenterId()).getId();
        ElasticLbVmMapVO map = _elbVmMapDao.findOneByIp(sourceIpId);
        if (map == null) {
            return null;
        }
        DomainRouterVO elbVm = _routerDao.findById(map.getElbVmId());
View Full Code Here


        return lbs == null || lbs.size()==0 ? null: lbs;
    }
   
    @DB
    public PublicIp allocDirectIp(Account account, long guestNetworkId) throws InsufficientAddressCapacityException {
        Network frontEndNetwork = _networkModel.getNetwork(guestNetworkId);
        Transaction txn = Transaction.currentTxn();
        txn.start();
       
        PublicIp ip = _networkMgr.assignPublicIpAddress(frontEndNetwork.getDataCenterId(), null, account, VlanType.DirectAttached, frontEndNetwork.getId(), null, true);
        IPAddressVO ipvo = _ipAddressDao.findById(ip.getId());
        ipvo.setAssociatedWithNetworkId(frontEndNetwork.getId());
        _ipAddressDao.update(ipvo.getId(), ipvo);
        txn.commit();
        s_logger.info("Acquired frontend IP for ELB " + ip);

        return ip;
View Full Code Here

            } else {
                s_logger.warn("ELB: Found existing load balancers matching requested new LB");
                throw new NetworkRuleConflictException("ELB: Found existing load balancers matching requested new LB");
            }

            Network network = _networkModel.getNetwork(networkId);
            IPAddressVO ipAddr = _ipAddressDao.findById(ipId);
           
            LoadBalancer result = null;
            try {
                lb.setSourceIpAddressId(ipId);
View Full Code Here

    when(offering.getGuestType()).thenReturn(GuestType.Isolated);
   
    when(nosd.areServicesSupportedByNetworkOffering(42L, Service.Connectivity)).thenReturn(true);
   
    DeploymentPlan plan = mock(DeploymentPlan.class);
    Network network = mock(Network.class);
    Account account = mock(Account.class);
   
    Network designednetwork = guru.design(offering, plan, network, account);
    assertTrue(designednetwork != null);
    assertTrue(designednetwork.getBroadcastDomainType() == BroadcastDomainType.Lswitch);   
  }
View Full Code Here

    when(offering.getId()).thenReturn(42L);
    when(offering.getTrafficType()).thenReturn(TrafficType.Guest);
    when(offering.getGuestType()).thenReturn(GuestType.Isolated);
   
    DeploymentPlan plan = mock(DeploymentPlan.class);
    Network network = mock(Network.class);
    Account account = mock(Account.class);
   
    Network designednetwork = guru.design(offering, plan, network, account);
    assertTrue(designednetwork == null)
  }
View Full Code Here

    when(offering.getId()).thenReturn(42L);
    when(offering.getTrafficType()).thenReturn(TrafficType.Guest);
    when(offering.getGuestType()).thenReturn(GuestType.Isolated);
   
    DeploymentPlan plan = mock(DeploymentPlan.class);
    Network network = mock(Network.class);
    Account account = mock(Account.class);
   
    Network designednetwork = guru.design(offering, plan, network, account);
    assertTrue(designednetwork == null);     
  }
View Full Code Here

    when(offering.getGuestType()).thenReturn(GuestType.Isolated);
   
    when(nosd.areServicesSupportedByNetworkOffering(42L, Service.Connectivity)).thenReturn(false);
   
    DeploymentPlan plan = mock(DeploymentPlan.class);
    Network network = mock(Network.class);
    Account account = mock(Account.class);
   
    Network designednetwork = guru.design(offering, plan, network, account);
    assertTrue(designednetwork == null);   
  }
View Full Code Here

    CreateLogicalSwitchAnswer answer = mock(CreateLogicalSwitchAnswer.class);
    when(answer.getResult()).thenReturn(true);
    when(answer.getLogicalSwitchUuid()).thenReturn("aaaaa");
     when(agentmgr.easySend(eq(42L), (Command)any())).thenReturn(answer);   

     Network implementednetwork = guru.implement(network, offering, dest, res);
    assertTrue(implementednetwork != null);   
    verify(agentmgr, times(1)).easySend(eq(42L), (Command)any());
  }
View Full Code Here

                else if (listener instanceof JmsListener) {
                    final Bus bus = model.getBus(listener.getBusidref()) ;
                    if (!(bus instanceof JmsBus))
                        continue ;
                   
                    final Provider provider = model.getProvider(bus) ;
                    if (provider instanceof JmsJcaProvider) {
                        // Jms JCA provider defaults to true
                        final JmsJcaProvider jmsJcaProvider = (JmsJcaProvider)provider ;
                        if (!jmsJcaProvider.isSetTransacted() || jmsJcaProvider.getTransacted())
                            return true ;
                    } else if (provider instanceof JmsProviderType) {
                        JmsMessageFilter filter = ((JmsListener)listener).getJmsMessageFilter() ;
                        if (filter == null)
                            filter = ((JmsBus)bus).getJmsMessageFilter() ;
                        if ((filter != null) && filter.getTransacted())
                            return true ;
                    }
                } else if (listener instanceof SqlListener) {
                    final Bus bus = model.getBus(listener.getBusidref()) ;
                    if (!(bus instanceof SqlBus))
                        continue ;
                   
                    final Provider provider = model.getProvider(bus) ;
                    if ((provider instanceof SqlProvider) && ((SqlProvider)provider).getTransacted())
                        return true ;
                }
            }
        }
View Full Code Here

    }
    Bus bus = model.getBus(listener.getBusidref());
    if(bus.getClass() != BusImpl.class) {
      throw new ConfigurationException("The base Listener config [" + listener.getName() + "] must reference a base Bus config type (<bus>).");
    }
    Provider provider = model.getProvider(bus);
    if(provider.getClass().isAssignableFrom(BusProviderImpl.class)) {
      throw new ConfigurationException("A base Bus config type (<bus>) must be contained within a base Provider type (<bus-provider>).");
    }
  }
View Full Code Here

TOP

Related Classes of com.cloud.network.Network$Provider

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.