Class Channel
java.lang.Object
org.deltava.beans.cooler.Channel
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<Channel>
,Auditable
,ComboAlias
,ViewEntry
,Cacheable
- Direct Known Subclasses:
Channel.AllChannel
public class Channel
extends Object
implements Comparable<Channel>, Auditable, Cacheable, ComboAlias, ViewEntry
A class containing Water Cooler channel data.
- Since:
- 1.0
- Version:
- 11.0
- Author:
- Luke
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
static enum
Subdata enumeration. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAirline
(String aCode) Add an Airline to the list of enabled airlines.void
addRole
(Channel.InfoType type, String roleName) Add a security role to this Channel.cacheKey()
Returns the cache key for this object.int
boolean
Compares the channel to another object.boolean
Queries if the Channel is active.Returns the airlines associated with this Channel.boolean
Queries if new Threads or Replies are allowed.Returns the object ID for this auditable object.Returns the alias to use in the HTML <OPTION> element.Returns the visible name to use in the HTML <OPTION> element.Returns the Channel description.Returns the title of the latest post in this Channel.int
Returns ID of the last Message Thread in this Channel.getName()
Returns the Channel name.Returns the roles notified when a new post is created in this Channel.int
Returns the number of posts in this Channel.Returns the roles authorized to access this Channel.Returns the CSS class for this object if rendered in a view table.int
Returns the total number of message threads in this Channel.int
Returns the total number of thread views for Threads in this Channel.Returns the roles authorized to post in this Channel.boolean
hasAirline
(String aCode) Queries if the Channel supports a particular airline.int
hashCode()
void
setActive
(boolean active) Set the channel active/inactive.void
setAirlines
(Collection<String> aCodes) Updates the enabled airlines.void
setAllowNewPosts
(boolean allow) Updates whether new Threads or Replies are allowed.void
setDescription
(String desc) Update the Channel description.void
setLastSubject
(String subj) Updates the last subject posted to in this Channel.void
setLastThreadID
(int id) Updates the ID of the last Message Thread in this Channel.void
setPostCount
(int count) Updates the number of posts in this Channel.void
setRoles
(Channel.InfoType type, Collection<String> roles) Updates the security roles for this Channel.void
setThreadCount
(int count) Updates the number of Message Threads in this Channel.void
setViewCount
(int count) Updates the number of times all Threads in this Channel have been viewed.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.deltava.beans.Auditable
getAuditType, isCrossApp
-
Field Details
-
ALL
-
SHOTS
-
-
Constructor Details
-
Channel
Creates a new Channel object with a given Channel name.- Parameters:
name
- the Channel name- Throws:
NullPointerException
- if name is null- See Also:
-
-
Method Details
-
getName
-
getComboName
Description copied from interface:ComboAlias
Returns the visible name to use in the HTML <OPTION> element.- Specified by:
getComboName
in interfaceComboAlias
- Returns:
- The visible name for this entry
-
getComboAlias
Description copied from interface:ComboAlias
Returns the alias to use in the HTML <OPTION> element.- Specified by:
getComboAlias
in interfaceComboAlias
- Returns:
- The alias for this entry
-
getDescription
Returns the Channel description.- Returns:
- the channel description
- See Also:
-
getReadRoles
Returns the roles authorized to access this Channel.- Returns:
- a Collection of roles authorized to view this Channel
- See Also:
-
getWriteRoles
Returns the roles authorized to post in this Channel.- Returns:
- a Collection of roles authorized to view this Channel
- See Also:
-
getNotifyRoles
Returns the roles notified when a new post is created in this Channel.- Returns:
- a Collection of roles
- See Also:
-
getViewCount
public int getViewCount()Returns the total number of thread views for Threads in this Channel.- Returns:
- the number of views
- See Also:
-
getThreadCount
public int getThreadCount()Returns the total number of message threads in this Channel.- Returns:
- the number of threads
- See Also:
-
getPostCount
public int getPostCount()Returns the number of posts in this Channel.- Returns:
- the number of posts
- See Also:
-
getAirlines
Returns the airlines associated with this Channel.- Returns:
- a sorted Set of Airline codes for this Channel
- See Also:
-
getLastSubject
Returns the title of the latest post in this Channel.- Returns:
- the post title
- See Also:
-
getLastThreadID
public int getLastThreadID()Returns ID of the last Message Thread in this Channel.- Returns:
- the database ID of the latest post
- See Also:
-
getActive
public boolean getActive()Queries if the Channel is active.- Returns:
- TRUE if the Channel is active, otherwise FALSE
- See Also:
-
getAllowNewPosts
public boolean getAllowNewPosts()Queries if new Threads or Replies are allowed.- Returns:
- TRUE if new threads/replies are allowed, otherwise FALSE
- See Also:
-
hasAirline
Queries if the Channel supports a particular airline.- Parameters:
aCode
- the Airline Code- Returns:
- TRUE if the Channel is supported by an airline, FALSE otherwisse
- See Also:
-
addAirline
Add an Airline to the list of enabled airlines.- Parameters:
aCode
- the Airline code to add- Throws:
NullPointerException
- if the airline code is null- See Also:
-
setAirlines
Updates the enabled airlines.- Parameters:
aCodes
- the Airline codes to enable- Throws:
NullPointerException
- if aCodes is null- See Also:
-
addRole
Add a security role to this Channel.- Parameters:
type
- the role typeroleName
- the name of the role to add to this Channel's access list- See Also:
-
setRoles
Updates the security roles for this Channel.- Parameters:
type
- the role typeroles
- the roles to add to this Channel's access list- See Also:
-
setDescription
Update the Channel description.- Parameters:
desc
- the Channel description- See Also:
-
setActive
public void setActive(boolean active) Set the channel active/inactive.- Parameters:
active
- TRUE if the Channel is active, otherwise FALSE- See Also:
-
setAllowNewPosts
public void setAllowNewPosts(boolean allow) Updates whether new Threads or Replies are allowed.- Parameters:
allow
- TRUE if new posts allowed, otherwise FALSE- See Also:
-
setLastSubject
Updates the last subject posted to in this Channel.- Parameters:
subj
- the thread subject- See Also:
-
setLastThreadID
public void setLastThreadID(int id) Updates the ID of the last Message Thread in this Channel.- Parameters:
id
- the database ID- Throws:
IllegalArgumentException
- if id is negative- See Also:
-
setThreadCount
public void setThreadCount(int count) Updates the number of Message Threads in this Channel.- Parameters:
count
- the number of threads- See Also:
-
setPostCount
public void setPostCount(int count) Updates the number of posts in this Channel.- Parameters:
count
- the number of posts- See Also:
-
setViewCount
public void setViewCount(int count) Updates the number of times all Threads in this Channel have been viewed.- Parameters:
count
- the number of thread views- See Also:
-
toString
-
cacheKey
-
equals
-
hashCode
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Channel>
-
getRowClassName
Description copied from interface:ViewEntry
Returns the CSS class for this object if rendered in a view table.- Specified by:
getRowClassName
in interfaceViewEntry
- Returns:
- the CSS class name, or NULL if none
-
getAuditID
Description copied from interface:Auditable
Returns the object ID for this auditable object.- Specified by:
getAuditID
in interfaceAuditable
- Returns:
- the ID
-