1 28 29 package ist.coach.coachEmsMibComponents.SnmpProtocolMonitorFactoryProviderComposition; 30 31 import ist.coach.coachEmfCommon.Utils; 32 import ist.coach.coachEmfCommon.CreateController; 33 import ist.coach.coachEmfCommon.CreateBindingInfo; 34 import ist.coach.coachEmfCommon.ExceptionMessages; 35 import ist.coach.coachEmfCommon.CreateErrorInfoTypeImpl; 36 import ist.coach.coachEmfCommon.ApplicationErrorInfoTypeImpl; 37 38 import ist.coach.coachEmsCommon.SnmpUtils; 39 import intt.itu.itut_x780.UIDType; 40 import intt.itu.itut_x780.CreateError; 41 import intt.itu.itut_x780.ApplicationError; 42 import intt.itu.itut_m3120.conditionalPackages.*; 43 import ist.coach.coachEmfServices.EmfBasicLog.*; 44 45 import org.omg.CosNaming.NameComponent ; 46 import ist.coach.coachEmsMibComponents.SnmpProtocolMonitorMgmt; 47 53 public class SnmpProtocolMonitorFactoryProviderImpl 54 extends ist.coach.coachEmsMibComponents.SnmpProtocolMonitorFactoryProviderComposition.SnmpProtocolMonitorFactoryProvider_impl 55 { 56 private static final String FACTORY_CLASS = "SnmpProtocolMonitorFactory"; 62 SnmpProtocolMonitorMgmt facade = null; 63 private BasicLog logSupport; 64 intt.itu.itut_q816.ContainmentComponent c_admin = null; 65 intt.itu.itut_q816.Containment c_query = null; 66 72 public SnmpProtocolMonitorFactoryProviderImpl() 73 { 74 } 75 89 public void 90 configuration_complete() 91 throws org.omg.Components.InvalidConfiguration 92 { 93 97 if ((facade = get_context().get_connection_facade()) == null) 98 throw new org.omg.Components.InvalidConfiguration(); 99 100 if ((c_admin = get_context().get_connection_containment_admin()) == null) 101 throw new org.omg.Components.InvalidConfiguration(); 102 103 if ((c_query = get_context().get_connection_containment_query()) == null) 104 throw new org.omg.Components.InvalidConfiguration(); 105 106 if ((logSupport = get_context().get_connection_basic_log()) == null) 107 throw new org.omg.Components.InvalidConfiguration(); 108 109 System.err.println("SnmpProtocolMonitorFactoryProvider configuration completed..."); 110 111 112 } 113 119 122 public org.omg.CosNaming.NameComponent [] 123 create(String nameBindingID, 124 org.omg.CosNaming.NameComponent [] superior, 125 String reqID, 126 String [] packageNameList, 127 byte[] mgmtIpAddress, 128 int snmpPort, 129 int supportedSnmpVersions) 130 throws intt.itu.itut_x780.ApplicationError, 131 intt.itu.itut_x780.CreateError 132 { 133 134 String nameBinding_str = "ist.coach.coachEmsMib.NameBindings." + 135 nameBindingID; 136 137 CreateBindingInfo info = CreateController.checkNameBinding(nameBinding_str); 138 139 String objectKind = info.objectKind; 140 short deletePolicy = info.deletePolicy; 141 142 if (! c_query.exists(superior)) { 144 ApplicationErrorInfoTypeImpl error_code = 145 new ApplicationErrorInfoTypeImpl(); 146 error_code.error = new UIDType( 147 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 148 intt.itu.itut_x780.ApplicationErrorConst.objectNotFound.value); 149 150 151 error_code.details = Utils.name2string(superior) + 152 ExceptionMessages.parent_object_error; 153 154 throw new ApplicationError(error_code); 155 } 156 157 159 String allocatedId = null; 160 if (reqID == null || reqID.length() == 0) { 161 162 org.omg.CosNaming.NameComponent [][] siblings = 163 c_query.getContained(superior); 164 allocatedId = CreateController.autoCreateId(siblings); 165 } 166 else 167 allocatedId = reqID; 168 169 171 org.omg.CosNaming.NameComponent [] name = CreateController.createFullName( 172 superior, 173 allocatedId, 174 Utils.name2facade(facade.facade_name()), 175 objectKind); 176 177 Utils.pretty_log(logSupport, FACTORY_CLASS, "Factory", (short) LogSeverity._Info, 178 "proceed to create " + Utils.name2string(name)); 179 180 facade.create( 181 name, 182 objectKind, 183 packageNameList, 184 deletePolicy, 185 intt.itu.itut_x780.SourceIndicatorType.resourceOperation, 186 superior, 187 mgmtIpAddress, 188 supportedSnmpVersions, 189 snmpPort); 190 191 c_admin.addName(name, superior); 192 194 196 Utils.pretty_log(logSupport, FACTORY_CLASS, "Factory", (short) LogSeverity._Info, 197 "successfully created " + Utils.name2string(name)); 198 return name; 199 200 } 201 202 205 public org.omg.CosNaming.NameComponent [] 206 create_base(String nameBinding, org.omg.CosNaming.NameComponent [] superior, String reqId) 207 throws intt.itu.itut_x780.CreateError, 208 209 intt.itu.itut_x780.ApplicationError 210 { 211 return null; 215 } 216 217 } 218 | Popular Tags |