diff --git a/bundles/org.eclipse.osgi.services/.settings/.api_filters b/bundles/org.eclipse.osgi.services/.settings/.api_filters index f26c211b0f4..ca7768c14c5 100644 --- a/bundles/org.eclipse.osgi.services/.settings/.api_filters +++ b/bundles/org.eclipse.osgi.services/.settings/.api_filters @@ -1,44 +1,34 @@ - - + + - - - + + - - + + - - - - - - - - - + + - - + + - - - + + - - + + - - - + + diff --git a/bundles/org.eclipse.osgi.services/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi.services/META-INF/MANIFEST.MF index d241d166b6b..1ff5ac6e9ff 100644 --- a/bundles/org.eclipse.osgi.services/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.osgi.services/META-INF/MANIFEST.MF @@ -2,32 +2,15 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %osgiServices Bundle-SymbolicName: org.eclipse.osgi.services -Bundle-Version: 3.11.300.qualifier +Bundle-Version: 3.12.0.qualifier Bundle-Description: %osgiServicesDes Bundle-Localization: plugin Bundle-Vendor: %eclipse.org Bundle-DocUrl: http://www.eclipse.org Bundle-ContactAddress: www.eclipse.org Export-Package: org.osgi.service.component.annotations;version="1.3", - org.osgi.service.http;version="1.2.1";uses:="javax.servlet,javax.servlet.http", - org.osgi.service.http.context;version="1.1";uses:="org.osgi.framework,javax.servlet.http", - org.osgi.service.http.runtime;version="1.1";uses:="org.osgi.service.http.runtime.dto", - org.osgi.service.http.runtime.dto;version="1.1";uses:="org.osgi.dto,org.osgi.framework.dto", - org.osgi.service.http.whiteboard;version="1.1", org.osgi.service.log;version="1.5";uses:="org.osgi.framework";mandatory:="never.ever.use";never.ever.use="true" -Import-Package: javax.servlet;resolution:=optional, - javax.servlet.http;resolution:=optional, - org.osgi.dto;version="1.0", - org.osgi.framework;version="1.6", - org.osgi.framework.dto;version="1.8.0", - org.osgi.service.http;version="[1.2,1.3)", - org.osgi.service.http.context;version="[1.1,1.2)", - org.osgi.service.http.runtime;version="[1.1,1.2)", - org.osgi.service.http.runtime.dto;version="[1.1,1.2)", - org.osgi.service.http.whiteboard;version="[1.1,1.2)", - org.osgi.service.log;version="[1.5,1.6)" -DynamicImport-Package: javax.servlet, - javax.servlet.http +Import-Package: org.osgi.service.log;version="[1.5,1.6)" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Automatic-Module-Name: org.eclipse.osgi.services Require-Bundle: org.osgi.service.cm;bundle-version="[1.6.0,1.7.0)";visibility:=reexport, @@ -38,4 +21,6 @@ Require-Bundle: org.osgi.service.cm;bundle-version="[1.6.0,1.7.0)";visibility:=r org.osgi.service.provisioning;bundle-version="[1.2.0,1.3.0)";visibility:=reexport, org.osgi.service.upnp;bundle-version="[1.2.0,1.3.0)";visibility:=reexport, org.osgi.service.useradmin;bundle-version="[1.1.0,1.2.0)";visibility:=reexport, - org.osgi.service.wireadmin;bundle-version="[1.0.0,1.1.0)";visibility:=reexport + org.osgi.service.wireadmin;bundle-version="[1.0.0,1.1.0)";visibility:=reexport, + org.osgi.service.http;bundle-version="[1.2.0,2.0.0)";visibility:=reexport, + org.osgi.service.http.whiteboard;bundle-version="[1.1.0,2.0.0)";visibility:=reexport diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/HttpContext.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/HttpContext.java deleted file mode 100644 index 5b4612284fe..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/HttpContext.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2000, 2014). 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; - -import java.io.IOException; -import java.net.URL; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * Context for HTTP Requests. - * - *

- * This service defines methods that the Http Service may call to get - * information for a request. - * - *

- * Servlets may be associated with an {@code HttpContext} service. Servlets that - * are associated using the same {@code HttpContext} object will share the same - * {@code ServletContext} object. - * - *

- * If no {@code HttpContext} service is associated, a default - * {@code HttpContext} is used. The behavior of the methods on the default - * {@code HttpContext} is defined as follows: - *

    - *
  • {@code getMimeType} - Does not define any customized MIME types for the - * {@code Content-Type} header in the response, and always returns {@code null}. - *
  • - *
  • {@code handleSecurity} - Performs implementation-defined authentication - * on the request.
  • - *
  • {@code getResource} - Assumes the named resource is in the bundle of the - * servlet service. This method calls the servlet bundle's - * {@code Bundle.getResource} method, and returns the appropriate URL to access - * the resource. On a Java runtime environment that supports permissions, the - * Http Service needs to be granted - * {@code org.osgi.framework.AdminPermission[*,RESOURCE]}.
  • - *
- * - * - * @author $Id$ - */ -public interface HttpContext { - /** - * {@code HttpServletRequest} attribute specifying the name of the - * authenticated user. The value of the attribute can be retrieved by - * {@code HttpServletRequest.getRemoteUser}. This attribute name is - * {@code org.osgi.service.http.authentication.remote.user}. - * - * @since 1.1 - */ - public static final String REMOTE_USER = "org.osgi.service.http.authentication.remote.user"; - /** - * {@code HttpServletRequest} attribute specifying the scheme used in - * authentication. The value of the attribute can be retrieved by - * {@code HttpServletRequest.getAuthType}. This attribute name is - * {@code org.osgi.service.http.authentication.type}. - * - * @since 1.1 - */ - public static final String AUTHENTICATION_TYPE = "org.osgi.service.http.authentication.type"; - /** - * {@code HttpServletRequest} attribute specifying the {@code Authorization} - * object obtained from the {@code org.osgi.service.useradmin.UserAdmin} - * service. The value of the attribute can be retrieved by - * {@code HttpServletRequest.getAttribute(HttpContext.AUTHORIZATION)}. This - * attribute name is {@code org.osgi.service.useradmin.authorization}. - * - * @since 1.1 - */ - public static final String AUTHORIZATION = "org.osgi.service.useradmin.authorization"; - - /** - * Handles security for the specified request. - * - *

- * The Http Service calls this method prior to servicing the specified - * request. This method controls whether the request is processed in the - * normal manner or an error is returned. - * - *

- * If the request requires authentication and the Authorization header in - * the request is missing or not acceptable, then this method should set the - * WWW-Authenticate header in the response object, set the status in the - * response object to Unauthorized(401) and return {@code false}. See also - * RFC 2617: HTTP Authentication: Basic and Digest Access Authentication - * (available at http://www.ietf.org/rfc/rfc2617.txt). - * - *

- * If the request requires a secure connection and the {@code getScheme} - * method in the request does not return 'https' or some other acceptable - * secure protocol, then this method should set the status in the response - * object to Forbidden(403) and return {@code false}. - * - *

- * When this method returns {@code false}, the Http Service will send the - * response back to the client, thereby completing the request. When this - * method returns {@code true}, the Http Service will proceed with servicing - * the request. - * - *

- * If the specified request has been authenticated, this method must set the - * {@link #AUTHENTICATION_TYPE} request attribute to the type of - * authentication used, and the {@link #REMOTE_USER} request attribute to - * the remote user (request attributes are set using the - * {@code setAttribute} method on the request). If this method does not - * perform any authentication, it must not set these attributes. - * - *

- * If the authenticated user is also authorized to access certain resources, - * this method must set the {@link #AUTHORIZATION} request attribute to the - * {@code Authorization} object obtained from the - * {@code org.osgi.service.useradmin.UserAdmin} service. - * - *

- * The servlet responsible for servicing the specified request determines - * the authentication type and remote user by calling the - * {@code getAuthType} and {@code getRemoteUser} methods, respectively, on - * the request. - * - * @param request The HTTP request. - * @param response The HTTP response. - * @return {@code true} if the request should be serviced, {@code false} if - * the request should not be serviced and Http Service will send the - * response back to the client. - * @throws java.io.IOException may be thrown by this method. If this occurs, - * the Http Service will terminate the request and close the socket. - */ - public boolean handleSecurity(HttpServletRequest request, HttpServletResponse response) throws IOException; - - /** - * Maps a resource name to a URL. - * - *

- * Called by the Http Service to map a resource name to a URL. For servlet - * registrations, Http Service will call this method to support the - * {@code ServletContext} methods {@code getResource} and - * {@code getResourceAsStream}. For resource registrations, Http Service - * will call this method to locate the named resource. The context can - * control from where resources come. For example, the resource can be - * mapped to a file in the bundle's persistent storage area via - * {@code bundleContext.getDataFile(name).toURL()} or to a resource in the - * context's bundle via {@code getClass().getResource(name)} - * - * @param name the name of the requested resource - * @return URL that Http Service can use to read the resource or - * {@code null} if the resource does not exist. - */ - public URL getResource(String name); - - /** - * Maps a name to a MIME type. - * - *

- * Called by the Http Service to determine the MIME type for the specified - * name. For servlets, the Http Service will call this method to support the - * {@code ServletContext} method {@code getMimeType}. For resources, the - * Http Service will call this method to determine the MIME type for the - * {@code Content-Type} header in the response. - * - * @param name The name for which to determine the MIME type. - * @return The MIME type (e.g. text/html) of the specified name or - * {@code null} to indicate that the Http Service should determine - * the MIME type itself. - */ - public String getMimeType(String name); -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/HttpService.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/HttpService.java deleted file mode 100644 index 1ea12b9c46a..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/HttpService.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2000, 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; - -import java.util.Dictionary; -import javax.servlet.Servlet; -import javax.servlet.ServletException; - -/** - * The Http Service allows other bundles in the OSGi environment to dynamically - * register resources and servlets into the URI namespace of Http Service. A - * bundle may later unregister its resources or servlets. - * - * @noimplement - * @author $Id$ - * @see HttpContext - */ -public interface HttpService { - /** - * Registers a servlet into the URI namespace. - * - *

- * The alias is the name in the URI namespace of the Http Service at which - * the registration will be mapped. - * - *

- * An alias must begin with slash ('/') and must not end with slash ('/'), - * with the exception that an alias of the form "/" is used to - * denote the root alias. See the specification text for details on how HTTP - * requests are mapped to servlet and resource registrations. - * - *

- * The Http Service will call the servlet's {@code init} method before - * returning. - * - *

-	 * httpService.registerServlet("/myservlet", servlet, initparams, context);
-	 * 
- * - *

- * Servlets registered with the same {@code HttpContext} object will share - * the same {@code ServletContext}. The Http Service will call the - * {@code context} argument to support the {@code ServletContext} methods - * {@code getResource},{@code getResourceAsStream} and {@code getMimeType}, - * and to handle security for requests. If the {@code context} argument is - * {@code null}, a default {@code HttpContext} object is used (see - * {@link #createDefaultHttpContext()}). - * - * @param alias name in the URI namespace at which the servlet is registered - * @param servlet the servlet object to register - * @param initparams initialization arguments for the servlet or - * {@code null} if there are none. This argument is used by the - * servlet's {@code ServletConfig} object. - * @param context the {@code HttpContext} object for the registered servlet, - * or {@code null} if a default {@code HttpContext} is to be created - * and used. - * @throws NamespaceException if the registration fails because the alias is - * already in use. - * @throws javax.servlet.ServletException if the servlet's {@code init} - * method throws an exception, or the given servlet object has - * already been registered at a different alias. - * @throws java.lang.IllegalArgumentException if any of the arguments are - * invalid - */ - public void registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context) throws ServletException, NamespaceException; - - /** - * Registers resources into the URI namespace. - * - *

- * The alias is the name in the URI namespace of the Http Service at which - * the registration will be mapped. An alias must begin with slash ('/') and - * must not end with slash ('/'), with the exception that an alias of the - * form "/" is used to denote the root alias. The name parameter - * must also not end with slash ('/') with the exception that a name of the - * form "/" is used to denote the root of the bundle. See the - * specification text for details on how HTTP requests are mapped to servlet - * and resource registrations. - *

- * For example, suppose the resource name /tmp is registered to the alias - * /files. A request for /files/foo.txt will map to the resource name - * /tmp/foo.txt. - * - *

-	 * httpservice.registerResources("/files", "/tmp", context);
-	 * 
- * - * The Http Service will call the {@code HttpContext} argument to map - * resource names to URLs and MIME types and to handle security for - * requests. If the {@code HttpContext} argument is {@code null}, a default - * {@code HttpContext} is used (see {@link #createDefaultHttpContext()}). - * - * @param alias name in the URI namespace at which the resources are - * registered - * @param name the base name of the resources that will be registered - * @param context the {@code HttpContext} object for the registered - * resources, or {@code null} if a default {@code HttpContext} is to - * be created and used. - * @throws NamespaceException if the registration fails because the alias is - * already in use. - * @throws java.lang.IllegalArgumentException if any of the parameters are - * invalid - */ - public void registerResources(String alias, String name, HttpContext context) throws NamespaceException; - - /** - * Unregisters a previous registration done by {@code registerServlet} or - * {@code registerResources} methods. - * - *

- * After this call, the registered alias in the URI name-space will no - * longer be available. If the registration was for a servlet, the Http - * Service must call the {@code destroy} method of the servlet before - * returning. - *

- * If the bundle which performed the registration is stopped or otherwise - * "unget"s the Http Service without calling {@link #unregister(String)} - * then Http Service must automatically unregister the registration. - * However, if the registration was for a servlet, the {@code destroy} - * method of the servlet will not be called in this case since the bundle - * may be stopped. {@link #unregister(String)} must be explicitly called to - * cause the {@code destroy} method of the servlet to be called. This can be - * done in the {@code BundleActivator.stop} method of the bundle registering - * the servlet. - * - * @param alias name in the URI name-space of the registration to unregister - * @throws java.lang.IllegalArgumentException if there is no registration - * for the alias or the calling bundle was not the bundle which - * registered the alias. - */ - public void unregister(String alias); - - /** - * Creates a default {@code HttpContext} for registering servlets or - * resources with the HttpService, a new {@code HttpContext} object is - * created each time this method is called. - * - *

- * The behavior of the methods on the default {@code HttpContext} is defined - * as follows: - *

    - *
  • {@code getMimeType} - Does not define any customized MIME types for - * the Content-Type header in the response, and always returns {@code null}. - *
  • - *
  • {@code handleSecurity} - Performs implementation-defined - * authentication on the request.
  • - *
  • {@code getResource} - Assumes the named resource is in the context - * bundle; this method calls the context bundle's {@code Bundle.getResource} - * method, and returns the appropriate URL to access the resource. On a Java - * runtime environment that supports permissions, the Http Service needs to - * be granted {@code org.osgi.framework.AdminPermission[*,RESOURCE]}.
  • - *
- * - * @return a default {@code HttpContext} object. - * @since 1.1 - */ - public HttpContext createDefaultHttpContext(); -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/NamespaceException.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/NamespaceException.java deleted file mode 100644 index d44893b0931..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/NamespaceException.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2000, 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; - -/** - * A NamespaceException is thrown to indicate an error with the caller's request - * to register a servlet or resources into the URI namespace of the Http - * Service. This exception indicates that the requested alias already is in use. - * - * @author $Id$ - */ -public class NamespaceException extends Exception { - static final long serialVersionUID = 7235606031147877747L; - - /** - * Construct a {@code NamespaceException} object with a detail message. - * - * @param message the detail message - */ - public NamespaceException(String message) { - super(message); - } - - /** - * Construct a {@code NamespaceException} object with a detail message and a - * nested exception. - * - * @param message The detail message. - * @param cause The nested exception. - */ - public NamespaceException(String message, Throwable cause) { - super(message, cause); - } - - /** - * Returns the nested exception. - * - *

- * This method predates the general purpose exception chaining mechanism. - * The {@code getCause()} method is now the preferred means of obtaining - * this information. - * - * @return The result of calling {@code getCause()}. - */ - public Throwable getException() { - return getCause(); - } - - /** - * Returns the cause of this exception or {@code null} if no cause was set. - * - * @return The cause of this exception or {@code null} if no cause was set. - * @since 1.2 - */ - @Override - public Throwable getCause() { - return super.getCause(); - } - - /** - * Initializes the cause of this exception to the specified value. - * - * @param cause The cause of this exception. - * @return This exception. - * @throws IllegalArgumentException If the specified cause is this - * exception. - * @throws IllegalStateException If the cause of this exception has already - * been set. - * @since 1.2 - */ - @Override - public Throwable initCause(Throwable cause) { - return super.initCause(cause); - } -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/ServletContextHelper.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/ServletContextHelper.java deleted file mode 100644 index e266f16edfd..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/ServletContextHelper.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2000, 2021). 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.context; - -import java.io.IOException; -import java.net.URL; -import java.util.Enumeration; -import java.util.LinkedHashSet; -import java.util.Set; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.osgi.annotation.versioning.ConsumerType; -import org.osgi.framework.Bundle; -import org.osgi.service.http.whiteboard.HttpWhiteboardConstants; - -/** - * Helper service for a servlet context used by a Http Whiteboard implementation - * to serve HTTP requests. - * - *

- * This service defines methods that the Http Whiteboard implementation may call - * to get information for a request when dealing with whiteboard services. - * - *

- * Each {@code ServletContextHelper} is registered with a - * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_NAME - * "osgi.http.whiteboard.context.name"} service property containing a name to - * reference by servlets, servlet filters, resources, and listeners. If there is - * more than one {@code ServletContextHelper} registered with the same context - * name, the one with the highest service ranking is active, the others are - * inactive. - * - *

- * A context is registered with the - * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_PATH - * "osgi.http.whiteboard.context.path"} service property to define a path under - * which all services registered with this context are reachable. If there is - * more than one {@code ServletContextHelper} registered with the same path, - * each duplicate context path is searched by service ranking order according to - * {@link org.osgi.framework.ServiceReference#compareTo(Object)} until a - * matching servlet or resource is found. - * - *

- * Servlets, servlet filters, resources, and listeners services may be - * associated with a {@code ServletContextHelper} service with the - * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_SELECT - * "osgi.http.whiteboard.context.select"} service property. If the referenced - * {@code ServletContextHelper} service does not exist or is currently not - * active, the whiteboard services for that {@code ServletContextHelper} are not - * active either. - * - *

- * If no {@code ServletContextHelper} service is associated, that is no - * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_SELECT - * "osgi.http.whiteboard.context.select"} service property is configured for a - * whiteboard service, a default {@code ServletContextHelper} is used. - * - *

- * Those whiteboard services that are associated with the same - * {@code ServletContextHelper} object will share the same - * {@code ServletContext} object. - * - *

- * The behavior of the methods on the default {@code ServletContextHelper} is - * defined as follows: - *

    - *
  • {@link #getMimeType(String) getMimeType} - Always returns {@code null}.
  • - *
  • {@link #handleSecurity(HttpServletRequest, HttpServletResponse) - * handleSecurity} - Always returns {@code true}.
  • - *
  • {@link #getResource(String) getResource} - Assumes the named resource is - * in the bundle of the whiteboard service, addressed from the root. This method - * calls the whiteboard service bundle's {@code Bundle.getEntry} method, and - * returns the appropriate URL to access the resource. On a Java runtime - * environment that supports permissions, the Http Whiteboard implementation - * needs to be granted {@code org.osgi.framework.AdminPermission[*,RESOURCE]}.
  • - *
  • {@link #getResourcePaths(String) getResourcePaths} - Assumes that the - * resources are in the bundle of the whiteboard service. This method calls - * {@code Bundle.findEntries} method, and returns the found entries. On a Java - * runtime environment that supports permissions, the Http Whiteboard - * implementation needs to be granted - * {@code org.osgi.framework.AdminPermission[*,RESOURCE]}.
  • - *
  • {@link #getRealPath(String) getRealPath} - Always returns {@code null}.
  • - *
- * - * @ThreadSafe - * @author $Id$ - * @see HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_NAME - * @see HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_PATH - */ -@ConsumerType -public abstract class ServletContextHelper { - /** - * {@code HttpServletRequest} attribute specifying the name of the - * authenticated user. The value of the attribute can be retrieved by - * {@code HttpServletRequest.getRemoteUser}. - */ - public static final String REMOTE_USER = "org.osgi.service.http.authentication.remote.user"; - /** - * {@code HttpServletRequest} attribute specifying the scheme used in - * authentication. The value of the attribute can be retrieved by - * {@code HttpServletRequest.getAuthType}. - */ - public static final String AUTHENTICATION_TYPE = "org.osgi.service.http.authentication.type"; - /** - * {@code HttpServletRequest} attribute specifying the {@code Authorization} - * object obtained from the {@code org.osgi.service.useradmin.UserAdmin} - * service. The value of the attribute can be retrieved by - * {@code HttpServletRequest.getAttribute(ServletContextHelper.AUTHORIZATION)} - * . - */ - public static final String AUTHORIZATION = "org.osgi.service.useradmin.authorization"; - - /** Bundle associated with this context. */ - private final Bundle bundle; - - /** - * Construct a new context helper. - * - *

- * If needed, the subclass will have to handle the association with a - * specific bundle. - */ - public ServletContextHelper() { - this(null); - } - - /** - * Construct a new context helper associated with the specified bundle. - * - * @param bundle The bundle to be associated with this context helper. - */ - public ServletContextHelper(final Bundle bundle) { - this.bundle = bundle; - } - - /** - * Handles security for the specified request. - *

- * The Http Whiteboard implementation calls this method prior to servicing - * the specified request. This method controls whether the request is - * processed in the normal manner or an error is returned. - *

- * If the request requires authentication and the {@code Authorization} - * header in the request is missing or not acceptable, then this method - * should set the {@code WWW-Authenticate} header in the response object, - * set the status in the response object to Unauthorized(401) and return - * {@code false}. See also RFC - * 2617: HTTP Authentication: Basic and Digest Access Authentication. - *

- * If the request requires a secure connection and the {@code getScheme} - * method in the request does not return 'https' or some other acceptable - * secure protocol, then this method should set the status in the response - * object to Forbidden(403) and return {@code false}. - *

- * When this method returns {@code false}, the Http Whiteboard - * implementation will send the response back to the client, thereby - * completing the request. When this method returns {@code true}, the Http - * Whiteboard implementation will proceed with servicing the request. - *

- * If the specified request has been authenticated, this method must set the - * {@link #AUTHENTICATION_TYPE} request attribute to the type of - * authentication used, and the {@link #REMOTE_USER} request attribute to - * the remote user (request attributes are set using the - * {@code setAttribute} method on the request). If this method does not - * perform any authentication, it must not set these attributes. - *

- * If the authenticated user is also authorized to access certain resources, - * this method must set the {@link #AUTHORIZATION} request attribute to the - * {@code Authorization} object obtained from the - * {@code org.osgi.service.useradmin.UserAdmin} service. - *

- * The servlet responsible for servicing the specified request determines - * the authentication type and remote user by calling the - * {@code getAuthType} and {@code getRemoteUser} methods, respectively, on - * the request. - *

- * If there is the need to clean up resources at the end of the request, the - * method {@link #finishSecurity(HttpServletRequest, HttpServletResponse)} - * can be implemented. That method is only called if this method returns {@code true}. - * - * @param request The HTTP request. - * @param response The HTTP response. - * @return {@code true} if the request should be serviced, {@code false} if - * the request should not be serviced and Http Whiteboard - * implementation will send the response back to the client. - * @throws java.io.IOException May be thrown by this method. If this occurs, - * the Http Whiteboard implementation will terminate the request - * and close the socket. - * @see #finishSecurity(HttpServletRequest, HttpServletResponse) - */ - public boolean handleSecurity(final HttpServletRequest request, - final HttpServletResponse response) - throws IOException { - return true; - } - - /** - * Finishes the security context for the specified request. - *

- * Implementations of this service can implement this method to clean up - * resources which have been setup in - * {@link #handleSecurity(HttpServletRequest, HttpServletResponse)}. - *

- * This method is only called if - * {@link #handleSecurity(HttpServletRequest, HttpServletResponse)} returned - * {@code true} for the specified request. This method is called once the - * pipeline finishes processing or if an exception is thrown from within the - * pipeline execution. - *

- * The default implementation of this method does nothing. - * - * @param request The HTTP request. - * @param response The HTTP response. - * @since 1.1 - * @see #handleSecurity(HttpServletRequest, HttpServletResponse) - */ - public void finishSecurity(final HttpServletRequest request, - final HttpServletResponse response) { - // do nothing - } - - /** - * Maps a resource name to a URL. - *

- * Called by the Http Whiteboard implementation to map the specified - * resource name to a URL. For servlets, the Http Whiteboard implementation - * will call this method to support the {@code ServletContext} methods - * {@code getResource} and {@code getResourceAsStream}. For resources, the - * Http Whiteboard implementation will call this method to locate the named - * resource. - *

- * The context can control from where resources come. For example, the - * resource can be mapped to a file in the bundle's persistent storage area - * via {@code BundleContext.getDataFile(name).toURI().toURL()} or to a - * resource in the context's bundle via {@code getClass().getResource(name)} - * - * @param name The name of the requested resource. - * @return A URL that a Http Whiteboard implementation can use to read the - * resource or {@code null} if the resource does not exist. - */ - public URL getResource(String name) { - if ((name != null) && (bundle != null)) { - if (name.startsWith("/")) { - name = name.substring(1); - } - - return bundle.getEntry(name); - } - return null; - } - - /** - * Maps a name to a MIME type. - * - *

- * Called by the Http Whiteboard implementation to determine the MIME type - * for the specified name. For whiteboard services, the Http Whiteboard - * implementation will call this method to support the - * {@code ServletContext} method {@code getMimeType}. For resource servlets, - * the Http Whiteboard implementation will call this method to determine the - * MIME type for the {@code Content-Type} header in the response. - * - * @param name The name for which to determine the MIME type. - * @return The MIME type (e.g. text/html) of the specified name or - * {@code null} to indicate that the Http Whiteboard implementation - * should determine the MIME type itself. - */ - public String getMimeType(final String name) { - return null; - } - - /** - * Returns a directory-like listing of all the paths to resources within the - * web application whose longest sub-path matches the supplied path - * argument. - * - *

- * Called by the Http Whiteboard implementation to support the - * {@code ServletContext} method {@code getResourcePaths} for whiteboard - * services. - * - * @param path The partial path used to match the resources, which must - * start with a /. - * @return A Set containing the directory listing, or {@code null} if there - * are no resources in the web application whose path begins with - * the supplied path. - */ - public Set getResourcePaths(final String path) { - if ((path != null) && (bundle != null)) { - final Enumeration e = bundle.findEntries(path, null, false); - if (e != null) { - final Set result = new LinkedHashSet<>(); - while (e.hasMoreElements()) { - result.add(e.nextElement().getPath()); - } - return result; - } - } - return null; - } - - /** - * Gets the real path corresponding to the given virtual path. - * - *

- * Called by the Http Whiteboard implementation to support the - * {@code ServletContext} method {@code getRealPath} for whiteboard - * services. - * - * @param path The virtual path to be translated to a real path. - * @return The real path, or {@code null} if the translation cannot be - * performed. - */ - public String getRealPath(final String path) { - return null; - } -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/package-info.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/package-info.java deleted file mode 100644 index bc4d39ce01e..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/package-info.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2010, 2018). 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. - */ - -/** - * Http Whiteboard Context Package Version 1.1. - *

- * Bundles wishing to use this package must list the package in the - * Import-Package header of the bundle's manifest. This package has two types of - * users: the consumers that use the API in this package and the providers that - * implement the API in this package. - *

- * Example import for consumers using the API in this package: - *

- * {@code Import-Package: org.osgi.service.http.context; version="[1.1,2.0)"} - *

- * Example import for providers implementing the API in this package: - *

- * {@code Import-Package: org.osgi.service.http.context; version="[1.1,1.2)"} - * - * @author $Id$ - */ - -@Version(HTTP_WHITEBOARD_SPECIFICATION_VERSION) -package org.osgi.service.http.context; - -import static org.osgi.service.http.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_SPECIFICATION_VERSION; - -import org.osgi.annotation.versioning.Version; - diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/package-info.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/package-info.java deleted file mode 100644 index caee1296bd5..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/package-info.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2010, 2016). 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. - */ - -/** - * Http Service Package Version 1.2. - * - *

- * Bundles wishing to use this package must list the package in the - * Import-Package header of the bundle's manifest. This package has two types of - * users: the consumers that use the API in this package and the providers that - * implement the API in this package. - * - *

- * Example import for consumers using the API in this package: - *

- * {@code Import-Package: org.osgi.service.http; version="[1.2,2.0)"} - *

- * Example import for providers implementing the API in this package: - *

- * {@code Import-Package: org.osgi.service.http; version="[1.2,1.3)"} - * - * @author $Id$ - */ - -@Version("1.2.1") -package org.osgi.service.http; - -import org.osgi.annotation.versioning.Version; diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/HttpServiceRuntime.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/HttpServiceRuntime.java deleted file mode 100644 index 03eec1eb1d0..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/HttpServiceRuntime.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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; - -import org.osgi.annotation.versioning.ProviderType; -import org.osgi.service.http.runtime.dto.RequestInfoDTO; -import org.osgi.service.http.runtime.dto.RuntimeDTO; - -/** - * The HttpServiceRuntime service represents the runtime information of an Http - * Whiteboard implementation. - * - *

- * It provides access to DTOs representing the current state of the service. - *

- * The HttpServiceRuntime service must be registered with the - * {@link HttpServiceRuntimeConstants#HTTP_SERVICE_ENDPOINT} service - * property. - * - * @ThreadSafe - * @author $Id$ - */ -@ProviderType -public interface HttpServiceRuntime { - - /** - * Return the runtime DTO representing the current state. - * - * @return The runtime DTO. - */ - public RuntimeDTO getRuntimeDTO(); - - /** - * Return a request info DTO containing the services involved with - * processing a request for the specified path. - * - * @param path The request path, relative to the root of the Http Whiteboard - * implementation. - * @return The request info DTO for the specified path. - */ - public RequestInfoDTO calculateRequestInfoDTO(String path); -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/HttpServiceRuntimeConstants.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/HttpServiceRuntimeConstants.java deleted file mode 100644 index f51ac2e998b..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/HttpServiceRuntimeConstants.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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; - -/** - * Defines standard names for Http Runtime Service constants. - * - * @author $Id$ - */ -public final class HttpServiceRuntimeConstants { - private HttpServiceRuntimeConstants() { - // non-instantiable - } - - /** - * Http Runtime Service service property specifying the endpoints upon which - * the Http Whiteboard implementation is listening. - * - *

- * An endpoint value is a URL or a relative path, to which the Http - * Whiteboard implementation is listening. For example, - * {@code http://192.168.1.10:8080/} or {@code /myapp/}. A relative path may - * be used if the scheme and authority parts of the URL are not known, e.g. - * in a bridged Http Whiteboard implementation. If the Http Whiteboard - * implementation is serving the root context and neither scheme nor - * authority is known, the value of the property is "/". Both, a URL and a - * relative path, must end with a slash. - *

- * An Http Whiteboard implementation can be listening on multiple endpoints. - * - *

- * The value of this service property must be of type {@code String}, - * {@code String[]}, or {@code Collection}. - */ - public static final String HTTP_SERVICE_ENDPOINT = "osgi.http.endpoint"; - - /** - * Http Runtime Service service property to associate the Http Runtime - * Service with one or more HttpService services. - * - *

- * If this Http Whiteboard implementation also implements the Http Service - * Specification, this service property is set to a collection of - * {@code service.id} for the {@code HttpService} services registered by - * this implementation. - * - *

- * The value of this service property must be of type - * {@code Collection}. - */ - public static final String HTTP_SERVICE_ID = "osgi.http.service.id"; -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/BaseServletDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/BaseServletDTO.java deleted file mode 100644 index 9f8c24a2288..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/BaseServletDTO.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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 common information about a {@code javax.servlet.Servlet} service. - * - * @NotThreadSafe - * @author $Id$ - */ -public abstract class BaseServletDTO extends DTO { - /** - * The name of the servlet. This value is never {@code null}, unless this - * object represents a {@code FailedServletDTO} or a - * {@code FailedErrorPageDTO} where the value might be {@code null}. - */ - public String name; - - /** - * The information string from the servlet. - *

- * This is the value returned by the {@code Servlet.getServletInfo()} - * method. For a {@code FailedServletDTO} or a {@code FailedErrorPageDTO} - * this is always {@code null}. - */ - public String servletInfo; - - /** - * Specifies whether the servlet supports asynchronous processing. - */ - public boolean asyncSupported; - - /** - * The servlet initialization parameters as provided during registration of - * the servlet. Additional parameters like the Http Service Runtime - * attributes are not included. If the service has no initialization - * parameters, the map is empty. - */ - public Map initParams; - - /** - * The service id of the servlet context for the servlet represented by this - * DTO. - */ - public long servletContextId; - - /** - * Service property identifying the servlet. In the case of a servlet - * 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 has not been 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; -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/DTOConstants.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/DTOConstants.java deleted file mode 100644 index 95b617655d4..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/DTOConstants.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2018). 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; - -/** - * Defines standard constants for the DTOs. - */ -public final class DTOConstants { - private DTOConstants() { - // non-instantiable - } - - /** - * Failure reason is unknown. - */ - public static final int FAILURE_REASON_UNKNOWN = 0; - - /** - * No matching {@code ServletContextHelper}. - **/ - public static final int FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING = 1; - - /** - * Matching {@code ServletContextHelper}, but the context is not used due to - * a problem with the context. - */ - public static final int FAILURE_REASON_SERVLET_CONTEXT_FAILURE = 2; - - /** - * Service is shadowed by another service. - *

- * For example, a service with the same service properties but a higher - * service ranking. - */ - public static final int FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE = 3; - - /** - * An exception occurred during initializing of the service. - *

- * This reason can only happen for servlets and servlet filters. - */ - public static final int FAILURE_REASON_EXCEPTION_ON_INIT = 4; - - /** - * The service is registered in the service registry but getting the service - * fails as it returns {@code null}. - */ - public static final int FAILURE_REASON_SERVICE_NOT_GETTABLE = 5; - - /** - * The service is registered in the service registry but the service - * properties are invalid. - */ - public static final int FAILURE_REASON_VALIDATION_FAILED = 6; - - /** - * The service is not registered as a prototype scoped service and is - * already in use with a servlet context and therefore can't be used with - * another servlet context. - */ - public static final int FAILURE_REASON_SERVICE_IN_USE = 7; - - /** - * The servlet is not registered as it is configured to have multipart - * enabled, but the bundle containing the servlet has no write permission to - * the provided location for the uploaded files. - * - * @since 1.1 - */ - public static final int FAILURE_REASON_SERVLET_WRITE_TO_LOCATION_DENIED = 8; - - /** - * The servlet is not registered as it is configured to have multipart - * enabled, but the whiteboard implementation has no write permission to the - * default location for the uploaded files. - * - * @since 1.1 - */ - public static final int FAILURE_REASON_WHITEBOARD_WRITE_TO_DEFAULT_DENIED = 9; - - /** - * The servlet is not registered as it is configured to have multipart - * enabled, but the bundle containing the servlet has no read permission to - * the default location for the uploaded files. - * - * @since 1.1 - */ - public static final int FAILURE_REASON_SERVLET_READ_FROM_DEFAULT_DENIED = 10; - - /** - * The servlet is not registered as it is configured to have multipart - * enabled, but the whiteboard implementation has no write permission to the - * provided location for the uploaded files. - * - * @since 1.1 - */ - public static final int FAILURE_REASON_WHITEBOARD_WRITE_TO_LOCATION_DENIED = 11; -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/ErrorPageDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/ErrorPageDTO.java deleted file mode 100644 index 19baaa9c3b3..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/ErrorPageDTO.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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; - -/** - * Represents a {@code javax.servlet.Servlet} for handling errors and currently - * being used by a servlet context. - * - * @NotThreadSafe - * @author $Id$ - */ -public class ErrorPageDTO extends BaseServletDTO { - /** - * The exceptions the error page is used for. This array might be - * empty. - */ - public String[] exceptions; - - /** - * The error codes the error page is used for. This array might be - * empty. - */ - public long[] errorCodes; -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedErrorPageDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedErrorPageDTO.java deleted file mode 100644 index f959f856d16..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedErrorPageDTO.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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; - -/** - * Represents a {@code javax.servlet.Servlet} service registered as an error - * page but currently not being used by a servlet context due to a problem. - *

- * As the servlet represented by this DTO is not used due to a failure, the - * field {@link FailedErrorPageDTO#servletContextId} always returns {@code 0} - * and does not point to an existing {@code ServletContextHelper}. - * - * @NotThreadSafe - * @author $Id$ - */ -public class FailedErrorPageDTO extends ErrorPageDTO { - - /** - * The reason why the servlet represented by this DTO is not used. - * - * @see DTOConstants#FAILURE_REASON_UNKNOWN - * @see DTOConstants#FAILURE_REASON_EXCEPTION_ON_INIT - * @see DTOConstants#FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING - * @see DTOConstants#FAILURE_REASON_SERVICE_NOT_GETTABLE - * @see DTOConstants#FAILURE_REASON_SERVLET_CONTEXT_FAILURE - * @see DTOConstants#FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE - */ - public int failureReason; - -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedFilterDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedFilterDTO.java deleted file mode 100644 index a38fad38ccd..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedFilterDTO.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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; - -/** - * Represents a servlet {@code Filter} service which is currently not being used - * by a servlet context due to a problem. - *

- * As the service represented by this DTO is not used due to a failure, the - * field {@link FailedFilterDTO#servletContextId} always returns {@code 0} and - * does not point to an existing servlet context. - * - * @NotThreadSafe - * @author $Id$ - */ -public class FailedFilterDTO extends FilterDTO { - - /** - * The reason why the servlet filter represented by this DTO is not used. - * - * @see DTOConstants#FAILURE_REASON_UNKNOWN - * @see DTOConstants#FAILURE_REASON_EXCEPTION_ON_INIT - * @see DTOConstants#FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING - * @see DTOConstants#FAILURE_REASON_SERVICE_NOT_GETTABLE - * @see DTOConstants#FAILURE_REASON_SERVLET_CONTEXT_FAILURE - * @see DTOConstants#FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE - */ - public int failureReason; - -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedListenerDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedListenerDTO.java deleted file mode 100644 index 04f808b177d..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedListenerDTO.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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; - -/** - * Represents a listener service which is currently not being used by a servlet - * context due to a problem. - *

- * As the listener represented by this DTO is not used due to a failure, the - * field {@link FailedErrorPageDTO#servletContextId} always returns {@code 0} - * and does not point to an existing servlet context. - * - * @NotThreadSafe - * @author $Id$ - */ -public class FailedListenerDTO extends ListenerDTO { - - /** - * The reason why the listener represented by this DTO is not used. - * - * @see DTOConstants#FAILURE_REASON_UNKNOWN - * @see DTOConstants#FAILURE_REASON_EXCEPTION_ON_INIT - * @see DTOConstants#FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING - * @see DTOConstants#FAILURE_REASON_SERVICE_NOT_GETTABLE - * @see DTOConstants#FAILURE_REASON_SERVLET_CONTEXT_FAILURE - * @see DTOConstants#FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE - */ - public int failureReason; - -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedPreprocessorDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedPreprocessorDTO.java deleted file mode 100644 index 7b446a1a99c..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedPreprocessorDTO.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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; - -/** - * Represents a preprocessor service which is currently not being used due to a - * problem. - * - * @NotThreadSafe - * @author $Id$ - * @since 1.1 - */ -public class FailedPreprocessorDTO extends PreprocessorDTO { - - /** - * The reason why the preprocessor represented by this DTO is not used. - * - * @see DTOConstants#FAILURE_REASON_UNKNOWN - * @see DTOConstants#FAILURE_REASON_EXCEPTION_ON_INIT - * @see DTOConstants#FAILURE_REASON_SERVICE_NOT_GETTABLE - */ - public int failureReason; - -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedResourceDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedResourceDTO.java deleted file mode 100644 index b5cee8abba1..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedResourceDTO.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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; - -/** - * Represents a resource definition which is currently not being used by a - * servlet context due to a problem. - *

- * As the resource represented by this DTO is not used due to a failure, the - * field {@link FailedResourceDTO#servletContextId} always returns {@code 0} and - * does not point to an existing servlet context. - * - * @NotThreadSafe - * @author $Id$ - */ -public class FailedResourceDTO extends ResourceDTO { - - /** - * The reason why the resource represented by this DTO is not used. - * - * @see DTOConstants#FAILURE_REASON_UNKNOWN - * @see DTOConstants#FAILURE_REASON_EXCEPTION_ON_INIT - * @see DTOConstants#FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING - * @see DTOConstants#FAILURE_REASON_SERVICE_NOT_GETTABLE - * @see DTOConstants#FAILURE_REASON_SERVLET_CONTEXT_FAILURE - * @see DTOConstants#FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE - */ - public int failureReason; - -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedServletContextDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedServletContextDTO.java deleted file mode 100644 index 9ca911b0398..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedServletContextDTO.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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; - -/** - * Represents a servlet context that is currently not used due to some problem. - * - * The following fields return an empty array for a - * {@code FailedServletContextDTO}: - *

    - *
  • {@link ServletContextDTO#servletDTOs}
  • - *
  • {@link ServletContextDTO#resourceDTOs}
  • - *
  • {@link ServletContextDTO#filterDTOs}
  • - *
  • {@link ServletContextDTO#errorPageDTOs}
  • - *
  • {@link ServletContextDTO#listenerDTOs}
  • - *
- *

- * The method {@link ServletContextDTO#attributes} returns an empty map for a - * {@code FailedServletContextDTO}. - * - * @NotThreadSafe - * @author $Id$ - */ -public class FailedServletContextDTO extends ServletContextDTO { - - /** - * The reason why the servlet context represented by this DTO is not used. - * - * @see DTOConstants#FAILURE_REASON_UNKNOWN - * @see DTOConstants#FAILURE_REASON_EXCEPTION_ON_INIT - * @see DTOConstants#FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING - * @see DTOConstants#FAILURE_REASON_SERVICE_NOT_GETTABLE - * @see DTOConstants#FAILURE_REASON_SERVLET_CONTEXT_FAILURE - * @see DTOConstants#FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE - */ - public int failureReason; -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedServletDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedServletDTO.java deleted file mode 100644 index 266814196ac..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FailedServletDTO.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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; - -/** - * Represents a {@code javax.servlet.Servlet} service which is currently not - * being used by a servlet context due to a problem. - *

- * As the servlet represented by this DTO is not used due to a failure, the - * field {@link FailedServletDTO#servletContextId} always returns {@code 0} and - * does not point to an existing servlet context. - * - * @NotThreadSafe - * @author $Id$ - */ -public class FailedServletDTO extends ServletDTO { - - /** - * The reason why the servlet represented by this DTO is not used. - * - * @see DTOConstants#FAILURE_REASON_UNKNOWN - * @see DTOConstants#FAILURE_REASON_EXCEPTION_ON_INIT - * @see DTOConstants#FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING - * @see DTOConstants#FAILURE_REASON_SERVICE_NOT_GETTABLE - * @see DTOConstants#FAILURE_REASON_SERVLET_CONTEXT_FAILURE - * @see DTOConstants#FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE - * @see DTOConstants#FAILURE_REASON_SERVLET_WRITE_TO_LOCATION_DENIED - * @see DTOConstants#FAILURE_REASON_WHITEBOARD_WRITE_TO_DEFAULT_DENIED - * @see DTOConstants#FAILURE_REASON_SERVLET_READ_FROM_DEFAULT_DENIED - */ - public int failureReason; -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FilterDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FilterDTO.java deleted file mode 100644 index ea523e82505..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/FilterDTO.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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 servlet {@code javax.servlet.Filter} service currently being - * used for by a servlet context. - * - * @NotThreadSafe - * @author $Id$ - */ -public class FilterDTO extends DTO { - /** - * The name of the servlet filter. This field is never {@code null}. - */ - public String name; - - /** - * The request mappings for the servlet filter. - * - *

- * The specified patterns are used to determine whether a request is mapped - * to the servlet filter. This array might be empty. - */ - public String[] patterns; - - /** - * The servlet names for the servlet filter. - * - *

- * The specified names are used to determine the servlets whose requests are - * mapped to the servlet filter. This array might be empty. - */ - public String[] servletNames; - - /** - * The request mappings for the servlet filter. - * - *

- * The specified regular expressions are used to determine whether a request - * is mapped to the servlet filter. This array might be empty. - */ - public String[] regexs; - - /** - * Specifies whether the servlet filter supports asynchronous processing. - */ - public boolean asyncSupported; - - /** - * The dispatcher associations for the servlet filter. - * - *

- * The specified names are used to determine in what occasions the servlet - * filter is called. This array is never {@code null}. - */ - public String[] dispatcher; - - /** - * The servlet filter initialization parameters as provided during - * registration of the servlet filter. Additional parameters like the Http - * Service Runtime attributes are not included. If the servlet filter has - * not initialization parameters, this map is empty. - */ - public Map initParams; - - /** - * Service property identifying the servlet filter. In the case of a servlet - * filter 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 filter has not been - * 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; - - /** - * The service id of the servlet context for the servlet filter represented - * by this DTO. - */ - public long servletContextId; -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/ListenerDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/ListenerDTO.java deleted file mode 100644 index f1404f1699f..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/ListenerDTO.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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 org.osgi.dto.DTO; - -/** - * Represents a listener currently being used by a servlet context. - * - * @NotThreadSafe - * @author $Id$ - */ -public class ListenerDTO extends DTO { - - /** - * The fully qualified type names the listener. This array is never empty. - */ - public String[] types; - - /** - * Service property identifying the listener. In the case of a Listener - * 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 listener has not been 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; - - /** - * The service id of the servlet context for the listener represented by - * this DTO. - */ - public long servletContextId; -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/PreprocessorDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/PreprocessorDTO.java deleted file mode 100644 index be078563a26..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/PreprocessorDTO.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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 preprocessor - * {@code org.osgi.service.http.whiteboard.Preprocessor} service currently being - * used during request processing. - * - * @NotThreadSafe - * @author $Id$ - * @since 1.1 - */ -public class PreprocessorDTO extends DTO { - - /** - * The preprocessor initialization parameters as provided during - * registration of the preprocessor. Additional parameters like the Http - * Service Runtime attributes are not included. If the preprocessor has not - * initialization parameters, this map is empty. - */ - public Map initParams; - - /** - * Service property identifying the preprocessor. In the case of a - * preprocessor 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 preprocessor has not been - * 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; -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/RequestInfoDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/RequestInfoDTO.java deleted file mode 100644 index 42929c0cfe4..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/RequestInfoDTO.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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 org.osgi.dto.DTO; - -/** - * Represents the services used to process a specific request. - * - * @NotThreadSafe - * @author $Id$ - */ -public class RequestInfoDTO extends DTO { - /** - * The path of the request relative to the root. - */ - public String path; - - /** - * The service id of the servlet context processing the request represented - * by this DTO. - */ - public long servletContextId; - - /** - * The servlet filters processing this request. If no servlet filters are - * called for processing this request, an empty array is returned. - */ - public FilterDTO[] filterDTOs; - - /** - * The servlet processing this request. If the request is processed by a - * servlet, this field points to the DTO of the servlet. If the request is - * processed by another type of component like a resource, this field is - * {@code null}. - */ - public ServletDTO servletDTO; - - /** - * The resource processing this request. If the request is processed by a - * resource, this field points to the DTO of the resource. If the request is - * processed by another type of component like a servlet, this field is - * {@code null}. - */ - public ResourceDTO resourceDTO; -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/ResourceDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/ResourceDTO.java deleted file mode 100644 index a960291f15f..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/ResourceDTO.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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 org.osgi.dto.DTO; - -/** - * Represents a resource definition currently being used by a servlet context. - * - * @NotThreadSafe - * @author $Id$ - */ -public class ResourceDTO extends DTO { - /** - * The request mappings for the resource. - * - *

- * The specified patterns are used to determine whether a request is mapped - * to the resource. This value is never {@code null}. - */ - public String[] patterns; - - /** - * The prefix of the resource. - */ - public String prefix; - - /** - * Service property identifying the resource. In the case of a resource - * 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 resource has not been 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; - - /** - * The service id of the servlet context for the resource represented by - * this DTO. - */ - public long servletContextId; -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/RuntimeDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/RuntimeDTO.java deleted file mode 100644 index 574f7ccda90..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/RuntimeDTO.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2018). 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 org.osgi.dto.DTO; -import org.osgi.framework.dto.ServiceReferenceDTO; - -/** - * Represents the state of a Http Service Runtime. - * - * @NotThreadSafe - * @author $Id$ - */ -public class RuntimeDTO extends DTO { - - /** - * The DTO for the corresponding - * {@code org.osgi.service.http.runtime.HttpServiceRuntime}. This value is - * never {@code null}. - */ - public ServiceReferenceDTO serviceDTO; - - /** - * Returns the representations of the - * {@code org.osgi.service.http.whiteboard.Preprocessor} objects used by the - * Http Service Runtime. The returned array may be empty if the Http Service - * Runtime is currently not using any - * {@code org.osgi.service.http.whiteboard.Preprocessor} objects. - * - * @since 1.1 - */ - public PreprocessorDTO[] preprocessorDTOs; - - /** - * Returns the representations of the {@code javax.servlet.ServletContext} - * objects used by the Http Service Runtime. The returned array may be empty - * if the Http Service Runtime is currently not using any - * {@code javax.servlet.ServletContext} objects. - */ - public ServletContextDTO[] servletContextDTOs; - - /** - * Returns the representations of the {@code javax.servlet.ServletContext} - * objects currently not used by the Http service runtime due to some - * problem. The returned array may be empty. - */ - public FailedServletContextDTO[] failedServletContextDTOs; - - /** - * Returns the representations of the {@code javax.servlet.Servlet} services - * associated with this runtime but currently not used due to some problem. - * The returned array may be empty. - */ - public FailedServletDTO[] failedServletDTOs; - - /** - * Returns the representations of the resources associated with this runtime - * but currently not used due to some problem. The returned array may be - * empty. - */ - public FailedResourceDTO[] failedResourceDTOs; - - /** - * Returns the representations of the servlet - * {@code org.osgi.service.http.whiteboard.Preprocessor} services associated - * with this runtime but currently not used due to some problem. The - * returned array may be empty. - * - * @since 1.1 - */ - public FailedPreprocessorDTO[] failedPreprocessorDTOs; - - /** - * Returns the representations of the {@code javax.servlet.Filter} services - * associated with this runtime but currently not used due to some problem. - * The returned array may be empty. - */ - public FailedFilterDTO[] failedFilterDTOs; - - /** - * Returns the representations of the error page - * {@code javax.servlet.Servlet} services associated with this runtime but - * currently not used due to some problem. The returned array may be empty. - */ - public FailedErrorPageDTO[] failedErrorPageDTOs; - - /** - * Returns the representations of the listeners associated with this runtime - * but currently not used due to some problem. The returned array may be - * empty. - */ - public FailedListenerDTO[] failedListenerDTOs; -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/ServletContextDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/ServletContextDTO.java deleted file mode 100644 index 63044e1c820..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/ServletContextDTO.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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}. - *

- * 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 initParams; - - /** - * The servlet context attributes. - * - *

- * 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 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; -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/ServletDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/ServletDTO.java deleted file mode 100644 index 5c7720dbf46..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/ServletDTO.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2017). 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; - - -/** - * Represents a {@code javax.servlet.Servlet} currently being used by a servlet - * context. - * - * @NotThreadSafe - * @author $Id$ - */ -public class ServletDTO extends BaseServletDTO { - /** - * The request mappings for the servlet. - *

- * The specified patterns are used to determine whether a request is mapped - * to the servlet. This array is never {@code null}. It might be empty for - * named servlets. - */ - public String[] patterns; - - /** - * Specifies whether multipart support is enabled. - * @since 1.1 - */ - public boolean multipartEnabled; - - /** - * Specifies the size threshold after which the file will be written to - * disk. If multipart is not enabled for this servlet, {@code 0} is - * returned. - * - * @since 1.1 - * @see #multipartEnabled - */ - public int multipartFileSizeThreshold; - - /** - * Specifies the location where the files can be stored on disk. If - * multipart is not enabled for this servlet, {@code null} is returned. - * - * @since 1.1 - * @see #multipartEnabled - */ - public String multipartLocation; - - /** - * Specifies the maximum size of a file being uploaded. If multipart is not - * enabled for this servlet, {@code 0} is returned. - * - * @since 1.1 - * @see #multipartEnabled - */ - public long multipartMaxFileSize; - - /** - * Specifies the maximum request size. If multipart is not enabled for this - * servlet, {@code 0} is returned. - * - * @since 1.1 - * @see #multipartEnabled - */ - public long multipartMaxRequestSize; -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/package-info.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/package-info.java deleted file mode 100644 index 9912367df41..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/package-info.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2010, 2018). 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. - */ - -/** - * Http Runtime DTO Package Version 1.1. - *

- * Bundles wishing to use this package must list the package in the - * Import-Package header of the bundle's manifest. This package has two types of - * users: the consumers that use the API in this package and the providers that - * implement the API in this package. - *

- * Example import for consumers using the API in this package: - *

- * {@code Import-Package: org.osgi.service.http.runtime.dto; version="[1.1,2.0)"} - *

- * Example import for providers implementing the API in this package: - *

- * {@code Import-Package: org.osgi.service.http.runtime.dto; version="[1.1,1.2)"} - * - * @author $Id$ - */ - -@Version(HTTP_WHITEBOARD_SPECIFICATION_VERSION) -package org.osgi.service.http.runtime.dto; - -import static org.osgi.service.http.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_SPECIFICATION_VERSION; - -import org.osgi.annotation.versioning.Version; - diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/package-info.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/package-info.java deleted file mode 100644 index 821fe04a751..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/package-info.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2010, 2018). 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. - */ - -/** - * Http Runtime Package Version 1.1. - *

- * Bundles wishing to use this package must list the package in the - * Import-Package header of the bundle's manifest. This package has two types of - * users: the consumers that use the API in this package and the providers that - * implement the API in this package. - *

- * Example import for consumers using the API in this package: - *

- * {@code Import-Package: org.osgi.service.http.runtime; version="[1.1,2.0)"} - *

- * Example import for providers implementing the API in this package: - *

- * {@code Import-Package: org.osgi.service.http.runtime; version="[1.1,1.2)"} - * - * @author $Id$ - */ - -@Version(HTTP_WHITEBOARD_SPECIFICATION_VERSION) -package org.osgi.service.http.runtime; - -import static org.osgi.service.http.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_SPECIFICATION_VERSION; - -import org.osgi.annotation.versioning.Version; - diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/HttpWhiteboardConstants.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/HttpWhiteboardConstants.java deleted file mode 100644 index 4beb4316fd9..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/HttpWhiteboardConstants.java +++ /dev/null @@ -1,594 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2012, 2018). 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.whiteboard; - -import javax.servlet.Servlet; - -import org.osgi.framework.Filter; -import org.osgi.service.http.context.ServletContextHelper; -import org.osgi.service.http.runtime.HttpServiceRuntimeConstants; - -/** - * Defines standard constants for the Http Whiteboard services. - * - * @author $Id$ - */ -public final class HttpWhiteboardConstants { - private HttpWhiteboardConstants() { - // non-instantiable - } - - /** - * Service property specifying the name of an {@link ServletContextHelper} - * service. - * - *

- * For {@link ServletContextHelper} services, this service property must be - * specified. Context services without this service property are ignored. - * - *

- * Servlet, listener, servlet filter, and resource services might refer to a - * specific {@link ServletContextHelper} service referencing the name with - * the {@link #HTTP_WHITEBOARD_CONTEXT_SELECT} property. - * - *

- * For {@link ServletContextHelper} services, the value of this service - * property must be of type {@code String}. The value must follow the - * "symbolic-name" specification from Section 1.3.2 of the OSGi Core - * Specification. - * - * @see #HTTP_WHITEBOARD_CONTEXT_PATH - * @see #HTTP_WHITEBOARD_CONTEXT_SELECT - * @see #HTTP_WHITEBOARD_DEFAULT_CONTEXT_NAME - */ - public static final String HTTP_WHITEBOARD_CONTEXT_NAME = "osgi.http.whiteboard.context.name"; - - /** - * The name of the default {@link ServletContextHelper}. If a service is - * registered with this property, it is overriding the default context with - * a custom provided context. - * - * @see #HTTP_WHITEBOARD_CONTEXT_NAME - */ - public static final String HTTP_WHITEBOARD_DEFAULT_CONTEXT_NAME = "default"; - - /** - * Service property specifying the path of an {@link ServletContextHelper} - * service. - * - *

- * For {@link ServletContextHelper} services this service property is - * required. Context services without this service property are ignored. - * - *

- * This property defines a context path under which all whiteboard services - * associated with this context are registered. Having different contexts - * with different paths allows to separate the URL space. - * - *

- * For {@link ServletContextHelper} services, the value of this service - * property must be of type {@code String}. The value is either a slash for - * the root or it must start with a slash but not end with a slash. Valid - * characters are defined in rfc3986#section-3.3. Contexts with an invalid - * path are ignored. - * - * @see #HTTP_WHITEBOARD_CONTEXT_NAME - * @see #HTTP_WHITEBOARD_CONTEXT_SELECT - */ - public static final String HTTP_WHITEBOARD_CONTEXT_PATH = "osgi.http.whiteboard.context.path"; - - /** - * Service property prefix referencing a {@link ServletContextHelper} - * service. - * - *

- * For {@link ServletContextHelper} services this prefix can be used for - * service properties to mark them as initialization parameters which can be - * retrieved from the associated servlet context. The prefix is removed from - * the service property name to build the initialization parameter name. - * - *

- * For {@link ServletContextHelper} services, the value of each - * initialization parameter service property must be of type {@code String}. - */ - public static final String HTTP_WHITEBOARD_CONTEXT_INIT_PARAM_PREFIX = "context.init."; - - /** - * Service property referencing a {@link ServletContextHelper} service. - * - *

- * For servlet, listener, servlet filter, or resource services, this service - * property refers to the associated {@code ServletContextHelper} service. - * The value of this property is a filter expression which is matched - * against the service registration properties of the - * {@code ServletContextHelper} service. If this service property is not - * specified, the default context is used. If there is no context service - * matching, the servlet, listener, servlet filter, or resource service is - * ignored. - *

- * For example, if a whiteboard service wants to select a servlet context - * helper with the name "Admin" the expression would be - * "(osgi.http.whiteboard.context.name=Admin)". Selecting all - * contexts could be done with - * "(osgi.http.whiteboard.context.name=*)". - *

- * For servlet, listener, servlet filter, or resource services, the value of - * this service property must be of type {@code String}. - * - * @see #HTTP_WHITEBOARD_CONTEXT_NAME - * @see #HTTP_WHITEBOARD_CONTEXT_PATH - */ - public static final String HTTP_WHITEBOARD_CONTEXT_SELECT = "osgi.http.whiteboard.context.select"; - - /** - * Service property specifying the servlet name of a {@code Servlet} - * service. - *

- * The servlet is registered with this name and the name can be used as a - * reference to the servlet for filtering or request dispatching. - *

- * This name is in addition used as the value for the - * {@code ServletConfig.getServletName()} method. If this service property - * is not specified, the fully qualified name of the service object's class - * is used as the servlet name. Filter services may refer to servlets by - * this name in their {@link #HTTP_WHITEBOARD_FILTER_SERVLET} service - * property to apply the filter to the servlet. - *

- * Servlet names should be unique among all servlet services associated with - * a single {@link ServletContextHelper}. - *

- * The value of this service property must be of type {@code String}. - */ - public static final String HTTP_WHITEBOARD_SERVLET_NAME = "osgi.http.whiteboard.servlet.name"; - - /** - * Service property specifying the request mappings for a {@code Servlet} - * service. - *

- * The specified patterns are used to determine whether a request should be - * mapped to the servlet. Servlet services without this service property, - * {@link #HTTP_WHITEBOARD_SERVLET_ERROR_PAGE} or - * {@link #HTTP_WHITEBOARD_SERVLET_NAME} are ignored. - *

- * The value of this service property must be of type {@code String}, - * {@code String[]}, or {@code Collection}. - * - * @see "Java Servlet Specification Version 3.0, Section 12.2 Specification of Mappings" - */ - public static final String HTTP_WHITEBOARD_SERVLET_PATTERN = "osgi.http.whiteboard.servlet.pattern"; - - /** - * Service property specifying whether a {@code Servlet} service acts as an - * error page. - * - *

- * The service property values may be the name of a fully qualified - * exception class, a three digit HTTP status code, the value "4xx" for all - * error codes in the 400 range, or the value "5xx" for all error codes in - * the 500 range. Any value that is not a three digit number, or one of the - * two special values is considered to be the name of a fully qualified - * exception class. - * - *

- * The value of this service property must be of type {@code String}, - * {@code String[]}, or {@code Collection}. - */ - public static final String HTTP_WHITEBOARD_SERVLET_ERROR_PAGE = "osgi.http.whiteboard.servlet.errorPage"; - - /** - * Service property specifying whether a {@code Servlet} service supports - * asynchronous processing. - * - *

- * By default servlet services do not support asynchronous processing. - * - *

- * The value of this service property must be of type {@code Boolean}. - * - * @see "Java Servlet Specification Version 3.0, Section 2.3.3.3 Asynchronous Processing" - */ - public static final String HTTP_WHITEBOARD_SERVLET_ASYNC_SUPPORTED = "osgi.http.whiteboard.servlet.asyncSupported"; - - /** - * Service property prefix referencing a {@link Servlet} service. - * - *

- * For {@link Servlet} services this prefix can be used for service - * properties to mark them as initialization parameters which can be - * retrieved from the associated servlet config. The prefix is removed from - * the service property name to build the initialization parameter name. - * - *

- * For {@link Servlet} services, the value of each initialization parameter - * service property must be of type {@code String}. - */ - public static final String HTTP_WHITEBOARD_SERVLET_INIT_PARAM_PREFIX = "servlet.init."; - - /** - * Service property specifying whether a {@code Servlet} service has enabled - * multipart request processing. - *

- * By default servlet services do not have multipart request processing - * enabled. - *

- * The value of this service property must be of type {@code Boolean}. - * - * @see "Java Servlet Specification Version 3.0, Section 8.1.5 @MultipartConfig" - * @since 1.1 - */ - public static final String HTTP_WHITEBOARD_SERVLET_MULTIPART_ENABLED = "osgi.http.whiteboard.servlet.multipart.enabled"; - - /** - * Service property specifying the size threshold after which the file will - * be written to disk. - *

- * When not set or when the value is not valid, the default threshold is - * determined by the implementation. This property is only evaluated if - * {@link #HTTP_WHITEBOARD_SERVLET_MULTIPART_ENABLED} is set to {@code true} - * . - *

- * The value of this service property must be of type {@code Integer}. - * - * @see "Java Servlet Specification Version 3.0, Section 14.4 Deployment Descriptor Diagram" - * @since 1.1 - */ - public static final String HTTP_WHITEBOARD_SERVLET_MULTIPART_FILESIZETHRESHOLD = "osgi.http.whiteboard.servlet.multipart.fileSizeThreshold"; - - /** - * Service property specifying the location where the files can be stored on - * disk. - *

- * When not set the default location is defined by the value of the system - * property "java.io.tmpdir". This property is only evaluated if - * {@link #HTTP_WHITEBOARD_SERVLET_MULTIPART_ENABLED} is set to {@code true} - * . - *

- * The value of this service property must be of type {@code String}. - * - * @see "Java Servlet Specification Version 3.0, Section 14.4 Deployment Descriptor Diagram" - * @since 1.1 - */ - public static final String HTTP_WHITEBOARD_SERVLET_MULTIPART_LOCATION = "osgi.http.whiteboard.servlet.multipart.location"; - - /** - * Service property specifying the maximum size of a file being uploaded. - *

- * When not set or when the value is not valid, the default maximum size is - * [@code -1} (no maximum size). This property is only evaluated if - * {@link #HTTP_WHITEBOARD_SERVLET_MULTIPART_ENABLED} is set to {@code true} - * . - *

- * The value of this service property must be of type {@code Long}. - * - * @see "Java Servlet Specification Version 3.0, Section 14.4 Deployment Descriptor Diagram" - * @since 1.1 - */ - public static final String HTTP_WHITEBOARD_SERVLET_MULTIPART_MAXFILESIZE = "osgi.http.whiteboard.servlet.multipart.maxFileSize"; - - /** - * Service property specifying the maximum request size. - *

- * When not set or when the value is not valid, the default maximum request - * size is {@code -1} (no maximum size). This property is only evaluated if - * {@link #HTTP_WHITEBOARD_SERVLET_MULTIPART_ENABLED} is set to {@code true} - * . - *

- * The value of this service property must be of type {@code Long}. - * - * @see "Java Servlet Specification Version 3.0, Section 14.4 Deployment Descriptor Diagram" - * @since 1.1 - */ - public static final String HTTP_WHITEBOARD_SERVLET_MULTIPART_MAXREQUESTSIZE = "osgi.http.whiteboard.servlet.multipart.maxRequestSize"; - - /** - * Service property specifying the servlet filter name of a {@code Filter} - * service. - * - *

- * This name is used as the value for the - * {@code FilterConfig.getFilterName()} method. If this service property is - * not specified, the fully qualified name of the service object's class is - * used as the servlet filter name. - * - *

- * Servlet filter names should be unique among all servlet filter services - * associated with a single {@link ServletContextHelper}. - * - *

- * The value of this service property must be of type {@code String}. - */ - public static final String HTTP_WHITEBOARD_FILTER_NAME = "osgi.http.whiteboard.filter.name"; - - /** - * Service property specifying the request mappings for a {@code Filter} - * service. - * - *

- * The specified patterns are used to determine whether a request should be - * mapped to the servlet filter. Filter services without this service - * property or the {@link #HTTP_WHITEBOARD_FILTER_SERVLET} or the - * {@link #HTTP_WHITEBOARD_FILTER_REGEX} service property are ignored. - * - *

- * The value of this service property must be of type {@code String}, - * {@code String[]}, or {@code Collection}. - * - * @see "Java Servlet Specification Version 3.0, Section 12.2 Specification of Mappings" - */ - public static final String HTTP_WHITEBOARD_FILTER_PATTERN = "osgi.http.whiteboard.filter.pattern"; - - /** - * Service property specifying the {@link #HTTP_WHITEBOARD_SERVLET_NAME - * servlet names} for a servlet {@code Filter} service. - * - *

- * The specified names are used to determine the servlets whose requests - * should be mapped to the servlet filter. Servlet filter services without - * this service property or the {@link #HTTP_WHITEBOARD_FILTER_PATTERN} or - * the {@link #HTTP_WHITEBOARD_FILTER_REGEX} service property are ignored. - * - *

- * The value of this service property must be of type {@code String}, - * {@code String[]}, or {@code Collection}. - */ - public static final String HTTP_WHITEBOARD_FILTER_SERVLET = "osgi.http.whiteboard.filter.servlet"; - - /** - * Service property specifying the request mappings for a servlet - * {@code Filter} service. - * - *

- * The specified regular expressions are used to determine whether a request - * should be mapped to the servlet filter. The regular expressions must - * follow the syntax defined in {@code java.util.regex.Pattern}. Servlet - * filter services without this service property or the - * {@link #HTTP_WHITEBOARD_FILTER_SERVLET} or the - * {@link #HTTP_WHITEBOARD_FILTER_PATTERN} service property are ignored. - * - *

- * The value of this service property must be of type {@code String}, - * {@code String[]}, or {@code Collection}. - * - * @see "java.util.regex.Pattern" - */ - public static final String HTTP_WHITEBOARD_FILTER_REGEX = "osgi.http.whiteboard.filter.regex"; - - /** - * Service property specifying whether a servlet {@code Filter} service - * supports asynchronous processing. - * - *

- * By default servlet filters services do not support asynchronous - * processing. - * - *

- * The value of this service property must be of type {@code Boolean}. - * - * @see "Java Servlet Specification Version 3.0, Section 2.3.3.3 Asynchronous Processing" - */ - public static final String HTTP_WHITEBOARD_FILTER_ASYNC_SUPPORTED = "osgi.http.whiteboard.filter.asyncSupported"; - - /** - * Service property specifying the dispatcher handling of a servlet - * {@code Filter}. - * - *

- * By default servlet filter services are associated with client requests - * only (see value {@link #DISPATCHER_REQUEST}). - * - *

- * The value of this service property must be of type {@code String}, - * {@code String[]}, or {@code Collection}. Allowed values are - * {@link #DISPATCHER_ASYNC}, {@link #DISPATCHER_ERROR}, - * {@link #DISPATCHER_FORWARD}, {@link #DISPATCHER_INCLUDE}, - * {@link #DISPATCHER_REQUEST}. - * - * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher" - */ - public static final String HTTP_WHITEBOARD_FILTER_DISPATCHER = "osgi.http.whiteboard.filter.dispatcher"; - - /** - * Service property prefix referencing a {@link Filter} service. - * - *

- * For {@link Filter} services this prefix can be used for service - * properties to mark them as initialization parameters which can be - * retrieved from the associated filter config. The prefix is removed from - * the service property name to build the initialization parameter name. - * - *

- * For {@link Filter} services, the value of each initialization parameter - * service property must be of type {@code String}. - */ - public static final String HTTP_WHITEBOARD_FILTER_INIT_PARAM_PREFIX = "filter.init."; - - /** - * Service property prefix referencing a {@link Preprocessor} service. - *

- * For {@link Preprocessor} services this prefix can be used for service - * properties to mark them as initialization parameters which can be - * retrieved from the associated filter configuration. The prefix is removed - * from the service property name to build the initialization parameter - * name. - *

- * For {@link Preprocessor} services, the value of each initialization - * parameter service property must be of type {@code String}. - * - * @since 1.1 - */ - public static final String HTTP_WHITEBOARD_PREPROCESSOR_INIT_PARAM_PREFIX = "preprocessor.init."; - - /** - * Service property to mark a Listener service as a Whiteboard service. - * Listener services with this property set to the string value "true" will - * be treated as Whiteboard services opting in to being handled by the Http - * Whiteboard implementation. If the value "false" is specified, the service - * is opting out and this case is treated exactly the same as if this - * property is missing. If an invalid value is specified this is treated as - * a failure. - *

- * The value of this service property must be of type {@code String}. Valid - * values are "true" and "false" ignoring case. - */ - public static final String HTTP_WHITEBOARD_LISTENER = "osgi.http.whiteboard.listener"; - - /** - * Possible value for the {@link #HTTP_WHITEBOARD_FILTER_DISPATCHER} - * property indicating the servlet filter is applied to client requests. - * - * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher" - */ - public static final String DISPATCHER_REQUEST = "REQUEST"; - - /** - * Possible value for the {@link #HTTP_WHITEBOARD_FILTER_DISPATCHER} - * property indicating the servlet filter is applied to include calls to the - * dispatcher. - * - * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher" - */ - public static final String DISPATCHER_INCLUDE = "INCLUDE"; - - /** - * Possible value for the {@link #HTTP_WHITEBOARD_FILTER_DISPATCHER} - * property indicating the servlet filter is applied to forward calls to the - * dispatcher. - * - * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher" - */ - public static final String DISPATCHER_FORWARD = "FORWARD"; - - /** - * Possible value for the {@link #HTTP_WHITEBOARD_FILTER_DISPATCHER} - * property indicating the servlet filter is applied in the asynchronous - * context. - * - * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher" - */ - public static final String DISPATCHER_ASYNC = "ASYNC"; - - /** - * Possible value for the {@link #HTTP_WHITEBOARD_FILTER_DISPATCHER} - * property indicating the servlet filter is applied when an error page is - * called. - * - * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher" - */ - public static final String DISPATCHER_ERROR = "ERROR"; - - /** - * Service property specifying the request mappings for resources. - * - *

- * The specified patterns are used to determine whether a request should be - * mapped to resources. Resource services without this service property are - * ignored. - * - *

- * The value of this service property must be of type {@code String}, - * {@code String[]}, or {@code Collection}. - * - * @see "Java Servlet Specification Version 3.0, Section 12.2 Specification of Mappings" - * @see #HTTP_WHITEBOARD_RESOURCE_PREFIX - */ - public static final String HTTP_WHITEBOARD_RESOURCE_PATTERN = "osgi.http.whiteboard.resource.pattern"; - - /** - * Service property specifying the resource entry prefix for a resource - * service. - * - *

- * If a resource service is registered with this property, requests are - * served with bundle resources. - * - *

- * This prefix is used to map a requested resource to the bundle's entries. - * The value must not end with slash ("/") with the exception that - * a name of the form "/" is used to denote the root of the - * bundle. See the specification text for details on how HTTP requests are - * mapped. - * - *

- * The value of this service property must be of type {@code String}. - * - * @see #HTTP_WHITEBOARD_RESOURCE_PATTERN - */ - public static final String HTTP_WHITEBOARD_RESOURCE_PREFIX = "osgi.http.whiteboard.resource.prefix"; - - /** - * Service property specifying the target filter to select the Http - * Whiteboard implementation to process the service. - * - *

- * An Http Whiteboard implementation can define any number of service - * properties which can be referenced by the target filter. The service - * properties should always include the - * {@link HttpServiceRuntimeConstants#HTTP_SERVICE_ENDPOINT - * osgi.http.endpoint} service property if the endpoint information is - * known. - * - *

- * If this service property is not specified, then all Http Whiteboard - * implementations can process the service. - * - *

- * The value of this service property must be of type {@code String} and be - * a valid {@link Filter filter string}. - */ - public static final String HTTP_WHITEBOARD_TARGET = "osgi.http.whiteboard.target"; - - /** - * If a servlet filter, error page or listener wants to be registered with - * the Http Context(s) managed by the Http Service, they can select the - * contexts having this property. - *

- * Servlets or resources registered using this property are treated as an - * invalid registration. - * - * @see #HTTP_SERVICE_CONTEXT_FILTER - * @since 1.1 - */ - public static final String HTTP_SERVICE_CONTEXT_PROPERTY = "osgi.http.whiteboard.context.httpservice"; - - /** - * If a servlet filter, error page or listener wants to be registered with - * the Http Context(s) managed by the Http Service, they can select the - * contexts having the {@link #HTTP_SERVICE_CONTEXT_PROPERTY} property using - * this filter. - * - * @see #HTTP_SERVICE_CONTEXT_PROPERTY - * @since 1.1 - */ - public static final String HTTP_SERVICE_CONTEXT_FILTER = "(" - + HTTP_SERVICE_CONTEXT_PROPERTY + "=*)"; - - /** - * The name of the implementation capability for the Http Whiteboard - * specification - * - * @since 1.1 - */ - public static final String HTTP_WHITEBOARD_IMPLEMENTATION = "osgi.http"; - - /** - * The version of the implementation capability for the Http Whiteboard - * specification - * - * @since 1.1 - */ - public static final String HTTP_WHITEBOARD_SPECIFICATION_VERSION = "1.1.0"; -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/Preprocessor.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/Preprocessor.java deleted file mode 100644 index 2f2430d5a25..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/Preprocessor.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2017). 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.whiteboard; - -import javax.servlet.Filter; - -import org.osgi.annotation.versioning.ConsumerType; - -/** - * Services registered as a {@code Preprocessor} using a whiteboard pattern are - * executed for every request before the dispatching is performed. - *

- * If there are several services of this type, they are run in order of their - * service ranking, the one with the highest ranking is used first. In the case - * of a service ranking tie, the service with the lowest service id is processed - * first. - *

- * The preprocessor is handled in the same way as filters. When a preprocessor - * is put into service {@link Filter#init(javax.servlet.FilterConfig)} is - * called, when it is not used anymore {@link Filter#destroy()} is called. As - * these preprocessors are run before dispatching and therefore the targeted - * servlet context is not known yet, - * {@link javax.servlet.FilterConfig#getServletContext()} returns the servlet - * context of the backing implementation. The same context is returned by the - * request object. The context path is the context path of this underlying - * servlet context. The passed in chain can be used to invoke the next - * preprocessor in the chain, or if the end of that chain is reached to start - * dispatching of the request. A preprocessor might decide to terminate the - * processing and directly generate a response. - *

- * Service properties with the prefix - * {@code HttpWhiteboardConstants#HTTP_WHITEBOARD_PREPROCESSOR_INIT_PARAM_PREFIX} - * are passed as init parameters to this service. - * - * @ThreadSafe - * @author $Id$ - * @since 1.1 - */ -@ConsumerType -public interface Preprocessor extends Filter { - - // this interface is a marker interface -} diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/package-info.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/package-info.java deleted file mode 100644 index 18453f05854..00000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/package-info.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2010, 2017). 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. - */ - -/** - * Http Whiteboard Package Version 1.1. - *

- * Bundles wishing to use this package must list the package in the - * Import-Package header of the bundle's manifest. This package has two types of - * users: the consumers that use the API in this package and the providers that - * implement the API in this package. - *

- * Example import for consumers using the API in this package: - *

- * {@code Import-Package: org.osgi.service.http.whiteboard; version="[1.1,2.0)"} - *

- * Example import for providers implementing the API in this package: - *

- * {@code Import-Package: org.osgi.service.http.whiteboard; version="[1.1,1.2)"} - * - * @author $Id$ - */ - -@Version(HTTP_WHITEBOARD_SPECIFICATION_VERSION) -package org.osgi.service.http.whiteboard; - -import static org.osgi.service.http.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_SPECIFICATION_VERSION; - -import org.osgi.annotation.versioning.Version; -