All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Alachisoft.NCache.Common.Util.NCLicenseDll Maven / Gradle / Ivy

There is a newer version: 5.3.3
Show newest version
package Alachisoft.NCache.Common.Util;

/**
 * Utility class to help with interop tasks.
 */
public class NCLicenseDll {
    //C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if MONO
    public static final String DLL_LICENSE = "nclicense";
//#endif

    ////
    //C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
    ////#if NCWOW64
    //	/**
    //	 Returns the number of processors on the system.
    //	*/
    //	public static native int GetNumProcessors();
    //	static {
    //		System.loadLibrary("nclicense32.dll");
    //	}
    //
    //
    //	/**
    //	 Returns the total number of cores available in the system.
    //	*/
    //	public static native int GetNumCores();
    //
    //	/**
    //	 Returns 0 or 1, If VM based OS found returns 1 else 0
    //	*/
    //	public static native int IsEmulatedOS();
    //
    //	/**
    //	 Returns a list of mac addresses found on the system.
    //	*/
    ////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    ////ORIGINAL LINE: public static extern int GetAdaptersAddressList([Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder list);
    //	public static native int GetAdaptersAddressList(StringBuilder list);
    //
    ////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    ////ORIGINAL LINE: public static extern void ReadActivationCode([Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder code, short prodId);
    //	public static native void ReadActivationCode(StringBuilder code, short prodId);
    //
    //	public static native int ReadEvaluationData(int version, tangible.RefObject time, short prodId);
    //
    ////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    ////ORIGINAL LINE: public static extern void ReadInstallCode([Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder code, short prodId);
    //	public static native void ReadInstallCode(StringBuilder code, short prodId);
    //
    ////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    ////ORIGINAL LINE: public static extern void GetRegVal([Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder RegVal,[MarshalAs(UnmanagedType.LPStr)] StringBuilder section, [MarshalAs(UnmanagedType.LPStr)] StringBuilder key, [MarshalAs(UnmanagedType.LPStr)]StringBuilder defaultVal, short prodId);
    //	public static native void GetRegVal(StringBuilder RegVal, StringBuilder section, StringBuilder key, StringBuilder defaultVal, short prodId);
    //
    ////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    ////ORIGINAL LINE: public static extern void GetRegKeys([Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder RegVal, [MarshalAs(UnmanagedType.LPStr)] StringBuilder section, [MarshalAs(UnmanagedType.LPStr)] StringBuilder key, [MarshalAs(UnmanagedType.LPStr)]StringBuilder defaultVal, short prodId);
    //	public static native void GetRegKeys(StringBuilder RegVal, StringBuilder section, StringBuilder key, StringBuilder defaultVal, short prodId);
    //
    ////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    ////ORIGINAL LINE: public static extern bool SetRegVal([MarshalAs(UnmanagedType.LPStr)] StringBuilder section, [MarshalAs(UnmanagedType.LPStr)]StringBuilder key, [MarshalAs(UnmanagedType.LPStr)]StringBuilder newVal, short prodId);
    //	public static native boolean SetRegVal(StringBuilder section, StringBuilder key, StringBuilder newVal, short prodId);
    //
    ////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    ////ORIGINAL LINE: public static extern bool SetRegValInt([MarshalAs(UnmanagedType.LPStr)] StringBuilder section, [MarshalAs(UnmanagedType.LPStr)] StringBuilder key, ulong newVal, short prodId);
    ////C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
    //	public static native boolean SetRegValInt(StringBuilder section, StringBuilder key, long newVal, short prodId);
    ////#else
    //	/**
    //	 Returns the number of processors on the system.
    //	*/
    ////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
    ////#if !MONO
    ////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //	//[DllImport("nclicense.dll", CallingConvention = CallingConvention.Cdecl)]
    //
    ////#else
    ////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //	//[DllImport(DLL_LICENSE)]
    //
    ////#endif
    //
    public static native int GetNumProcessors();

    /**
     * Returns the total number of cores available in the system.
     */
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if !MONO
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport("nclicense.dll", CallingConvention = CallingConvention.Cdecl)]

//#else
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport(DLL_LICENSE)]

//#endif
    public static native int GetNumCores();

    /**
     * Returns 0 or 1, If VM based OS found returns 1 else 0
     */
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if !MONO
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport("nclicense.dll", CallingConvention = CallingConvention.Cdecl)]

//#else
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport(DLL_LICENSE)]

//#endif
    public static native int IsEmulatedOS();

    /**
     * Returns a list of mac addresses found on the system.
     */
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if !MONO
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport("nclicense.dll", CallingConvention = CallingConvention.Cdecl)]

//#else
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport(DLL_LICENSE)]

