org.jboss.dna.sequencer.mp3
Class Mp3MetadataSequencer
java.lang.Object
org.jboss.dna.sequencer.mp3.Mp3MetadataSequencer
- All Implemented Interfaces:
- StreamSequencer
public class Mp3MetadataSequencer
- extends java.lang.Object
- implements StreamSequencer
A sequencer that processes the binary content of an MP3 audio file, extracts the metadata for the file, and then writes that
audio metadata to the repository.
This sequencer produces data that corresponds to the following structure:
- mp3:metadata node of type
mp3:metadata
- jcr:mimeType - optional string property for the mime type of the image
- jcr:encoding - optional string property for the encoding of the image
- mp3:title - optional string property for the name of the audio file or recording
- mp3:author - optional string property for the author of the recording
- mp3:album - optional string property for the name of the album
- mp3:year - optional integer property for the year the recording as created
- mp3:comment - optional string property specifying a comment
- Author:
- Stefano Maestri, Randall Hauch
Method Summary |
void |
sequence(java.io.InputStream stream,
SequencerOutput output,
ProgressMonitor progressMonitor)
Sequence the data found in the supplied stream, placing the output information into the supplied map. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
METADATA_NODE
public static final java.lang.String METADATA_NODE
- See Also:
- Constant Field Values
MP3_PRIMARY_TYPE
public static final java.lang.String MP3_PRIMARY_TYPE
- See Also:
- Constant Field Values
MP3_TITLE
public static final java.lang.String MP3_TITLE
- See Also:
- Constant Field Values
MP3_AUTHOR
public static final java.lang.String MP3_AUTHOR
- See Also:
- Constant Field Values
MP3_ALBUM
public static final java.lang.String MP3_ALBUM
- See Also:
- Constant Field Values
MP3_YEAR
public static final java.lang.String MP3_YEAR
- See Also:
- Constant Field Values
MP3_COMMENT
public static final java.lang.String MP3_COMMENT
- See Also:
- Constant Field Values
Mp3MetadataSequencer
public Mp3MetadataSequencer()
sequence
public void sequence(java.io.InputStream stream,
SequencerOutput output,
ProgressMonitor progressMonitor)
- Sequence the data found in the supplied stream, placing the output information into the supplied map.
JBoss DNA's SequencingService determines the sequencers that should be executed by monitoring the changes to one or more
workspaces that it is monitoring. Changes in those workspaces are aggregated and used to determine which sequencers should
be called. If the sequencer implements this interface, then this method is called with the property that is to be sequenced
along with the interface used to register the output. The framework takes care of all the rest.
This operation should report progress to the supplied ProgressMonitor
. At the beginning of the operation, call
ProgressMonitor.beginTask(double, org.jboss.dna.common.i18n.I18n, Object...)
with a meaningful message describing
the operation and a total for the amount of work that will be done by this sequencer. Then perform the sequencing work,
periodically reporting work by specifying the amount of work
that has was just
completed or by creating a subtask
and reporting work against that subtask
monitor.
The implementation should also periodically check whether the operation has been
cancelled
. If this method returns true, the implementation should abort all work as
soon as possible and close any resources that were acquired or opened.
Finally, the implementation should call ProgressMonitor.done()
when the operation has finished.
- Specified by:
sequence
in interface StreamSequencer
- Parameters:
stream
- the stream with the data to be sequenced; never nulloutput
- the output from the sequencing operation; never nullprogressMonitor
- the progress monitor that should be kept updated with the sequencer's progress and that should be
frequently consulted as to whether this operation has been cancelled
.
Copyright © 2008. All Rights Reserved.