public class CSForumThread extends CSFormatItem
This class is used to read details of a thread from the database, write details of a new thread to the database, or modify details of an existing thread.
The setXXX(...)
methods are used to set thread details before a database get
or
update
is performed. getXXX()
methods are then used to access details of the thread.
The update
operation adds a new thread in the case where no ThreadID has been specified. A ThreadID is
specified following a call to setThreadID
, get
or update
.
ACCESS_GRANTED, DOES_NOT_EXIST, EMPTY, EXISTS, SECURE_ACCESS_DENIED, SECURE_ACCESS_GRANTED, UPDATE_ACTION_INSERTED, UPDATE_ACTION_UPDATED
LEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSForumThread()
Creates a new CSForumThread Object, no datasource is specified.
|
CSForumThread(java.lang.String strPropertyFile)
Creates a new CSForumThread Object, datasource details are specified in a property file.
|
Modifier and Type | Method and Description |
---|---|
void |
delete()
Not currently implemented for a thread.
|
void |
get()
Retrieves the details of a Forum Thread from the database.
|
int |
getForumID()
Gets the unique ID of the forum containing this thread.
|
java.util.Date |
getLastMsgDate()
Gets the date of the last message added to this thread.
|
int |
getMessageCount()
Gets the number of messages in the thread.
|
int |
getThreadID()
Gets the unique ID of this thread.
|
java.lang.String |
getThreadName()
Gets the name of this thread.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setForumID(int nForumID)
Sets the ID of the forum which contains this thread.
|
void |
setLastMsgDate(java.util.Date DateLastMsg)
Sets the date that the last message was added to this thread.
|
void |
setMessageCount(int nMessageCount)
Sets the number of messages in the thread.
|
void |
setThreadID(int nThreadID)
Sets the unique ID of this thread.
|
void |
setThreadName(java.lang.String strThreadName)
Sets the name of this thread.
|
void |
update()
Updates a Thread on the database.
|
getCensorString, getEmoticonDirectory, getEmoticonHeight, getEmoticonWidth, getFilterSwearWords, getReplaceEmoticons, getStripTags, setCensorString, setEmoticonDirectory, setEmoticonHeight, setEmoticonWidth, setFilterSwearWords, setReplaceEmoticons, setStripTags, toString
equals, exist, getID, getStatus, hashCode, jsonString, serialiseWithTypes, setID, setStatus, unset
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public CSForumThread()
public CSForumThread(java.lang.String strPropertyFile)
strPropertyFile
- the name of the property file from which the database connection details are to be read.public void setThreadID(int nThreadID)
public int getThreadID()
setThreadID
, or if get
or update
has not been
called.public void setForumID(int nForumID)
A thread added or modified with update
will be put in this forum.
nForumID
- the unique ID of a forum.public int getForumID()
setForumID
, or if update
or get
has not been
called.public void setThreadName(java.lang.String strThreadName)
strThreadName
- the name which will be used when this thread is added to or updated on the database.public java.lang.String getThreadName()
setThreadName
, or if update
or get
has
not been called.public void setMessageCount(int nMessageCount)
nMessageCount
- this number is ignored, and is reset during a call to get
.public int getMessageCount()
get
.public void setLastMsgDate(java.util.Date DateLastMsg)
DateLastMsg
- this Date is ignored, and is reset during a call to get
.public java.util.Date getLastMsgDate()
get
.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method.
Valid detail levels for a thread are :
LEVEL_ID - the thread ID
LEVEL_ALL - the thread name, forum ID, message count and date of last message
Each detail level processes the information specified alongside it in addition to the information specified for all detail levels listed above it. The default detail level is LEVEL_ALL.
setDetailLevel
in class CSDatabaseItem
nDetailLevel
- the detail level to be used.CSParameterException
- if an invalid detail level is specified.public void get() throws CSException
Use setThreadID
to set the thread ID which you are interested in, then get
to load the details from the database. This CSForumThread
object is then populated with the
details of the thread, which can be accessed using the getXXX()
methods.
get
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if the specified thread cannot be found on the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public void update() throws CSException
Use update
to store the current contents of this CSForumThread
object to the
database. If the ThreadID has already been set, then that Thread is modified on the database, otherwise a new
thread is added, and its ID is available through getThreadID
.
update
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if the specified thread cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
delete
in class CSItem
CSParameterException
- if an invalid combination of key information has been suppliedCSDatabaseException
- if there are problems accessing the databaseCSNotFoundException
- if the specified thread cannot be found on the databaseCSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.