//#endif
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
//ORIGINAL LINE: public static extern int GetAdaptersAddressList([Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder list);
    public static native int GetAdaptersAddressList(StringBuilder list);

    //#endif
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
//ORIGINAL LINE: public static extern void ReadActivationCode([Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder code, short prodId);
    public static native void ReadActivationCode(StringBuilder code, short prodId);

    //#endif
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
//ORIGINAL LINE: public static extern void ReadInstallCode([Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder code, short prodId);
    public static native void ReadInstallCode(StringBuilder code, short prodId);
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if !MONO
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport("nclicense.dll", CallingConvention = CallingConvention.Cdecl)]

//#else
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport(DLL_LICENSE)]

    //#endif
    public static native int ReadEvaluationData(int version, tangible.RefObject time, short prodId);
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if !MONO
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport("nclicense.dll", CallingConvention= CallingConvention.Cdecl)]

//#else
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport(DLL_LICENSE)]

    //#endif
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
//ORIGINAL LINE: public static extern void GetRegVal([Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder RegVal, [MarshalAs(UnmanagedType.LPStr)] StringBuilder section, [MarshalAs(UnmanagedType.LPStr)] StringBuilder key, [MarshalAs(UnmanagedType.LPStr)]StringBuilder defaultVal, short prodId);
    public static native void GetRegVal(StringBuilder RegVal, StringBuilder section, StringBuilder key, StringBuilder defaultVal, short prodId);

//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if !MONO
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport("nclicense.dll", CallingConvention = CallingConvention.Cdecl)]

//#else
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport(DLL_LICENSE)]

    //#endif
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
//ORIGINAL LINE: public static extern bool SetRegVal([MarshalAs(UnmanagedType.LPStr)] StringBuilder section, [MarshalAs(UnmanagedType.LPStr)]StringBuilder key, [MarshalAs(UnmanagedType.LPStr)]StringBuilder newVal, short prodId);
    public static native boolean SetRegVal(StringBuilder section, StringBuilder key, StringBuilder newVal, short prodId);
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if !MONO
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport("nclicense.dll", CallingConvention = CallingConvention.Cdecl)]

//#else
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport(DLL_LICENSE)]

    //#endif
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
//ORIGINAL LINE: public static extern bool SetRegValInt([MarshalAs(UnmanagedType.LPStr)] StringBuilder section, [MarshalAs(UnmanagedType.LPStr)] StringBuilder key, long newVal, short prodId);
    public static native boolean SetRegValInt(StringBuilder section, StringBuilder key, long newVal, short prodId);

//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if !MONO
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport("nclicense.dll", CallingConvention = CallingConvention.Cdecl)]

//#else
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport(DLL_LICENSE)]

    //#endif
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
//ORIGINAL LINE: public static extern void GetRegKeys([Out, MarshalAs(UnmanagedType.LPStr)] StringBuilder RegVal, [MarshalAs(UnmanagedType.LPStr)] StringBuilder section, [MarshalAs(UnmanagedType.LPStr)] StringBuilder key, [MarshalAs(UnmanagedType.LPStr)]StringBuilder defaultVal, short prodId);
    public static native void GetRegKeys(StringBuilder RegVal, StringBuilder section, StringBuilder key, StringBuilder defaultVal, short prodId);

//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if !MONO
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport("nclicense.dll", CallingConvention = CallingConvention.Cdecl)]

//#else
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport(DLL_LICENSE)]

    public enum ActivationStatus {
        EVAL(80),
        ACTIVATED(81),
        DEACTIVATED(82);

        private static java.util.HashMap mappings;
        private int intValue;

        private ActivationStatus(int value) {
            intValue = value;
            ActivationStatus.getMappings().put(value, this);
        }

        private static java.util.HashMap getMappings() {
            if (mappings == null) {
                synchronized (ActivationStatus.class) {
                    if (mappings == null) {
                        mappings = new java.util.HashMap();
                    }
                }
            }
            return mappings;
        }

        public static ActivationStatus forValue(int value) {
            return getMappings().get(value);
        }

        public int getValue() {
            return intValue;
        }
    }
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if !MONO
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport("nclicense.dll", CallingConvention = CallingConvention.Cdecl)]

//#else
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[DllImport(DLL_LICENSE)]

    /**
     * Declare the structure, which is the parameter of ReadEvaluationData.
     */
//C# TO JAVA CONVERTER WARNING: Java does not allow user-defined value types. The behavior of this class will differ from the original:
//ORIGINAL LINE: public struct EvaluationData
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
    //[StructLayout(LayoutKind.Sequential)]
    public final static class EvaluationData {
        public short Year;
        public short Month;
        public short Days;
        public short ExtensionVal;
        public short Extensions;
        public short Period;
        public short ActivationStatus;
        public short Res3;

        public EvaluationData clone() {
            EvaluationData varCopy = new EvaluationData();

            varCopy.Year = this.Year;
            varCopy.Month = this.Month;
            varCopy.Days = this.Days;
            varCopy.ExtensionVal = this.ExtensionVal;
            varCopy.Extensions = this.Extensions;
            varCopy.Period = this.Period;
            varCopy.ActivationStatus = this.ActivationStatus;
            varCopy.Res3 = this.Res3;

            return varCopy;
        }
    }
//#endif
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy