|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.forum.nntp.SessionManager
public class SessionManager
Manages all NNTP sessions known to the server.
Field Summary | |
---|---|
static int |
MODE_ALWAYS_REQUIRE_LOGIN
Always require the user to login before posting. |
static int |
MODE_NEVER_REQUIRE_LOGIN
Ignore forum permissions and always permit users to post anonymously. |
static int |
MODE_USE_PERMISSIONS
Use standard forum permissions to determine whether the user must login before posting or not. |
Method Summary | |
---|---|
Session |
createSession(Connection con)
Creates a session for the given connection. |
void |
destroy()
Notifies the manager to release any resources that may be holding on too. |
static SessionManager |
getInstance()
Returns a SessionManager instance. |
int |
getPostPermissionMode()
Returns the post permission mode. |
Session |
getSession(Connection con)
Obtain a session that corresponds to the given connection. |
long |
getSessionCheckPeriod()
Obtains period between idle session checks in milliseconds. |
long |
getSessionTimeout()
Returns the session timeout in milliseconds. |
void |
initialize()
Initialize the manager. |
boolean |
isAnonymousReadAllowed()
Flag indicating if logins are required to read content from the server. |
boolean |
isReadTrackingEnabled()
Returns true if read tracking of NNTP sessions is enabled. |
boolean |
isSession(Connection conn)
Indicates if the given connection has an associated session. |
void |
removeSession(Connection con)
Removes the session associated with the connection. |
void |
setAnonymousReadAllowed(boolean allowed)
Sets whether the server requires logins before any other commands are allowed. |
void |
setPostPermissionMode(int permissionMode)
Sets the post permission mode. |
void |
setReadTrackingEnabled(boolean readTrackingEnabled)
Enables or disables read tracking of NNTP sessions. |
void |
setSessionCheckPeriod(long period)
Sets the new period between idle session checks in milliseconds. |
void |
setSessionTimeout(long timeout)
Sets the new session timeout in milliseconds. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MODE_ALWAYS_REQUIRE_LOGIN
public static final int MODE_USE_PERMISSIONS
public static final int MODE_NEVER_REQUIRE_LOGIN
Method Detail |
---|
public static SessionManager getInstance()
public void initialize()
JiveManager
This method is used internally by Jive during application startup and should not be called during normal usage of the class.
initialize
in interface JiveManager
public void destroy()
JiveManager
destroy
in interface JiveManager
public boolean isSession(Connection conn)
Indicates if the given connection has an associated session.
conn
- the connection to check.
public Session getSession(Connection con) throws SessionNotFoundException
Obtain a session that corresponds to the given connection.
A session is created for the connection if one doesn't already exist.
con
- the connection to locate a session for.
SessionNotFoundException
public Session createSession(Connection con) throws SessionAlreadyExistsException
con
- the connection to create a session for
SessionAlreadyExistsException
- if a session for the connection already existspublic void removeSession(Connection con)
Removes the session associated with the connection.
con
- the connection to locate a session for.public long getSessionTimeout()
public void setSessionTimeout(long timeout)
timeout
- the session idle timeout in millisecondspublic long getSessionCheckPeriod()
Obtains period between idle session checks in milliseconds. The manager must inspect each session every period to look for expired sessions. High frequency checking results in more accurate timeouts of idle sessions. However, too frequent checking (esp. with large numbers of sessions) can consume large amounts of system resources.
public void setSessionCheckPeriod(long period)
Sets the new period between idle session checks in milliseconds.
period
- the idle session checking period in millisecondspublic boolean isReadTrackingEnabled()
public void setReadTrackingEnabled(boolean readTrackingEnabled)
readTrackingEnabled
- true if read tracking should be enabled.public boolean isAnonymousReadAllowed()
Flag indicating if logins are required to read content from the server.
The setting is not the same as anonymous logins since all sessions start with anonymous login status. This setting determines if the server will allow any commands other than AUTHINFO before authenticating with a valid user account. If false, anonymous sessions can access forum data according to normal Forums permissions for anonymous users (read/list/post) without doing any authentication.
public void setAnonymousReadAllowed(boolean allowed)
Sets whether the server requires logins before any other commands are allowed.
allowed
- true if logins are required to interact with the server.public int getPostPermissionMode()
public void setPostPermissionMode(int permissionMode)
permissionMode
- the post permission mode.
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |