6fcba5d6b5a7c645bca3aa22bdd82ba595cffa6d
[moon.git] /
1 /*
2  * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.aaa.idm;
10
11 import java.util.Arrays;
12 import java.util.HashSet;
13 import java.util.Set;
14
15 import javax.ws.rs.core.Application;
16
17 import org.opendaylight.aaa.idm.rest.DomainHandler;
18 import org.opendaylight.aaa.idm.rest.RoleHandler;
19 import org.opendaylight.aaa.idm.rest.UserHandler;
20 import org.opendaylight.aaa.idm.rest.VersionHandler;
21
22 /**
23  * A JAX-RS application for IdmLight.  The REST endpoints delivered by this
24  * application are in the form:
25  * <code>http://{HOST}:{PORT}/auth/v1/</code>
26  *
27  * For example, the users REST endpoint is:
28  * <code>http://{HOST}:{PORT}/auth/v1/users</code>
29  *
30  * This application is responsible for interaction with the backing h2
31  * database store.
32  *
33  * @author liemmn
34  * @author Ryan Goulding (ryandgoulding@gmail.com)
35  * @see <code>org.opendaylight.aaa.idm.rest.DomainHandler</code>
36  * @see <code>org.opendaylight.aaa.idm.rest.UserHandler</code>
37  * @see <code>org.opendaylight.aaa.idm.rest.RoleHandler</code>
38  */
39 public class IdmLightApplication extends Application {
40
41     //TODO create a bug to address the fact that the implementation assumes 128
42     // as the max length, even though this claims 256.
43     /**
44      * The maximum field length for identity fields.
45      */
46     public static final int MAX_FIELD_LEN = 256;
47     public IdmLightApplication() {
48     }
49
50     @Override
51     public Set<Class<?>> getClasses() {
52         return new HashSet<Class<?>>(Arrays.asList(VersionHandler.class,
53                                                    DomainHandler.class,
54                                                    RoleHandler.class,
55                                                    UserHandler.class));
56     }
57 }