001/*
002 * (C) Copyright 2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Thierry Delprat
018 */
019package org.nuxeo.ecm.platform.ui.web.auth.service;
020
021import org.nuxeo.common.xmap.annotation.XNode;
022import org.nuxeo.common.xmap.annotation.XObject;
023import org.nuxeo.ecm.platform.ui.web.auth.NuxeoAuthenticationFilter;
024
025@XObject("preFilter")
026public class AuthPreFilterDescriptor implements Comparable<AuthPreFilterDescriptor> {
027
028    private static final long serialVersionUID = 237654398643289764L;
029
030    @XNode("@name")
031    protected String name;
032
033    @XNode("@enabled")
034    protected boolean enabled = true;
035
036    @XNode("@class")
037    protected Class<NuxeoAuthenticationFilter> className;
038
039    @XNode("@order")
040    protected int order = 10;
041
042    public String getName() {
043        return name;
044    }
045
046    public boolean isEnabled() {
047        return enabled;
048    }
049
050    public Class<NuxeoAuthenticationFilter> getClassName() {
051        return className;
052    }
053
054    public Integer getOrder() {
055        return order;
056    }
057
058    @Override
059    public int compareTo(AuthPreFilterDescriptor o) {
060        return this.getOrder().compareTo(o.getOrder());
061    }
062
063}