1 /* 2 CIMEvent.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 * 17931 2005-07-28 thschaef Add InetAddress field 21 * + constructor and getter 22 * 1535756 2006-08-07 lupusalex Make code warning free 23 * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL 24 * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1) 25 * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2) 26 */ 27 28 package org.metricshub.wbem.sblim.cimclient.internal.wbem.indications; 29 30 /*- 31 * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲ 32 * WBEM Java Client 33 * ჻჻჻჻჻჻ 34 * Copyright 2023 - 2025 MetricsHub 35 * ჻჻჻჻჻჻ 36 * Licensed under the Apache License, Version 2.0 (the "License"); 37 * you may not use this file except in compliance with the License. 38 * You may obtain a copy of the License at 39 * 40 * http://www.apache.org/licenses/LICENSE-2.0 41 * 42 * Unless required by applicable law or agreed to in writing, software 43 * distributed under the License is distributed on an "AS IS" BASIS, 44 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 45 * See the License for the specific language governing permissions and 46 * limitations under the License. 47 * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱ 48 */ 49 50 import java.net.InetAddress; 51 import org.metricshub.wbem.javax.cim.CIMInstance; 52 53 /** 54 * Class CIMEvent is required for indication handling. 55 * 56 */ 57 public class CIMEvent { 58 protected CIMInstance iIndication; 59 60 protected String iID; 61 62 protected InetAddress iInetAddress = null; 63 64 /** 65 * Ctor. 66 * 67 * @param pIndication 68 */ 69 public CIMEvent(CIMInstance pIndication) { 70 this(pIndication, null); 71 } 72 73 /** 74 * Ctor. 75 * 76 * @param pIndication 77 * @param id 78 */ 79 public CIMEvent(CIMInstance pIndication, String id) { 80 this.iIndication = pIndication; 81 this.iID = id; 82 } 83 84 /** 85 * Constructor that takes the CIMInstance of the indication, the id as well 86 * as the InetAddress of the remote machine. 87 * 88 * @param pIndication 89 * The indication instance 90 * @param pId 91 * The id 92 * @param pInetAddress 93 * The address 94 */ 95 public CIMEvent(CIMInstance pIndication, String pId, InetAddress pInetAddress) { 96 this.iIndication = pIndication; 97 this.iID = pId; 98 this.iInetAddress = pInetAddress; 99 } 100 101 /** 102 * This method returns the InetAddress of the machine that hosts the CIM 103 * Agent that sent the indication. Be aware the remote machine could have 104 * multiple network adapters - thus the result can be ambiguous. 105 * 106 * @return The InetAddress of the remote machine 107 */ 108 public InetAddress getInetAddress() { 109 return this.iInetAddress; 110 } 111 112 /** 113 * getIndication 114 * 115 * @return CIMInstance 116 */ 117 public CIMInstance getIndication() { 118 return this.iIndication; 119 } 120 121 /** 122 * getID 123 * 124 * @return String 125 */ 126 public String getID() { 127 return this.iID; 128 } 129 }