diff --git a/scm-core/src/main/java/sonia/scm/LastModifiedAware.java b/scm-core/src/main/java/sonia/scm/LastModifiedAware.java new file mode 100644 index 0000000000..43deacf09a --- /dev/null +++ b/scm-core/src/main/java/sonia/scm/LastModifiedAware.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2010, Sebastian Sdorra + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of SCM-Manager; nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * http://bitbucket.org/sdorra/scm-manager + * + */ + + + +package sonia.scm; + +/** + * + * @author Sebastian Sdorra + */ +public interface LastModifiedAware +{ + + /** + * Method description + * + * + * @return + */ + public Long getLastModified(); +} diff --git a/scm-core/src/main/java/sonia/scm/Manager.java b/scm-core/src/main/java/sonia/scm/Manager.java index 45673122eb..9fc413a785 100644 --- a/scm-core/src/main/java/sonia/scm/Manager.java +++ b/scm-core/src/main/java/sonia/scm/Manager.java @@ -47,7 +47,7 @@ import java.util.Collection; * @param */ public interface Manager - extends HandlerBase + extends HandlerBase, LastModifiedAware { /** diff --git a/scm-core/src/main/java/sonia/scm/group/Group.java b/scm-core/src/main/java/sonia/scm/group/Group.java index 4d918d7484..b269f1439a 100644 --- a/scm-core/src/main/java/sonia/scm/group/Group.java +++ b/scm-core/src/main/java/sonia/scm/group/Group.java @@ -35,6 +35,7 @@ package sonia.scm.group; //~--- non-JDK imports -------------------------------------------------------- +import sonia.scm.LastModifiedAware; import sonia.scm.TypedObject; import sonia.scm.Validateable; import sonia.scm.util.Util; @@ -61,8 +62,8 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @XmlRootElement(name = "groups") @XmlAccessorType(XmlAccessType.FIELD) public class Group - implements TypedObject, Serializable, Cloneable, Validateable, - Iterable + implements TypedObject, LastModifiedAware, Cloneable, Validateable, + Iterable, Serializable { /** Field description */ diff --git a/scm-core/src/main/java/sonia/scm/repository/Repository.java b/scm-core/src/main/java/sonia/scm/repository/Repository.java index b434eaad0c..fe2ababe5c 100644 --- a/scm-core/src/main/java/sonia/scm/repository/Repository.java +++ b/scm-core/src/main/java/sonia/scm/repository/Repository.java @@ -35,6 +35,7 @@ package sonia.scm.repository; //~--- non-JDK imports -------------------------------------------------------- +import sonia.scm.LastModifiedAware; import sonia.scm.TypedObject; import sonia.scm.Validateable; import sonia.scm.util.Util; @@ -62,7 +63,8 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @XmlRootElement(name = "repositories") @XmlAccessorType(XmlAccessType.FIELD) public class Repository - implements TypedObject, Validateable, Cloneable, Serializable + implements TypedObject, LastModifiedAware, Validateable, Cloneable, + Serializable { /** Field description */ @@ -229,6 +231,7 @@ public class Repository * * @return */ + @Override public Long getLastModified() { return lastModified; diff --git a/scm-core/src/main/java/sonia/scm/user/User.java b/scm-core/src/main/java/sonia/scm/user/User.java index e39059a709..bf4104bf7d 100644 --- a/scm-core/src/main/java/sonia/scm/user/User.java +++ b/scm-core/src/main/java/sonia/scm/user/User.java @@ -35,6 +35,7 @@ package sonia.scm.user; //~--- non-JDK imports -------------------------------------------------------- +import sonia.scm.LastModifiedAware; import sonia.scm.TypedObject; import sonia.scm.Validateable; import sonia.scm.util.Util; @@ -59,7 +60,8 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @XmlRootElement(name = "users") @XmlAccessorType(XmlAccessType.FIELD) public class User - implements TypedObject, Principal, Cloneable, Validateable, Serializable + implements TypedObject, Principal, Cloneable, LastModifiedAware, + Validateable, Serializable { /** Field description */ @@ -312,6 +314,7 @@ public class User * * @return */ + @Override public Long getLastModified() { return lastModified; diff --git a/scm-webapp/src/main/java/sonia/scm/group/xml/XmlGroupManager.java b/scm-webapp/src/main/java/sonia/scm/group/xml/XmlGroupManager.java index b19cd2e0f0..0aa06d4ad5 100644 --- a/scm-webapp/src/main/java/sonia/scm/group/xml/XmlGroupManager.java +++ b/scm-webapp/src/main/java/sonia/scm/group/xml/XmlGroupManager.java @@ -387,6 +387,18 @@ public class XmlGroupManager extends AbstractGroupManager return groups; } + /** + * Method description + * + * + * @return + */ + @Override + public Long getLastModified() + { + return groupDB.getLastModified(); + } + //~--- methods -------------------------------------------------------------- /** diff --git a/scm-webapp/src/main/java/sonia/scm/repository/xml/XmlRepositoryManager.java b/scm-webapp/src/main/java/sonia/scm/repository/xml/XmlRepositoryManager.java index 2c8f42708b..8f0693938a 100644 --- a/scm-webapp/src/main/java/sonia/scm/repository/xml/XmlRepositoryManager.java +++ b/scm-webapp/src/main/java/sonia/scm/repository/xml/XmlRepositoryManager.java @@ -407,6 +407,18 @@ public class XmlRepositoryManager extends AbstractRepositoryManager return handlerMap.get(type); } + /** + * Method description + * + * + * @return + */ + @Override + public Long getLastModified() + { + return repositoryDB.getLastModified(); + } + /** * Method description * diff --git a/scm-webapp/src/main/java/sonia/scm/user/xml/XmlUserManager.java b/scm-webapp/src/main/java/sonia/scm/user/xml/XmlUserManager.java index 6da9b2b31b..0c28e2c47b 100644 --- a/scm-webapp/src/main/java/sonia/scm/user/xml/XmlUserManager.java +++ b/scm-webapp/src/main/java/sonia/scm/user/xml/XmlUserManager.java @@ -403,6 +403,18 @@ public class XmlUserManager extends AbstractUserManager return users; } + /** + * Method description + * + * + * @return + */ + @Override + public Long getLastModified() + { + return userDB.getLastModified(); + } + //~--- methods -------------------------------------------------------------- /**