Tabnine Logo
ExternalNetworkDeviceManager$NetworkDevice
Code IndexAdd Tabnine to your IDE (free)

How to use
ExternalNetworkDeviceManager$NetworkDevice
in
org.apache.cloudstack.network

Best Java code snippets using org.apache.cloudstack.network.ExternalNetworkDeviceManager$NetworkDevice (Showing top 20 results out of 315)

origin: apache/cloudstack

ServerResource odlController = new OpenDaylightControllerResource();
final String deviceName = NetworkDevice.OpenDaylightController.getName();
NetworkDevice networkDevice = NetworkDevice.getNetworkDevice(deviceName);
if (networkDevice == null) {
  throw new CloudRuntimeException("No network device found for name " + deviceName);
    networkDevice.getNetworkServiceProvder());
if (ntwkSvcProvider == null) {
  throw new CloudRuntimeException("Network Service Provider: " + networkDevice.getNetworkServiceProvder() + " is not enabled in the physical network: "
      + physicalNetworkId + "to add this device");
} else if (ntwkSvcProvider.getState() == PhysicalNetworkServiceProvider.State.Shutdown) {
origin: apache/cloudstack

final NuageVspResource resource = new NuageVspResource();
final String deviceName = Network.Provider.NuageVsp.getName();
ExternalNetworkDeviceManager.NetworkDevice networkDevice = ExternalNetworkDeviceManager.NetworkDevice.getNetworkDevice(deviceName);
final Long physicalNetworkId = cmd.getPhysicalNetworkId();
PhysicalNetworkVO physicalNetwork = _physicalNetworkDao.findById(physicalNetworkId);
    networkDevice.getNetworkServiceProvder());
if (ntwkSvcProvider == null) {
  throw new CloudRuntimeException("Network Service Provider: " + networkDevice.getNetworkServiceProvder() + " is not enabled in the physical network: "
      + physicalNetworkId + "to add this device");
} else if (ntwkSvcProvider.getState() == PhysicalNetworkServiceProvider.State.Shutdown) {
origin: apache/cloudstack

NuageVspResource resource = new NuageVspResource();
final String deviceName = Network.Provider.NuageVsp.getName();
ExternalNetworkDeviceManager.NetworkDevice networkDevice = ExternalNetworkDeviceManager.NetworkDevice.getNetworkDevice(deviceName);
final Long physicalNetworkId = command.getPhysicalNetworkId();
PhysicalNetworkVO physicalNetwork = _physicalNetworkDao.findById(physicalNetworkId);
    networkDevice.getNetworkServiceProvder());
if (ntwkSvcProvider == null) {
  throw new CloudRuntimeException("Network Service Provider: " + networkDevice.getNetworkServiceProvder() + " is not enabled in the physical network: "
      + physicalNetworkId + "to add this device");
origin: apache/cloudstack

final NetworkDevice ntwkDevice = NetworkDevice.getNetworkDevice(deviceName);
long zoneId;
  _physicalNetworkServiceProviderDao.findByServiceProvider(pNetwork.getId(), ntwkDevice.getNetworkServiceProvder());
ntwkSvcProvider = _physicalNetworkServiceProviderDao.findByServiceProvider(pNetwork.getId(), ntwkDevice.getNetworkServiceProvder());
if (ntwkSvcProvider == null) {
  throw new CloudRuntimeException("Network Service Provider: " + ntwkDevice.getNetworkServiceProvder() + " is not enabled in the physical network: " +
    physicalNetworkId + "to add this device");
} else if (ntwkSvcProvider.getState() == PhysicalNetworkServiceProvider.State.Shutdown) {
    _externalLoadBalancerDeviceDao.findGslbServiceProvider(physicalNetworkId, ntwkDevice.getNetworkServiceProvder());
  if (zoneGslbProvider != null) {
    throw new CloudRuntimeException("There is a GSLB service provider configured in the zone alredy.");
origin: apache/cloudstack

NetworkDevice networkDevice = NetworkDevice.getNetworkDevice(deviceName);
final Long physicalNetworkId = cmd.getPhysicalNetworkId();
final String hostname = cmd.getHost();
  _physicalNetworkServiceProviderDao.findByServiceProvider(physicalNetwork.getId(), networkDevice.getNetworkServiceProvder());
if (ntwkSvcProvider == null) {
  throw new CloudRuntimeException("Network Service Provider: " + networkDevice.getNetworkServiceProvder() + " is not enabled in the physical network: " +
    physicalNetworkId + "to add this device");
} else if (ntwkSvcProvider.getState() == PhysicalNetworkServiceProvider.State.Shutdown) {
origin: apache/cloudstack

  if (NetworkDevice.NetscalerSDXLoadBalancer.getName().equalsIgnoreCase(deviceName)
      || NetworkDevice.NetscalerMPXLoadBalancer.getName().equalsIgnoreCase(deviceName)) {
    if (dedicatedUse != null && dedicatedUse == true) {
      throw new InvalidParameterValueException(
if (!NetworkDevice.NetscalerSDXLoadBalancer.getName().equalsIgnoreCase(deviceName)) {
  if (capacity != null) {
    lbDeviceVo.setCapacity(capacity);
origin: apache/cloudstack

String guid;
PhysicalNetworkVO pNetwork = null;
NetworkDevice ntwkDevice = NetworkDevice.getNetworkDevice(deviceName);
long zoneId;
  _physicalNetworkServiceProviderDao.findByServiceProvider(pNetwork.getId(), ntwkDevice.getNetworkServiceProvder());
if (ntwkSvcProvider == null) {
  throw new CloudRuntimeException("Network Service Provider: " + ntwkDevice.getNetworkServiceProvder() + " is not enabled in the physical network: " +
    physicalNetworkId + "to add this device");
} else if (ntwkSvcProvider.getState() == PhysicalNetworkServiceProvider.State.Shutdown) {
origin: apache/cloudstack

ServerResource resource = new NiciraNvpResource();
final String deviceName = Network.Provider.NiciraNvp.getName();
NetworkDevice networkDevice = NetworkDevice.getNetworkDevice(deviceName);
if (networkDevice == null) {
  throw new CloudRuntimeException("No network device found for " + deviceName);
    physicalNetworkServiceProviderDao.findByServiceProvider(physicalNetwork.getId(), networkDevice.getNetworkServiceProvder());
if (ntwkSvcProvider == null) {
  throw new CloudRuntimeException("Network Service Provider: " + networkDevice.getNetworkServiceProvder() + " is not enabled in the physical network: " +
      physicalNetworkId + "to add this device");
} else if (ntwkSvcProvider.getState() == PhysicalNetworkServiceProvider.State.Shutdown) {
origin: apache/cloudstack

ServerResource resource = new BrocadeVcsResource();
final String deviceName = Network.Provider.BrocadeVcs.getName();
NetworkDevice networkDevice = NetworkDevice.getNetworkDevice(deviceName);
if (networkDevice == null) {
  throw new CloudRuntimeException("No network device found for " + deviceName);
    networkDevice.getNetworkServiceProvder());
if (ntwkSvcProvider == null) {
  throw new CloudRuntimeException("Network Service Provider: " + networkDevice.getNetworkServiceProvder() + " is not enabled in the physical network: "
      + physicalNetworkId + "to add this device");
} else if (ntwkSvcProvider.getState() == PhysicalNetworkServiceProvider.State.Shutdown) {
origin: apache/cloudstack

? Boolean.parseBoolean(configParams.get(ApiConstants.LOAD_BALANCER_DEVICE_DEDICATED)) : false;
if (dedicatedUse && !deviceName.equals(NetworkDevice.NetscalerVPXLoadBalancer.getName())) {
  String msg = "Only Netscaler VPX load balancers can be specified for dedicated use";
  s_logger.debug(msg);
  if (!deviceName.equals(NetworkDevice.NetscalerVPXLoadBalancer.getName())
      && !deviceName.equals(NetworkDevice.NetscalerMPXLoadBalancer.getName())) {
    String msg = "Only Netscaler VPX or MPX load balancers can be specified as GSLB service provider";
    s_logger.debug(msg);
origin: apache/cloudstack

Collection paramsCollection = paramList.values();
HashMap params = (HashMap)(paramsCollection.toArray())[0];
if (NetworkDevice.ExternalDhcp.getName().equalsIgnoreCase(cmd.getDeviceType())) {
  Long zoneId = Long.parseLong((String)params.get(ApiConstants.ZONE_ID));
  Long podId = Long.parseLong((String)params.get(ApiConstants.POD_ID));
  res = listNetworkDevice(zoneId, null, podId, Host.Type.ExternalDhcp);
} else if (NetworkDevice.PxeServer.getName().equalsIgnoreCase(cmd.getDeviceType())) {
  Long zoneId = Long.parseLong((String)params.get(ApiConstants.ZONE_ID));
  Long podId = Long.parseLong((String)params.get(ApiConstants.POD_ID));
origin: apache/cloudstack

@Override
public List<ExternalFirewallDeviceVO> listPaloAltoFirewalls(ListPaloAltoFirewallsCmd cmd) {
  Long physcialNetworkId = cmd.getPhysicalNetworkId();
  Long fwDeviceId = cmd.getFirewallDeviceId();
  PhysicalNetworkVO pNetwork = null;
  List<ExternalFirewallDeviceVO> fwDevices = new ArrayList<ExternalFirewallDeviceVO>();
  if (physcialNetworkId == null && fwDeviceId == null) {
    throw new InvalidParameterValueException("Either physical network Id or load balancer device Id must be specified");
  }
  if (fwDeviceId != null) {
    ExternalFirewallDeviceVO fwDeviceVo = _fwDevicesDao.findById(fwDeviceId);
    if (fwDeviceVo == null || !fwDeviceVo.getDeviceName().equalsIgnoreCase(NetworkDevice.PaloAltoFirewall.getName())) {
      throw new InvalidParameterValueException("Could not find Palo Alto firewall device with ID: " + fwDeviceId);
    }
    fwDevices.add(fwDeviceVo);
  }
  if (physcialNetworkId != null) {
    pNetwork = _physicalNetworkDao.findById(physcialNetworkId);
    if (pNetwork == null) {
      throw new InvalidParameterValueException("Could not find phyical network with ID: " + physcialNetworkId);
    }
    fwDevices = _fwDevicesDao.listByPhysicalNetworkAndProvider(physcialNetworkId, Provider.PaloAlto.getName());
  }
  return fwDevices;
}
origin: apache/cloudstack

@Override
public List<Host> listExternalLoadBalancers(long physicalNetworkId, String deviceName) {
  List<Host> lbHosts = new ArrayList<Host>();
  NetworkDevice lbNetworkDevice = NetworkDevice.getNetworkDevice(deviceName);
  PhysicalNetworkVO pNetwork = null;
  pNetwork = _physicalNetworkDao.findById(physicalNetworkId);
  if ((pNetwork == null) || (lbNetworkDevice == null)) {
    throw new InvalidParameterValueException("Atleast one of the required parameter physical networkId, device name is invalid.");
  }
  PhysicalNetworkServiceProviderVO ntwkSvcProvider =
    _physicalNetworkServiceProviderDao.findByServiceProvider(pNetwork.getId(), lbNetworkDevice.getNetworkServiceProvder());
  // if provider not configured in to physical network, then there can be no instances
  if (ntwkSvcProvider == null) {
    return null;
  }
  List<ExternalLoadBalancerDeviceVO> lbDevices =
    _externalLoadBalancerDeviceDao.listByPhysicalNetworkAndProvider(physicalNetworkId, ntwkSvcProvider.getProviderName());
  for (ExternalLoadBalancerDeviceVO provderInstance : lbDevices) {
    lbHosts.add(_hostDao.findById(provderInstance.getHostId()));
  }
  return lbHosts;
}
origin: apache/cloudstack

@Override
public ExternalFirewallDeviceVO configurePaloAltoFirewall(ConfigurePaloAltoFirewallCmd cmd) {
  Long fwDeviceId = cmd.getFirewallDeviceId();
  Long deviceCapacity = cmd.getFirewallCapacity();
  ExternalFirewallDeviceVO fwDeviceVO = _fwDevicesDao.findById(fwDeviceId);
  if (fwDeviceVO == null || !fwDeviceVO.getDeviceName().equalsIgnoreCase(NetworkDevice.PaloAltoFirewall.getName())) {
    throw new InvalidParameterValueException("No Palo Alto firewall device found with ID: " + fwDeviceId);
  }
  if (deviceCapacity != null) {
    // check if any networks are using this Palo Alto device
    List<NetworkExternalFirewallVO> networks = _networkFirewallDao.listByFirewallDeviceId(fwDeviceId);
    if ((networks != null) && !networks.isEmpty()) {
      if (deviceCapacity < networks.size()) {
        throw new CloudRuntimeException("There are more number of networks already using this Palo Alto firewall device than configured capacity");
      }
    }
    if (deviceCapacity != null) {
      fwDeviceVO.setCapacity(deviceCapacity);
    }
  }
  fwDeviceVO.setDeviceState(FirewallDeviceState.Enabled);
  _fwDevicesDao.update(fwDeviceId, fwDeviceVO);
  return fwDeviceVO;
}
origin: apache/cloudstack

@Override
public List<Host> listExternalFirewalls(long physicalNetworkId, String deviceName) {
  List<Host> firewallHosts = new ArrayList<Host>();
  NetworkDevice fwNetworkDevice = NetworkDevice.getNetworkDevice(deviceName);
  PhysicalNetworkVO pNetwork = null;
  pNetwork = _physicalNetworkDao.findById(physicalNetworkId);
  if (pNetwork == null) {
    throw new InvalidParameterValueException("Could not find phyical network with ID: " + physicalNetworkId);
  }
  if ((pNetwork == null) || (fwNetworkDevice == null)) {
    throw new InvalidParameterValueException("Atleast one of ther required parameter physical networkId, device name is missing or invalid.");
  }
  PhysicalNetworkServiceProviderVO ntwkSvcProvider =
    _physicalNetworkServiceProviderDao.findByServiceProvider(pNetwork.getId(), fwNetworkDevice.getNetworkServiceProvder());
  if (ntwkSvcProvider == null) {
    return null;
  }
  List<ExternalFirewallDeviceVO> fwDevices = _externalFirewallDeviceDao.listByPhysicalNetworkAndProvider(physicalNetworkId, ntwkSvcProvider.getProviderName());
  for (ExternalFirewallDeviceVO fwDevice : fwDevices) {
    firewallHosts.add(_hostDao.findById(fwDevice.getHostId()));
  }
  return firewallHosts;
}
origin: apache/cloudstack

public ExternalLoadBalancerDeviceVO(long hostId, long physicalNetworkId, String providerName, String deviceName, long capacity, boolean dedicated,
    boolean gslbProvider) {
  this.physicalNetworkId = physicalNetworkId;
  this.providerName = providerName;
  this.deviceName = deviceName;
  this.hostId = hostId;
  this.state = LBDeviceState.Disabled;
  this.allocationState = LBDeviceAllocationState.Free;
  this.capacity = capacity;
  this.isDedicatedDevice = dedicated;
  this.isManagedDevice = false;
  this.state = LBDeviceState.Enabled;
  this.uuid = UUID.randomUUID().toString();
  this.gslbProvider = gslbProvider;
  this.gslbSitePublicIP = null;
  this.gslbSitePrivateIP = null;
  if (deviceName.equalsIgnoreCase(ExternalNetworkDeviceManager.NetworkDevice.NetscalerSDXLoadBalancer.getName())) {
    this.allocationState = LBDeviceAllocationState.Provider;
  }
}
origin: apache/cloudstack

  @Override
  public ExternalLoadBalancerDeviceVO doInTransaction(TransactionStatus status) {
    ExternalLoadBalancerDeviceVO lbDeviceVO =
      new ExternalLoadBalancerDeviceVO(host.getId(), pNetworkFinal.getId(), ntwkDevice.getNetworkServiceProvder(), deviceName, capacityFinal,
        dedicatedUse, gslbProvider);
    if (gslbProvider) {
      lbDeviceVO.setGslbSitePublicIP(gslbSitePublicIp);
      lbDeviceVO.setGslbSitePrivateIP(gslbSitePrivateIp);
      lbDeviceVO.setExclusiveGslbProvider(exclusiveGslbProivider);
    }
    _externalLoadBalancerDeviceDao.persist(lbDeviceVO);
    DetailVO hostDetail = new DetailVO(host.getId(), ApiConstants.LOAD_BALANCER_DEVICE_ID, String.valueOf(lbDeviceVO.getId()));
    _hostDetailDao.persist(hostDetail);
    return lbDeviceVO;
  }
});
origin: apache/cloudstack

@Override
public List<? extends Network> listNetworks(ListPaloAltoFirewallNetworksCmd cmd) {
  Long fwDeviceId = cmd.getFirewallDeviceId();
  List<NetworkVO> networks = new ArrayList<NetworkVO>();
  ExternalFirewallDeviceVO fwDeviceVo = _fwDevicesDao.findById(fwDeviceId);
  if (fwDeviceVo == null || !fwDeviceVo.getDeviceName().equalsIgnoreCase(NetworkDevice.PaloAltoFirewall.getName())) {
    throw new InvalidParameterValueException("Could not find Palo Alto firewall device with ID " + fwDeviceId);
  }
  List<NetworkExternalFirewallVO> networkFirewallMaps = _networkFirewallDao.listByFirewallDeviceId(fwDeviceId);
  if (networkFirewallMaps != null && !networkFirewallMaps.isEmpty()) {
    for (NetworkExternalFirewallVO networkFirewallMap : networkFirewallMaps) {
      NetworkVO network = _networkDao.findById(networkFirewallMap.getNetworkId());
      networks.add(network);
    }
  }
  return networks;
}
origin: apache/cloudstack

@Override
public boolean deletePaloAltoFirewall(DeletePaloAltoFirewallCmd cmd) {
  Long fwDeviceId = cmd.getFirewallDeviceId();
  ExternalFirewallDeviceVO fwDeviceVO = _fwDevicesDao.findById(fwDeviceId);
  if (fwDeviceVO == null || !fwDeviceVO.getDeviceName().equalsIgnoreCase(NetworkDevice.PaloAltoFirewall.getName())) {
    throw new InvalidParameterValueException("No Palo Alto firewall device found with ID: " + fwDeviceId);
  }
  return deleteExternalFirewall(fwDeviceVO.getHostId());
}
origin: apache/cloudstack

  public static NetworkDevice getNetworkDevice(String devicerName) {
    for (NetworkDevice device : supportedNetworkDevices) {
      if (device.getName().equalsIgnoreCase(devicerName)) {
        return device;
      }
    }
    return null;
  }
}
org.apache.cloudstack.networkExternalNetworkDeviceManager$NetworkDevice

Most used methods

  • getName
  • getNetworkDevice
  • getNetworkServiceProvder

Popular in Java

  • Start an intent from android
  • runOnUiThread (Activity)
  • getResourceAsStream (ClassLoader)
  • getSupportFragmentManager (FragmentActivity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now