Home | History | Annotate | Download | only in oauth
      1 /*
      2  * Copyright 2008 Google, Inc.
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *     http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 package net.oauth;
     17 
     18 import java.io.IOException;
     19 import java.net.URISyntaxException;
     20 
     21 /**
     22  * An algorithm to determine whether a message has a valid signature, a correct
     23  * version number, a fresh timestamp, etc.
     24  *
     25  * @author Dirk Balfanz
     26  * @author John Kristian
     27  * @hide
     28  */
     29 public interface OAuthValidator {
     30 
     31     /**
     32      * Check that the given message from the given accessor is valid.
     33      * @throws OAuthException TODO
     34      * @throws IOException TODO
     35      * @throws URISyntaxException
     36      * @throws OAuthProblemException the message is invalid.
     37      * The implementation should throw exceptions that conform to the OAuth
     38      * <a href="http://wiki.oauth.net/ProblemReporting">Problem Reporting extension</a>.
     39      */
     40     public void validateMessage(OAuthMessage message, OAuthAccessor accessor)
     41             throws OAuthException, IOException, URISyntaxException;
     42 
     43 }
     44