Changeset 2165


Ignore:
Timestamp:
08/28/12 20:11:45 (12 years ago)
Author:
oschonef
Message:
  • rename SRUClient to SRUSimpleClient (no pun intended)

HEADS UP: This breaks existing API. Please update you application.

OT: I saw tail lights last night in a dream about my old life ...

Location:
SRUClient/trunk/src
Files:
2 moved

Legend:

Unmodified
Added
Removed
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUSimpleClient.java

    r2163 r2165  
    4747
    4848/**
    49  * A class to perform SRU operations.
    50  * <p>This class is <em>not</em> thread-safe!</p>
     49 * A simple client to perform SRU operations using callbacks. The application
     50 * must provide the appropriate callbacks to receive the results of the
     51 * operations.
     52 * <p>
     53 * This client is reusable but not thread-safe: the application may reuse a
     54 * client object, but it may not be concurrently shared between multiple
     55 * threads.
     56 * </p>
     57 * <p>
     58 * This class is modeled after Java's SAX-API.
     59 * </p>
     60 *
     61 * @see SRUExplainHandler
     62 * @see SRUScanHandler
     63 * @see SRUSearchRetrieveHandler
     64 * @see SRUDefaultHandlerAdapter
    5165 */
    52 public class SRUClient {
     66public class SRUSimpleClient {
    5367    /** default version the client will use, if not otherwise specified */
    5468    public static final SRUVersion DEFAULT_SRU_VERSION = SRUVersion.VERSION_1_2;
     
    6478    private static final String RECORD_PACKING_STRING = "string";
    6579    private static final Logger logger =
    66             LoggerFactory.getLogger(SRUClient.class);
     80            LoggerFactory.getLogger(SRUSimpleClient.class);
    6781    private final SRUVersion defaultVersion;
    6882    private boolean strictMode;
     
    7690     * use the default SRU version.
    7791     *
    78      * @see #SRUClient(SRUVersion, boolean)
     92     * @see #SRUSimpleClient(SRUVersion, boolean)
    7993     * @see #DEFAULT_SRU_VERSION
    8094     */
    81     public SRUClient() {
     95    public SRUSimpleClient() {
    8296        this(DEFAULT_SRU_VERSION, true);
    8397    }
     
    90104     *            the default version to use for SRU requests; may be overridden
    91105     *            by individual requests
    92      * @see #SRUClient(SRUVersion, boolean)
     106     * @see #SRUSimpleClient(SRUVersion, boolean)
    93107     */
    94     public SRUClient(SRUVersion defaultVersion) {
     108    public SRUSimpleClient(SRUVersion defaultVersion) {
    95109        this(defaultVersion, true);
    96110    }
     
    109123     *            certain violations
    110124     */
    111     public SRUClient(SRUVersion defaultVersion, boolean strictMode) {
     125    public SRUSimpleClient(SRUVersion defaultVersion, boolean strictMode) {
    112126        this(defaultVersion, strictMode,
    113127                new HashMap<String, SRURecordDataParser>());
     
    134148     *            parser mappings
    135149     */
    136     SRUClient(SRUVersion defaultVersion, boolean strictMode,
     150    SRUSimpleClient(SRUVersion defaultVersion, boolean strictMode,
    137151            Map<String, SRURecordDataParser> parsers) {
    138152        if (defaultVersion == null) {
     
    11391153    }
    11401154
    1141 } // class SRUClient
     1155} // class SRUSimpleClient
  • SRUClient/trunk/src/test/java/eu/clarin/sru/client/TestSimpleClient.java

    r2163 r2165  
    2626
    2727
    28 public class TestClient {
     28public class TestSimpleClient {
    2929    private static final Logger logger =
    30             LoggerFactory.getLogger(TestClient.class);
     30            LoggerFactory.getLogger(TestSimpleClient.class);
    3131
    3232    public static void main(String[] args) {
    3333        if (args.length > 0) {
    3434            logger.info("initializing client ...");
    35             SRUClient client = new SRUClient(SRUVersion.VERSION_1_2);
     35            SRUSimpleClient client = new SRUSimpleClient(SRUVersion.VERSION_1_2);
    3636            try {
    3737                client.registerRecordParser(new ClarinFederatedContentSearchRecordParser());
     
    166166                logger.error("a fatal error occured while performing 'searchRetrieve' request", e);
    167167            }
     168           
     169            logger.info("done");
    168170        } else {
    169171            System.err.println("missing args");
     
    180182                org.apache.log4j.Logger.getRootLogger();
    181183        logger.setLevel(org.apache.log4j.Level.INFO);
    182         logger.getLoggerRepository()
    183             .getLogger("eu.clarin").setLevel(org.apache.log4j.Level.DEBUG);
     184        logger.getLoggerRepository().getLogger("eu.clarin").setLevel(
     185                org.apache.log4j.Level.DEBUG);
    184186    }
    185 } // class TestClient
     187
     188} // class TestSimpleClient
Note: See TracChangeset for help on using the changeset viewer.