View Javadoc
1   /*
2     CIMOperation.java
3   
4     (C) Copyright IBM Corp. 2005, 2009
5   
6     THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
7     ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
8     CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
9   
10    You can obtain a current copy of the Eclipse Public License from
11    http://www.opensource.org/licenses/eclipse-1.0.php
12  
13    @author : Roberto Pineiro, IBM, roberto.pineiro@us.ibm.com
14   * @author : Chung-hao Tan, IBM, chungtan@us.ibm.com
15   * 
16   * 
17   * Change History
18   * Flag       Date        Prog         Description
19   *------------------------------------------------------------------------------- 
20   * 1535756    2006-08-07  lupusalex    Make code warning free
21   * 2003590    2008-06-30  blaschke-oss Change licensing from CPL to EPL
22   * 2524131    2009-01-21  raman_arora  Upgrade client to JDK 1.5 (Phase 1)
23   */
24  
25  package org.metricshub.wbem.sblim.cimclient.internal.wbem.operations;
26  
27  /*-
28   * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
29   * WBEM Java Client
30   * ჻჻჻჻჻჻
31   * Copyright 2023 - 2025 MetricsHub
32   * ჻჻჻჻჻჻
33   * Licensed under the Apache License, Version 2.0 (the "License");
34   * you may not use this file except in compliance with the License.
35   * You may obtain a copy of the License at
36   *
37   *      http://www.apache.org/licenses/LICENSE-2.0
38   *
39   * Unless required by applicable law or agreed to in writing, software
40   * distributed under the License is distributed on an "AS IS" BASIS,
41   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
42   * See the License for the specific language governing permissions and
43   * limitations under the License.
44   * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
45   */
46  
47  import org.metricshub.wbem.javax.cim.CIMObjectPath;
48  import org.metricshub.wbem.javax.wbem.WBEMException;
49  
50  /**
51   * CIMOperation
52   *
53   */
54  public abstract class CIMOperation {
55  	protected CIMObjectPath iObjectName;
56  
57  	protected String iNameSpace;
58  
59  	protected String iMethodCall;
60  
61  	protected Object iResult;
62  
63  	/**
64  	 * Returns the object name
65  	 *
66  	 * @return The object name
67  	 */
68  	public CIMObjectPath getObjectName() {
69  		return this.iObjectName;
70  	}
71  
72  	/**
73  	 * Returns the namespace
74  	 *
75  	 * @return The namespace
76  	 */
77  	public String getNameSpace() {
78  		return this.iNameSpace;
79  	}
80  
81  	/**
82  	 * Sets the namespace
83  	 *
84  	 * @param pNamespace
85  	 *            The namespace
86  	 */
87  	public void setNameSpace(String pNamespace) {
88  		this.iNameSpace = pNamespace;
89  	}
90  
91  	/**
92  	 * Returns the method call
93  	 *
94  	 * @return The method call
95  	 */
96  	public String getMethodCall() {
97  		return this.iMethodCall;
98  	}
99  
100 	/**
101 	 * Returns if an (uncaught) exception occurred
102 	 *
103 	 * @return <code>true</code> if an (uncaught) exception occurred,
104 	 *         <code>false</code> otherwise
105 	 */
106 	public boolean isException() {
107 		return (this.iResult instanceof Exception);
108 	}
109 
110 	/**
111 	 * Returns the result of the operation
112 	 *
113 	 * @return The result
114 	 * @throws WBEMException
115 	 */
116 	public Object getResult() throws WBEMException {
117 		if (this.iResult instanceof WBEMException) throw (WBEMException) this.iResult;
118 		return this.iResult;
119 	}
120 
121 	/**
122 	 * Sets the operation result
123 	 *
124 	 * @param pResult
125 	 *            The result
126 	 */
127 	public void setResult(Object pResult) {
128 		this.iResult = pResult;
129 	}
130 }