org.jmonks.dms.versioncontrol.api
Interface RepositoryEntry

All Known Subinterfaces:
DirectoryEntry, FileEntry
All Known Implementing Classes:
DefaultDirectoryEntry, DefaultFileEntry, DefaultRepositoryEntry

public interface RepositoryEntry

Author:
Suresh Pragada This represents interface to entry in Repository. It can be either Directory or File. Every entry in repository will have an ID and name.

Method Summary
 boolean cancelDelete()
          This actually takes off the delete mark on the entry.
 boolean delete()
          This marks the entry for delete.
 java.util.Date getDeletedDate()
          Gets the deleted date of this entry.
 long getEntryID()
          This returns the unique ID of the entry.
 java.lang.String getEntryName()
          This returns name of the entry.
 int getEntryType()
          Returns the entry type.
 long getParentEntryID()
          Returns the parent entry ID.
 RepositoryEntry getParentRepositoryEntry()
          Gets the parent repository entry.
 boolean isDeleted()
          Returns the deleted status of the entry.
 boolean remove()
          This process actually permanently delete the entry from repository.
 

Method Detail

getEntryID

public long getEntryID()
This returns the unique ID of the entry. Every entry in repository will have a unique ID.

Returns:
Returns unique ID of the entry in repository.

getEntryName

public java.lang.String getEntryName()
This returns name of the entry.

Returns:
Returns the entry name.

getParentEntryID

public long getParentEntryID()
Returns the parent entry ID.

Returns:
Returns the entry ID of the parent.

getEntryType

public int getEntryType()
Returns the entry type.

Returns:
Returns the "1" if the entry type is file, "0" it entry type is directory.

getParentRepositoryEntry

public RepositoryEntry getParentRepositoryEntry()
Gets the parent repository entry.

Returns:
Returns the parent repository entry, null if parent doesnt exist.

delete

public boolean delete()
This marks the entry for delete. It is not actually physicall delete the entry from the repository. Later point of time, admin can go and recover this entry. These kind of entries will be stay in repository for sepcified period and delete completely when batch job runs on periodically based.

Returns:
Return true if it could mark delete the entry, false otherwise.

isDeleted

public boolean isDeleted()
Returns the deleted status of the entry.

Returns:
Return true if entry is deleted, false otherwise.

cancelDelete

public boolean cancelDelete()
This actually takes off the delete mark on the entry. When there is request to delete an entry, it simply marks the entry for delete. This takes off that mark on entry.

Returns:
Return true if delete mark has been cancelled, false otherwise.

getDeletedDate

public java.util.Date getDeletedDate()
Gets the deleted date of this entry.

Returns:
Returns date of the entry got deleted.

remove

public boolean remove()
This process actually permanently delete the entry from repository. After this operation entry will not be available in the repository.

Returns:
Returns true if entry got deleted permanently, false otherwise.