1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  
19  package org.apache.commons.modeler.demo;
20  
21  
22  /***
23   * <p>Sample managed object for the Modeler Demonstration Application,
24   * based on the Catalina architecture of Tomcat 4.</p>
25   *
26   * @author Craig R. McClanahan
27   * @version $Revision: 480402 $ $Date: 2006-11-29 04:43:23 +0000 (Wed, 29 Nov 2006) $
28   */
29  
30  public class Connector {
31  
32  
33      // ----------------------------------------------------------- Constructors
34  
35  
36      /***
37       * Construct a default instance of this class.
38       */
39      public Connector() {
40  
41          super();
42  
43      }
44  
45  
46      /***
47       * Construct a configured instance of this class.
48       *
49       * @param port Port number
50       * @param scheme Protocol (scheme)
51       * @param secure Secure flag
52       * @param service Associated service
53       * @param container Associated container
54       */
55      public Connector(int port, String scheme, boolean secure,
56                       Service service, Container container) {
57  
58          super();
59          setPort(port);
60          setScheme(scheme);
61          setSecure(secure);
62          setService(service);
63          setContainer(container);
64  
65      }
66  
67  
68      // ----------------------------------------------------- Instance Variables
69  
70  
71      // ------------------------------------------------------------- Properties
72  
73  
74      /***
75       * The Container for this Connector.
76       */
77      private Container container = null;
78  
79      public Container getContainer() {
80          return (this.container);
81      }
82  
83      public void setContainer(Container container) {
84          this.container = container;
85      }
86  
87  
88      /***
89       * The port number of this Connector.
90       */
91      private int port = 8080;
92  
93      public int getPort() {
94          return (this.port);
95      }
96  
97      public void setPort(int port) {
98          this.port = port;
99      }
100 
101 
102     /***
103      * The scheme of this Connector.
104      */
105     private String scheme = "http";
106 
107     public String getScheme() {
108         return (this.scheme);
109     }
110 
111     public void setScheme(String scheme) {
112         this.scheme = scheme;
113     }
114 
115 
116     /***
117      * The secure flag of this Connector.
118      */
119     private boolean secure = false;
120 
121     public boolean getSecure() {
122         return (this.secure);
123     }
124 
125     public void setSecure(boolean secure) {
126         this.secure = secure;
127     }
128 
129 
130     /***
131      * The associated Service of this Connector.
132      */
133     private Service service = null;
134 
135     public Service getService() {
136         return (this.service);
137     }
138 
139     public void setService(Service service) {
140         this.service = service;
141     }
142 
143 
144     /***
145      * Return a String representation of this object.
146      */
147     public String toString() {
148 
149         StringBuffer sb = new StringBuffer("Connector[");
150         sb.append("port=");
151         sb.append(port);
152         sb.append(", scheme=");
153         sb.append(scheme);
154         sb.append(", secure=");
155         sb.append(secure);
156         sb.append("]");
157         return (sb.toString());
158 
159     }
160 
161 
162 }