Package org.dspace.access.status
Class AccessStatusServiceImpl
- java.lang.Object
-
- org.dspace.access.status.AccessStatusServiceImpl
-
- All Implemented Interfaces:
AccessStatusService
public class AccessStatusServiceImpl extends Object implements AccessStatusService
Implementation for the access status calculation service.
-
-
Field Summary
Fields Modifier and Type Field Description protected ConfigurationServiceconfigurationServiceprotected Dateforever_dateprotected AccessStatusHelperhelperprotected PluginServicepluginService
-
Constructor Summary
Constructors Constructor Description AccessStatusServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAccessStatus(Context context, Item item)Calculate the access status for an Item while considering the forever embargo date threshold.StringgetEmbargoFromItem(Context context, Item item)Retrieve embargo information for the itemvoidinit()Initialize the bean (after dependency injection has already taken place).
-
-
-
Field Detail
-
helper
protected AccessStatusHelper helper
-
forever_date
protected Date forever_date
-
configurationService
@Autowired(required=true) protected ConfigurationService configurationService
-
pluginService
@Autowired(required=true) protected PluginService pluginService
-
-
Method Detail
-
init
public void init() throws ExceptionInitialize the bean (after dependency injection has already taken place). Ensures the configurationService is injected, so that we can get the plugin and the forever embargo date threshold from the configuration. Called by "init-method" in Spring configuration.- Throws:
Exception- on generic exception
-
getAccessStatus
public String getAccessStatus(Context context, Item item) throws SQLException
Description copied from interface:AccessStatusServiceCalculate the access status for an Item while considering the forever embargo date threshold.- Specified by:
getAccessStatusin interfaceAccessStatusService- Parameters:
context- the DSpace contextitem- the item- Returns:
- an access status value
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
getEmbargoFromItem
public String getEmbargoFromItem(Context context, Item item) throws SQLException
Description copied from interface:AccessStatusServiceRetrieve embargo information for the item- Specified by:
getEmbargoFromItemin interfaceAccessStatusService- Parameters:
context- the DSpace contextitem- the item to check for embargo information- Returns:
- an embargo date
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
-