Add the API for representing versioning system
[smart-dao.git] / smart-version / smart-version-api / src / main / java / com / smartitengineering / version / api / VersionedResource.java
blob116e6eea58687642fef18fdf054a2aaa6e1b26d5
1 /*
2 * This is a common dao with basic CRUD operations and is not limited to any
3 * persistent layer implementation
4 *
5 * Copyright (C) 2008 Imran M Yousuf (imyousuf@smartitengineering.com)
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 3 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 package com.smartitengineering.version.api;
21 import java.util.Collection;
23 /**
24 * This object represents an resource that is versioned. It provides easy access
25 * to versions of the resource.
26 * @author imyousuf
28 public interface VersionedResource {
30 /**
31 * Retrieve the content of object from the HEAD revision.
32 * @return Content of HEAD
34 public Resource getHeadVersionResource();
36 /**
37 * Get the versions of the object. The must be sorted in descending order,
38 * i.e. HEAD will be in index 0 and the first version @ 'size - 1'th
39 * position.
40 * @return All versions for the object, empty if now revisions available.
42 public Collection<Revision> getRevisions();