001/*
002 * (C) Copyright 2015 Nuxeo SAS (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     Nuxeo - initial API and implementation
016 *
017 */
018
019package org.nuxeo.scim.server.jaxrs;
020
021import java.util.HashSet;
022import java.util.Set;
023
024import org.nuxeo.ecm.webengine.app.WebEngineModule;
025import org.nuxeo.scim.server.jaxrs.marshalling.GroupResourceReader;
026import org.nuxeo.scim.server.jaxrs.marshalling.GroupResourceWriter;
027import org.nuxeo.scim.server.jaxrs.marshalling.ResourcesWriter;
028import org.nuxeo.scim.server.jaxrs.marshalling.ServiceProviderConfigWriter;
029import org.nuxeo.scim.server.jaxrs.marshalling.UserResourceReader;
030import org.nuxeo.scim.server.jaxrs.marshalling.UserResourceWriter;
031
032/**
033 * Roor module to declare resources exposed for SCIM API
034 *
035 * @author tiry
036 * @since 7.4
037 */
038public class SCIMModule extends WebEngineModule {
039
040    @Override
041    public Set<Class<?>> getClasses() {
042        Set<Class<?>> result = super.getClasses();
043        return result;
044    }
045
046    @Override
047    public Set<Object> getSingletons() {
048        Set<Object> result = new HashSet<Object>();
049        result.add(new UserResourceWriter());
050        result.add(new ResourcesWriter());
051        result.add(new UserResourceReader());
052        result.add(new GroupResourceReader());
053        result.add(new GroupResourceWriter());
054        result.add(new ServiceProviderConfigWriter());
055        return result;
056    }
057}