亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? licenseserver.java

?? Sun公司Dream項目
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/*
 * The contents of this file are subject to the terms
 * of the Common Development and Distribution License
 * (the "License").  You may not use this file except
 * in compliance with the License.
 *
 * You can obtain a copy of the license at
 * http://www.opensource.org/licenses/cddl1.php
 * See the License for the specific language governing
 * permissions and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL
 * HEADER in each file and include the License file at
 * http://www.opensource.org/licenses/cddl1.php.  If
 * applicable, add the following below this CDDL HEADER,
 * with the fields enclosed by brackets "[]" replaced
 * with your own identifying information:
 * Portions Copyright [yyyy]
 * [name of copyright owner]
 */

/*
 * $(@)LicenseServer.java $Revision: 1.3 $ $Date: 2006/09/20 01:37:39 $
 *
 * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
 */
package com.sun.licenseserver;

import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Logger;
import java.io.*;
import java.net.*;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.*;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.omc.dream.mmi.common.*;
// import com.sun.sjc.idtv.vod.shared.data.*;

import org.w3c.dom.Document;
import org.xml.sax.SAXException;
import com.sun.dream.*;
import java.util.*;

import sun.misc.*;
import com.sun.sjc.idtv.vod.shared.data.RightsInfo;
import com.sun.sjc.idtv.vod.shared.data.VerbElement;

/**
 * The LicenseServer is a servlet that can be used to
 * get the license for a given media type. The license server
 * stores the licenses in a database. The database details have
 * to by the user in the configuration file WEB-INF/conf/LicenseServer.xml.
 *
 */
public class LicenseServer extends HttpServlet {
    
    
    /**
     * Initialize the servlet. The method reads
     * the configuration values stored in the file
     * WEB-INF/conf/License-Server.xml.
     *
     */
    public void init()
    throws ServletException {
        m_log.finest("Entering Function...");
        Document doc = loadConfFile();
        if (doc == null) {
            m_log.severe("Error in initializing the servlet because of problems in parsing conf file");
            throw new LicenseServerException(LicenseServerException.EC_NO_ERROR_CODE,
                    "error in parsing the conf file");
            
        }
        m_databaseHelper = DatabaseHelper.init(doc);
        m_operaProxyURL  = m_databaseHelper.getConfParameterValue(doc, "operaProxyURL");
        if (m_operaProxyURL == null || "".equals(m_operaProxyURL.trim())) {
            m_log.severe("Error in initializing the servlet because opera proxy URL is null. " +
                    "Change WEB-INF/conf/license-server.xml");
            throw new LicenseServerException(LicenseServerException.EC_NO_ERROR_CODE,
                    "error in parsing the conf file because opera proxy is null");
        }
        String authenticate = m_databaseHelper.getConfParameterValue(doc, "authenticate");
        if (authenticate != null && authenticate.equalsIgnoreCase("false")) {
            m_authenticate = false;
        }
        HashMap map = new HashMap();
        ServletContext servletContext = getServletContext();
        servletContext.setAttribute("SessionHashMap", map);
        
        m_log.finer("Leaving Function...");
    }
    
    /**
     * Loads the xml configuration file,
     * parses it and returns the Document object.
     *
     * @return
     */
    private Document loadConfFile() {
        m_log.finer("Entering Function...");
        String    confFile = "/WEB-INF/conf/license-server.xml";
        URL       confFileURL = null;
        try {
            confFileURL = getServletContext().getResource(confFile);
        } catch (MalformedURLException e1) {
            m_log.severe("License Server configuration file does not exists..");
            e1.printStackTrace();
        }
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder        db  = null;
        Document               doc = null;
        try {
            db = dbf.newDocumentBuilder();
            doc = db.parse(confFileURL.openStream());
        } catch (SAXException e2) {
            m_log.severe("Error in Parsing License Server Configuration File..");
            e2.printStackTrace();
        } catch (IOException e2) {
            m_log.severe("Error in Parsing License Server Configuration File..");
            m_log.severe("Probably the file /WEB-INF/conf/license-server.xml does not exists");
            e2.printStackTrace();
        } catch (ParserConfigurationException e) {
            m_log.severe("Error in Parsing License Server Configuration File..");
            e.printStackTrace();
        }
        m_log.finer("Leaving function...");
        return doc;
    }
    
