1 package org.metricshub.ipmi.core.coding.commands.session;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 import org.metricshub.ipmi.core.coding.commands.CommandsConstants;
26 import org.metricshub.ipmi.core.coding.commands.PrivilegeLevel;
27 import org.metricshub.ipmi.core.coding.commands.ResponseData;
28
29
30
31
32
33
34 public class OpenSessionResponseData implements ResponseData {
35
36
37
38
39 private byte messageTag;
40
41
42
43
44
45
46 private byte statusCode;
47
48
49
50
51 private byte privilegeLevel;
52
53
54
55
56
57 private int remoteConsoleSessionId;
58
59
60
61
62 private int managedSystemSessionId;
63
64
65
66
67
68 private byte authenticationAlgorithm;
69
70
71
72
73
74 private byte integrityAlgorithm;
75
76
77
78
79
80 private byte confidentialityAlgorithm;
81
82 public void setMessageTag(byte messageTag) {
83 this.messageTag = messageTag;
84 }
85
86 public byte getMessageTag() {
87 return messageTag;
88 }
89
90 public void setStatusCode(byte statusCode) {
91 this.statusCode = statusCode;
92 }
93
94 public byte getStatusCode() {
95 return statusCode;
96 }
97
98 public void setPrivilegeLevel(byte privilegeLevel) {
99 this.privilegeLevel = privilegeLevel;
100 }
101
102 public PrivilegeLevel getPrivilegeLevel() {
103 switch (privilegeLevel) {
104 case CommandsConstants.AL_CALLBACK:
105 return PrivilegeLevel.Callback;
106 case CommandsConstants.AL_USER:
107 return PrivilegeLevel.User;
108 case CommandsConstants.AL_OPERATOR:
109 return PrivilegeLevel.Operator;
110 case CommandsConstants.AL_ADMINISTRATOR:
111 return PrivilegeLevel.Administrator;
112 default:
113 throw new IllegalArgumentException("Invalid privilege level");
114 }
115 }
116
117 public void setRemoteConsoleSessionId(int remoteConsoleSessionId) {
118 this.remoteConsoleSessionId = remoteConsoleSessionId;
119 }
120
121 public int getRemoteConsoleSessionId() {
122 return remoteConsoleSessionId;
123 }
124
125 public void setManagedSystemSessionId(int managedSystemSessionId) {
126 this.managedSystemSessionId = managedSystemSessionId;
127 }
128
129 public int getManagedSystemSessionId() {
130 return managedSystemSessionId;
131 }
132
133 public void setAuthenticationAlgorithm(byte authenticationAlgorithm) {
134 this.authenticationAlgorithm = authenticationAlgorithm;
135 }
136
137 public byte getAuthenticationAlgorithm() {
138 return authenticationAlgorithm;
139 }
140
141 public void setIntegrityAlgorithm(byte integrityAlgorithm) {
142 this.integrityAlgorithm = integrityAlgorithm;
143 }
144
145 public byte getIntegrityAlgorithm() {
146 return integrityAlgorithm;
147 }
148
149 public void setConfidentialityAlgorithm(byte confidentialityAlgorithm) {
150 this.confidentialityAlgorithm = confidentialityAlgorithm;
151 }
152
153 public byte getConfidentialityAlgorithm() {
154 return confidentialityAlgorithm;
155 }
156 }