Package org.apache.abdera.protocol.server

Examples of org.apache.abdera.protocol.server.TargetType


        RequestContext context = (RequestContext)request;
        String uri = context.getTargetPath();
        for (Pattern pattern : patterns.keySet()) {
            Matcher matcher = pattern.matcher(uri);
            if (matcher.matches()) {
                TargetType type = this.patterns.get(pattern);
                String[] fields = this.fields.get(pattern);
                return getTarget(type, context, matcher, fields);
            }
        }
        return null;
View Full Code Here


    public String toString() {
        StringBuilder buf = new StringBuilder();
        buf.append("Regex Target Resolver:\n");
        for (Pattern pattern : patterns.keySet()) {
            TargetType type = this.patterns.get(pattern);
            String[] fields = this.fields.get(pattern);
            buf.append(pattern.toString() + ", Type: " + type + ", Fields: " + Arrays.toString(fields));
        }
        return buf.toString();
    }
View Full Code Here

        Target target = request.getTarget();
        if (target == null || target.getType() == TargetType.TYPE_NOT_FOUND) {
            return ProviderHelper.notfound(request);
        }

        TargetType type = target.getType();
        RequestProcessor processor = this.requestProcessors.get(type);
        if (processor == null) {
            return ProviderHelper.notfound(request);
        }
View Full Code Here

            }
            // note: now first matching pattern wins
            for (Pattern pattern : orderedPatterns.keySet()) {
                Matcher matcher = pattern.matcher(uri);
                if (matcher.lookingAt()) {
                    TargetType type = this.orderedPatterns.get(pattern);
                    String[] fields = this.fields.get(pattern);
                    return getTarget(type, context, matcher, fields);
                }
            }
            return null;
View Full Code Here

 
  public RegexTargetResolver(Map<String, TargetType> patterns) {
    this.patterns = new HashMap<Pattern, TargetType>();
    this.fields = new HashMap<Pattern, String[]>();
    for (String p : patterns.keySet()) {
      TargetType type = patterns.get(p);
      setPattern(p,type);
    }
  }
View Full Code Here

    RequestContext context = (RequestContext) request;
    String uri = context.getTargetPath();
    for (Pattern pattern : patterns.keySet()) {
      Matcher matcher = pattern.matcher(uri);
      if (matcher.matches()) {
        TargetType type = this.patterns.get(pattern);
        String[] fields = this.fields.get(pattern);
        return getTarget(type, context, matcher, fields);
      }
    }
    return null;
View Full Code Here

 
  public String toString() {
    StringBuilder buf = new StringBuilder();
    buf.append("Regex Target Resolver:\n");
    for (Pattern pattern : patterns.keySet()) {
      TargetType type = this.patterns.get(pattern);
      String[] fields = this.fields.get(pattern);
      buf.append(pattern.toString() + ", Type: " + type + ", Fields: " + Arrays.toString(fields));
    }
    return buf.toString();
  }
View Full Code Here

  public ResponseContext filter(
    RequestContext request,
    FilterChain chain) {
   
      Target target = request.getTarget();
      TargetType type = target.getType();
      if (type == TYPE_OPENSEARCH_DESCRIPTION) {
        return getOpenSearchDescription(request);
      } else {
        for (Entry<String,String> entry : map.entrySet()) {
          String value = target.getParameter(entry.getKey());
View Full Code Here

      Target target = request.getTarget();
      if (target == null ||
          target.getType() == TargetType.TYPE_NOT_FOUND)
        return ProviderHelper.notfound(request);
      String method = request.getMethod();
      TargetType type = target.getType();
      if (type == TargetType.TYPE_SERVICE &&
          method.equalsIgnoreCase("GET")) {
          return getServiceDocument(request);
      }
      WorkspaceManager wm = getWorkspaceManager(request);
View Full Code Here

  protected IRI resolveBase(RequestContext request) {
    return request.getBaseUri().resolve(request.getUri());
  }

  public ResponseContext request(RequestContext request) {
    TargetType type = request.getTarget().getType();
    String method = request.getMethod();
    log.debug(Messages.format("TARGET.TYPE",type));
    log.debug(Messages.format("TARGET.ID",request.getTarget().getIdentity()));
    log.debug(Messages.format("METHOD",method));
    if (method.equals("GET")) {
View Full Code Here

TOP

Related Classes of org.apache.abdera.protocol.server.TargetType

Copyright © 2018 www.massapicom. 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.