View Javadoc
1   /**
2    * Waffle (https://github.com/dblock/waffle)
3    *
4    * Copyright (c) 2010 - 2015 Application Security, Inc.
5    *
6    * All rights reserved. This program and the accompanying materials
7    * are made available under the terms of the Eclipse Public License v1.0
8    * which accompanies this distribution, and is available at
9    * http://www.eclipse.org/legal/epl-v10.html
10   *
11   * Contributors:
12   *     Application Security, Inc.
13   */
14  package waffle.apache.catalina;
15  
16  import javax.servlet.ServletContext;
17  
18  import org.apache.catalina.Authenticator;
19  import org.apache.catalina.Container;
20  import org.apache.catalina.Context;
21  import org.apache.catalina.Manager;
22  import org.apache.catalina.Pipeline;
23  import org.apache.catalina.Realm;
24  import org.apache.juli.logging.Log;
25  import org.apache.juli.logging.LogFactory;
26  
27  /**
28   * Simple Context.
29   * 
30   * @author dblock[at]dblock[dot]org
31   */
32  public abstract class SimpleContext implements Context {
33  
34      private String         path;
35      private String         name;
36      private Realm          realm;
37      private Container      parent;
38      private ServletContext servletContext;
39      private Pipeline       pipeline;
40      private Authenticator  authenticator;
41  
42      /**
43       * Get Authenticator Used By Waffle.
44       */
45      @Override
46      public Authenticator getAuthenticator() {
47          return this.authenticator;
48      }
49  
50      /**
51       * Get Logger for Waffle.
52       */
53      @Override
54      public Log getLogger() {
55          return LogFactory.getLog(SimpleContext.class);
56      }
57  
58      /**
59       * Get null Manager for Waffle.
60       */
61      @Override
62      public Manager getManager() {
63          return null;
64      }
65  
66      /**
67       * Get Name Used By Waffle.
68       */
69      @Override
70      public String getName() {
71          return this.name;
72      }
73  
74      /**
75       * Get Parent Used By Waffle.
76       */
77      @Override
78      public Container getParent() {
79          return this.parent;
80      }
81  
82      /**
83       * Get Path Used By Waffle.
84       */
85      @Override
86      public String getPath() {
87          return this.path;
88      }
89  
90      /**
91       * Get Pipeline Used By Waffle.
92       */
93      @Override
94      public Pipeline getPipeline() {
95          return this.pipeline;
96      }
97  
98      /**
99       * Get Realm Used By Waffle.
100      */
101     @Override
102     public Realm getRealm() {
103         return this.realm;
104     }
105 
106     /**
107      * Get Servlet Context Used By Waffle.
108      */
109     @Override
110     public ServletContext getServletContext() {
111         return this.servletContext;
112     }
113 
114     /**
115      * Set Authenticator Used By Waffle.
116      * 
117      * @param value
118      */
119     public void setAuthenticator(final Authenticator value) {
120         this.authenticator = value;
121     }
122 
123     /**
124      * Set Name Used By Waffle.
125      */
126     @Override
127     public void setName(final String value) {
128         this.name = value;
129     }
130 
131     /**
132      * Set Parent Used By Waffle.
133      */
134     @Override
135     public void setParent(final Container container) {
136         this.parent = container;
137     }
138 
139     /**
140      * Set Path Used By Waffle.
141      */
142     @Override
143     public void setPath(final String value) {
144         this.path = value;
145     }
146 
147     /**
148      * Set Pipeline Used By Waffle.
149      * 
150      * @param value
151      */
152     public void setPipeline(final Pipeline value) {
153         this.pipeline = value;
154     }
155 
156     /**
157      * Set Realm Used By Waffle.
158      */
159     @Override
160     public void setRealm(final Realm value) {
161         this.realm = value;
162     }
163 
164     /**
165      * Set Servlet Context Used By Waffle.
166      */
167     public void setServletContext(final ServletContext value) {
168         this.servletContext = value;
169     }
170 
171 }