Fix license header violations in aaa-idmlight
[aaa.git] / aaa-idmlight / src / main / java / org / opendaylight / aaa / idm / rest / VersionHandler.java
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.rest;
10
11 /**
12  *
13  * @author peter.mellquist@hp.com
14  *
15  */
16
17 import javax.servlet.http.HttpServletRequest;
18 import javax.ws.rs.GET;
19 import javax.ws.rs.Path;
20 import javax.ws.rs.Produces;
21 import javax.ws.rs.core.Context;
22 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory;
24 import org.opendaylight.aaa.idm.model.Version;
25
26 @Path("/")
27 public class VersionHandler {
28    private static Logger logger = LoggerFactory.getLogger(VersionHandler.class);;
29
30    protected static String CURRENT_VERSION      = "v1";
31    protected static String LAST_UPDATED         = "2014-04-18T18:30:02.25Z";
32    protected static String CURRENT_STATUS       = "CURRENT";
33
34    @GET
35    @Produces("application/json")
36    public Version getVersion(@Context HttpServletRequest request) {
37       logger.info("Get /");
38       Version version = new Version();
39       version.setId(CURRENT_VERSION);
40       version.setUpdated(LAST_UPDATED);
41       version.setStatus(CURRENT_STATUS);
42       return version;
43    }
44
45 }