Project

General

Profile

Download (1.8 KB) Statistics
| Branch: | Tag: | Revision:
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 java.net.URI;
13

    
14
import org.apache.log4j.Logger;
15
import org.hibernate.envers.Audited;
16

    
17

    
18
import javax.persistence.*;
19
import javax.xml.bind.annotation.XmlAccessType;
20
import javax.xml.bind.annotation.XmlAccessorType;
21
import javax.xml.bind.annotation.XmlElement;
22
import javax.xml.bind.annotation.XmlRootElement;
23
import javax.xml.bind.annotation.XmlType;
24

    
25
/**
26
 * @author m.doering
27
 * @since 08-Nov-2007 13:06:35
28
 */
29
@XmlAccessorType(XmlAccessType.FIELD)
30
@XmlType(name = "MovieFile", propOrder = {
31
    "duration"
32
})
33
@XmlRootElement(name = "MovieFile")
34
@Entity
35
@Audited
36
public class MovieFile extends MediaRepresentationPart {
37
	private static final long serialVersionUID = 8650308822737671731L;
38
	private static final Logger logger = Logger.getLogger(MovieFile.class);
39

    
40
	//Length of movie in seconds
41
	@XmlElement(name = "Duration")
42
	private int duration;
43

    
44
	public static MovieFile NewInstance(URI uri, Integer size){
45
		logger.debug("NewInstance");
46
		return new MovieFile(uri, size);
47
	}
48

    
49
	/**
50
	 * Factory method
51
	 * @return
52
	 */
53
	public static MovieFile NewInstance(){
54
		return new MovieFile();
55
	}
56

    
57
	/**
58
	 * Constructor
59
	 */
60
	protected MovieFile() {
61
		super();
62
	}
63

    
64
	/**
65
	 * Constructor
66
	 */
67
	protected MovieFile(URI uri, Integer size) {
68
		super(uri, size);
69
	}
70

    
71

    
72
	/**
73
	 * The Length of the movie in seconds
74
	 *
75
	 * @return
76
	 */
77
	public int getDuration(){
78
		return this.duration;
79
	}
80

    
81
	/**
82
	 * Sets the Length of the movie in seconds
83
	 * @param duration    duration
84
	 */
85
	public void setDuration(int duration){
86
		this.duration = duration;
87
	}
88

    
89
}
(13-13/16)