View Javadoc
1   package ca.uhn.fhir.rest.server.interceptor;
2   
3   /*
4    * #%L
5    * HAPI FHIR - Core Library
6    * %%
7    * Copyright (C) 2014 University Health Network
8    * %%
9    * Licensed under the Apache License, Version 2.0 (the "License");
10   * you may not use this file except in compliance with the License.
11   * You may obtain a copy of the License at
12   * 
13   *      http://www.apache.org/licenses/LICENSE-2.0
14   * 
15   * Unless required by applicable law or agreed to in writing, software
16   * distributed under the License is distributed on an "AS IS" BASIS,
17   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   * See the License for the specific language governing permissions and
19   * limitations under the License.
20   * #L%
21   */
22  
23  import javax.servlet.http.HttpServletRequest;
24  import javax.servlet.http.HttpServletResponse;
25  
26  import ca.uhn.fhir.model.api.Bundle;
27  import ca.uhn.fhir.model.api.IResource;
28  import ca.uhn.fhir.model.api.TagList;
29  import ca.uhn.fhir.rest.method.RequestDetails;
30  import ca.uhn.fhir.rest.server.exceptions.AuthenticationException;
31  
32  /**
33   * Base class for {@link IServerInterceptor} implementations. Provides a No-op implementation
34   * of all methods, always returning <code>true</code> 
35   */
36  public class InterceptorAdapter implements IServerInterceptor {
37  
38  	@Override
39  	public boolean incomingRequestPreProcessed(HttpServletRequest theRequest, HttpServletResponse theResponse) {
40  		return true;
41  	}
42  
43  	@Override
44  	public boolean incomingRequestPostProcessed(RequestDetails theRequestDetails, HttpServletRequest theRequest, HttpServletResponse theResponse) throws AuthenticationException {
45  		return true;
46  	}
47  
48  	@Override
49  	public boolean outgoingResponse(RequestDetails theRequestDetails, TagList theResponseObject, HttpServletRequest theServletRequest, HttpServletResponse theServletResponse) throws AuthenticationException {
50  		return true;
51  	}
52  
53  	@Override
54  	public boolean outgoingResponse(RequestDetails theRequestDetails, Bundle theResponseObject, HttpServletRequest theServletRequest, HttpServletResponse theServletResponse) throws AuthenticationException {
55  		return true;
56  	}
57  
58  	@Override
59  	public boolean outgoingResponse(RequestDetails theRequestDetails, IResource theResponseObject, HttpServletRequest theServletRequest, HttpServletResponse theServletResponse) throws AuthenticationException {
60  		return true;
61  	}
62  
63  	@Override
64  	public boolean outgoingResponse(RequestDetails theRequestDetails, HttpServletRequest theServletRequest, HttpServletResponse theServletResponse) throws AuthenticationException {
65  		return true;
66  	}
67  
68  }