Package org.jivesoftware.util
Class WebManager
- java.lang.Object
-
- org.jivesoftware.util.WebBean
-
- org.jivesoftware.util.WebManager
-
public class WebManager extends WebBean
A utility bean for Openfire admin console pages.
-
-
Constructor Summary
Constructors Constructor Description WebManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcopy(URL src, File dst)Copies the contents atsrctodst.AuthTokengetAuthToken()Cache[]getCaches()intgetCurrentPage()GroupManagergetGroupManager()LockOutManagergetLockOutManager()WebManagergetManager()MultiUserChatManagergetMultiUserChatManager()intgetPageProperty(String pageName, String property, int defaultValue)PresenceManagergetPresenceManager()PrivateStoragegetPrivateStore()PubSubServiceInfogetPubSubInfo()intgetRange()intgetRefreshValue(String pageName, int defaultValue)Returns the number of seconds between each page refresh for the specified page for the current logged user.RosterManagergetRosterManager()intgetRowsPerPage(String pageName, int defaultValue)Returns the number of rows per page for the specified page for the current logged user.SecurityAuditManagergetSecurityAuditManager()XMPPServerInfogetServerInfo()SessionManagergetSessionManager()intgetStart()UsergetUser()UserManagergetUserManager()XMPPServergetXMPPServer()javax.servlet.http.HttpSessioninvalidateSession()Invalidates and recreates session (do this on login/logout).booleanisEmbedded()booleanisServerRunning()booleanisSetupMode()voidlogEvent(String summary, String details)Logs a security event as the currently logged in user.voidrestart()Restarts the server then sleeps for 3 seconds.voidsetPageProperty(String pageName, String property, int newValue)voidsetRange(int range)voidsetRefreshValue(String pageName, int newValue)Sets the number of seconds between each page refresh for the specified page for the current logged user.voidsetRowsPerPage(String pageName, int newValue)Sets the new number of rows per page for the specified page for the current logged user.voidsetStart(int start)protected voidshowServerDown()voidstop()Stops the server then sleeps for 3 seconds.voidvalidateService()
-
-
-
Method Detail
-
invalidateSession
public javax.servlet.http.HttpSession invalidateSession()
Invalidates and recreates session (do this on login/logout).- Returns:
- the new HTTP session
-
getAuthToken
public AuthToken getAuthToken()
- Returns:
- the auth token; redirect to the login page if an auth token is not found.
-
isSetupMode
public boolean isSetupMode()
- Returns:
trueif the Openfire container is in setup mode,falseotherwise.
-
getXMPPServer
public XMPPServer getXMPPServer()
- Returns:
- the XMPP server object -- can get many config items from here.
-
getUserManager
public UserManager getUserManager()
-
getGroupManager
public GroupManager getGroupManager()
-
getLockOutManager
public LockOutManager getLockOutManager()
-
getSecurityAuditManager
public SecurityAuditManager getSecurityAuditManager()
-
getRosterManager
public RosterManager getRosterManager()
-
getPrivateStore
public PrivateStorage getPrivateStore()
-
getPresenceManager
public PresenceManager getPresenceManager()
-
getSessionManager
public SessionManager getSessionManager()
-
getMultiUserChatManager
public MultiUserChatManager getMultiUserChatManager()
-
getServerInfo
public XMPPServerInfo getServerInfo()
-
getPubSubInfo
public PubSubServiceInfo getPubSubInfo()
-
logEvent
public void logEvent(String summary, String details)
Logs a security event as the currently logged in user. (convenience routine for SecurityAuditManager)- Parameters:
summary- Summary of event.details- Details of event, can be null if no details available.
-
getUser
public User getUser()
- Returns:
- the page user or
nullif one is not found.
-
isEmbedded
public boolean isEmbedded()
- Returns:
trueif the server is in embedded mode,falseotherwise.
-
restart
public void restart()
Restarts the server then sleeps for 3 seconds.
-
stop
public void stop()
Stops the server then sleeps for 3 seconds.
-
getManager
public WebManager getManager()
-
validateService
public void validateService()
-
isServerRunning
public boolean isServerRunning()
-
setStart
public void setStart(int start)
-
getStart
public int getStart()
-
setRange
public void setRange(int range)
-
getRange
public int getRange()
-
getCurrentPage
public int getCurrentPage()
-
showServerDown
protected void showServerDown()
-
copy
public static void copy(URL src, File dst) throws IOException
Copies the contents atsrctodst.- Parameters:
src- the source locationdst- the target location- Throws:
IOException- if the copy failed
-
getRowsPerPage
public int getRowsPerPage(String pageName, int defaultValue)
Returns the number of rows per page for the specified page for the current logged user. The rows per page value is stored as a user property. The same property is being used for different pages. The encoding format is the following "pageName1=value,pageName2=value".- Parameters:
pageName- the name of the page to look up its stored value.defaultValue- the default value to return if no user value was found.- Returns:
- the number of rows per page for the specified page for the current logged user.
-
setRowsPerPage
public void setRowsPerPage(String pageName, int newValue)
Sets the new number of rows per page for the specified page for the current logged user. The rows per page value is stored as a user property. The same property is being used for different pages. The encoding format is the following "pageName1=value,pageName2=value".- Parameters:
pageName- the name of the page to stored its new value.newValue- the new rows per page value.
-
getRefreshValue
public int getRefreshValue(String pageName, int defaultValue)
Returns the number of seconds between each page refresh for the specified page for the current logged user. The value is stored as a user property. The same property is being used for different pages. The encoding format is the following "pageName1=value,pageName2=value".- Parameters:
pageName- the name of the page to look up its stored value.defaultValue- the default value to return if no user value was found.- Returns:
- the number of seconds between each page refresh for the specified page for the current logged user.
-
setRefreshValue
public void setRefreshValue(String pageName, int newValue)
Sets the number of seconds between each page refresh for the specified page for the current logged user. The value is stored as a user property. The same property is being used for different pages. The encoding format is the following "pageName1=value,pageName2=value".- Parameters:
pageName- the name of the page to stored its new value.newValue- the new number of seconds between each page refresh.
-
getCaches
public Cache[] getCaches()
-
-