added LastModifiedAware interface

This commit is contained in:
Sebastian Sdorra
2011-02-12 19:55:18 +01:00
parent 8a8ab5f6e6
commit d5c2338d1d
8 changed files with 98 additions and 5 deletions

View File

@@ -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();
}

View File

@@ -47,7 +47,7 @@ import java.util.Collection;
* @param <E>
*/
public interface Manager<T extends TypedObject, E extends Exception>
extends HandlerBase<T, E>
extends HandlerBase<T, E>, LastModifiedAware
{
/**

View File

@@ -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<String>
implements TypedObject, LastModifiedAware, Cloneable, Validateable,
Iterable<String>, Serializable
{
/** Field description */

View File

@@ -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;

View File

@@ -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;

View File

@@ -387,6 +387,18 @@ public class XmlGroupManager extends AbstractGroupManager
return groups;
}
/**
* Method description
*
*
* @return
*/
@Override
public Long getLastModified()
{
return groupDB.getLastModified();
}
//~--- methods --------------------------------------------------------------
/**

View File

@@ -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
*

View File

@@ -403,6 +403,18 @@ public class XmlUserManager extends AbstractUserManager
return users;
}
/**
* Method description
*
*
* @return
*/
@Override
public Long getLastModified()
{
return userDB.getLastModified();
}
//~--- methods --------------------------------------------------------------
/**