aboutsummaryrefslogtreecommitdiffstats
path: root/shared/src/main/java/com/vaadin/osgi/resources/VaadinResourceService.java
blob: 6c1369658620f788ba19b6d7f1efebb2ee06b2af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
 * Copyright 2000-2021 Vaadin Ltd.
 *
 * 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 com.vaadin.osgi.resources;

import org.osgi.service.http.HttpService;
import org.osgi.service.http.NamespaceException;

/**
 * Service used to publish themes, widgetsets and static resources at the root
 * of a versioned namespaced /VAADIN/ folder.
 *
 * @author Vaadin Ltd.
 *
 * @since 8.1
 */
public interface VaadinResourceService {
    /**
     * Register the theme with the given name under the
     * {@link VaadinResourceService} versioned namespace. The theme folder is
     * expected to be compiled and under "/VAADIN/themes/" in the calling
     * bundle.
     *
     * The theme will become accessible under the url
     * "/vaadin-x.x.x/VAADIN/themes/themeName" where x.x.x is the version of the
     * Vaadin Shared bundle
     *
     * @deprecated use OSGi DS services and register a {@link OsgiVaadinTheme}
     * @param themeName
     *            the name of the theme
     * @param httpService
     *            the {@link HttpService} instance for the calling bundle
     * @throws NamespaceException
     *             if there is a clash during the theme registration
     */
    @Deprecated
    void publishTheme(String themeName, HttpService httpService)
            throws NamespaceException;

    /**
     * Register the resource with the given name under the
     * {@link VaadinResourceService} versioned namespace. The resource is
     * expected to be under "/VAADIN/" in the calling bundle.
     *
     * The resource will become accessible under the url "/vaadin-x.x.x/VAADIN/"
     * where x.x.x is the version of the Vaadin Shared bundle
     *
     * @deprecated use OSGi DS services and register a
     *             {@link OsgiVaadinResource}
     * @param resourceName
     *            the name of the resource
     * @param httpService
     *            the {@link HttpService} instance for the calling bundle
     * @throws NamespaceException
     *             if there is a clash during the theme registration
     */
    @Deprecated
    void publishResource(String resourceName, HttpService httpService)
            throws NamespaceException;

    /**
     * Register the widgetset with the given name under the
     * {@link VaadinResourceService} versioned namespace. The resource is
     * expected to be under "/VAADIN/widgetsets" in the calling bundle.
     *
     * The resource will become accessible under the url
     * "/vaadin-x.x.x/VAADIN/widgetsets" where x.x.x is the version of the
     * Vaadin Shared bundle
     *
     * @deprecated use OSGi DS services and register a
     *             {@link OsgiVaadinWidgetset}
     * @param widgetsetName
     *            the name of the resource
     * @param httpService
     *            the {@link HttpService} instance for the calling bundle
     * @throws NamespaceException
     *             if there is a clash during the theme registration
     */
    @Deprecated
    void publishWidgetset(String widgetsetName, HttpService httpService)
            throws NamespaceException;

    /**
     * Returns the prefix of the versioned namespace for the resources. The
     * result can't be null and is of the format "vaadin-x.x.x" where x.x.x the
     * version of the Vaadin Shared bundle.
     *
     * @return the prefix of the resources folder managed by this service
     */
    String getResourcePathPrefix();

    /**
     * Returns the http servlet context name of Vaadin
     *
     * @return the context name
     */
    String getContextName();
}