Changeset 2131
- Timestamp:
- 08/22/12 09:29:58 (12 years ago)
- Location:
- SRUClient/trunk/src
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUSimpleClient.java
r2130 r2131 48 48 49 49 /** 50 * A class to perform SRU operations.50 * A non-threaded SRU client. 51 51 * <p>This class is <em>not</em> thread-safe!</p> 52 52 */ 53 public class SRUSimpleClient {53 public class SRUSimpleClient implements SRUClient { 54 54 /** constant record data schema parser to match any schema */ 55 55 public static final String RECORD_DATA_PARSER_SCHEMA_ANY = "*"; … … 80 80 * use the default SRU version. 81 81 * 82 * @see #SRU Client(SRUVersion, boolean)82 * @see #SRUSimpleClient(SRUVersion, boolean) 83 83 * @see #DEFAULT_SRU_VERSION 84 84 */ … … 94 94 * the default version to use for SRU requests; may be overridden 95 95 * by individual requests 96 * @see #SRU Client(SRUVersion, boolean)96 * @see #SRUSimpleClient(SRUVersion, boolean) 97 97 */ 98 98 public SRUSimpleClient(SRUVersion defaultVersion) { … … 126 126 127 127 128 /** 129 * Get the SRU protocol conformance mode of the client. 130 * 131 * @return <code>true</code> if the client operation in strict mode, 132 * <code>false</code> otherwise 133 */ 134 public boolean isStrictMode() { 135 return strictMode; 136 } 137 138 139 /** 140 * Set the SRU protocol conformance mode of the client. 141 * 142 * @param strictMode 143 * <code>true</code> if the client should operate in strict mode, 144 * <code>false</code> if the client should be more tolerant 145 */ 146 public void setStrictMode(boolean strictMode) { 147 this.strictMode = strictMode; 148 } 149 150 /** 151 * Register a record data parser. 152 * 153 * @param parser 154 * a parser instance 155 * @throws SRUClientException 156 * if a parser handing the same record schema is already 157 * registered 158 * @throws NullPointerException 159 * if any required argument is <code>null</code> 160 * @throws IllegalArgumentException 161 * if the supplied parser is invalid 162 */ 128 @Override 163 129 public void registerRecordParser(SRURecordDataParser parser) 164 130 throws SRUClientException { … … 184 150 185 151 186 /** 187 * Perform a <em>explain</em> operation. 188 * 189 * @param request 190 * an instance of a {@link SRUExplainRequest} object 191 * @param handler 192 * an instance of {@link SRUExplainHandler} to receive callbacks 193 * when processing the result of this request 194 * @throws SRUClientException 195 * if an unrecoverable error occurred 196 * @throws NullPointerException 197 * if any required argument is <code>null</code> 198 * @see SRUExplainRequest 199 * @see SRUExplainHandler 200 */ 152 @Override 201 153 public void explain(SRUExplainRequest request, SRUExplainHandler handler) 202 154 throws SRUClientException { … … 265 217 266 218 267 /** 268 * Perform a <em>scan</em> operation. 269 * 270 * @param request 271 * an instance of a {@link SRUScanRequest} object 272 * @param handler 273 * an instance of {@link SRUScanHandler} to receive callbacks 274 * when processing the result of this request 275 * @throws SRUClientException 276 * if an unrecoverable error occurred 277 * @throws NullPointerException 278 * if any required argument is <code>null</code> 279 * @see SRUScanRequest 280 * @see SRUScanHandler 281 */ 219 @Override 282 220 public void scan(SRUScanRequest request, SRUScanHandler handler) 283 221 throws SRUClientException { … … 346 284 347 285 348 /** 349 * Perform a <em>searchRetreive</em> operation. 350 * 351 * @param request 352 * an instance of a {@link SRUSearchRetrieveRequest} object 353 * @param handler 354 * an instance of {@link SRUSearchRetrieveHandler} to receive 355 * callbacks when processing the result of this request 356 * @throws SRUClientException 357 * if an unrecoverable error occurred 358 * @throws NullPointerException 359 * if any required argument is <code>null</code> 360 * @see SRUSearchRetrieveRequest 361 * @see SRUSearchRetrieveHandler 362 */ 286 @Override 363 287 public void searchRetrieve(SRUSearchRetrieveRequest request, 364 288 SRUSearchRetrieveHandler handler) throws SRUClientException { -
SRUClient/trunk/src/test/java/eu/clarin/sru/client/TestClient.java
r2130 r2131 33 33 if (args.length > 0) { 34 34 logger.info("initializing client ..."); 35 SRU SimpleClient client = new SRUSimpleClient(SRUVersion.VERSION_1_2);35 SRUClient client = new SRUSimpleClient(SRUVersion.VERSION_1_2); 36 36 try { 37 37 client.registerRecordParser(new ClarinFederatedContentSearchRecordParser());
Note: See TracChangeset
for help on using the changeset viewer.