Enum HardwareIdentication

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<HardwareIdentication>

    public enum HardwareIdentication
    extends java.lang.Enum<HardwareIdentication>
    Hardware identifications that are used to build up the license.

    The identification strings such as Operating System "Family:" is followed by a tab ('\t') and then the string. Multiple identification strings are separated with new lines ('\n').

    Author:
    Christopher Mindus
    • Field Summary

      Fields 
      Modifier and TypeFieldDescription
      static java.lang.StringdefaultHWIDs
      The default hardware identification used for new installations.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidappend​(SendTransaction trans, boolean refresh)
      Appends the hardware information to a transaction.
      static HardwareIdenticationfrom​(int indexValue)
      Gets the hardware identification from the "index" value.
      static IntArrayListgetDefaultHWIDIndexes()
      The default hardware indexed IDs used for new installations.
      java.lang.StringgetIdentification()
      Gets the information for this hardware identification.
      java.lang.StringgetIdentification​(boolean refresh)
      Gets the information for this hardware identification.
      java.lang.StringgetIdentification​(boolean refresh, java.lang.String... ipAddresses)
      Gets the information for this hardware identification.
      java.lang.StringgetIdentification​(java.lang.String... ipAddresses)
      Gets the information for this hardware identification.
      intgetValue()
      Gets the value for this identification as an integer.
      booleanhasDNSLookUp()
      Flag for long processing with DNS look-up.
      booleanneedsRefresh()
      Returns if this information might need a refresh because it could change.
      voidset​(VSField field, boolean refresh)
      Sets the hardware information to a VS field.
      voidset​(VSTable table, boolean refresh)
      Sets the hardware information into a VS table.
      static HardwareIdenticationvalueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static HardwareIdentication[]values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • ComputerInfo

        public static final HardwareIdentication ComputerInfo
        General information about the computer system. This information should ALWAYS be formatted the same way, e.g.:
           Manufacturer: Dell Inc.
           Model:        XPS 8920
           Serial:       75GDXJ2
         
      • ProcessorInfo

        public static final HardwareIdentication ProcessorInfo
        Processor identification. This information should ALWAYS be formatted the same way, e.g.:
           Information:  Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
           Identifier:   Intel64 Family 6 Model 158 Stepping 9
           IdentifierID: 158
           ProcessorID:  BFEBFBFF000906E9
           Physical:     4
           Logical:      8
         
      • MemoryInfo

        public static final HardwareIdentication MemoryInfo
        Memory information. This information can change during runtime and should not be used as identification, but can serve as a activation code trigger. It is always formatted as:
           Total: 17076768768
           Swap:  11274289152
         
      • OperatingSystem

        public static final HardwareIdentication OperatingSystem
        General information about the operating system. This information should ALWAYS be formatted the same way, e.g.:
           Family:       Windows
           Manufacturer: Microsoft
         
      • OperatingSystemWithVersion

        public static final HardwareIdentication OperatingSystemWithVersion
        General information about the operating system with version. This information should be formatted the same way, but the version may change during system updates, e.g.:
           Family:       Windows
           Manufacturer: Microsoft
           Version:      10 build 15063
         
      • AllMacAddresses

        public static final HardwareIdentication AllMacAddresses
        The MAC addresses for all the network cards.

        This value is often a good value that should NOT be separated with ':', but, beware: it can change in an virtualized environment unless it is fixed. If it is fixed, this value is the most secure value in terms of not changing.

        Beware: if this value changes, it could mean that the user is moving server. If this happens very often, it should attract your attention in terms of licensing.

        The format of the returned string is comma separated.

      • IPv4MacAddresses

        public static final HardwareIdentication IPv4MacAddresses
        The MAC addresses for all the network cards with IPv4 address and a speed set.

        This value is often a good value that should NOT be separated with ':', but, beware: it can change in an virtualized environment unless it is fixed. If it is fixed, this value is the most secure value in terms of not changing.

        Beware: if this value changes, it could mean that the user is moving server. If this happens very often, it should attract your attention in terms of licensing.

        The format of the returned string is comma separated.

      • IPv6MacAddresses

        public static final HardwareIdentication IPv6MacAddresses
        The MAC addresses for all the network cards with IPv6 address and a speed set.

        This value is often a good value that should NOT be separated with ':', but, beware: it can change in an virtualized environment unless it is fixed. If it is fixed, this value is the most secure value in terms of not changing.

        Beware: if this value changes, it could mean that the user is moving server. If this happens very often, it should attract your attention in terms of licensing.

        The format of the returned string is comma separated.

      • HostNamesWithDomain

        public static final HardwareIdentication HostNamesWithDomain
        The host name with domain (not recommended). The DNS structure may change quite often at companies.

        WARNING: this requires a DNS look-up and MAY take time!

        The format is an array of comma separated String's as:

           name1.domain.com,name2.domain.com
         

      • HostNames

        public static final HardwareIdentication HostNames
        The host name(s) without domain (not recommended). The DNS structure may change quite often at companies.

        WARNING: this requires a DNS look-up and MAY take time!

        The format is an array of comma separated String's as:

          name1,name2
         

      • HostAddressesIPv4

        public static final HardwareIdentication HostAddressesIPv4
        The IPv4 address of the server. This is also not recommended. Only network adapters that has a speed (e.g. 1GB) registered are included in the list.

        The format is an array of comma separated String's as:

           1.2.3.4,5.6.7.8
         

      • DiskSerials

        public static final HardwareIdentication DiskSerials
        The disk(s) serial number. This value has no particular meaning in a Virtualized environment. The disks listed must have at least one partition that has a mount point (i.e. drive letter for Windows).

        An example of an SSD and a hard disk, formatted as an array of comma separated String's as:

           BF3A_0E00_030D_0800,Z4Z7KFE2
         

      • SystemEnvironment

        public static final HardwareIdentication SystemEnvironment
        The system environment. This value SHOULD NEVER be used to test for.

        An example for Windows would be:

           ALLUSERSPROFILE=C:\ProgramData
           APPDATA=C:\iiziBuildInstall\windows\appdata
           CommonProgramFiles=C:\Program Files\Common Files
           CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
           CommonProgramW6432=C:\Program Files\Common Files
           COMPUTERNAME=CHRIS
           ComSpec=C:\WINDOWS\system32\cmd.exe
           FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer
           FPS_BROWSER_USER_PROFILE_STRING=Default
           HOME=C:\Users\myuser
           HOMEDRIVE=C:
           HOMEPATH=\Users\
           LOCALAPPDATA=C:\Users\myuser\AppData\Local
           LOGONSERVER=\\MYMACHINE
           NUMBER_OF_PROCESSORS=8
           OneDrive=D:\OneDrive-Data\OneDrive
           ProgramData=C:\ProgramData
           ProgramFiles=C:\Program Files
           ProgramFiles(x86)=C:\Program Files (x86)
           ProgramW6432=C:\Program Files
           PUBLIC=C:\Users\Public
           SESSIONNAME=Console
           SystemDrive=C:
           SystemRoot=C:\WINDOWS
           USERDOMAIN=MYMACHINE
           USERDOMAIN_ROAMINGPROFILE=MYMACHINE
           USERNAME=myuser
           USERPROFILE=C:\Users\myuser
           windir=C:\WINDOWS
         

    • Field Detail

      • defaultHWIDs

        public static final java.lang.String defaultHWIDs
        The default hardware identification used for new installations.

        The default ones are:

        • ComputerInfo,
        • ProcessorInfo,
        • OperatingSystem,
        • AllMacAddresses, and
        • DiskSerials.

        It's a comma separated string with the values of each hardware identification.

    • Method Detail

      • values

        public static HardwareIdentication[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (HardwareIdentication c : HardwareIdentication.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static HardwareIdentication valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getValue

        public int getValue()
        Gets the value for this identification as an integer.
        Returns:
        A unique integer for this identification (not the ordinal value).
      • needsRefresh

        public boolean needsRefresh()
        Returns if this information might need a refresh because it could change.
        Returns:
        true if refresh would matter, false otherwise.
      • hasDNSLookUp

        public boolean hasDNSLookUp()
        Flag for long processing with DNS look-up.
      • getIdentification

        public java.lang.String getIdentification()
        Gets the information for this hardware identification.
        Returns:
        The hardware identification string.
      • getIdentification

        public java.lang.String getIdentification​(boolean refresh)
        Gets the information for this hardware identification.
        Parameters:
        refresh - Flag for refresh required.
        Returns:
        The hardware identification string.
      • getIdentification

        public java.lang.String getIdentification​(java.lang.String... ipAddresses)
        Gets the information for this hardware identification.
        Parameters:
        ipAddresses - IP addresses to look-up.
        Returns:
        The hardware identification string.
      • getIdentification

        public java.lang.String getIdentification​(boolean refresh,
                                                  java.lang.String... ipAddresses)
        Gets the information for this hardware identification.
        Parameters:
        refresh - Flag for refresh required.
        ipAddresses - IP addresses to look-up.
        Returns:
        The hardware identification string.
      • append

        public void append​(SendTransaction trans,
                           boolean refresh)
        Appends the hardware information to a transaction.
        Parameters:
        trans - The transaction.
        refresh - The refresh flag.
      • set

        public void set​(VSField field,
                        boolean refresh)
        Sets the hardware information to a VS field.
        Parameters:
        field - The VS component (VSTable or VSField).
        refresh - The refresh flag.
      • set

        public void set​(VSTable table,
                        boolean refresh)
        Sets the hardware information into a VS table. This method is typically used for network adapters or IP addresses. The first column of the table will contain the information. The entire operation is done in a single VSWorkUnit.
        Parameters:
        table - The VS table to set.
        refresh - The refresh flag.
      • from

        public static HardwareIdentication from​(int indexValue)
        Gets the hardware identification from the "index" value.
        Returns:
        The HardwareIdentification matching.
        Throws:
        NotFoundException - If HardwareIdentification is not found.
      • getDefaultHWIDIndexes

        public static final IntArrayList getDefaultHWIDIndexes()
        The default hardware indexed IDs used for new installations.
        Returns:
        A clone of the indexes.

        The default ones are:

        • ComputerInfo,
        • ProcessorInfo,
        • OperatingSystem,
        • AllMacAddresses, and
        • DiskSerials.