View Javadoc

1   /*
2    * Copyright (c) 2005-2007 Creative Sphere Limited.
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the Eclipse Public License v1.0
5    * which accompanies this distribution, and is available at
6    * http://www.eclipse.org/legal/epl-v10.html
7    *
8    * Contributors:
9    *
10   *   Creative Sphere - initial API and implementation
11   *
12   */
13  package org.abstracthorizon.danube.http.matcher;
14  
15  import org.abstracthorizon.danube.connection.ConnectionHandler;
16  import org.abstracthorizon.danube.http.HTTPConnection;
17  
18  /**
19   * This interface defines matcher for {@link org.abstracthorizon.danube.http.Selector} class.
20   *
21   * @author Daniel Sendula
22   */
23  public interface Matcher {
24  
25      /**
26       * Returns stored {@link ConnectionHandler}
27       * @return stored {@link ConnectionHandler}
28       */
29      public ConnectionHandler getConnectionHandler();
30  
31      /**
32       * Returns <code>true</code> if no other {@link ConnectionHandler} should be processed after this one
33       * @return <code>true</code> if no other {@link ConnectionHandler} should be processed after this one
34       */
35      public boolean isStopOnMatch();
36  
37      /**
38       * Returns <code>true</code> if uri from connection is matched
39       * @param connection http connection
40       * @return <code>true</code> if uri from connection is matched
41       */
42      public boolean matches(HTTPConnection connection);
43  
44      /**
45       * Adjusts connection for nested connection handler to be invoked
46       * @param connection connection to be a used
47       */
48      public void adjustForInvocation(HTTPConnection connection);
49  }