package jp.ehobby.util.syslog;


/**
 * syslog の分類を示す.
 *
 * @author kei-n
 */
public enum SyslogFacility {

	/** kernel message.								*/
	KERNEL(0),

	/** user-level message.							*/
	USER_LEVEL(1),

	/** mail system.								*/
	MAIL(2),

	/** system daemons.								*/
	SYSTEM_DAEMONS(3),

	/** security/authorization messages.			*/
	SECURITY_AUTHORIZATION_1(4),

	/** messages generated internally by syslogd.	*/
	SYSLOGD(5),

	/** line printer subsystem.						*/
	LINE_PRINTER(6),

	/** network news subsystem.						*/
	NET_NEWS(7),

	/** UUCP subsystem.								*/
	UUCP(8),

	/** clock daemon.								*/
	CLOCK_DAEMON_1(9),

	/** security/authorization message.				*/
	SECURITY_AUTHORIZATION_2(10),

	/** FTP daemon.									*/
	FTP(11),

	/** NTP subsystem.								*/
	NTP(12),

	/** log audit.									*/
	AUDIT(13),

	/** log alert.									*/
	ALERT(14),

	/** clock daemon.								*/
	CLOCK_DAEMON_2(15),

	/** local use 0.								*/
	LOCAL0(16),

	/** local use 1.								*/
	LOCAL1(17),

	/** local use 2.								*/
	LOCAL2(18),

	/** local use 3.								*/
	LOCAL3(19),

	/** local use 4.								*/
	LOCAL4(20),

	/** local use 5.								*/
	LOCAL5(21),

	/** local use 6.								*/
	LOCAL6(22),

	/** local use 7.								*/
	LOCAL7(23);


	////////////////////////////////////////////////////////////////////////////
	//
	// 共通メソッド
	//


	/** priority 用演算用.	*/
	private static final int PRIORITY_MUL = 8;


	/** facilityの値.		*/
	private final int facilityValue;


	/**
	 * Facility を生成する.
	 *
	 * @param val 値
	 */
	private SyslogFacility(final int val) {
		this.facilityValue = val;
	}


	/**
	 * Facility の値を返します.
	 *
	 * @return Facilityの値
	 */
	public int getValue() {
		return this.facilityValue;
	}


	/**
	 * Priority 用の Facility を 8倍した値を返します.
	 *
	 * @return Priority用の値
	 */
	public int getPriorityValue() {
		return (this.facilityValue * PRIORITY_MUL);
	}
}
