001/*
002 * file CqHit.java
003 *
004 * Licensed Materials - Property of IBM
005 * Restricted Materials of IBM 
006 *
007 * com.ibm.rational.wvcm.stp.cq.CqHit
008 *
009 * (C) Copyright IBM Corporation 2008, 2014.  All Rights Reserved.
010 * Note to U.S. Government Users Restricted Rights:  Use, duplication or 
011 * disclosure restricted by GSA ADP  Schedule Contract with IBM Corp.
012 */
013
014package com.ibm.rational.wvcm.stp.cq;
015
016import java.util.List;
017
018import javax.wvcm.PropertyNameList;
019
020import com.ibm.rational.wvcm.stp.StpLocation;
021
022/**
023 * Information about one record matching by a full-text search query.
024 */
025public interface CqHit
026{
027    /**
028     * @return The score or rank (from 1 to 100) of this hit compared to the
029     *         other hits of the result set. Its common to have one or more
030     *         hits with the same score.
031     */
032    int getScore();
033
034    /**
035     * @return The value of the USER_FRIENDLY_LOCATION property of the hit
036     *         resource.
037     */
038    StpLocation getUserFriendlyLocation();
039
040    /**
041     * @return The value of the STABLE_LOCATION property of the hit
042     *         resource.
043     */
044    StpLocation getStableLocation();
045
046    /**
047     * @return <b>true</b> if the version of the resource that generated this
048     *         hit in the indexed content of the database is different from the
049     *         version that currently exists in the database. Use this
050     *         information to let the user know that this hit item may change
051     *         when indexing catches up with the database. For example, its
052     *         possible this hit item will not show up as a hit for the same
053     *         search when rerun.
054     */
055    boolean notCurrent();
056
057    /**
058     * @return The version of the hit resource in the ClearQuest database. 
059     */
060    long getVersion();
061
062    /**
063     * @return The version of the hit resource whose content has been indexed.
064     *         If the value you get back from this call and from getVersion()
065     *         are different, the indexing has not yet caught-up with the
066     *         updates in the database.
067     * 
068     */
069    long getIndexedVersion();
070
071    /**
072     * @return A PropertyNameList containing a PropertyName for each property of
073     *         the resource whose value is reported in this hit item. This list
074     *         is determined by the database administrator and cannot be changed
075     *         by any method in this API. The ordering of this list matches the
076     *         ordering of the values returned by getPropertyValues().
077     */
078    PropertyNameList getPropertyNames();
079
080    /**
081     * @return A List<String> containing a value for each property of the
082     *         resource reported in this hit. The number and ordering of these
083     *         values matches the number and ordering of the PropertyNames
084     *         returned by getPropertyNames().
085     */
086    List<String> getPropertyValues();
087    
088    /**
089     * @return A String of displayName for each record in this hit.
090     *         The displayName is returned by getDisplayName().        
091     */
092    String getDisplayName();
093
094}