Tabnine Logo
IpAssocCommand.getIpAddresses
Code IndexAdd Tabnine to your IDE (free)

How to use
getIpAddresses
method
in
com.cloud.agent.api.routing.IpAssocCommand

Best Java code snippets using com.cloud.agent.api.routing.IpAssocCommand.getIpAddresses (Showing top 12 results out of 315)

origin: apache/cloudstack

public IpAssocAnswer(IpAssocCommand cmd, String[] results) {
  boolean finalResult = true;
  for (String result : results) {
    if (result.equals(errorResult)) {
      finalResult = false;
      break;
    }
  }
  this.result = finalResult;
  this.details = null;
  assert (cmd.getIpAddresses().length == results.length) : "Shouldn't the results match the commands?";
  this.results = results;
}
origin: apache/cloudstack

private synchronized Answer execute(IpAssocCommand cmd,  int numRetries) {
  String[] results = new String[cmd.getIpAddresses().length];
  int i = 0;
  IpAddressTO[] ips = cmd.getIpAddresses();
  for (IpAddressTO ip : ips) {
    results[i++] = ip.getPublicIp() + " - success";
  }
  return new IpAssocAnswer(cmd, results);
}
origin: apache/cloudstack

private ExecutionResult prepareNetworkElementCommand(IpAssocCommand cmd) {
  return prepNetBoth(cmd
      .getAccessDetail(NetworkElementCommand.ROUTER_NAME),
      cmd.getIpAddresses(), "IpAssocCommand");
}
origin: apache/cloudstack

protected Answer execute(final IpAssocCommand cmd) {
  if (s_logger.isInfoEnabled()) {
    s_logger.info("Executing resource IPAssocCommand: " + s_gson.toJson(cmd));
  }
  int i = 0;
  final String[] results = new String[cmd.getIpAddresses().length];
  try {
    final IpAddressTO[] ips = cmd.getIpAddresses();
    final String routerName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
    final String controlIp = getRouterSshControlIp(cmd);
    for (final IpAddressTO ip : ips) {
      assignPublicIpAddress(routerName, controlIp, ip.getPublicIp(), ip.isAdd(), ip.isFirstIP(), ip.isSourceNat(), ip.getBroadcastUri(), ip.getVlanGateway(),
          ip.getVlanNetmask(), ip.getVifMacAddress());
      results[i++] = ip.getPublicIp() + " - success";
    }
    for (; i < cmd.getIpAddresses().length; i++) {
      results[i++] = IpAssocAnswer.errorResult;
    }
  } catch (final Throwable e) {
    s_logger.error("Unexpected exception: " + e.toString() + " will shortcut rest of IPAssoc commands", e);
    for (; i < cmd.getIpAddresses().length; i++) {
      results[i++] = IpAssocAnswer.errorResult;
    }
  }
  return new IpAssocAnswer(cmd, results);
}
origin: apache/cloudstack

@Override
public List<ConfigItem> generateConfig(final NetworkElementCommand cmd) {
  final IpAssocCommand command = (IpAssocCommand) cmd;
  final List<IpAddress> ips = new LinkedList<IpAddress>();
  for (final IpAddressTO ip : command.getIpAddresses()) {
    final IpAddress ipAddress = new IpAddress(ip.getPublicIp(), ip.isSourceNat(), ip.isAdd(), ip.isOneToOneNat(), ip.isFirstIP(), ip.getVlanGateway(), ip.getVlanNetmask(),
        ip.getVifMacAddress(), ip.getNicDevId(), ip.isNewNic(), ip.getTrafficType().toString());
    ips.add(ipAddress);
  }
  final IpAssociation ipAssociation = new IpAssociation(ips.toArray(new IpAddress[ips.size()]));
  return generateConfigItems(ipAssociation);
}
origin: apache/cloudstack

final IpAddressTO[] ips = cmd.getIpAddresses();
int nicNum = 0;
for (final IpAddressTO ip : ips) {
origin: apache/cloudstack

final String[] results = new String[cmd.getIpAddresses().length];
int i = 0;
try {
  final IpAddressTO[] ips = cmd.getIpAddresses();
  for (final IpAddressTO ip : ips) {
    final long guestVlanTag = Long.parseLong(ip.getBroadcastUri());
origin: apache/cloudstack

final IpAddressTO[] ips = cmd.getIpAddresses();
int nicNum = 0;
for (final IpAddressTO ip : ips) {
origin: apache/cloudstack

private Answer execute(IpAssocCommand cmd, int numRetries) {
  String[] results = new String[cmd.getIpAddresses().length];
  int i = 0;
  try {
    IpAddressTO ip;
    if (cmd.getIpAddresses().length != 1) {
      throw new ExecutionException("Received an invalid number of guest IPs to associate.");
    } else {
      ip = cmd.getIpAddresses()[0];
origin: apache/cloudstack

private ExecutionResult prepareNetworkElementCommand(final IpAssocCommand cmd) {
  try {
    final IpAddressTO[] ips = cmd.getIpAddresses();
    final String routerName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
    final String controlIp = getRouterSshControlIp(cmd);
origin: apache/cloudstack

final IpAddressTO[] ips = cmd.getIpAddresses();
for (final IpAddressTO ip : ips) {
origin: apache/cloudstack

final IpAddressTO[] ips = cmd.getIpAddresses();
for (final IpAddressTO ip : ips) {
com.cloud.agent.api.routingIpAssocCommandgetIpAddresses

Popular methods of IpAssocCommand

  • getAccessDetail
  • <init>
  • setAccessDetail

Popular in Java

  • Running tasks concurrently on multiple threads
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • scheduleAtFixedRate (Timer)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Top plugins for Android Studio
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