Changeset 2165
- Timestamp:
- 08/28/12 20:11:45 (12 years ago)
- Location:
- SRUClient/trunk/src
- Files:
-
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUSimpleClient.java
r2163 r2165 47 47 48 48 /** 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 51 65 */ 52 public class SRU Client {66 public class SRUSimpleClient { 53 67 /** default version the client will use, if not otherwise specified */ 54 68 public static final SRUVersion DEFAULT_SRU_VERSION = SRUVersion.VERSION_1_2; … … 64 78 private static final String RECORD_PACKING_STRING = "string"; 65 79 private static final Logger logger = 66 LoggerFactory.getLogger(SRU Client.class);80 LoggerFactory.getLogger(SRUSimpleClient.class); 67 81 private final SRUVersion defaultVersion; 68 82 private boolean strictMode; … … 76 90 * use the default SRU version. 77 91 * 78 * @see #SRU Client(SRUVersion, boolean)92 * @see #SRUSimpleClient(SRUVersion, boolean) 79 93 * @see #DEFAULT_SRU_VERSION 80 94 */ 81 public SRU Client() {95 public SRUSimpleClient() { 82 96 this(DEFAULT_SRU_VERSION, true); 83 97 } … … 90 104 * the default version to use for SRU requests; may be overridden 91 105 * by individual requests 92 * @see #SRU Client(SRUVersion, boolean)106 * @see #SRUSimpleClient(SRUVersion, boolean) 93 107 */ 94 public SRU Client(SRUVersion defaultVersion) {108 public SRUSimpleClient(SRUVersion defaultVersion) { 95 109 this(defaultVersion, true); 96 110 } … … 109 123 * certain violations 110 124 */ 111 public SRU Client(SRUVersion defaultVersion, boolean strictMode) {125 public SRUSimpleClient(SRUVersion defaultVersion, boolean strictMode) { 112 126 this(defaultVersion, strictMode, 113 127 new HashMap<String, SRURecordDataParser>()); … … 134 148 * parser mappings 135 149 */ 136 SRU Client(SRUVersion defaultVersion, boolean strictMode,150 SRUSimpleClient(SRUVersion defaultVersion, boolean strictMode, 137 151 Map<String, SRURecordDataParser> parsers) { 138 152 if (defaultVersion == null) { … … 1139 1153 } 1140 1154 1141 } // class SRU Client1155 } // class SRUSimpleClient -
SRUClient/trunk/src/test/java/eu/clarin/sru/client/TestSimpleClient.java
r2163 r2165 26 26 27 27 28 public class Test Client {28 public class TestSimpleClient { 29 29 private static final Logger logger = 30 LoggerFactory.getLogger(Test Client.class);30 LoggerFactory.getLogger(TestSimpleClient.class); 31 31 32 32 public static void main(String[] args) { 33 33 if (args.length > 0) { 34 34 logger.info("initializing client ..."); 35 SRU Client client = new SRUClient(SRUVersion.VERSION_1_2);35 SRUSimpleClient client = new SRUSimpleClient(SRUVersion.VERSION_1_2); 36 36 try { 37 37 client.registerRecordParser(new ClarinFederatedContentSearchRecordParser()); … … 166 166 logger.error("a fatal error occured while performing 'searchRetrieve' request", e); 167 167 } 168 169 logger.info("done"); 168 170 } else { 169 171 System.err.println("missing args"); … … 180 182 org.apache.log4j.Logger.getRootLogger(); 181 183 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); 184 186 } 185 } // class TestClient 187 188 } // class TestSimpleClient
Note: See TracChangeset
for help on using the changeset viewer.