001/*
002 * Copyright (c) 2013 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     Florent Guillaume
011 */
012package org.nuxeo.ecm.core.schema;
013
014import java.util.HashSet;
015import java.util.Set;
016
017import org.nuxeo.common.xmap.annotation.XNode;
018import org.nuxeo.common.xmap.annotation.XNodeList;
019import org.nuxeo.common.xmap.annotation.XObject;
020
021/**
022 * Repository proxies configuration descriptor.
023 */
024@XObject("proxies")
025public class ProxiesDescriptor {
026
027    @XNode("@type")
028    private String type;
029
030    @XNodeList(value = "schema@name", type = HashSet.class, componentType = String.class)
031    private Set<String> schemas = new HashSet<String>(0);
032
033    /* empty constructor needed by XMap */
034    public ProxiesDescriptor() {
035    }
036
037    public String getType() {
038        return type == null ? "*" : type;
039    }
040
041    public Set<String> getSchemas() {
042        return schemas;
043    }
044
045    @Override
046    public String toString() {
047        return getClass().getSimpleName() + "(type=" + getType() + ", schemas=" + getSchemas() + ")";
048    }
049
050}