Add Example Server project for embedded Jersey + Weld
diff --git a/pom.xml b/pom.xml
index c7503cd..c1c4f4f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -151,8 +151,8 @@
<dependency>
<groupId>org.jboss.weld.se</groupId>
- <artifactId>weld-se</artifactId>
- <version>2.4.8.Final</version>
+ <artifactId>weld-se-core</artifactId>
+ <version>4.0.3.Final</version>
</dependency>
<dependency>
<groupId>args4j</groupId>
@@ -225,6 +225,16 @@
<version>31.1-android</version>
</dependency>
<dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.2.11</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
+ <version>${version.slf4j}</version>
+ </dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${version.slf4j}</version>
diff --git a/scim-server/scim-server-example/pom.xml b/scim-server/scim-server-example/pom.xml
index 297ad48..03d5836 100644
--- a/scim-server/scim-server-example/pom.xml
+++ b/scim-server/scim-server-example/pom.xml
@@ -29,6 +29,7 @@
<modules>
<module>scim-server-memory</module>
+ <module>scim-server-jersey</module>
</modules>
</project>
diff --git a/scim-server/scim-server-example/scim-server-jersey/README.md b/scim-server/scim-server-example/scim-server-jersey/README.md
new file mode 100644
index 0000000..cb8ee49
--- /dev/null
+++ b/scim-server/scim-server-example/scim-server-jersey/README.md
@@ -0,0 +1,20 @@
+Apache Directory SCIMple In Memory Example
+==========================================
+
+This example project demo's how to:
+
+* Add a custom SCIM Extension
+* Manage Users and Groups (in memory)
+
+Use this as a starter point on how to integrate Apache Directory SCIMple into your own project.
+
+Run: `mvn package exec:run` and then access one of the endpoints:
+
+```bash
+# httpie
+http :8080/Users
+
+# curl
+curl localhost:8080/Users
+```
+n
diff --git a/scim-server/scim-server-example/scim-server-jersey/pom.xml b/scim-server/scim-server-example/scim-server-jersey/pom.xml
new file mode 100644
index 0000000..a0a2414
--- /dev/null
+++ b/scim-server/scim-server-example/scim-server-jersey/pom.xml
@@ -0,0 +1,119 @@
+<!-- Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.directory.scim</groupId>
+ <artifactId>scim-server-examples</artifactId>
+ <version>2.23-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>scim-server-jersey</artifactId>
+ <name>SCIM - Server - Jersey</name>
+
+ <properties>
+ <jersey.version>3.0.5</jersey.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.glassfish.jersey</groupId>
+ <artifactId>jersey-bom</artifactId>
+ <version>${jersey.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.containers</groupId>
+ <artifactId>jersey-container-jetty-http</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.inject</groupId>
+ <artifactId>jersey-hk2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.media</groupId>
+ <artifactId>jersey-media-json-jackson</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.ext.cdi</groupId>
+ <artifactId>jersey-weld2-se</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.ext.cdi</groupId>
+ <artifactId>jersey-weld2-se</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.weld.se</groupId>
+ <artifactId>weld-se-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>jakarta.servlet</groupId>
+ <artifactId>jakarta.servlet-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.scim</groupId>
+ <artifactId>scim-server-common</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>3.0.0</version>
+ <configuration>
+ <mainClass>org.apache.directory.scim.example.jersey.JerseyApplication</mainClass>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/scim-server/scim-server-example/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/JerseyApplication.java b/scim-server/scim-server-example/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/JerseyApplication.java
new file mode 100644
index 0000000..0e0e62b
--- /dev/null
+++ b/scim-server/scim-server-example/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/JerseyApplication.java
@@ -0,0 +1,84 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you 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.apache.directory.scim.example.jersey;
+
+import org.apache.directory.scim.server.rest.ScimResourceHelper;
+
+import java.net.URI;
+import java.util.HashSet;
+import java.util.Set;
+
+import jakarta.ws.rs.core.Application;
+import org.eclipse.jetty.server.Server;
+import org.glassfish.jersey.jetty.JettyHttpContainerFactory;
+import org.glassfish.jersey.server.ApplicationHandler;
+import org.jboss.weld.environment.se.Weld;
+import org.slf4j.LoggerFactory;
+import org.slf4j.bridge.SLF4JBridgeHandler;
+
+// @ApplicationPath("v2")
+// Embedded Jersey + Jetty ignores the ApplicationPath annotation
+// https://github.com/eclipse-ee4j/jersey/issues/3222
+public class JerseyApplication extends Application {
+
+ private static final String BASE_URI = "http://localhost:8080/";
+
+ private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(JerseyApplication.class);
+
+ @Override
+ public Set<Class<?>> getClasses() {
+ return new HashSet<>(ScimResourceHelper.getScimClassesToLoad());
+ }
+
+ public static void main(String[] args) {
+
+ // configure JUL logging
+ SLF4JBridgeHandler.install();
+
+ try {
+ Weld weld = new Weld();
+ // ensure Weld discovers the beans in this project
+ weld.addPackages(true, JerseyApplication.class.getPackage());
+ weld.initialize();
+
+ ApplicationHandler applicationHandler = new ApplicationHandler(JerseyApplication.class);
+ final Server server = JettyHttpContainerFactory.createServer(URI.create(BASE_URI), applicationHandler.getConfiguration());
+
+ Runtime.getRuntime().addShutdownHook(new Thread(() -> {
+ try {
+ System.out.println("Shutting down the application...");
+ server.stop();
+ weld.shutdown();
+ System.out.println("Done, exit.");
+ } catch (Exception e) {
+ LOG.error("Failed to shutdown service", e);
+ }
+ }));
+
+ System.out.printf("Application started: %s\nStop the application using CTRL+C%n", BASE_URI);
+
+ // block and wait shut down signal, like CTRL+C
+ Thread.currentThread().join();
+
+ } catch (InterruptedException ex) {
+ LOG.error("Service Interrupted", ex);
+ }
+ }
+}
diff --git a/scim-server/scim-server-example/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/extensions/LuckyNumberExtension.java b/scim-server/scim-server-example/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/extensions/LuckyNumberExtension.java
new file mode 100644
index 0000000..4f37beb
--- /dev/null
+++ b/scim-server/scim-server-example/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/extensions/LuckyNumberExtension.java
@@ -0,0 +1,62 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you 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.apache.directory.scim.example.jersey.extensions;
+
+import jakarta.xml.bind.annotation.XmlAccessType;
+import jakarta.xml.bind.annotation.XmlAccessorType;
+import jakarta.xml.bind.annotation.XmlElement;
+import jakarta.xml.bind.annotation.XmlRootElement;
+
+import lombok.Data;
+import org.apache.directory.scim.spec.annotation.ScimAttribute;
+import org.apache.directory.scim.spec.annotation.ScimExtensionType;
+import org.apache.directory.scim.spec.resources.ScimExtension;
+import org.apache.directory.scim.spec.schema.Schema;
+
+/**
+ * Allows a User's lucky number to be passed as part of the User's entry via
+ * the SCIM protocol.
+ *
+ * @author Chris Harm <crh5255@psu.edu>
+ */
+@XmlRootElement( name = "LuckyNumberExtension", namespace = "http://www.psu.edu/schemas/psu-scim" )
+@XmlAccessorType(XmlAccessType.NONE)
+@Data
+@ScimExtensionType(id = LuckyNumberExtension.SCHEMA_URN, description="Lucky Numbers", name="LuckyNumbers", required=true)
+public class LuckyNumberExtension implements ScimExtension {
+
+ public static final String SCHEMA_URN = "urn:mem:params:scim:schemas:extension:LuckyNumberExtension";
+
+ @ScimAttribute(returned=Schema.Attribute.Returned.DEFAULT, required=true)
+ @XmlElement
+ private long luckyNumber;
+
+ /**
+ * Provides the URN associated with this extension which, as defined by the
+ * SCIM specification is the extension's unique identifier.
+ *
+ * @return The extension's URN.
+ */
+ @Override
+ public String getUrn() {
+ return SCHEMA_URN;
+ }
+
+}
diff --git a/scim-server/scim-server-example/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryGroupService.java b/scim-server/scim-server-example/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryGroupService.java
new file mode 100644
index 0000000..0d0c883
--- /dev/null
+++ b/scim-server/scim-server-example/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryGroupService.java
@@ -0,0 +1,102 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you 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.apache.directory.scim.example.jersey.service;
+
+import jakarta.annotation.PostConstruct;
+import org.apache.directory.scim.server.exception.UnableToUpdateResourceException;
+import org.apache.directory.scim.server.provider.Provider;
+import org.apache.directory.scim.server.provider.UpdateRequest;
+import org.apache.directory.scim.spec.protocol.filter.FilterResponse;
+import org.apache.directory.scim.spec.protocol.search.Filter;
+import org.apache.directory.scim.spec.protocol.search.PageRequest;
+import org.apache.directory.scim.spec.protocol.search.SortRequest;
+import org.apache.directory.scim.spec.resources.ScimExtension;
+import org.apache.directory.scim.spec.resources.ScimGroup;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Named;
+
+@Named
+@ApplicationScoped
+public class InMemoryGroupService implements Provider<ScimGroup> {
+
+ private final Map<String, ScimGroup> groups = new HashMap<>();
+
+ @PostConstruct
+ public void init() {
+ ScimGroup group = new ScimGroup();
+ group.setId("example-group");
+ groups.put(group.getId(), group);
+ }
+
+ @Override
+ public Class<ScimGroup> getResourceClass() {
+ return ScimGroup.class;
+ }
+
+ @Override
+ public ScimGroup create(ScimGroup resource) {
+ String resourceId = resource.getId();
+ int idCandidate = resource.hashCode();
+ String id = resourceId != null ? resourceId : Integer.toString(idCandidate);
+
+ while (groups.containsKey(id)) {
+ id = Integer.toString(idCandidate);
+ ++idCandidate;
+ }
+ groups.put(id, resource);
+ resource.setId(id);
+ return resource;
+ }
+
+ @Override
+ public ScimGroup update(UpdateRequest<ScimGroup> updateRequest) throws UnableToUpdateResourceException {
+ String id = updateRequest.getId();
+ ScimGroup resource = updateRequest.getResource();
+ groups.put(id, resource);
+ return resource;
+ }
+
+ @Override
+ public ScimGroup get(String id) {
+ return groups.get(id);
+ }
+
+ @Override
+ public void delete(String id) {
+ groups.remove(id);
+ }
+
+ @Override
+ public FilterResponse<ScimGroup> find(Filter filter, PageRequest pageRequest, SortRequest sortRequest) {
+ return new FilterResponse<>(groups.values(), pageRequest, groups.size());
+ }
+
+ @Override
+ public List<Class<? extends ScimExtension>> getExtensionList() {
+ return Collections.emptyList();
+ }
+
+}
diff --git a/scim-server/scim-server-example/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemorySelfResolverImpl.java b/scim-server/scim-server-example/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemorySelfResolverImpl.java
new file mode 100644
index 0000000..c7e4240
--- /dev/null
+++ b/scim-server/scim-server-example/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemorySelfResolverImpl.java
@@ -0,0 +1,37 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you 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.apache.directory.scim.example.jersey.service;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import org.apache.directory.scim.server.exception.UnableToResolveIdResourceException;
+import org.apache.directory.scim.server.provider.SelfIdResolver;
+
+import java.security.Principal;
+
+import jakarta.ws.rs.core.Response.Status;
+
+@ApplicationScoped
+public class InMemorySelfResolverImpl implements SelfIdResolver {
+
+ @Override
+ public String resolveToInternalId(Principal principal) throws UnableToResolveIdResourceException {
+ throw new UnableToResolveIdResourceException(Status.NOT_IMPLEMENTED, "Caller Principal not available");
+ }
+}
diff --git a/scim-server/scim-server-example/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryUserService.java b/scim-server/scim-server-example/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryUserService.java
new file mode 100644
index 0000000..2eb541c
--- /dev/null
+++ b/scim-server/scim-server-example/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryUserService.java
@@ -0,0 +1,151 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you 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.apache.directory.scim.example.jersey.service;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import jakarta.annotation.PostConstruct;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Named;
+
+import org.apache.directory.scim.example.jersey.extensions.LuckyNumberExtension;
+import org.apache.directory.scim.server.exception.UnableToUpdateResourceException;
+import org.apache.directory.scim.server.provider.Provider;
+import org.apache.directory.scim.server.provider.UpdateRequest;
+import org.apache.directory.scim.spec.protocol.filter.FilterResponse;
+import org.apache.directory.scim.spec.protocol.search.Filter;
+import org.apache.directory.scim.spec.protocol.search.PageRequest;
+import org.apache.directory.scim.spec.protocol.search.SortRequest;
+import org.apache.directory.scim.spec.resources.Email;
+import org.apache.directory.scim.spec.resources.ScimExtension;
+import org.apache.directory.scim.spec.resources.ScimResource;
+import org.apache.directory.scim.spec.resources.ScimUser;
+
+/**
+ * Creates a singleton (effectively) Provider<User> with a memory-based
+ * persistence layer.
+ *
+ * @author Chris Harm <crh5255@psu.edu>
+ */
+@Named
+@ApplicationScoped
+public class InMemoryUserService implements Provider<ScimUser> {
+
+ static final String DEFAULT_USER_ID = "1";
+ static final String DEFAULT_USER_EXTERNAL_ID = "e" + DEFAULT_USER_ID;
+ static final String DEFAULT_USER_DISPLAY_NAME = "User " + DEFAULT_USER_ID;
+ static final String DEFAULT_USER_EMAIL_VALUE = "e1@example.com";
+ static final String DEFAULT_USER_EMAIL_TYPE = "work";
+ static final int DEFAULT_USER_LUCKY_NUMBER = 7;
+
+ private Map<String, ScimUser> users = new HashMap<>();
+
+ @PostConstruct
+ public void init() {
+ ScimUser user = new ScimUser();
+ user.setId(DEFAULT_USER_ID);
+ user.setExternalId(DEFAULT_USER_EXTERNAL_ID);
+ user.setUserName(DEFAULT_USER_EXTERNAL_ID);
+ user.setDisplayName(DEFAULT_USER_DISPLAY_NAME);
+ Email email = new Email();
+ email.setDisplay(DEFAULT_USER_EMAIL_VALUE);
+ email.setValue(DEFAULT_USER_EMAIL_VALUE);
+ email.setType(DEFAULT_USER_EMAIL_TYPE);
+ email.setPrimary(true);
+ user.setEmails(Arrays.asList(email));
+
+ LuckyNumberExtension luckyNumberExtension = new LuckyNumberExtension();
+ luckyNumberExtension.setLuckyNumber(DEFAULT_USER_LUCKY_NUMBER);
+
+ user.addExtension(luckyNumberExtension);
+
+ users.put(user.getId(), user);
+ }
+
+ @Override
+ public Class<ScimUser> getResourceClass() {
+ return ScimUser.class;
+ }
+
+ /**
+ * @see Provider#create(ScimResource)
+ */
+ @Override
+ public ScimUser create(ScimUser resource) {
+ String resourceId = resource.getId();
+ int idCandidate = resource.hashCode();
+ String id = resourceId != null ? resourceId : Integer.toString(idCandidate);
+
+ while (users.containsKey(id)) {
+ id = Integer.toString(idCandidate);
+ ++idCandidate;
+ }
+ users.put(id, resource);
+ resource.setId(id);
+ return resource;
+ }
+
+ /**
+ * @see Provider#update(UpdateRequest)
+ */
+ @Override
+ public ScimUser update(UpdateRequest<ScimUser> updateRequest) throws UnableToUpdateResourceException {
+ String id = updateRequest.getId();
+ ScimUser resource = updateRequest.getResource();
+ users.put(id, resource);
+ return resource;
+ }
+
+ /**
+ * @see Provider#get(java.lang.String)
+ */
+ @Override
+ public ScimUser get(String id) {
+ return users.get(id);
+ }
+
+ /**
+ * @see Provider#delete(java.lang.String)
+ */
+ @Override
+ public void delete(String id) {
+ users.remove(id);
+ }
+
+ /**
+ * @see Provider#find(Filter, PageRequest, SortRequest)
+ */
+ @Override
+ public FilterResponse<ScimUser> find(Filter filter, PageRequest pageRequest, SortRequest sortRequest) {
+ return new FilterResponse<>(users.values(), pageRequest, users.size());
+ }
+
+ /**
+ * @see Provider#getExtensionList()
+ */
+ @Override
+ public List<Class<? extends ScimExtension>> getExtensionList() {
+ return Arrays.asList(LuckyNumberExtension.class);
+ }
+
+}
diff --git a/scim-server/scim-server-example/scim-server-jersey/src/main/resources/beans.xml b/scim-server/scim-server-example/scim-server-jersey/src/main/resources/beans.xml
new file mode 100644
index 0000000..a47f43b
--- /dev/null
+++ b/scim-server/scim-server-example/scim-server-jersey/src/main/resources/beans.xml
@@ -0,0 +1,22 @@
+<!-- Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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. -->
+<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
+ version="1.1" bean-discovery-mode="all">
+
+</beans>
diff --git a/scim-server/scim-server-example/scim-server-jersey/src/main/resources/logback.xml b/scim-server/scim-server-example/scim-server-jersey/src/main/resources/logback.xml
new file mode 100644
index 0000000..e1ac385
--- /dev/null
+++ b/scim-server/scim-server-example/scim-server-jersey/src/main/resources/logback.xml
@@ -0,0 +1,26 @@
+<!-- Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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. -->
+<configuration>
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
+ </encoder>
+ </appender>
+ <root level="debug">
+ <appender-ref ref="STDOUT" />
+ </root>
+</configuration>