Class DetectorWrapper
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.module.web.data.wrappers.DetectorWrapper
-
public class DetectorWrapper extends java.lang.Object
The wrapper that manages database detectors
-
-
Constructor Summary
Constructors Constructor Description DetectorWrapper()
Empty initialiserDetectorWrapper(long id, Account account, TDetectorRepository tDetectorRepository)
Initialise the wrapper by trying to find a detector that is either owned by the account or is publicDetectorWrapper(TDetector tDetector, boolean isOwner)
Initialise the wrapper with a template that has already been loaded
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TDetector
getDetector()
Get the detectorjava.lang.Class<? extends IDetector>
getEngineDetector()
Get the engine object for this detectorjava.util.List<AdjustableParameterObj>
getEngineParameters()
Get the list of adjustable parameters for this detectorjava.util.Map<java.lang.String,AdjustableParameterObj>
getEngineParametersMap()
Get the adjustable parameters for this detector as a mapjava.util.List<AdjustableParameterObj>
getEnginePostProcessingParameters()
Get the list of adjustable postprocessing parameters for this detectorjava.util.Map<java.lang.String,AdjustableParameterObj>
getEnginePostProcessingParametersMap()
long
getId()
Get the id of the detectorjava.util.List<ParameterWrapper>
getParametersList()
Get the list of parameters for this detectorEngineDetectorWrapper
getWrapper()
Get the engine wrapper for this detectorboolean
isOwner()
Whether or not the template is owned by the current uservoid
setDetector(TDetector tDetector)
Set the detectorvoid
updateParameters(ParameterForm parameterForm, TParameterRepository tParameterRepository)
Update the parameters for this detector
-
-
-
Constructor Detail
-
DetectorWrapper
public DetectorWrapper()
Empty initialiser
-
DetectorWrapper
public DetectorWrapper(TDetector tDetector, boolean isOwner)
Initialise the wrapper with a template that has already been loaded- Parameters:
tDetector
- the detector to manageisOwner
- whether the account owns the detector
-
DetectorWrapper
public DetectorWrapper(long id, Account account, TDetectorRepository tDetectorRepository) throws DetectorNotFound
Initialise the wrapper by trying to find a detector that is either owned by the account or is public- Parameters:
id
- the template id to findaccount
- the account of the current usertDetectorRepository
- the detector database repository- Throws:
DetectorNotFound
- if the detector wasn't found
-
-
Method Detail
-
isOwner
public boolean isOwner()
Whether or not the template is owned by the current user- Returns:
- the result
-
getDetector
public TDetector getDetector()
Get the detector- Returns:
- the detector
-
setDetector
public void setDetector(TDetector tDetector)
Set the detector- Parameters:
tDetector
- the new detector
-
getEngineParameters
public java.util.List<AdjustableParameterObj> getEngineParameters() throws DetectorNotFound
Get the list of adjustable parameters for this detector- Returns:
- the list of adjustable parameters
- Throws:
DetectorNotFound
- if the detector no longer exists
-
getEnginePostProcessingParameters
public java.util.List<AdjustableParameterObj> getEnginePostProcessingParameters() throws DetectorNotFound
Get the list of adjustable postprocessing parameters for this detector- Returns:
- the list of adjustable postprocessing parameters
- Throws:
DetectorNotFound
- if the detector no longer exists
-
getEngineParametersMap
public java.util.Map<java.lang.String,AdjustableParameterObj> getEngineParametersMap() throws DetectorNotFound
Get the adjustable parameters for this detector as a map- Returns:
- the map of adjustable parameters
- Throws:
DetectorNotFound
- if the detector no longer exists
-
getEnginePostProcessingParametersMap
public java.util.Map<java.lang.String,AdjustableParameterObj> getEnginePostProcessingParametersMap() throws DetectorNotFound
- Throws:
DetectorNotFound
-
getId
public long getId()
Get the id of the detector- Returns:
- the id
-
getEngineDetector
public java.lang.Class<? extends IDetector> getEngineDetector() throws DetectorNotFound
Get the engine object for this detector- Returns:
- the IDetector
- Throws:
DetectorNotFound
- if the engine detector no longer exists
-
getWrapper
public EngineDetectorWrapper getWrapper() throws DetectorNotFound
Get the engine wrapper for this detector- Returns:
- the engine detector wrapper
- Throws:
DetectorNotFound
- if the engine detector no longer exists
-
getParametersList
public java.util.List<ParameterWrapper> getParametersList() throws DetectorNotFound, ParameterNotFound
Get the list of parameters for this detector- Returns:
- the list of parameters
- Throws:
ParameterNotFound
DetectorNotFound
- if the engine detector no longer exists
-
updateParameters
public void updateParameters(ParameterForm parameterForm, TParameterRepository tParameterRepository) throws NotTemplateOwner
Update the parameters for this detector- Parameters:
parameterForm
- the form to usetParameterRepository
- the database repository- Throws:
NotTemplateOwner
-
-