public void pushEvent ( final String attributeName , final AttributeValue value , final EventType eventType ) throws DevFailed { switch ( eventType ) { case CHANGE_EVENT : case ARCHIVE_EVENT : case USER_EVENT : // set attribute value final AttributeImpl attribute = AttributeGetterSetter . getAttribute ( attributeName , device . getAttributeList ( ) ) ; attribute . lock ( ) ; try { attribute . updateValue ( value ) ; // push the event EventManager . getInstance ( ) . pushAttributeValueEvent ( name , attributeName , eventType ) ; } catch ( final DevFailed e ) { EventManager . getInstance ( ) . pushAttributeErrorEvent ( name , attributeName , e ) ; } finally { attribute . unlock ( ) ; } break ; default : throw DevFailedUtils . newDevFailed ( "Only USER, ARCHIVE or CHANGE event can be send" ) ; } }
Push an event if some client had register it .