class ComponentEventRestService {

    @GET
    @Path( "/host/{host_id}/{event_source}" )
    @Produces( "application/json" )
    public List<Event> getComponnetEvents( @PathParam( "host_id" ) String host_id,
                                           @PathParam( "event_source" ) EventComponent event_source )
        throws HMSRestException
    {

        if ( !serverConnector.getNodeMap().containsKey( host_id ) )
            throw new HMSRestException( Status.NOT_FOUND.getStatusCode(), "Invalid Request",
                                        "Can't find host with id " + host_id );
        else
        {

            ServerNode node = (ServerNode) serverConnector.getNodeMap().get( host_id );
            try
            {
                ServerComponent component = EventMonitoringSubscriptionHolder.getMappedServerComponents( event_source );
                executeServerMonitorTask( node, component );
                return EventMonitoringSubscriptionHolder.getEventList( node, component );
            }
            catch ( HmsOperationNotSupportedException e )
            {
                logger.error( "Operation not supported for node :" + host_id + " component: " + event_source );
                throw new HMSRestException( Status.INTERNAL_SERVER_ERROR.getStatusCode(), "Server Error",
                                            e.getMessage() );
            }
            catch ( HMSRestException e )
            {
                logger.error( "Error getting sensor events for node :" + host_id + " component: " + event_source, e );
                throw e;
            }
            catch ( HmsException e )
            {
                logger.error( "Error getting sensor events for node :" + host_id + " component: " + event_source, e );
                throw new HMSRestException( Status.INTERNAL_SERVER_ERROR.getStatusCode(), "Server Error",
                                            e.getMessage() );
            }
            catch ( Exception e )
            {
                logger.error( "Error getting sensor events for node :" + host_id + " component: " + event_source, e );
                throw new HMSRestException( Status.INTERNAL_SERVER_ERROR.getStatusCode(), "Server Error",
                                            e.getMessage() );
            }
        }
    }

}