|
1 /* |
|
2 * CDDL HEADER START |
|
3 * |
|
4 * The contents of this file are subject to the terms of the |
|
5 * Common Development and Distribution License (the "License"). |
|
6 * You may not use this file except in compliance with the License. |
|
7 * |
|
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 * or http://www.opensolaris.org/os/licensing. |
|
10 * See the License for the specific language governing permissions |
|
11 * and limitations under the License. |
|
12 * |
|
13 * When distributing Covered Code, include this CDDL HEADER in each |
|
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 * If applicable, add the following below this CDDL HEADER, with the |
|
16 * fields enclosed by brackets "[]" replaced with your own identifying |
|
17 * information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 * |
|
19 * CDDL HEADER END |
|
20 */ |
|
21 |
|
22 /* |
|
23 * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. |
|
24 */ |
|
25 |
|
26 package com.oracle.solaris.vp.panel.common.smf; |
|
27 |
|
28 import java.math.BigInteger; |
|
29 import java.util.*; |
|
30 import com.oracle.solaris.scf.common.ScfException; |
|
31 import com.oracle.solaris.vp.panel.common.api.smf_old.*; |
|
32 |
|
33 /** |
|
34 * An SMF service (and instance) MXBean interface |
|
35 * |
|
36 * (This isn't actually an MXBean interface, it's a wrapper around the |
|
37 * real one.) |
|
38 */ |
|
39 public interface ServiceMXBean |
|
40 { |
|
41 /** |
|
42 * Get the FMRI. |
|
43 */ |
|
44 String getFmri() throws ScfException; |
|
45 |
|
46 /** |
|
47 * Get method names. |
|
48 */ |
|
49 List<String> getMethodNames() throws ScfException; |
|
50 |
|
51 /** |
|
52 * Get dependency names. |
|
53 */ |
|
54 List<String> getDependencyNames() throws ScfException; |
|
55 |
|
56 /** |
|
57 * Get dependency properties. |
|
58 * |
|
59 * @param name dependency name |
|
60 */ |
|
61 Dependency getDependency(String name) throws ScfException; |
|
62 |
|
63 /** |
|
64 * Get property names in a property group. |
|
65 * |
|
66 * @param name property group name |
|
67 */ |
|
68 List<String> getPropertyNames(String name) throws ScfException; |
|
69 |
|
70 /** |
|
71 * Get type of a property. |
|
72 * |
|
73 * @param pg_name property group name |
|
74 * @param prop_name property name |
|
75 */ |
|
76 PropertyType getPropertyType(String pg_name, String prop_name) |
|
77 throws ScfException; |
|
78 |
|
79 /** |
|
80 * Get values of a property. |
|
81 * |
|
82 * @param pg_name property group name |
|
83 * @param prop_name property name |
|
84 */ |
|
85 List<String> getPropertyValues(String pg_name, String prop_name) |
|
86 throws ScfException; |
|
87 |
|
88 /** |
|
89 * Get values of a property in a snapshot. |
|
90 * |
|
91 * @param snap_name snapshot name |
|
92 * @param pg_name property group name |
|
93 * @param prop_name property name |
|
94 */ |
|
95 List<String> getSnapshotPropertyValues(String snap_name, String pg_name, |
|
96 String prop_name) throws ScfException; |
|
97 |
|
98 /** |
|
99 * Set the current values of a property. |
|
100 * |
|
101 * @param pg_name property group name |
|
102 * @param prop_name property name |
|
103 * @param values values |
|
104 */ |
|
105 void setPropertyValues(String pg_name, String prop_name, |
|
106 List<String> values) throws ScfException; |
|
107 |
|
108 /** |
|
109 * Create property group. |
|
110 * |
|
111 * @param pg_name property group name |
|
112 * @param prop_name property type |
|
113 */ |
|
114 void createPropertyGroup(String pg_name, String prop_name) |
|
115 throws ScfException; |
|
116 |
|
117 /** |
|
118 * Delete named property group. |
|
119 * |
|
120 * @param pg_name property group name |
|
121 */ |
|
122 void deletePropertyGroup(String pg_name) |
|
123 throws ScfException; |
|
124 |
|
125 /** |
|
126 * Create property. |
|
127 * |
|
128 * @param pg_name property group name |
|
129 * @param prop_name property name |
|
130 * @param type property type |
|
131 */ |
|
132 void createProperty(String pg_name, String prop_name, |
|
133 PropertyType type) throws ScfException; |
|
134 |
|
135 /** |
|
136 * Delete named property. |
|
137 * |
|
138 * @param pg_name property group name |
|
139 * @param prop_name property name |
|
140 */ |
|
141 void deleteProperty(String pg_name, String prop_name) |
|
142 throws ScfException; |
|
143 |
|
144 /** |
|
145 * Get property group names. |
|
146 */ |
|
147 List<PropertyGroup> getPropertyGroups() throws ScfException; |
|
148 |
|
149 /** |
|
150 * Get template information for a property. |
|
151 * |
|
152 * @param pg_name property group name |
|
153 * @param prop_name property name |
|
154 * @param locale locale name |
|
155 */ |
|
156 Template getPropertyTemplate(String pg_name, String prop_name, |
|
157 String locale) throws ScfException; |
|
158 |
|
159 /** |
|
160 * Get the common name of a service. |
|
161 * |
|
162 * @param locale locale name |
|
163 */ |
|
164 String getCommonName(String locale) throws ScfException; |
|
165 |
|
166 /** |
|
167 * Get the description of a service. |
|
168 * |
|
169 * @param locale locale name |
|
170 */ |
|
171 String getDescription(String locale) throws ScfException; |
|
172 |
|
173 /** |
|
174 * Get the contents of the log file for this service instance. |
|
175 * |
|
176 * @param max_size |
|
177 * the maximum size of the returned array (populated |
|
178 * from the end of the log file), or -1 to return the |
|
179 * entire file |
|
180 */ |
|
181 LogInfo getLogInfo(int max_size) throws ScfException; |
|
182 |
|
183 /** |
|
184 * Get manual pages. |
|
185 */ |
|
186 List<Manpage> getManpages() throws ScfException; |
|
187 |
|
188 /** |
|
189 * Get documentation links. |
|
190 */ |
|
191 List<String> getDoclinks() throws ScfException; |
|
192 |
|
193 /** |
|
194 * Put into maintenance. |
|
195 * |
|
196 * @param immediate do immediately |
|
197 */ |
|
198 void maintain(boolean immediate) throws ScfException; |
|
199 |
|
200 /** |
|
201 * Clear maintenance. |
|
202 */ |
|
203 void clear() throws ScfException; |
|
204 |
|
205 /** |
|
206 * Put into degraded state. |
|
207 * |
|
208 * @param immediate do immediately |
|
209 */ |
|
210 void degrade(boolean immediate) throws ScfException; |
|
211 |
|
212 /** |
|
213 * Restart the service. |
|
214 */ |
|
215 void restart() throws ScfException; |
|
216 |
|
217 /** |
|
218 * Refresh the service. |
|
219 */ |
|
220 void refresh() throws ScfException; |
|
221 |
|
222 /* |
|
223 * "Attributes" |
|
224 */ |
|
225 |
|
226 /** |
|
227 * Service should run on next boot. |
|
228 */ |
|
229 boolean isPersistentlyEnabled() throws ScfException; |
|
230 |
|
231 /** |
|
232 * Service should run on next boot. |
|
233 * |
|
234 * @param enabled service should run on next boot |
|
235 */ |
|
236 void setPersistentlyEnabled(boolean enabled) throws ScfException; |
|
237 |
|
238 /** |
|
239 * Service should run until next boot. |
|
240 */ |
|
241 boolean isTemporarilyEnabled() throws ScfException; |
|
242 |
|
243 /** |
|
244 * Service should run. |
|
245 */ |
|
246 boolean isEnabled() throws ScfException; |
|
247 |
|
248 /** |
|
249 * Whether Service is an instance. |
|
250 */ |
|
251 boolean isInstance() throws ScfException; |
|
252 |
|
253 /** |
|
254 * Restarter of service. |
|
255 */ |
|
256 String getRestarter() throws ScfException; |
|
257 |
|
258 /** |
|
259 * Current state of service. |
|
260 */ |
|
261 SmfState getState() throws ScfException; |
|
262 |
|
263 /** |
|
264 * Next state of service. |
|
265 */ |
|
266 SmfState getNextState() throws ScfException; |
|
267 |
|
268 /** |
|
269 * Time of last state transition. |
|
270 */ |
|
271 Date getSTime() throws ScfException; |
|
272 |
|
273 /** |
|
274 * Process contract of main processes. |
|
275 */ |
|
276 BigInteger getContractID() throws ScfException; |
|
277 |
|
278 /** |
|
279 * Extra state information. |
|
280 */ |
|
281 String getAuxiliaryState() throws ScfException; |
|
282 |
|
283 /** |
|
284 * Reason for state. |
|
285 */ |
|
286 String getReason() throws ScfException; |
|
287 } |