|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springbyexample.httpclient.solr.SolrOxmClient<T>
public class SolrOxmClient<T>
Specialized client for processing requests with Solr that are marshalled and unmarshalled.
Field Summary | |
---|---|
protected String |
baseUrl
|
protected static String |
COMMIT_ELEMENT_NAME
|
protected static String |
DELETE_ELEMENT_NAME
|
protected static String |
DELETE_ID_ELEMENT_NAME
|
protected static String |
DELETE_QUERY_ELEMENT_NAME
|
protected Marshaller |
marshaller
|
protected static String |
OPTIMIZE_ELEMENT_NAME
|
protected HttpClientTemplate |
postTemplate
|
protected static String |
ROLLBACK_REQUEST
|
static String |
SEARCH_QUERY_PARAM
|
protected static String |
SELECT_URL_SUFFIX
|
protected HttpClientOxmTemplate<List<T>> |
selectTemplate
|
protected Unmarshaller |
unmarshaller
|
protected static String |
UPDATE_URL_SUFFIX
|
protected HttpClientOxmTemplate<List<T>> |
updateTemplate
|
Constructor Summary | |
---|---|
SolrOxmClient()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Initializes HttpClientTemplate s. |
void |
commit()
Commits pending transactions. |
void |
commit(SolrRequestAttributes attrs)
Commits pending transactions using specified attributes. |
protected void |
delete(String query,
boolean commit)
Deletes. |
void |
deleteById(String id)
Deletes a record based on an id and automatically commits the delete. |
void |
deleteById(String id,
boolean commit)
Deletes a record based on an id. |
void |
deleteByQuery(String query)
Deletes an id and automatically commits the delete. |
void |
deleteByQuery(String query,
boolean commit)
Deletes an id and automatically commits the delete. |
void |
destroy()
Calls destroy on HttpClientTemplate s. |
String |
getBaseUrl()
Gets base url (ex: http://localhost:8983/solr). |
Marshaller |
getMarshaller()
Gets marshaller. |
protected String |
getSelectUrl()
Gets Solr select url. |
Unmarshaller |
getUnmarshaller()
Gets unmarshaller. |
protected String |
getUpdateUrl()
Gets Solr update url. |
void |
optimize()
Optimize. |
void |
optimize(SolrRequestAttributes attrs)
Optimize using specified attributes. |
void |
rollback()
Rollback pending transactions. |
List<T> |
search(Map<String,String> hParams)
Search. |
List<T> |
search(String query)
Search. |
List<T> |
search(String query,
Map<String,String> hParams)
Search. |
void |
setBaseUrl(String baseUrl)
Sets base url (ex: http://localhost:8983/solr). |
void |
setMarshaller(Marshaller marshaller)
Sets marshaller. |
void |
setUnmarshaller(Unmarshaller unmarshaller)
Sets unmarshaller. |
void |
update(List<T> lBeans)
Updates a list of beans and automatically commits the updates. |
void |
update(List<T> lBeans,
boolean commit)
Updates a list of beans. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SEARCH_QUERY_PARAM
protected static final String SELECT_URL_SUFFIX
protected static final String UPDATE_URL_SUFFIX
protected static final String DELETE_ELEMENT_NAME
protected static final String DELETE_ID_ELEMENT_NAME
protected static final String DELETE_QUERY_ELEMENT_NAME
protected static final String COMMIT_ELEMENT_NAME
protected static final String ROLLBACK_REQUEST
protected static final String OPTIMIZE_ELEMENT_NAME
protected HttpClientOxmTemplate<List<T>> selectTemplate
protected HttpClientOxmTemplate<List<T>> updateTemplate
protected HttpClientTemplate postTemplate
protected String baseUrl
protected Marshaller marshaller
protected Unmarshaller unmarshaller
Constructor Detail |
---|
public SolrOxmClient()
Method Detail |
---|
public String getBaseUrl()
public void setBaseUrl(String baseUrl)
protected String getSelectUrl()
protected String getUpdateUrl()
public Marshaller getMarshaller()
public void setMarshaller(Marshaller marshaller)
public Unmarshaller getUnmarshaller()
public void setUnmarshaller(Unmarshaller unmarshaller)
public void afterPropertiesSet() throws Exception
Initializes HttpClientTemplate
s.
Implementation of InitializingBean
.
afterPropertiesSet
in interface InitializingBean
Exception
public void destroy() throws Exception
Calls destroy on HttpClientTemplate
s.
Implementation of DisposableBean
.
destroy
in interface DisposableBean
Exception
public List<T> search(String query)
query
- Search query.public List<T> search(String query, Map<String,String> hParams)
query
- Search query.hParams
- Map
of query parameters.public List<T> search(Map<String,String> hParams)
hParams
- Map
of query parameters.public void update(List<T> lBeans)
lBeans
- List of beans to create or update.public void update(List<T> lBeans, boolean commit)
lBeans
- List of beans to create or update.commit
- Whether or not to commit the request.public void deleteById(String id)
id
- ID to delete.public void deleteById(String id, boolean commit)
id
- ID to delete.commit
- Whether or not to commit the request.public void deleteByQuery(String query)
query
- ID to delete.public void deleteByQuery(String query, boolean commit)
query
- ID to delete.commit
- Whether or not to commit the request.protected void delete(String query, boolean commit)
query
- Query should either be an id element or
query element.commit
- Whether or not to commit the request.public void commit()
public void commit(SolrRequestAttributes attrs)
public void rollback()
public void optimize()
public void optimize(SolrRequestAttributes attrs)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |