/**
 * Logback: the generic, reliable, fast and flexible logging framework.
 * 
 * Copyright (C) 1999-2006, QOS.ch
 * 
 * This library 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.
 */
package ch.qos.logback.classic.spi;

import java.io.Serializable;
import java.util.Map;

import ch.qos.logback.classic.LoggerContext;

/**
 * LoggerContextVO offers a restricted view of LoggerContext intended to be
 * exposed by LoggingEvent to remote system. This restricted view is optimized
 * for serialization.
 * 
 * Some of the LoggerContext or Logger attributes should not survive
 * serialization, e.g appenders, level values etc, as these attributes may have
 * other values on the remote platform. LoggerContextVO class exposes
 * the minimal (relevant) attributes to remote host, instead of having to deal
 * with an incomplete LoggerContext with many null references.
 * 
 * @author Ceki G&uuml;lc&uuml;
 * @author S&eacute;bastien Pennec
 */
public class LoggerContextVO implements Serializable {

  private static final long serialVersionUID = 5488023392483144387L;

  final String name;
  final Map<String, String> propertyMap;
  final long birthTime;

  public LoggerContextVO(LoggerContext lc) {
    this.name = lc.getName();
    this.propertyMap = lc.getCopyOfPropertyMap();
    this.birthTime = lc.getBithTime();
  }

  public String getName() {
    return name;
  }

  public Map<String, String> getPropertyMap() {
    return propertyMap;
  }

  public long getBirthTime() {
    return birthTime;
  }
}
