public class DSpaceAuthorityIndexer extends Object implements AuthorityIndexerInterface, org.springframework.beans.factory.InitializingBean
An instance of DSpaceAuthorityIndexer is bound to a list of items. This can be one item or all items too depending on the init() method.
DSpaceAuthorityIndexer lets you iterate over each metadata value for each metadata field defined in dspace.cfg with 'authority.author.indexer.field' for each item in the list.
| Modifier and Type | Field and Description |
|---|---|
protected AuthorityValueService |
authorityValueService |
protected Map<String,AuthorityValue> |
cache |
protected ConfigurationService |
configurationService |
protected Context |
context |
protected int |
currentFieldIndex |
protected Item |
currentItem |
protected int |
currentMetadataIndex |
protected Iterator<Item> |
itemIterator |
protected ItemService |
itemService |
protected List<String> |
metadataFields
The list of metadata fields which are to be indexed *
|
protected AuthorityValue |
nextValue |
protected boolean |
useCache |
| Constructor and Description |
|---|
DSpaceAuthorityIndexer() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
close() |
boolean |
hasMore() |
void |
init(Context context) |
void |
init(Context context,
boolean useCache) |
void |
init(Context context,
Item item) |
protected void |
initialize(Context context) |
boolean |
isConfiguredProperly() |
AuthorityValue |
nextValue() |
protected void |
prepareNextValue(String metadataField,
MetadataValue value)
This method looks at the authority of a metadata.
|
protected Item currentItem
protected List<String> metadataFields
protected int currentFieldIndex
protected int currentMetadataIndex
protected AuthorityValue nextValue
protected Context context
@Autowired(required=true) protected AuthorityValueService authorityValueService
@Autowired(required=true) protected ItemService itemService
protected boolean useCache
protected Map<String,AuthorityValue> cache
@Autowired(required=true) protected ConfigurationService configurationService
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic void init(Context context, Item item)
init in interface AuthorityIndexerInterfacepublic void init(Context context)
init in interface AuthorityIndexerInterfacepublic void init(Context context, boolean useCache)
init in interface AuthorityIndexerInterfaceprotected void initialize(Context context)
public AuthorityValue nextValue()
nextValue in interface AuthorityIndexerInterfacepublic boolean hasMore()
throws SQLException,
AuthorizeException
hasMore in interface AuthorityIndexerInterfaceSQLExceptionAuthorizeExceptionprotected void prepareNextValue(String metadataField, MetadataValue value) throws SQLException, AuthorizeException
metadataField - Is one of the fields defined in dspace.cfg to be indexed.value - Is one of the values of the given metadataField in one of the items being indexed.SQLException - if database errorAuthorizeException - if authorization errorpublic void close()
close in interface AuthorityIndexerInterfacepublic boolean isConfiguredProperly()
isConfiguredProperly in interface AuthorityIndexerInterfaceCopyright © 2016 DuraSpace. All rights reserved.