001/**
002 * Copyright 2010-2014 The Kuali Foundation
003 *
004 * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
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 */
016package org.kuali.common.util.log4j.model;
017
018import java.util.ArrayList;
019import java.util.Arrays;
020import java.util.List;
021
022import javax.xml.bind.annotation.XmlAttribute;
023import javax.xml.bind.annotation.XmlElement;
024
025import org.kuali.common.util.CollectionUtils;
026
027/**
028 * @deprecated
029 */
030@Deprecated
031public class Logger {
032
033        public static final Boolean DEFAULT_ADDITIVITY_VALUE = true;
034
035        Boolean additivity = DEFAULT_ADDITIVITY_VALUE;
036        String name;
037        List<AppenderRef> references = new ArrayList<AppenderRef>();
038        Level level;
039
040        public Logger() {
041                this((String) null);
042        }
043
044        public Logger(List<AppenderRef> references) {
045                this(null, references);
046        }
047
048        public Logger(AppenderRef reference, Level level) {
049                this(Arrays.asList(reference), level);
050        }
051
052        public Logger(List<AppenderRef> references, Level level) {
053                this(null, references, level);
054        }
055
056        public Logger(String name) {
057                this(name, (Level) null);
058        }
059
060        public Logger(String name, Level level) {
061                this(name, null, level);
062        }
063
064        public Logger(String name, List<AppenderRef> references) {
065                this(name, references, null);
066        }
067
068        public Logger(String name, List<AppenderRef> references, Level level) {
069                super();
070                this.name = name;
071                this.references = references;
072                this.level = level;
073        }
074
075        public Logger(Logger logger) {
076                super();
077                this.additivity = logger.getAdditivity();
078                this.name = logger.getName();
079                this.level = logger.getLevel();
080                for (AppenderRef reference : CollectionUtils.toEmptyList(logger.getReferences())) {
081                        this.references.add(new AppenderRef(reference));
082                }
083        }
084
085        @XmlElement(name = "appender-ref")
086        public List<AppenderRef> getReferences() {
087                return references;
088        }
089
090        @XmlAttribute
091        public Boolean getAdditivity() {
092                return additivity;
093        }
094
095        @XmlAttribute
096        public String getName() {
097                return name;
098        }
099
100        public void setAdditivity(Boolean additivity) {
101                this.additivity = additivity;
102        }
103
104        public void setName(String name) {
105                this.name = name;
106        }
107
108        public void setReferences(List<AppenderRef> references) {
109                this.references = references;
110        }
111
112        public Level getLevel() {
113                return level;
114        }
115
116        public void setLevel(Level level) {
117                this.level = level;
118        }
119
120}