private String getTopic ( BundleEvent bundleEvent ) { StringBuilder topic = new StringBuilder ( BUNDLE_EVENT_TOPIC_PREFIX ) ; switch ( bundleEvent . getType ( ) ) { case BundleEvent . INSTALLED : topic . append ( "INSTALLED" ) ; break ; case BundleEvent . STARTED : topic . append ( "STARTED" ) ; break ; case BundleEvent . STOPPED : topic . append ( "STOPPED" ) ; break ; case BundleEvent . UPDATED : topic . append ( "UPDATED" ) ; break ; case BundleEvent . UNINSTALLED : topic . append ( "UNINSTALLED" ) ; break ; case BundleEvent . RESOLVED : topic . append ( "RESOLVED" ) ; break ; case BundleEvent . UNRESOLVED : topic . append ( "UNRESOLVED" ) ; break ; default : return null ; } return topic . toString ( ) ; }
Determine the appropriate topic to use for the Bundle Event .