edu.udayton.udri.asset.webcam.uvc/src/edu/udayton/udri/asset/webcam/uvc/UVCWebcamAsset.java
private Observation onCaptureImageCommand() throws AssetException
    {
        final DigitalMedia media = captureImage();
        
        final String captureReasonDescription = "Manual capture image command was received.";
        final ImageMetadata meta = createMetadata(captureReasonDescription);
        
        final Observation obs = new Observation()
            .withDigitalMedia(media)
            .withImageMetadata(meta)
            .withModalities(m_Modality);
        
        try 
        {
            m_Context.persistObservation(obs);
        } 
        catch (final PersistenceFailedException | ValidationFailedException e) 
        {
            Logging.log(LogService.LOG_ERROR, e.toString());
            Logging.log(LogService.LOG_ERROR, m_PersistanceFailure);
            throw new CommandExecutionException("Failed to persist observation");
        }
        
        return obs;
    }
/**
     * Method that captures an image to send back as an observation with DigitalMedia and ImageMetadata.
     * 
     * @return 
     *      the observation with image
     * @throws AssetException when capturing the image fails
     */
Method that captures an image to send back as an observation with DigitalMedia and ImageMetadata.

@return
the observation with image
@throws AssetException when capturing the image fails
Method that captures an image to send back as an observation with DigitalMedia and ImageMetadata . @return the observation with image @throws AssetException when capturing the image fails
private Observation onCaptureImageCommand() throws AssetException
    {
        final DigitalMedia media = captureImage();
        final String captureReasonDescription = "Manual capture image command was received.";
        final ImageMetadata meta = createMetadata(captureReasonDescription);
        final Observation obs = new Observation()
            .withDigitalMedia(media)
            .withImageMetadata(meta)
            .withModalities(m_Modality);
        try 
        {
            m_Context.persistObservation(obs);
        } 
        catch (final PersistenceFailedException | ValidationFailedException e) 
        {
            Logging.log(LogService.LOG_ERROR, e.toString());
            Logging.log(LogService.LOG_ERROR, m_PersistanceFailure);
            throw new CommandExecutionException("Failed to persist observation");
        }
        return obs;
    }
private Observation onCaptureImageCommand ( ) throws AssetException { final DigitalMedia media = captureImage ( ) ; final String captureReasonDescription = "Manual capture image command was received." ; final ImageMetadata meta = createMetadata ( captureReasonDescription ) ; final Observation obs = new Observation ( ) . withDigitalMedia ( media ) . withImageMetadata ( meta ) . withModalities ( m_Modality ) ; try { m_Context . persistObservation ( obs ) ; } catch ( final PersistenceFailedException | ValidationFailedException e ) { Logging . log ( LogService . LOG_ERROR , e . toString ( ) ) ; Logging . log ( LogService . LOG_ERROR , m_PersistanceFailure ) ; throw new CommandExecutionException ( "Failed to persist observation" ) ; } return obs ; }
Method that captures an image to send back as an observation with DigitalMedia and ImageMetadata.
Method that captures an image to send back as an observation with DigitalMedia and ImageMetadata .