View Javadoc
1   package org.metricshub.ipmi.core.coding.commands.sel;
2   
3   /*-
4    * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
5    * IPMI Java Client
6    * ჻჻჻჻჻჻
7    * Copyright 2023 Verax Systems, MetricsHub
8    * ჻჻჻჻჻჻
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU Lesser General Public License as
11   * published by the Free Software Foundation, either version 3 of the
12   * License, or (at your option) any later version.
13   *
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Lesser Public License for more details.
18   *
19   * You should have received a copy of the GNU General Lesser Public
20   * License along with this program.  If not, see
21   * <http://www.gnu.org/licenses/lgpl-3.0.html>.
22   * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
23   */
24  
25  import java.util.Date;
26  
27  import org.metricshub.ipmi.core.coding.commands.ResponseData;
28  
29  /**
30   * The reply to Get SEL Info (IPMI 2.0 section 31.2): the version of the SEL, its number of entries and the times of
31   * its last addition and erasure.
32   */
33  public class GetSelInfoResponseData implements ResponseData {
34  	private int selVersion;
35  
36  	private int entriesCount;
37  
38  	/**
39  	 * Most recent addition timestamp.
40  	 */
41  	private Date additionTimestamp;
42  
43  	/**
44  	 * Most recent erase timestamp.
45  	 */
46  	private Date eraseTimestamp;
47  
48  	/**
49  	 * Returns the version of the SEL command set, BCD-decoded: 15 for 51h, version 1.5.
50  	 *
51  	 * @return the SEL version, 15 for version 1.5
52  	 */
53  	public int getSelVersion() {
54  		return selVersion;
55  	}
56  
57  	/**
58  	 * Sets the version of the SEL command set.
59  	 *
60  	 * @param selVersion the SEL version, BCD-decoded (15 for version 1.5)
61  	 */
62  	public void setSelVersion(int selVersion) {
63  		this.selVersion = selVersion;
64  	}
65  
66  	/**
67  	 * Returns the number of entries in the SEL.
68  	 *
69  	 * @return the number of entries
70  	 */
71  	public int getEntriesCount() {
72  		return entriesCount;
73  	}
74  
75  	/**
76  	 * Sets the number of entries in the SEL.
77  	 *
78  	 * @param entriesCount the number of entries
79  	 */
80  	public void setEntriesCount(int entriesCount) {
81  		this.entriesCount = entriesCount;
82  	}
83  
84  	/**
85  	 * Returns the time of the most recent addition to the SEL as the BMC sent it: a {@link Date} of the unsigned 32-bit
86  	 * number of seconds, with no UTC offset applied. FFFFFFFFh means that no entry was ever added, or that the BMC lost
87  	 * the value.
88  	 *
89  	 * @return the time of the most recent addition
90  	 */
91  	public Date getAdditionTimestamp() {
92  		return additionTimestamp;
93  	}
94  
95  	/**
96  	 * Sets the time of the most recent addition to the SEL.
97  	 *
98  	 * @param additionTimestamp the time of the most recent addition, as the BMC sent it
99  	 */
100 	public void setAdditionTimestamp(Date additionTimestamp) {
101 		this.additionTimestamp = additionTimestamp;
102 	}
103 
104 	/**
105 	 * Returns the time of the most recent erasure of SEL entries as the BMC sent it: a {@link Date} of the unsigned
106 	 * 32-bit number of seconds, with no UTC offset applied.
107 	 *
108 	 * @return the time of the most recent erasure
109 	 */
110 	public Date getEraseTimestamp() {
111 		return eraseTimestamp;
112 	}
113 
114 	/**
115 	 * Sets the time of the most recent erasure of SEL entries.
116 	 *
117 	 * @param eraseTimestamp the time of the most recent erasure, as the BMC sent it
118 	 */
119 	public void setEraseTimestamp(Date eraseTimestamp) {
120 		this.eraseTimestamp = eraseTimestamp;
121 	}
122 }