org.apache.directory.server.core.changelog
Interface TagSearchEngine


public interface TagSearchEngine

An optional search interface supported by TaggableChangeLogStores. This interface enables the:

While investigating these interface methods keep in mind that only one tag can exist on a revision. Unlike subversion which allows multiple tags on a revision we only allow at most one: more than one is pointless. Date wise searches for tags are not present within this interface since they should be used in conjunction with the ChangeLogSearchEngine which is by default supported by TaggableSearchableChangeLogStores. The ChangeLogSearchEngine can find revisions based on time descriptors and returned revisions can be checked for the presence of tags using this interface. The whole point to enabling both search engines in a single interfaces is because if you can search for tags you should be able to search for revisions: however the converse may not be the case.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Method Summary
 Cursor<Tag> find(long startRevision, long endRevision, RevisionOrder order)
          Enumerates over the tags of all snapshots taken between a specific revision range inclusive.
 Cursor<Tag> find(RevisionOrder order)
          Finds all the snapshot tags taken since revision 0 until the current revision.
 Cursor<Tag> findAfter(long revision, RevisionOrder order)
          Finds all the snapshot tags taken after a specific revision.
 Cursor<Tag> findBefore(long revision, RevisionOrder order)
          Finds all the snapshot tags taken before a specific revision.
 boolean has(long revision)
          Checks to see if a snapshot exists for a specific revision.
 Tag lookup(long revision)
          Gets the tag for a specific snapshot if that snapshot exists.
 

Method Detail

lookup

Tag lookup(long revision)
           throws java.lang.Exception
Gets the tag for a specific snapshot if that snapshot exists.

Parameters:
revision - the revision number to use to check for a snapshot
Returns:
the snapshot at the revision if one exists, otherwise null
Throws:
java.lang.Exception - if there is a problem accessing the store

has

boolean has(long revision)
            throws java.lang.Exception
Checks to see if a snapshot exists for a specific revision.

Parameters:
revision - the revision number to use to check for a snapshot
Returns:
true if a snapshot exists at the revision, false otherwise
Throws:
java.lang.Exception - if there is a problem accessing the store

find

Cursor<Tag> find(RevisionOrder order)
                 throws java.lang.Exception
Finds all the snapshot tags taken since revision 0 until the current revision.

Parameters:
order - the revision order in which to return snapshot tags
Returns:
a cursor containing the tags of all snapshots taken since revision 1
Throws:
java.lang.Exception - if there is a problem accessing the store

findBefore

Cursor<Tag> findBefore(long revision,
                       RevisionOrder order)
                       throws java.lang.Exception
Finds all the snapshot tags taken before a specific revision. If a tag exists at the revision parameter it will be returned as well.

Parameters:
revision - the revision number to get snapshots before
order - the revision order in which to return snapshot tags
Returns:
an enumeration over the tags of all snapshots taken before a revision inclusive
Throws:
java.lang.Exception - if there is a problem accessing the store
java.lang.IllegalArgumentException - if the revision is greater than the current revision or less than 0.

findAfter

Cursor<Tag> findAfter(long revision,
                      RevisionOrder order)
                      throws java.lang.Exception
Finds all the snapshot tags taken after a specific revision. If a tag exists at the revision parameter it will be returned as well.

Parameters:
revision - the revision number to get snapshots after
order - the revision order in which to return snapshot tags
Returns:
an enumeration over the tags of all snapshots taken after a revision inclusive
Throws:
java.lang.Exception - if there is a problem accessing the store
java.lang.IllegalArgumentException - if the revision is greater than the current revision or less than 0.

find

Cursor<Tag> find(long startRevision,
                 long endRevision,
                 RevisionOrder order)
                 throws java.lang.Exception
Enumerates over the tags of all snapshots taken between a specific revision range inclusive. The first revision parameter should be less than or equal to the second revision parameter.

Parameters:
startRevision - the revision to start on inclusive
endRevision - the revision to end on inclusive
order - the revision order in which to return snapshot tags
Returns:
enumeration over all the snapshots taken in a revision range inclusive
Throws:
java.lang.Exception - if there is a problem accessing the store
java.lang.IllegalArgumentException - if the revision range is not constructed properly or if either revision number is greater than the current revision or less than 0.


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.