private String getTopic ( ServiceEvent serviceEvent ) { StringBuilder topic = new StringBuilder ( SERVICE_EVENT_TOPIC_PREFIX ) ; switch ( serviceEvent . getType ( ) ) { case ServiceEvent . REGISTERED : topic . append ( "REGISTERED" ) ; break ; case ServiceEvent . MODIFIED : topic . append ( "MODIFIED" ) ; break ; case ServiceEvent . UNREGISTERING : topic . append ( "UNREGISTERING" ) ; break ; default : return null ; } return topic . toString ( ) ; }
Determine the appropriate topic to use for the Service Event .