Tabnine Logo
NetUtils.verifyDomainNameLabel
Code IndexAdd Tabnine to your IDE (free)

How to use
verifyDomainNameLabel
method
in
com.cloud.utils.net.NetUtils

Best Java code snippets using com.cloud.utils.net.NetUtils.verifyDomainNameLabel (Showing top 3 results out of 315)

origin: apache/cloudstack

public void checkNameForRFCCompliance(String name) {
  if (!NetUtils.verifyDomainNameLabel(name, true)) {
    throw new InvalidParameterValueException("Invalid name. Vm name can contain ASCII letters 'a' through 'z', the digits '0' through '9', "
        + "and the hyphen ('-'), must be between 1 and 63 characters long, and can't start or end with \"-\" and can't start with digit");
  }
}
origin: apache/cloudstack

public static boolean verifyDomainName(final String domainName) {
  // don't allow domain name length to exceed 190 chars (190 + 63 (max host name length) = 253 = max domainName length
  if (domainName.length() < 1 || domainName.length() > 190) {
    s_logger.trace("Domain name must be between 1 and 190 characters long");
    return false;
  }
  if (domainName.startsWith(".") || domainName.endsWith(".")) {
    s_logger.trace("Domain name can't start or end with .");
    return false;
  }
  final String[] domainNameLabels = domainName.split("\\.");
  for (int i = 0; i < domainNameLabels.length; i++) {
    if (!verifyDomainNameLabel(domainNameLabels[i], false)) {
      s_logger.warn("Domain name label " + domainNameLabels[i] + " is incorrect");
      return false;
    }
  }
  return true;
}
origin: MissionCriticalCloud/cosmic

public static boolean verifyDomainName(final String domainName) {
  // don't allow domain name length to exceed 190 chars (190 + 63 (max host name length) = 253 = max domainName length
  if (domainName.length() < 1 || domainName.length() > 190) {
    s_logger.trace("Domain name must be between 1 and 190 characters long");
    return false;
  }
  if (domainName.startsWith(".") || domainName.endsWith(".")) {
    s_logger.trace("Domain name can't start or end with .");
    return false;
  }
  final String[] domainNameLabels = domainName.split("\\.");
  for (int i = 0; i < domainNameLabels.length; i++) {
    if (!verifyDomainNameLabel(domainNameLabels[i], false)) {
      s_logger.warn("Domain name label " + domainNameLabels[i] + " is incorrect");
      return false;
    }
  }
  return true;
}
com.cloud.utils.netNetUtilsverifyDomainNameLabel

Popular methods of NetUtils

  • ip2Long
  • isValidIp4
  • isNetworkAWithinNetworkB
  • isValidIp4Cidr
  • getCidrSubNet
  • long2Ip
  • long2Mac
  • getCidrNetmask
  • getCidrSize
  • getLinkLocalGateway
  • isValidIp6Cidr
  • isValidMac
  • isValidIp6Cidr,
  • isValidMac,
  • isValidPort,
  • getLinkLocalCIDR,
  • ipAndNetMaskToCidr,
  • isValidIp4Netmask,
  • validateGuestCidr,
  • cidrToLong,
  • countIp6InRange,
  • getCidrFromGatewayAndNetmask

Popular in Java

  • Reactive rest calls using spring rest template
  • setScale (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • runOnUiThread (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • CodeWhisperer alternatives
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