All Downloads are FREE. Search and download functionalities are using the official Maven repository.

no.priv.bang.oldalbum.web.api.OldAlbumWebApiServlet Maven / Gradle / Ivy

There is a newer version: 2.1.4
Show newest version
/*
 * Copyright 2020-2024 Steinar Bang
 *
 * 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 no.priv.bang.oldalbum.web.api;

import javax.servlet.Servlet;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.http.whiteboard.propertytypes.HttpWhiteboardContextSelect;
import org.osgi.service.http.whiteboard.propertytypes.HttpWhiteboardServletName;
import org.osgi.service.http.whiteboard.propertytypes.HttpWhiteboardServletPattern;
import org.osgi.service.log.LogService;
import static org.osgi.service.http.whiteboard.HttpWhiteboardConstants.*;

import no.priv.bang.oldalbum.services.OldAlbumService;
import no.priv.bang.oldalbum.services.ReloadableShiroFilter;
import no.priv.bang.osgiservice.users.UserManagementService;
import no.priv.bang.servlet.jersey.JerseyServlet;

@Component(service=Servlet.class, immediate=true)
@HttpWhiteboardContextSelect("(" + HTTP_WHITEBOARD_CONTEXT_NAME + "=oldalbum)")
@HttpWhiteboardServletName("oldalbumapi")
@HttpWhiteboardServletPattern("/api/*")
public class OldAlbumWebApiServlet extends JerseyServlet {
    private static final long serialVersionUID = -4443311569561233056L;

    @Override
    @Reference
    public void setLogService(LogService logservice) {
        super.setLogService(logservice);
    }

    @Reference
    public void setOldAlbumService(OldAlbumService oldAlbumService) {
        addInjectedOsgiService(OldAlbumService.class, oldAlbumService);
    }

    @Reference
    public void setUseradmin(UserManagementService useradmin) {
        addInjectedOsgiService(UserManagementService.class, useradmin);
    }

    @Reference
    public void setReloadableShiroFilter(ReloadableShiroFilter shirofilter) {
        addInjectedOsgiService(ReloadableShiroFilter.class, shirofilter);
    }

    @Activate
    public void activate() {
        // Called when DS component is activated
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy