Examples of URIData


Examples of org.openxri.mapper.URIMapper.URIData

  {
    if (soLog.isDebugEnabled()) soLog.debug("doGet()");

    // let our URI mapper tell us what we have to look up

    URIData data = moMapper.parseRequest(request);

    // if the URI mapper does not know what to do, hand off the request to the plugin

    if (data == null) {

      if (moPlugin == null) {

        soLog.warn("No plugin installed.");
        response.sendError(HttpServletResponse.SC_BAD_REQUEST);
        return;
      }

      if (soLog.isDebugEnabled()) soLog.debug("Forwarding request to plugin.");

      boolean ret = moPlugin.processCustomRequest(request, response);

      // did the plugin handle the request?

      if (ret == true) {

        return;
      } else {

        soLog.warn("Plugin failed to handle the request.");
        response.sendError(HttpServletResponse.SC_BAD_REQUEST);
        return;
      }
    }

    // TODO: check if we want trusted resolution

    boolean bSigned = false;

    /*      String sAccept = request.getHeader(Tags.HEADER_ACCEPT);

      boolean bSigned =
        (sAccept != null) &&
        (sAccept.startsWith(Tags.CONTENT_TYPE_XRID_TRUSTED));*/

    // look at the input data the URI mapper gave us

    String namespace = data.getNS();
    String authorityId = data.getID();
    String resolveData = data.getResolveData();
    XRISegment segment = null;

    try {

      segment = new XRISegment(resolveData);
View Full Code Here

Examples of org.openxri.server.URIMapper.URIData

    {
        soLog.debug("doGet()");

        try
        {
            URIData oData = moMapper.parseRequest(oReq);

            // if we get no data, hand off processing to the installed plugin
            if (oData == null)
            {
                if (moPlugin != null)
                {
                    moPlugin.processCustomRequest(oReq, oResp);
                }
                else
                {
                    sendNotFound(oResp);
                }
                   
                return;
            }

            // if we are in proxy mode, try to resolve externally
            String sAccept = oReq.getHeader(Tags.HEADER_ACCEPT);
           
            boolean bSigned = false;
            /** TODO determine if content type trust parameter has SAML
            boolean bSigned =
                (sAccept != null) &&
                (sAccept.startsWith(Tags.CONTENT_TYPE_XRID_TRUSTED));
            */
            if (oData.isProxied())
            {
                processProxyRequest(oData.getResolveData(), bSigned, oResp);
            }
            else
            {
                String sID = oData.getID();
                if (sID == null)
                {
                    sID = getAuthorityIDFromNS(oData.getNS());
                }
                processDirectRequest(
                    oData.getResolveData(), sID, bSigned, oResp);
            }
        }
        catch (IOException oEx)
        {
            // log and send a 404
View Full Code Here

Examples of org.openxri.server.URIMapper.URIData

        if ((sQuery == null) || (sQuery.length() == 0))
        {
            return null;
        }

        URIData oRetval = new URIData();

        // Gather the resolve data
        if ((sPath != null) && (sPath.length() > 1) &&
            (sPath.charAt(0) == '/'))
        {
            // Trim the slash
            sPath = sPath.substring(1);
            oRetval.setResolveData(sPath);
        }
        else
        {
            return null;
        }

        // Determine the type of real query we have
        String sLowQuery = sQuery.toLowerCase();
        if (sLowQuery.startsWith("proxy=true"))
        {
            oRetval.setProxied(true);
        }
        else if (sLowQuery.startsWith("ns="))
        {
            oRetval.setNS(sQuery.substring(3));
        }
        else if (sLowQuery.startsWith("id="))
        {
            oRetval.setID(sQuery.substring(3));
        }
        else
        {
            // we have no idea what was being asked at
            // this point
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.