private void handleEvent ( SiteNode parent , SiteNode node , EventType eventType ) { switch ( eventType ) { case ADD : publishEvent ( SiteMapEventPublisher . SITE_NODE_ADDED_EVENT , node ) ; if ( parent == getRoot ( ) ) { publishEvent ( SiteMapEventPublisher . SITE_ADDED_EVENT , node ) ; } break ; case REMOVE : publishEvent ( SiteMapEventPublisher . SITE_NODE_REMOVED_EVENT , node ) ; if ( parent == getRoot ( ) ) { publishEvent ( SiteMapEventPublisher . SITE_REMOVED_EVENT , node ) ; } } }
Handles the publishing of the add or remove event . Node events are always published . Site events are only published when the parent of the node is the root of the tree .