IoT CAS Frameworks/IOT_Server/Server_Admin_Framework/source/ConsumerAPI/src/java/AV_Action/AV_SALicense.java
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        LicenseServiceImpl license = new LicenseServiceImpl(request);

        String operation = null;
        String customerName = null;
        String productId = null;
        String licenseType = null;
        String timeStamp = null;
        String timeZone = null;
        String startDate = null;
        String endDate = null;
        String optionalAttribs = null;
        String optionalLabel = null;
        String tLicenseKey = null;
        String ret = null;

        try {
            System.out.println("AV_SALicense");
            operation = request.getParameter("operation");
            customerName = request.getParameter("customerName");
            productId = request.getParameter("productId");
            licenseType = request.getParameter("licenseType");
            timeStamp = request.getParameter("timeStamp");
            timeZone = request.getParameter("timeZone");
            startDate = request.getParameter("startDate");
            endDate = request.getParameter("endDate");
            optionalAttribs = request.getParameter("optionalAttribs");
            optionalLabel = request.getParameter("optionalLabel");
            tLicenseKey = request.getParameter("tLicenseKey");

            if (operation.equalsIgnoreCase("createLicense")) {

                ret = license.createLicense(customerName, productId, licenseType, timeStamp, timeZone, startDate, endDate, optionalAttribs);

            }
            if (operation.equalsIgnoreCase("checkLicense")) {

                if (tLicenseKey != null) {

                    ret = license.checkLicense(customerName, productId, optionalLabel, tLicenseKey);

                } else {

                    ret = license.checkLicense(customerName, productId, optionalLabel);

                }
            }
            if (ret == "1") {
                //     System.out.println("if ret====>" + ret);

                out.print(ret);

            } else {
                //       System.out.println("else ret====>" + ret);
                ret = ret.substring(0, ret.length() - 1);
                out.print(ret);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            out.close();
        }
    }
/**
     * Processes requests for both HTTP
     * <code>GET</code> and
     * <code>POST</code> methods.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
Processes requests for both HTTP
GET and
POST methods.

@param request servlet request
@param response servlet response
@throws ServletException if a servlet-specific error occurs
@throws IOException if an I/O error occurs
Processes requests for both HTTP GET and POST methods . @param request servlet request @param response servlet response @throws ServletException if a servlet - specific error occurs @throws IOException if an I / O error occurs
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        LicenseServiceImpl license = new LicenseServiceImpl(request);
        String operation = null;
        String customerName = null;
        String productId = null;
        String licenseType = null;
        String timeStamp = null;
        String timeZone = null;
        String startDate = null;
        String endDate = null;
        String optionalAttribs = null;
        String optionalLabel = null;
        String tLicenseKey = null;
        String ret = null;
        try {
            System.out.println("AV_SALicense");
            operation = request.getParameter("operation");
            customerName = request.getParameter("customerName");
            productId = request.getParameter("productId");
            licenseType = request.getParameter("licenseType");
            timeStamp = request.getParameter("timeStamp");
            timeZone = request.getParameter("timeZone");
            startDate = request.getParameter("startDate");
            endDate = request.getParameter("endDate");
            optionalAttribs = request.getParameter("optionalAttribs");
            optionalLabel = request.getParameter("optionalLabel");
            tLicenseKey = request.getParameter("tLicenseKey");
            if (operation.equalsIgnoreCase("createLicense")) {
                ret = license.createLicense(customerName, productId, licenseType, timeStamp, timeZone, startDate, endDate, optionalAttribs);
            }
            if (operation.equalsIgnoreCase("checkLicense")) {
                if (tLicenseKey != null) {
                    ret = license.checkLicense(customerName, productId, optionalLabel, tLicenseKey);
                } else {
                    ret = license.checkLicense(customerName, productId, optionalLabel);
                }
            }
            if (ret == "1") {
                out.print(ret);
            } else {
                ret = ret.substring(0, ret.length() - 1);
                out.print(ret);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            out.close();
        }
    }
protected void processRequest ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { response . setContentType ( "text/html;charset=UTF-8" ) ; PrintWriter out = response . getWriter ( ) ; LicenseServiceImpl license = new LicenseServiceImpl ( request ) ; String operation = null ; String customerName = null ; String productId = null ; String licenseType = null ; String timeStamp = null ; String timeZone = null ; String startDate = null ; String endDate = null ; String optionalAttribs = null ; String optionalLabel = null ; String tLicenseKey = null ; String ret = null ; try { System . out . println ( "AV_SALicense" ) ; operation = request . getParameter ( "operation" ) ; customerName = request . getParameter ( "customerName" ) ; productId = request . getParameter ( "productId" ) ; licenseType = request . getParameter ( "licenseType" ) ; timeStamp = request . getParameter ( "timeStamp" ) ; timeZone = request . getParameter ( "timeZone" ) ; startDate = request . getParameter ( "startDate" ) ; endDate = request . getParameter ( "endDate" ) ; optionalAttribs = request . getParameter ( "optionalAttribs" ) ; optionalLabel = request . getParameter ( "optionalLabel" ) ; tLicenseKey = request . getParameter ( "tLicenseKey" ) ; if ( operation . equalsIgnoreCase ( "createLicense" ) ) { ret = license . createLicense ( customerName , productId , licenseType , timeStamp , timeZone , startDate , endDate , optionalAttribs ) ; } if ( operation . equalsIgnoreCase ( "checkLicense" ) ) { if ( tLicenseKey != null ) { ret = license . checkLicense ( customerName , productId , optionalLabel , tLicenseKey ) ; } else { ret = license . checkLicense ( customerName , productId , optionalLabel ) ; } } if ( ret == "1" ) { out . print ( ret ) ; } else { ret = ret . substring ( 0 , ret . length ( ) - 1 ) ; out . print ( ret ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { out . close ( ) ; } }
Processes requests for both HTTP
 <code>GET</code> and
 <code>POST</code> methods.
Processes requests for both HTTP <code > GET< / code > and <code > POST< / code > methods .
//     System.out.println("if ret====>" + ret); //       System.out.println("else ret====>" + ret);