Example usage for com.liferay.portal.kernel.license.util LicenseManagerUtil getHostName

List of usage examples for com.liferay.portal.kernel.license.util LicenseManagerUtil getHostName

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.license.util LicenseManagerUtil getHostName.

Prototype

public static String getHostName() 

Source Link

Usage

From source file:com.liferay.marketplace.store.web.internal.util.MarketplaceLicenseUtil.java

License:Open Source License

public static String getOrder(String productEntryName) throws Exception {
    JSONObject jsonObject = JSONFactoryUtil.createJSONObject();

    jsonObject.put("cmd", "GET_ORDER");
    jsonObject.put("hostName", LicenseManagerUtil.getHostName());
    jsonObject.put("ipAddresses", StringUtil.merge(LicenseManagerUtil.getIpAddresses()));
    jsonObject.put("macAddresses", StringUtil.merge(LicenseManagerUtil.getMacAddresses()));
    jsonObject.put("productEntryName", productEntryName);
    jsonObject.put("serverId", Arrays.toString(getServerIdBytes()));

    String response = LicenseUtil.sendRequest(jsonObject.toString());

    JSONObject responseJSONObject = JSONFactoryUtil.createJSONObject(response);

    return responseJSONObject.getString("orderUuid");
}