2 * Copyright (c) 2014, 2017 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.aaa.shiro.idm;
11 import java.util.Arrays;
12 import java.util.HashSet;
14 import javax.ws.rs.core.Application;
15 import org.opendaylight.aaa.provider.GsonProvider;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
20 * A JAX-RS application for IdmLight. The REST endpoints delivered by this
21 * application are in the form: <code>http://{HOST}:{PORT}/auth/v1/</code>
24 * For example, the users REST endpoint is:
25 * <code>http://{HOST}:{PORT}/auth/v1/users</code>
28 * This application is responsible for interaction with the backing h2 database
32 * @see <code>org.opendaylight.aaa.shiro.idm.rest.DomainHandler</code>
33 * @see <code>org.opendaylight.aaa.shiro.idm.rest.UserHandler</code>
34 * @see <code>org.opendaylight.aaa.shiro.idm.rest.RoleHandler</code>
36 public class IdmLightApplication extends Application {
38 private static final Logger LOG = LoggerFactory.getLogger(IdmLightApplication.class);
40 // TODO create a bug to address the fact that the implementation assumes 128
41 // as the max length, even though this claims 256.
43 * The maximum field length for identity fields.
45 public static final int MAX_FIELD_LEN = 256;
47 public IdmLightApplication() {
51 public Set<Class<?>> getClasses() {
52 return new HashSet<>(Arrays.asList(GsonProvider.class,
53 DomainHandler.class, RoleHandler.class, UserHandler.class));