001/*
002 * (C) Copyright 2015 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Nuxeo - initial API and implementation
018 *
019 */
020
021package org.nuxeo.scim.server.jaxrs;
022
023import java.util.HashSet;
024import java.util.Set;
025
026import org.nuxeo.ecm.webengine.app.WebEngineModule;
027import org.nuxeo.scim.server.jaxrs.marshalling.GroupResourceReader;
028import org.nuxeo.scim.server.jaxrs.marshalling.GroupResourceWriter;
029import org.nuxeo.scim.server.jaxrs.marshalling.ResourcesWriter;
030import org.nuxeo.scim.server.jaxrs.marshalling.ServiceProviderConfigWriter;
031import org.nuxeo.scim.server.jaxrs.marshalling.UserResourceReader;
032import org.nuxeo.scim.server.jaxrs.marshalling.UserResourceWriter;
033
034/**
035 * Roor module to declare resources exposed for SCIM API
036 *
037 * @author tiry
038 * @since 7.4
039 */
040public class SCIMModule extends WebEngineModule {
041
042    @Override
043    public Set<Class<?>> getClasses() {
044        Set<Class<?>> result = super.getClasses();
045        return result;
046    }
047
048    @Override
049    public Set<Object> getSingletons() {
050        Set<Object> result = new HashSet<Object>();
051        result.add(new UserResourceWriter());
052        result.add(new ResourcesWriter());
053        result.add(new UserResourceReader());
054        result.add(new GroupResourceReader());
055        result.add(new GroupResourceWriter());
056        result.add(new ServiceProviderConfigWriter());
057        return result;
058    }
059}