1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.cdm.model.media;
|
11
|
|
12
|
import org.apache.log4j.Logger;
|
13
|
import org.hibernate.envers.Audited;
|
14
|
|
15
|
import javax.persistence.*;
|
16
|
import javax.xml.bind.annotation.XmlAccessType;
|
17
|
import javax.xml.bind.annotation.XmlAccessorType;
|
18
|
import javax.xml.bind.annotation.XmlElement;
|
19
|
import javax.xml.bind.annotation.XmlRootElement;
|
20
|
import javax.xml.bind.annotation.XmlType;
|
21
|
|
22
|
/**
|
23
|
* @author m.doering
|
24
|
* @version 1.0
|
25
|
* @created 08-Nov-2007 13:06:11
|
26
|
*/
|
27
|
@XmlAccessorType(XmlAccessType.FIELD)
|
28
|
@XmlType(name = "AudioFile", propOrder = {
|
29
|
"duration"
|
30
|
})
|
31
|
@XmlRootElement(name = "AudioFile")
|
32
|
@Entity
|
33
|
@Audited
|
34
|
public class AudioFile extends MediaRepresentationPart {
|
35
|
private static final long serialVersionUID = 2327736023969971196L;
|
36
|
private static final Logger logger = Logger.getLogger(AudioFile.class);
|
37
|
|
38
|
//length of recording in seconds
|
39
|
@XmlElement(name = "Duration")
|
40
|
private int duration;
|
41
|
|
42
|
public static AudioFile NewInstance(String uri, Integer size){
|
43
|
logger.debug("NewInstance");
|
44
|
return new AudioFile(uri, size);
|
45
|
}
|
46
|
|
47
|
/**
|
48
|
* Factory method
|
49
|
* @return
|
50
|
*/
|
51
|
public static AudioFile NewInstance(){
|
52
|
return new AudioFile();
|
53
|
}
|
54
|
|
55
|
/**
|
56
|
* Constructor
|
57
|
*/
|
58
|
protected AudioFile() {
|
59
|
super();
|
60
|
}
|
61
|
|
62
|
/**
|
63
|
* Constructor
|
64
|
*/
|
65
|
protected AudioFile(String uri, Integer size) {
|
66
|
super(uri, size);
|
67
|
}
|
68
|
|
69
|
public int getDuration(){
|
70
|
return this.duration;
|
71
|
}
|
72
|
|
73
|
/**
|
74
|
*
|
75
|
* @param duration duration
|
76
|
*/
|
77
|
public void setDuration(int duration){
|
78
|
this.duration = duration;
|
79
|
}
|
80
|
|
81
|
}
|