View Javadoc
1   /*
2    * Licensed to The Apereo Foundation under one or more contributor license
3    * agreements. See the NOTICE file distributed with this work for additional
4    * information regarding copyright ownership.
5    *
6    *
7    * The Apereo Foundation licenses this file to you under the Educational
8    * Community License, Version 2.0 (the "License"); you may not use this file
9    * except in compliance with the License. You may obtain a copy of the License
10   * at:
11   *
12   *   http://opensource.org/licenses/ecl2.txt
13   *
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
17   * License for the specific language governing permissions and limitations under
18   * the License.
19   *
20   */
21  package org.opencastproject.assetmanager.impl;
22  
23  import org.opencastproject.assetmanager.api.Availability;
24  import org.opencastproject.assetmanager.api.Snapshot;
25  import org.opencastproject.assetmanager.api.Version;
26  import org.opencastproject.mediapackage.MediaPackage;
27  
28  import java.util.Date;
29  
30  public class SnapshotImpl implements Snapshot {
31    private final Long id;
32    private final Version version;
33    private final String organizationId;
34    private final Date archivalDate;
35    private final Availability availability;
36    private final String storageId;
37    private final String owner;
38    private final MediaPackage mediaPackage;
39  
40    public SnapshotImpl(
41            Version version,
42            String organizationId,
43            Date archivalDate,
44            Availability availability,
45            String storageId,
46            String owner,
47            MediaPackage mediaPackage) {
48      this.id = null;
49      this.version = version;
50      this.organizationId = organizationId;
51      this.archivalDate = archivalDate;
52      this.availability = availability;
53      this.mediaPackage = mediaPackage;
54      this.owner = owner;
55      this.storageId = storageId;
56    }
57  
58    public SnapshotImpl(
59            Long id,
60            Version version,
61            String organizationId,
62            Date archivalDate,
63            Availability availability,
64            String storageId,
65            String owner,
66            MediaPackage mediaPackage) {
67      this.id = id;
68      this.version = version;
69      this.organizationId = organizationId;
70      this.archivalDate = archivalDate;
71      this.availability = availability;
72      this.mediaPackage = mediaPackage;
73      this.owner = owner;
74      this.storageId = storageId;
75    }
76  
77    @Override public Version getVersion() {
78      return version;
79    }
80  
81    @Override public String getOrganizationId() {
82      return organizationId;
83    }
84  
85    @Override public Date getArchivalDate() {
86      return archivalDate;
87    }
88  
89    @Override public Availability getAvailability() {
90      return availability;
91    }
92  
93    @Override public MediaPackage getMediaPackage() {
94      return mediaPackage;
95    }
96  
97    @Override public String getOwner() {
98      return owner;
99    }
100 
101   @Override public String getStorageId() {
102     return storageId;
103   }
104 }