* Implement app.charset and app.getCharset() to get the app's default charset
* Fill in missing JavaDoc comments
This commit is contained in:
parent
39cdaf045f
commit
ac0a5f1daa
1 changed files with 68 additions and 84 deletions
|
@ -185,20 +185,17 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Return the number of currently active sessions
|
||||||
*
|
* @return the current number of active sessions
|
||||||
* @return ...
|
|
||||||
*/
|
*/
|
||||||
public int countSessions() {
|
public int countSessions() {
|
||||||
return app.countSessions();
|
return app.countSessions();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Get a session object for the specified session id
|
||||||
*
|
* @param sessionID the session id
|
||||||
* @param sessionID ...
|
* @return the session belonging to the session id, or null
|
||||||
*
|
|
||||||
* @return ...
|
|
||||||
*/
|
*/
|
||||||
public SessionBean getSession(String sessionID) {
|
public SessionBean getSession(String sessionID) {
|
||||||
if (sessionID == null) {
|
if (sessionID == null) {
|
||||||
|
@ -215,11 +212,9 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Create a new session with the given session id
|
||||||
*
|
* @param sessionID the session id
|
||||||
* @param sessionID ...
|
* @return the newly created session
|
||||||
*
|
|
||||||
* @return ...
|
|
||||||
*/
|
*/
|
||||||
public SessionBean createSession(String sessionID) {
|
public SessionBean createSession(String sessionID) {
|
||||||
if (sessionID == null) {
|
if (sessionID == null) {
|
||||||
|
@ -236,9 +231,8 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Get an array of all active sessions
|
||||||
*
|
* @return an array of session beans
|
||||||
* @return ...
|
|
||||||
*/
|
*/
|
||||||
public SessionBean[] getSessions() {
|
public SessionBean[] getSessions() {
|
||||||
Map sessions = app.getSessions();
|
Map sessions = app.getSessions();
|
||||||
|
@ -254,12 +248,11 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Register a user with the given name and password using the
|
||||||
*
|
* database mapping of the User prototype
|
||||||
* @param username ...
|
* @param username the user name
|
||||||
* @param password ...
|
* @param password the user password
|
||||||
*
|
* @return the newly registered user, or null if we failed
|
||||||
* @return ...
|
|
||||||
*/
|
*/
|
||||||
public INode registerUser(String username, String password) {
|
public INode registerUser(String username, String password) {
|
||||||
if ((username == null) || (password == null) || "".equals(username.trim()) ||
|
if ((username == null) || (password == null) || "".equals(username.trim()) ||
|
||||||
|
@ -271,11 +264,9 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Get a user object with the given name
|
||||||
*
|
* @param username the user name
|
||||||
* @param username ...
|
* @return the user object, or null
|
||||||
*
|
|
||||||
* @return ...
|
|
||||||
*/
|
*/
|
||||||
public INode getUser(String username) {
|
public INode getUser(String username) {
|
||||||
if ((username == null) || "".equals(username.trim())) {
|
if ((username == null) || "".equals(username.trim())) {
|
||||||
|
@ -286,9 +277,8 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Get an array of currently active registered users
|
||||||
*
|
* @return an array of user nodes
|
||||||
* @return ...
|
|
||||||
*/
|
*/
|
||||||
public INode[] getActiveUsers() {
|
public INode[] getActiveUsers() {
|
||||||
List activeUsers = app.getActiveUsers();
|
List activeUsers = app.getActiveUsers();
|
||||||
|
@ -297,9 +287,8 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Get an array of all registered users
|
||||||
*
|
* @return an array containing all registered users
|
||||||
* @return ...
|
|
||||||
*/
|
*/
|
||||||
public INode[] getRegisteredUsers() {
|
public INode[] getRegisteredUsers() {
|
||||||
List registeredUsers = app.getRegisteredUsers();
|
List registeredUsers = app.getRegisteredUsers();
|
||||||
|
@ -308,11 +297,9 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Get an array of all currently active sessions for a given user node
|
||||||
*
|
* @param usernode the user node
|
||||||
* @param usernode ...
|
* @return an array of sessions for the given user
|
||||||
*
|
|
||||||
* @return ...
|
|
||||||
*/
|
*/
|
||||||
public SessionBean[] getSessionsForUser(INode usernode) {
|
public SessionBean[] getSessionsForUser(INode usernode) {
|
||||||
if (usernode == null) {
|
if (usernode == null) {
|
||||||
|
@ -323,11 +310,9 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Get an array of all currently active sessions for a given user name
|
||||||
*
|
* @param username the user node
|
||||||
* @param username ...
|
* @return an array of sessions for the given user
|
||||||
*
|
|
||||||
* @return ...
|
|
||||||
*/
|
*/
|
||||||
public SessionBean[] getSessionsForUser(String username) {
|
public SessionBean[] getSessionsForUser(String username) {
|
||||||
if ((username == null) || "".equals(username.trim())) {
|
if ((username == null) || "".equals(username.trim())) {
|
||||||
|
@ -340,9 +325,8 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Add a cron job that will run once a minute
|
||||||
*
|
* @param functionName the function name
|
||||||
* @param functionName ...
|
|
||||||
*/
|
*/
|
||||||
public void addCronJob(String functionName) {
|
public void addCronJob(String functionName) {
|
||||||
CronJob job = new CronJob(functionName);
|
CronJob job = new CronJob(functionName);
|
||||||
|
@ -352,15 +336,15 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Add a cron job that will run at the specified time intervals
|
||||||
*
|
*
|
||||||
*
|
* @param functionName the function name
|
||||||
* @param functionName ...
|
* @param year comma separated list of years, or *
|
||||||
* @param year ...
|
* @param month comma separated list of months, or *
|
||||||
* @param month ...
|
* @param day comma separated list of days, or *
|
||||||
* @param day ...
|
* @param weekday comma separated list of weekdays, or *
|
||||||
* @param weekday ...
|
* @param hour comma separated list of hours, or *
|
||||||
* @param hour ...
|
* @param minute comma separated list of minutes, or *
|
||||||
* @param minute ...
|
|
||||||
*/
|
*/
|
||||||
public void addCronJob(String functionName, String year, String month, String day,
|
public void addCronJob(String functionName, String year, String month, String day,
|
||||||
String weekday, String hour, String minute) {
|
String weekday, String hour, String minute) {
|
||||||
|
@ -370,9 +354,8 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Unregister a previously registered cron job
|
||||||
*
|
* @param functionName the function name
|
||||||
* @param functionName ...
|
|
||||||
*/
|
*/
|
||||||
public void removeCronJob(String functionName) {
|
public void removeCronJob(String functionName) {
|
||||||
app.customCronJobs.remove(functionName);
|
app.customCronJobs.remove(functionName);
|
||||||
|
@ -524,36 +507,32 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Get the number of currently available threads/request evaluators
|
||||||
*
|
* @return the currently available threads
|
||||||
* @return ...
|
|
||||||
*/
|
*/
|
||||||
public int getFreeThreads() {
|
public int getFreeThreads() {
|
||||||
return app.countFreeEvaluators();
|
return app.countFreeEvaluators();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Get the number of currently active request threads
|
||||||
*
|
* @return the number of currently active threads
|
||||||
* @return ...
|
|
||||||
*/
|
*/
|
||||||
public int getActiveThreads() {
|
public int getActiveThreads() {
|
||||||
return app.countActiveEvaluators();
|
return app.countActiveEvaluators();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Get the maximal thread number for this application
|
||||||
*
|
* @return the maximal number of threads/request evaluators
|
||||||
* @return ...
|
|
||||||
*/
|
*/
|
||||||
public int getMaxThreads() {
|
public int getMaxThreads() {
|
||||||
return app.countEvaluators();
|
return app.countEvaluators();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Set the maximal thread number for this application
|
||||||
*
|
* @param n the maximal number of threads/request evaluators
|
||||||
* @param n ...
|
|
||||||
*/
|
*/
|
||||||
public void setMaxThreads(int n) {
|
public void setMaxThreads(int n) {
|
||||||
// add one to the number to compensate for the internal scheduler.
|
// add one to the number to compensate for the internal scheduler.
|
||||||
|
@ -573,9 +552,9 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Return a map of skin resources
|
||||||
*
|
*
|
||||||
*
|
* @return a map containing the skin resources
|
||||||
* @return ...
|
|
||||||
*/
|
*/
|
||||||
public Map getSkinfiles() {
|
public Map getSkinfiles() {
|
||||||
Map skinz = new SystemMap();
|
Map skinz = new SystemMap();
|
||||||
|
@ -592,11 +571,10 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Return a map of skin resources including the app-specific skinpath
|
||||||
*
|
*
|
||||||
*
|
* @param skinpath an array of directory paths or HopObjects to search for skins
|
||||||
* @param skinpath ...
|
* @return a map containing the skin resources
|
||||||
*
|
|
||||||
* @return ...
|
|
||||||
*/
|
*/
|
||||||
public Map getSkinfilesInPath(Object[] skinpath) {
|
public Map getSkinfilesInPath(Object[] skinpath) {
|
||||||
Map skinz = new SystemMap();
|
Map skinz = new SystemMap();
|
||||||
|
@ -613,18 +591,17 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Return the absolute application directory (appdir property
|
||||||
*
|
* in apps.properties file)
|
||||||
* @return ...
|
* @return the app directory as absolute path
|
||||||
*/
|
*/
|
||||||
public String getAppDir() {
|
public String getAppDir() {
|
||||||
return app.getAppDir().getAbsolutePath();
|
return app.getAppDir().getAbsolutePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Return the absolute server directory
|
||||||
*
|
* @return the server directory as absolute path
|
||||||
* @return ...
|
|
||||||
*/
|
*/
|
||||||
public String getServerDir() {
|
public String getServerDir() {
|
||||||
File f = app.getServerDir();
|
File f = app.getServerDir();
|
||||||
|
@ -637,9 +614,16 @@ public class ApplicationBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Return the app's default charset/encoding.
|
||||||
*
|
* @return the app's charset
|
||||||
* @return ...
|
*/
|
||||||
|
public String getCharset() {
|
||||||
|
return app.getCharset();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a string presentation of this AppBean
|
||||||
|
* @return string description of this app bean object
|
||||||
*/
|
*/
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "[Application " + app.getName() + "]";
|
return "[Application " + app.getName() + "]";
|
||||||
|
|
Loading…
Add table
Reference in a new issue