Tabnine Logo
IpAddressTO.isAdd
Code IndexAdd Tabnine to your IDE (free)

How to use
isAdd
method
in
com.cloud.agent.api.to.IpAddressTO

Best Java code snippets using com.cloud.agent.api.to.IpAddressTO.isAdd (Showing top 10 results out of 315)

origin: apache/cloudstack

protected void setNicDevIdIfCorrectVifIsNotNull(final Connection conn, final IpAddressTO ip, final VIF correctVif)
    throws InternalErrorException, BadServerResponse, XenAPIException, XmlRpcException {
  if (correctVif == null) {
    if (ip.isAdd()) {
      throw new InternalErrorException("Failed to find DomR VIF to associate IP with.");
    } else {
      s_logger.debug("VIF to deassociate IP with does not exist, return success");
    }
  } else {
    ip.setNicDevId(Integer.valueOf(correctVif.getDevice(conn)));
  }
}
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 String vlanNetmask = ip.getVlanNetmask();
if (ip.isAdd()) {
final String action = ip.isAdd() ? "associate" : "remove";
if (s_logger.isDebugEnabled()) {
  s_logger.debug("Netscaler load balancer " + _ip + " successfully executed IPAssocCommand to " + action + " IP " + ip);
origin: apache/cloudstack

if (org.apache.commons.lang.StringUtils.equalsIgnoreCase(lastIp, "true") && !ip.isAdd()) {
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

private ExecutionResult prepareNetworkElementCommand(final IpAssocVpcCommand cmd) {
  final String routerName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
  try {
    final IpAddressTO[] ips = cmd.getIpAddresses();
    for (final IpAddressTO ip : ips) {
      final URI broadcastUri = BroadcastDomainType.fromString(ip.getBroadcastUri());
      if (BroadcastDomainType.getSchemeValue(broadcastUri) != BroadcastDomainType.Vlan) {
        throw new InternalErrorException("Invalid Broadcast URI " + ip.getBroadcastUri());
      }
      final String vlanId = BroadcastDomainType.getValue(broadcastUri);
      int publicNicInfo = -1;
      publicNicInfo = getVmNics(routerName, vlanId);
      if (publicNicInfo < 0) {
        if (ip.isAdd()) {
          throw new InternalErrorException("Failed to find DomR VIF to associate/disassociate IP with.");
        } else {
          s_logger.debug("VIF to deassociate IP with does not exist, return success");
          continue;
        }
      }
      ip.setNicDevId(publicNicInfo);
    }
  } catch (final Exception e) {
    s_logger.error("Prepare Ip Assoc failure on applying one ip due to exception:  ", e);
    return new ExecutionResult(false, e.toString());
  }
  return new ExecutionResult(true, null);
}
origin: apache/cloudstack

if (ip.isAdd()) {
origin: apache/cloudstack

if (ip.isAdd() && publicNicInfo == -1) {
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("Plug new NIC to associate" + controlIp + " to " + ip.getPublicIp());
origin: apache/cloudstack

if (ip.isAdd() && correctVif == null) {
  addVif = true;
if (ip.isAdd() && correctVif == null) {
  throw new InternalErrorException("Failed to find DomR VIF to associate/disassociate IP with.");
origin: apache/cloudstack

if (org.apache.commons.lang.StringUtils.equalsIgnoreCase(lastIp, "true") && !ip.isAdd()) {
  final VIF correctVif = getCorrectVif(conn, router, network);
com.cloud.agent.api.toIpAddressTOisAdd

Popular methods of IpAddressTO

  • getBroadcastUri
  • getVifMacAddress
  • getPublicIp
  • setNicDevId
  • getVlanGateway
  • getVlanNetmask
  • isSourceNat
  • setNewNic
  • getTrafficType
  • isFirstIP
  • <init>
  • getNetworkName
  • <init>,
  • getNetworkName,
  • getNetworkRate,
  • getNicDevId,
  • isNewNic,
  • isOneToOneNat,
  • setNetworkName,
  • setTrafficType

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • getExternalFilesDir (Context)
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JLabel (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top plugins for WebStorm
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