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 domain for Waffle.
52       */
53      @Override
54      public String getDomain() {
55          return "Waffle-Domain";
56      }
57  
58      /**
59       * Get Logger for Waffle.
60       */
61      @Override
62      public Log getLogger() {
63          return LogFactory.getLog(SimpleContext.class);
64      }
65  
66      /**
67       * Get null Manager for Waffle.
68       */
69      @Override
70      public Manager getManager() {
71          return null;
72      }
73  
74      /**
75       * Get MBean String for Waffle.
76       */
77      @Override
78      public String getMBeanKeyProperties() {
79          return "Waffle-MBeans";
80      }
81  
82      /**
83       * Get Name Used By Waffle.
84       */
85      @Override
86      public String getName() {
87          return this.name;
88      }
89  
90      /**
91       * Get Parent Used By Waffle.
92       */
93      @Override
94      public Container getParent() {
95          return this.parent;
96      }
97  
98      /**
99       * Get Path Used By Waffle.
100      */
101     @Override
102     public String getPath() {
103         return this.path;
104     }
105 
106     /**
107      * Get Pipeline Used By Waffle.
108      */
109     @Override
110     public Pipeline getPipeline() {
111         return this.pipeline;
112     }
113 
114     /**
115      * Get Realm Used By Waffle.
116      */
117     @Override
118     public Realm getRealm() {
119         return this.realm;
120     }
121 
122     /**
123      * Get Servlet Context Used By Waffle.
124      */
125     @Override
126     public ServletContext getServletContext() {
127         return this.servletContext;
128     }
129 
130     /**
131      * Set Authenticator Used By Waffle.
132      * 
133      * @param value
134      */
135     public void setAuthenticator(final Authenticator value) {
136         this.authenticator = value;
137     }
138 
139     /**
140      * Set Name Used By Waffle.
141      */
142     @Override
143     public void setName(final String value) {
144         this.name = value;
145     }
146 
147     /**
148      * Set Parent Used By Waffle.
149      */
150     @Override
151     public void setParent(final Container container) {
152         this.parent = container;
153     }
154 
155     /**
156      * Set Path Used By Waffle.
157      */
158     @Override
159     public void setPath(final String value) {
160         this.path = value;
161     }
162 
163     /**
164      * Set Pipeline Used By Waffle.
165      * 
166      * @param value
167      */
168     public void setPipeline(final Pipeline value) {
169         this.pipeline = value;
170     }
171 
172     /**
173      * Set Realm Used By Waffle.
174      */
175     @Override
176     public void setRealm(final Realm value) {
177         this.realm = value;
178     }
179 
180     /**
181      * Set Servlet Context Used By Waffle.
182      */
183     public void setServletContext(final ServletContext value) {
184         this.servletContext = value;
185     }
186 
187 }