Project

General

Profile

Download (1.81 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 org.apache.log4j.Logger;
13
import org.hibernate.envers.Audited;
14

    
15

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

    
23
/**
24
 * @author m.doering
25
 * @version 1.0
26
 * @created 08-Nov-2007 13:06:35
27
 */
28
@XmlAccessorType(XmlAccessType.FIELD)
29
@XmlType(name = "MovieFile", propOrder = {
30
    "duration"
31
})
32
@XmlRootElement(name = "MovieFile")
33
@Entity
34
@Audited
35
public class MovieFile extends MediaRepresentationPart {
36
	private static final long serialVersionUID = 8650308822737671731L;
37
	private static final Logger logger = Logger.getLogger(MovieFile.class);
38
	
39
	//Length of movie in seconds
40
	@XmlElement(name = "Duration")
41
	private int duration;
42

    
43
	public static MovieFile NewInstance(String uri, Integer size){
44
		logger.debug("NewInstance");
45
		return new MovieFile(uri, size);
46
	}
47
	
48
	/**
49
	 * Factory method
50
	 * @return
51
	 */
52
	public static MovieFile NewInstance(){
53
		return new MovieFile();
54
	}
55
	
56
	/**
57
	 * Constructor
58
	 */
59
	protected MovieFile() {
60
		super();
61
	}
62
	
63
	/**
64
	 * Constructor
65
	 */
66
	protected MovieFile(String uri, Integer size) {
67
		super(uri, size);
68
	}
69
	
70
	
71
	/**
72
	 * The Length of the movie in seconds
73
	 * 
74
	 * @return
75
	 */
76
	public int getDuration(){
77
		return this.duration;
78
	}
79

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

    
88
}
(9-9/13)