1 28 29 package ist.coach.itut_x780Components.ManagedObjectProviderComposition; 30 31 import ist.coach.coachEmfCommon.Utils; 32 import ist.coach.coachEmfCommon.ExceptionMessages; 33 34 35 import ist.coach.coachEmfCommon.CreateErrorInfoTypeImpl; 36 import ist.coach.coachEmfCommon.ApplicationErrorInfoTypeImpl; 37 import ist.coach.coachEmfCommon.ManagedObjectValueTypeImpl; 38 39 import ist.coach.coachEmfCommon.ObjectDeletionImpl; 40 41 import intt.itu.itut_x780.ManagedObjectValueType; 42 import intt.itu.itut_x780.ApplicationError; 43 import intt.itu.itut_x780.AttributeValueType; 44 import intt.itu.itut_x780.UIDType; 45 46 import org.omg.CosNaming.NameComponent ; 47 import ist.coach.coachEmfServices.EmfBasicLog.*; 48 49 55 public class ManagedObjectProviderImpl 56 extends ist.coach.itut_x780Components.ManagedObjectProviderComposition.ManagedObjectProvider_impl 57 { 58 private String _facade_name; 64 65 protected static java.util.Hashtable elements; 66 private static int notifId = 100; 67 private BasicLog logSupport; 68 69 70 73 74 80 public ManagedObjectProviderImpl() 81 {} 82 88 102 public void 103 configuration_complete() 104 throws org.omg.Components.InvalidConfiguration 105 { 106 110 elements = new java.util.Hashtable (); 111 if ((logSupport = get_context().get_connection_basic_log()) == null) 112 throw new org.omg.Components.InvalidConfiguration(); 113 System.err.println(facade_name() + " configuration completed..."); 114 } 115 131 132 142 public void 143 ccm_remove() 144 throws org.omg.Components.CCMException 145 { 146 Utils.pretty_log(logSupport, "System Monitor", facade_name(), (short) LogSeverity._Info, 147 "ManagedObject monitoring is shutting down..."); 148 } 152 163 174 177 public String 178 facade_name() 179 { 180 return _facade_name; 184 } 185 186 189 public void 190 facade_name(String facade_name) 191 { 192 if (facade_name != null) 196 _facade_name = new String (facade_name); 197 } 198 199 202 public org.omg.CosNaming.NameComponent [] 203 nameGet() 204 { 205 return Utils.string2name(_facade_name); 209 } 210 211 214 public String 215 objectClassGet(org.omg.CosNaming.NameComponent [] name) 216 throws intt.itu.itut_x780.ApplicationError 217 { 218 if ( ! elements.containsKey(Utils.name2string(name))) { 222 ApplicationErrorInfoTypeImpl error_code = 223 new ApplicationErrorInfoTypeImpl(); 224 error_code.error = new UIDType( 225 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 226 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 227 error_code.details = ExceptionMessages.not_exists_error; 228 229 throw new ApplicationError(error_code); 230 } 231 ManagedObjectValueType mo_value = 232 (ManagedObjectValueType) elements.get(Utils.name2string(name)); 233 return mo_value.objectClass; 234 } 235 236 239 public intt.itu.itut_x780.ManagedObjectValueType 240 attributesGet(org.omg.CosNaming.NameComponent [] name, intt.itu.itut_x780.StringSetTypeHolder attributeNames) 241 throws intt.itu.itut_x780.ApplicationError 242 { 243 if ( ! elements.containsKey(Utils.name2string(name))) { 247 ApplicationErrorInfoTypeImpl error_code = 248 new ApplicationErrorInfoTypeImpl(); 249 error_code.error = new UIDType( 250 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 251 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 252 error_code.details = ExceptionMessages.not_exists_error; 253 254 throw new ApplicationError(error_code); 255 } 256 ManagedObjectValueType mo_value = 257 (ManagedObjectValueType) elements.get(Utils.name2string(name)); 258 261 273 Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name), (short) LogSeverity._Info, 274 "attributesGet successfully finished"); 275 276 279 return mo_value; 281 } 282 283 286 public String [] 287 packagesGet(org.omg.CosNaming.NameComponent [] name) 288 throws intt.itu.itut_x780.ApplicationError 289 { 290 if ( ! elements.containsKey(Utils.name2string(name))) { 294 ApplicationErrorInfoTypeImpl error_code = 295 new ApplicationErrorInfoTypeImpl(); 296 error_code.error = new UIDType( 297 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 298 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 299 error_code.details = ExceptionMessages.not_exists_error; 300 301 throw new ApplicationError(error_code); 302 } 303 ManagedObjectValueType mo_value = 304 (ManagedObjectValueType) elements.get(Utils.name2string(name)); 305 return mo_value.packages; 306 } 307 308 311 public intt.itu.itut_x780.SourceIndicatorType 312 creationSourceGet(org.omg.CosNaming.NameComponent [] name) 313 throws intt.itu.itut_x780.ApplicationError 314 { 315 if ( ! elements.containsKey(Utils.name2string(name))) { 319 ApplicationErrorInfoTypeImpl error_code = 320 new ApplicationErrorInfoTypeImpl(); 321 error_code.error = new UIDType( 322 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 323 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 324 error_code.details = ExceptionMessages.not_exists_error; 325 326 throw new ApplicationError(error_code); 327 } 328 ManagedObjectValueType mo_value = 329 (ManagedObjectValueType) elements.get(Utils.name2string(name)); 330 return mo_value.creationSource; 331 } 332 333 336 public short 337 deletePolicyGet(org.omg.CosNaming.NameComponent [] name) 338 throws intt.itu.itut_x780.ApplicationError 339 { 340 344 if ( ! elements.containsKey(Utils.name2string(name))) { 345 ApplicationErrorInfoTypeImpl error_code = 346 new ApplicationErrorInfoTypeImpl(); 347 error_code.error = new UIDType( 348 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 349 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 350 error_code.details = ExceptionMessages.not_exists_error; 351 352 throw new ApplicationError(error_code); 353 } 354 ManagedObjectValueType mo_value = 355 (ManagedObjectValueType) elements.get(Utils.name2string(name)); 356 return mo_value.deletePolicy; 357 } 358 359 362 public void 363 destroy(org.omg.CosNaming.NameComponent [] name) 364 throws intt.itu.itut_x780.ApplicationError, 365 intt.itu.itut_x780.DeleteError 366 { 367 if ( ! elements.containsKey(Utils.name2string(name))) { 371 ApplicationErrorInfoTypeImpl error_code = 372 new ApplicationErrorInfoTypeImpl(); 373 error_code.error = new UIDType( 374 intt.itu.itut_x780.ApplicationErrorConst.moduleName.value, 375 intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value); 376 error_code.details = ExceptionMessages.not_exists_error; 377 378 throw new ApplicationError(error_code); 379 380 } 381 ManagedObjectValueType mo_value = null; 382 synchronized(elements) { 383 mo_value = 384 (ManagedObjectValueType) elements.remove(Utils.name2string(name)); 385 } 386 org.omg.TimeBase.UtcT eventTime = new org.omg.TimeBase.UtcT(System.currentTimeMillis(), 387 0,(short) 0,(short) 0); 388 get_context().push_objectDeletion_alarm(new ObjectDeletionImpl(eventTime, name, 389 mo_value.objectClass, 390 getUniqueNotificationIdentifier(), 391 mo_value.creationSource, 392 new AttributeValueType[0])); 393 394 Utils.pretty_log(logSupport, Utils.name2string(name), mo_value.objectClass, (short) LogSeverity._Info, 395 "Object successfully removed"); 396 } 397 398 synchronized static int getUniqueNotificationIdentifier() { 399 400 notifId++; 401 402 return (notifId); 403 } 404 } 405 | Popular Tags |