Example usage for com.liferay.portal.util LicenseUtil sendRequest

List of usage examples for com.liferay.portal.util LicenseUtil sendRequest

Introduction

In this page you can find the example usage for com.liferay.portal.util LicenseUtil sendRequest.

Prototype

public static String sendRequest(String request) throws Exception 

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");
}