Package adams.flow.webservice
Class SimpleImageService
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.webservice.SimpleImageService
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.SizeOfHandler
,adams.db.DatabaseConnectionUser
,OwnedByImageServiceWS
,Serializable
,ImageService
public class SimpleImageService extends adams.core.option.AbstractOptionHandler implements ImageService, OwnedByImageServiceWS, adams.db.DatabaseConnectionUser
Class that implements the Image web service.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.db.AbstractDatabaseConnection
m_DatabaseConnection
the database connection.protected ImageServiceWS
m_Owner
web service objectprotected adams.core.io.PlaceholderDirectory
m_UploadDir
the upload directory.
-
Constructor Summary
Constructors Constructor Description SimpleImageService()
Default Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected adams.db.AbstractDatabaseConnection
getDatabaseConnection()
Determines the database connection in the flow.ImageServiceWS
getOwner()
Returns the current owner of this webservice.adams.core.io.PlaceholderDirectory
getUploadDir()
Returns the directory to store the images in.String
globalInfo()
Returns a string for the GUI that describes this object.void
setOwner(ImageServiceWS value)
Sets the owner of this webservice.void
setUploadDir(adams.core.io.PlaceholderDirectory value)
Sets the directory to store the images in.UploadResponse
upload(UploadRequest parameters)
Uploads an image.String
uploadDirTipText()
Returns the tip text for this property.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Owner
protected ImageServiceWS m_Owner
web service object
-
m_DatabaseConnection
protected adams.db.AbstractDatabaseConnection m_DatabaseConnection
the database connection.
-
m_UploadDir
protected adams.core.io.PlaceholderDirectory m_UploadDir
the upload directory.
-
-
Constructor Detail
-
SimpleImageService
public SimpleImageService()
Default Constructor.
NB: the owning webservice needs to get set before using this implemention, using thesetOwner(ImageServiceWS)
method.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string for the GUI that describes this object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.AbstractOptionHandler
- Returns:
- the description
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
setUploadDir
public void setUploadDir(adams.core.io.PlaceholderDirectory value)
Sets the directory to store the images in.- Parameters:
value
- the directory
-
getUploadDir
public adams.core.io.PlaceholderDirectory getUploadDir()
Returns the directory to store the images in.- Returns:
- the directory
-
uploadDirTipText
public String uploadDirTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDatabaseConnection
protected adams.db.AbstractDatabaseConnection getDatabaseConnection()
Determines the database connection in the flow.- Returns:
- the database connection to use
-
setOwner
public void setOwner(ImageServiceWS value)
Sets the owner of this webservice.- Specified by:
setOwner
in interfaceOwnedByImageServiceWS
- Parameters:
value
- the owner
-
getOwner
public ImageServiceWS getOwner()
Returns the current owner of this webservice.- Specified by:
getOwner
in interfaceOwnedByImageServiceWS
- Returns:
- the owner, null if none set
-
upload
public UploadResponse upload(UploadRequest parameters)
Uploads an image.- Specified by:
upload
in interfaceImageService
-
-