Examples of URIMapperResult


Examples of org.openxri.mapper.URIMapperResult

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

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

    URIMapperResult data = moMapper.parseRequest(new URIMapperRequest(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.getNamespace();
    String authorityId = data.getId();
    String resolveData = data.getResolveData();
    XRISegment segment = null;

    try {

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

Examples of org.openxri.urimapper.URIMapperResult

    if (queryMatcher.groupCount() == 1) {

      resultQuery = queryMatcher.group(1);
    }

    URIMapperResult uriMapperResult = new URIMapperResult(resultNamespace, resultQuery);

    return(uriMapperResult);
  }
View Full Code Here

Examples of org.openxri.urimapper.URIMapperResult

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

    URIMapperResult oRetval = new URIMapperResult();

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

    // Determine the type of real query we have
    String sLowQuery = sQuery.toLowerCase();
    if (sLowQuery.startsWith("namespace="))
    {
      oRetval.setNamespace(sQuery.substring(3));
    }
    else
    {
      // we have no idea what was being asked at
      // this point
View Full Code Here

Examples of org.openxri.urimapper.URIMapperResult

  }

  public URIMapperResult parseRequest(URIMapperRequest request) {

    URIMapperResult uriData = super.parseRequest(request);

    if (uriData != null) uriData.setNamespace(this.namespace)// override the (empty) result from the RegexURIMapper

    return(uriData);
  }
View Full Code Here

Examples of org.openxri.urimapper.URIMapperResult

  }

  public URIMapperResult parseRequest(URIMapperRequest request) {

    return(new URIMapperResult("", ""));
  }
View Full Code Here

Examples of org.openxri.urimapper.URIMapperResult

    if (queryMatcher.groupCount() == 1) {

      resultQuery = queryMatcher.group(1);
    }

    URIMapperResult uriMapperResult = new URIMapperResult(resultNamespace, resultQuery);

    return(uriMapperResult);
  }
View Full Code Here

Examples of org.openxri.urimapper.URIMapperResult

  public final void testParseRequest() {

    URIMapperRequest request = new URIMapperRequest();
    request.setPath("/ns/@free/*markus");

    URIMapperResult result = this.mapper.parseRequest(request);
    assertEquals(result.getNamespace(), "@free");
    assertEquals(result.getQuery(), "*markus");
  }
 
View Full Code Here

Examples of org.openxri.urimapper.URIMapperResult

  public final void testParseRequest() {

    URIMapperRequest request = new URIMapperRequest();
    request.setPath("/ns/*markus");

    URIMapperResult result = this.mapper.parseRequest(request);
    System.out.println(result.getNamespace());
    System.out.println(result.getQuery());
  }
View Full Code Here

Examples of org.openxri.urimapper.URIMapperResult

    XRDS xrds = null;

    // let our URIMapper tell us what to do

    URIMapperResult data = this.uriMapper.parseRequest(new URIMapperRequest(request));

    String namespace = (data == null) ? null : data.getNamespace();
    String query = (data == null) ? null : data.getQuery();

    if (namespace != null && namespace.trim().equals("")) namespace = null;
    if (query != null && query.trim().equals("")) query = null;

    String path = request.getRequestURI().substring(request.getContextPath().length() + 1);
View Full Code Here

Examples of org.openxri.urimapper.URIMapperResult

    protected void onSubmit() {

      URIMapper openXRIURIMapper = ((OpenXRIAdminApplication) Application.get()).getOpenXRIURIMapper();

      URIMapperRequest request;
      URIMapperResult result;

      try {

        request = (URIMapperRequest) this.getModelObject();
        result = openXRIURIMapper.parseRequest(request);
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.