view src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorRestlet.java @ 89:247cbbb385de

improved logging.
author casties
date Wed, 04 Feb 2015 19:37:02 +0100
parents b406507a953d
children cf44d9e1a4a7
line wrap: on
line source

package de.mpiwg.itgroup.annotations.restlet;

/*
 * #%L
 * AnnotationManager
 * %%
 * Copyright (C) 2012 - 2014 MPIWG Berlin
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as 
 * published by the Free Software Foundation, either version 3 of the 
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Lesser Public License for more details.
 * 
 * You should have received a copy of the GNU General Lesser Public 
 * License along with this program.  If not, see
 * <http://www.gnu.org/licenses/lgpl-3.0.html>.
 * #L%
 */

import org.restlet.Restlet;
import org.restlet.routing.Router;

/**
 * @author casties
 *
 */
public class AnnotatorRestlet extends BaseRestlet {

    public final String version = "AnnotationManagerN4J/Annotator 0.5.0";

    /*
     * (non-Javadoc)
     * 
     * @see org.restlet.Application#createInboundRoot()
     */
    @Override
    public Restlet createInboundRoot() {
        // this.authenticator = createAuthenticator();

        Router router = new Router(getContext());

        router.attach("/annotations", AnnotatorAnnotations.class);
        router.attach("/annotations/{id}", AnnotatorAnnotations.class);
        router.attach("/search", AnnotatorSearch.class);
        router.attach("/groups", AnnotatorGroups.class);
        router.attach("/tags", AnnotatorTags.class);
        router.attach("/tags/{id}", AnnotatorTags.class);
        router.attach("/tags/{id}/annotations", AnnotatorAnnotationsByTags.class);
        router.attach("/resources", AnnotatorResources.class);
        router.attach("/resources/{id}", AnnotatorResources.class);
        router.attach("/resources/{id}/annotations", AnnotatorAnnotationsByResources.class);
        router.attach("/", AnnotatorInfo.class);
        // authenticator.setNext(router);
        // return authenticator;

        return router;
    }

    /* (non-Javadoc)
     * @see de.mpiwg.itgroup.annotations.restlet.RestletImpl#getVersion()
     */
    @Override
    public String getVersion() {
        return version;
    }

}