Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 51af19570314a4a82955a22f78f059680d896e49 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
 * Copyright (c) OSGi Alliance (2012, 2015). All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.osgi.service.http.runtime.dto;

import java.util.Map;
import org.osgi.dto.DTO;

/**
 * Represents a {@code javax.servlet.ServletContext} created for servlets,
 * resources, servlet Filters, and listeners associated with that servlet
 * context. The Servlet Context is usually backed by a
 * {@link org.osgi.service.http.context.ServletContextHelper} service.
 * 
 * @NotThreadSafe
 * @author $Id$
 */
public class ServletContextDTO extends DTO {
	/**
	 * The name of the servlet context.
	 * The name of the corresponding
	 * {@link org.osgi.service.http.context.ServletContextHelper}.
	 * <p>
	 * This is the value returned by the
	 * {@code ServletContext.getServletContextName()} method.
	 */
	public String name;

	/**
	 * The servlet context path.
	 * 
	 * This is the value returned by the {@code ServletContext.getContextPath()}
	 * method.
	 */
	public String				contextPath;

	/**
	 * The servlet context initialization parameters. This is the set of
	 * parameters provided when registering this context. Additional parameters
	 * like the Http Service Runtime attributes are not included. If the context
	 * has no initialization parameters, this map is empty.
	 */
	public Map<String, String>	initParams;

	/**
	 * The servlet context attributes.
	 * 
	 * <p>
	 * The value type must be a numerical type, {@code Boolean}, {@code String},
	 * {@code DTO} or an array of any of the former. Therefore this method will
	 * only return the attributes of the servlet context conforming to this
	 * constraint. Other attributes are omitted. If there are no attributes
	 * conforming to the constraint, an empty map is returned.
	 */
	public Map<String, Object>	attributes;

	/**
	 * Service property identifying the servlet context. In the case of a
	 * servlet context backed by a {@code ServletContextHelper} registered in
	 * the service registry and picked up by a Http Whiteboard Implementation,
	 * this value is not negative and corresponds to the service id in the
	 * registry. If the servlet context is not backed by a service registered in
	 * the service registry, the value is negative and a unique negative value
	 * is generated by the Http Service Runtime in this case.
	 */
	public long					serviceId;

	/**
	 * Returns the representations of the {@code Servlet} services associated
	 * with this context.
	 * 
	 * The representations of the {@code Servlet} services associated with this
	 * context. The returned array may be empty if this context is currently not
	 * associated with any {@code Servlet} services.
	 */
	public ServletDTO[]			servletDTOs;

	/**
	 * Returns the representations of the resource services associated with this
	 * context.
	 * 
	 * The representations of the resource services associated with this
	 * context. The returned array may be empty if this context is currently not
	 * associated with any resource services.
	 */
	public ResourceDTO[]		resourceDTOs;

	/**
	 * Returns the representations of the servlet {@code Filter} services
	 * associated with this context.
	 * 
	 * The representations of the servlet {@code Filter} services associated
	 * with this context. The returned array may be empty if this context is
	 * currently not associated with any servlet {@code Filter} services.
	 */
	public FilterDTO[]			filterDTOs;

	/**
	 * Returns the representations of the error page {@code Servlet} services
	 * associated with this context.
	 * 
	 * The representations of the error page {@code Servlet} services associated
	 * with this context. The returned array may be empty if this context is
	 * currently not associated with any error pages.
	 */
	public ErrorPageDTO[]		errorPageDTOs;

	/**
	 * Returns the representations of the listener services associated with this
	 * context.
	 * 
	 * The representations of the listener services associated with this
	 * context. The returned array may be empty if this context is currently not
	 * associated with any listener services.
	 */
	public ListenerDTO[]		listenerDTOs;
}

Back to the top