    /*
     * This method is used to handle HTTP POST requests.
     *
     * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     */
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        m_log.finest("Entering Function...");
        processRequest(request, response);
        m_log.finer("Leaving Function...");
    }
    
    
    /**
     * This method is used to handle HTTP GET requests.
     *
     * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        m_log.finer("Entering Function...");
        processRequest(request, response);
        m_log.finer("Leaving Function...");
    }
    
    
    /**
     * This method processes all the requests that
     * are send to the LicenseServer.
     *
     * @param request
     * @param response
     * @throws IOException
     * @throws ServletException
     */
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException {
        m_log.finer("Entering Function...");
        m_log.fine("LICENSE SERVER REQUEST.GETQUERYSTRING() "+request.getQueryString());
        String action = request.getParameter(Const.ACTION);
        String userID = null;
        String contentID = null;
        String shopID = null;
        String mmiVersion;
        HttpSession httpSession = null;
        MMIMessage mmiMessage = null;
        if (action == null) {
            m_log.fine("ACTION = null");
            mmiVersion = request.getParameter("MMIVersion");
            if(mmiVersion != null) {   //MMI route
                m_log.fine("There is a MMIMessage in this request");
                // This maybe an MMIMessage
                // check MMIMessage
                // get userID, contentID
                String strQuery = request.getQueryString();
                
                MMIParserFactory mmiParserFactory = MMIParserFactory.PLAINTEXT;
                MMIPlainTextParser mmiPlainTextParser = (MMIPlainTextParser)mmiParserFactory.createParser();
                try {
                    m_log.fine("QUERY:"+strQuery);
                    mmiMessage = mmiPlainTextParser.parseMessage(strQuery);
                    
                } catch (Exception e) {
                    e.printStackTrace();
                }
                httpSession = request.getSession();
                httpSession.setAttribute("MMIMessage", mmiMessage);
                
                ServletContext servletContext = getServletContext();
                
                HashMap hashMap = (HashMap)servletContext.getAttribute("SessionHashMap");
                hashMap.put(httpSession.getId(), mmiMessage);
                servletContext.setAttribute("SessionHashMap", hashMap);
                
                MMIRequest mmiRequest = (MMIRequest)mmiMessage.getMMIDataObject();
                userID = mmiRequest.getIdentitySegment().getAuthServiceId().getAuthServiceId();
                MMIRightsRequestElement[] mmiRightsRequestElement = mmiRequest.getRightsSegment().getMMIRightsRequestElement();
                
                StringBuffer sb = new StringBuffer();
                for(int i=0;i<mmiRightsRequestElement.length; i++) {
                    ContentId[] contentId = mmiRightsRequestElement[i].getContentId();
                    for(int j=0; j<contentId.length; j++) {
                        if(i==0 && j==0) {
                            sb.append(contentId[j].getContentId());
                        } else {
                            sb.append(","+contentId[j].getContentId());
                        }
                    }
                }
                contentID=sb.toString();
                shopID="operaShop0";
                
                strQuery = request.getQueryString();
                // check to see if vouchers exist
                // strQuery[1] are the vouchers
                m_log.finer("Calling handleLicenseRequest");
                handleLicenseRequest(userID, contentID, shopID, null, request, response);  // redirect to Opera Proxy
                m_log.finer("Exit handleLicenseRequest");
            } else if ("".equals(action.trim())) {
                throw new LicenseServerException(LicenseServerException.EC_INVALID_ARGUMENT,
                        "Action parameter can not be null.");
            }
        } else {
            m_log.finer("There is no MMIMessage in this request");
            userID = request.getParameter(Const.USERID);
            contentID = request.getParameter(Const.CONTENT_ID);
            shopID = request.getParameter(Const.SHOPID);
            String casFlag = request.getParameter(Const.CAS_FLAG);
            // See if we have a stored session
            // We need to extract defaults from there
            // if userid, contentId and shopid are null
            //
            HttpSession session = request.getSession(true);
            SessionInfo si = (SessionInfo) session.getAttribute("session");
            
            if (si != null) {
                if (userID == null || "".equals(userID.trim())) {
                    userID = si.getUserId();
                }
                if (contentID == null || "".equals(contentID.trim())) {
                    contentID = si.getContentId();
                }
                if (shopID == null || "".equals(shopID.trim())) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久午夜| 91精品国产入口在线| 69堂精品视频| 精品久久国产老人久久综合| 国产欧美日韩另类一区| 亚洲视频免费在线观看| 亚洲成人激情社区| 国产中文字幕一区| 不卡影院免费观看| 欧美性大战久久久| 精品久久久久久久人人人人传媒| 国产亚洲欧美日韩俺去了| 一区二区三区免费看视频| 亚洲美女视频在线观看| 精品一区二区三区免费观看| 国产伦精品一区二区三区免费迷| 99re这里只有精品首页| 日韩午夜精品电影| 一区二区三区在线看| 国产在线视频一区二区| 欧美在线免费观看视频| 国产清纯白嫩初高生在线观看91| 亚洲大片精品永久免费| av高清不卡在线| 国产色产综合产在线视频| 天堂va蜜桃一区二区三区| 欧美不卡一区二区三区| 亚洲黄色小视频| 91最新地址在线播放| 国产精品丝袜91| 99久久99久久精品免费看蜜桃| 337p粉嫩大胆色噜噜噜噜亚洲| 亚洲国产日日夜夜| 欧美性欧美巨大黑白大战| 一区二区三区国产精华| 99久久久久久| 亚洲成人在线网站| 欧美在线观看视频一区二区| 五月开心婷婷久久| 日韩亚洲欧美中文三级| 蜜桃av一区二区三区| 欧美一级高清片在线观看| 久久精品国产秦先生| 久久综合九色综合久久久精品综合 | 成人av手机在线观看| 国产日韩三级在线| 日本乱人伦aⅴ精品| 亚洲午夜精品在线| 日韩欧美中文字幕公布| 国产91丝袜在线18| 一区二区三区日韩欧美精品| 欧美日韩三级在线| 国产成人精品三级麻豆| 亚洲人被黑人高潮完整版| 欧美久久婷婷综合色| 欧美在线观看视频一区二区| 国产麻豆午夜三级精品| 亚洲乱码国产乱码精品精的特点| 91精品国产91久久久久久最新毛片| 欧美极品另类videosde| 欧美精品 国产精品| 国产激情视频一区二区在线观看 | 欧美午夜影院一区| 国内成人自拍视频| 亚洲日本va午夜在线电影| 欧美日韩在线播放三区| 国模冰冰炮一区二区| 激情六月婷婷久久| 亚洲国产成人午夜在线一区| 欧美日韩久久久| 国产一区二区在线观看免费| 一区二区三区在线视频免费观看 | 日韩精品一区二区三区在线播放| 成人小视频免费在线观看| 亚洲aaa精品| 亚洲精选免费视频| 精品免费日韩av| 在线综合视频播放| 在线精品视频免费观看| 成人禁用看黄a在线| 精品在线视频一区| 日韩精品电影在线观看| 一个色妞综合视频在线观看| 国产欧美日产一区| 国产精品三级av| 日本一区二区不卡视频| 欧美极品aⅴ影院| 欧美成人精品福利| 精品国产乱码久久久久久老虎| 在线观看欧美精品| 91丨九色porny丨蝌蚪| 91麻豆精品一区二区三区| 99精品欧美一区二区三区综合在线| 国产成人鲁色资源国产91色综 | 成人激情免费视频| 精品一区二区久久久| 免费人成在线不卡| 麻豆精品一二三| 国产成人av一区二区三区在线| 成人黄色电影在线 | 国产精品久久久久久久久免费丝袜 | 色综合久久久久| 在线视频你懂得一区| 在线不卡a资源高清| 国产亚洲一区二区三区| 国产精品久线观看视频| 亚洲已满18点击进入久久| 视频一区二区中文字幕| 精品影院一区二区久久久| 国产中文字幕一区| 99视频精品在线| 色8久久人人97超碰香蕉987| 欧美精品日韩一区| 国产精品久久久久久久久久久免费看 | thepron国产精品| 4438x成人网最大色成网站| 久久久电影一区二区三区| 亚洲国产精品久久久久婷婷884| 五月天国产精品| 在线视频中文字幕一区二区| 国产精品女人毛片| 经典三级一区二区| 51精品视频一区二区三区| 亚洲视频在线观看三级| 国产成人8x视频一区二区| 日韩一区二区视频在线观看| 一区二区久久久久| 在线视频一区二区三| 国产精品国产三级国产普通话99| 欧美a级理论片| 欧美性三三影院| 日韩国产成人精品| 欧美一区二区三区公司| 日韩激情在线观看| 欧美日韩美少妇| 五月综合激情网| 午夜精品久久久久久久久久久| 97aⅴ精品视频一二三区| 亚洲美女视频一区| 欧美亚洲愉拍一区二区| 婷婷夜色潮精品综合在线| 欧美日韩一区二区在线观看视频| 亚洲综合丝袜美腿| 欧美日韩成人综合天天影院| 视频一区在线视频| 欧美在线观看一二区| 精品亚洲porn| 亚洲美女屁股眼交| 91精品在线观看入口| 精品在线亚洲视频| 亚洲欧美综合在线精品| 欧美日韩卡一卡二| 国产伦理精品不卡| 亚洲最大色网站| 欧美另类z0zxhd电影| 激情另类小说区图片区视频区| 国产精品久久三区| 欧美肥妇free| 日本高清视频一区二区| 琪琪一区二区三区| 亚洲人成网站影音先锋播放| 日韩一区二区三| 一本一道综合狠狠老| 国产一区二区三区香蕉| 亚洲高清免费观看 | 亚洲国产精品综合小说图片区| 欧美电影免费观看高清完整版在线| a4yy欧美一区二区三区| 国模少妇一区二区三区| 日本最新不卡在线| 久久久久久久久久美女| 国产精品丝袜一区| 国产亚洲一区二区在线观看| 精品久久久久99| 精品国产百合女同互慰| 日韩一区二区三区在线观看| 欧美精品色一区二区三区| 欧美日韩中文一区| 欧美日本一道本在线视频| 欧美无砖砖区免费| 欧美日韩免费视频| 欧日韩精品视频| 欧美午夜电影网| 日韩视频在线你懂得| 欧美成人福利视频| 久久色在线观看| 国产精品国产三级国产三级人妇| 国产蜜臀av在线一区二区三区| 日本一区二区电影| 亚洲综合另类小说| 婷婷开心久久网| 国产麻豆91精品| 欧美亚洲国产一区二区三区| 色香蕉成人二区免费| 欧美精品一区二区蜜臀亚洲| 欧美美女一区二区在线观看| 1024国产精品| 韩国精品在线观看| 日韩视频一区二区在线观看| 国产日韩欧美亚洲|