| java.lang.Object freecs.Server
Constructor Summary | |
public | Server() |
Method Summary | |
public void | addToken(String token, String cookie) | public void | banHost(InetAddress ia, long millis, String msg) | public void | banUser(User u, String msgTemplate, String message, long millis, String bannedBy) Used to ban a user from the server. | public void | banUser(Vector v, String message, long millis, String bannedBy) | public void | banUser(User u, String message, long millis, String bannedBy) | public void | changed() | public static boolean | checkLogLvl(short type, short lvl) | public void | created() | public static void | debug(Object o, String prefix, Throwable t, short type, short lvl) | public boolean | filePresent() | public static String | formatDefaultTimeStamp(long ts) | public String | formatTimeStamp(long ts, String pattern) | public static String | formatTimeStamp(long ts, SimpleDateFormat sdf) | public BanObject[] | getBanList() | public File | getConfigDir() returns the directory of the main server config. | public File | getFile() | public String | getFormatedTime(String pattern) | public InetAddress | getLocalHost() | public String | getProperty(String key) | public String | getUrl() | public static String | getVersion() | public void | initServer() | public boolean | isAdminHost(InetAddress ia) | public boolean | isBanned(Object o) | public boolean | isRunning() | public boolean | isTokenValid(String token, String cookie) | public long | lastModified() | public static void | log(Object o, String msg, short type, short lvl) | public static void | main(String args) the main-method of server is responsible for:
.) reading in the configuration
.) initializing the server
.) starting the neccessary threads
If this task's are completed this main-thread will
be used to remove bans which are not valid anymore
Parameters: args - the base-path may be given @commandline. | public void | readConfig() | public boolean | removeBan(String key) | public void | removeToken(String cookie) | public void | removed() | public void | startShutdown() | public String | toString() |
ALLOW_EXTERNALDEBUG_TEMPLATESETUSE_HTTP11USE_IP_BANTHREAD_PER_READUSE_TOKENSTOREMD5_PASSWORDSUSE_MESSAGE_RENDER_CACHEUSE_TRAFFIC_MONITORUSE_CENTRAL_REQUESTQUEUESTRICT_HOST_BINDING | public boolean ALLOW_EXTERNALDEBUG_TEMPLATESETUSE_HTTP11USE_IP_BANTHREAD_PER_READUSE_TOKENSTOREMD5_PASSWORDSUSE_MESSAGE_RENDER_CACHEUSE_TRAFFIC_MONITORUSE_CENTRAL_REQUESTQUEUESTRICT_HOST_BINDING(Code) | | |
DEBUG | public static boolean DEBUG(Code) | | |
DEFAULT_CHARSETCOOKIE_DOMAINSERVER_NAMETIMEZONEADMIN_HTTP_ALLOWEDADMIN_HTTP_USERNAMEADMIN_HTTP_PASSWORDADMIN_XMLRPC_ALLOWED | public String DEFAULT_CHARSETCOOKIE_DOMAINSERVER_NAMETIMEZONEADMIN_HTTP_ALLOWEDADMIN_HTTP_USERNAMEADMIN_HTTP_PASSWORDADMIN_XMLRPC_ALLOWED(Code) | | |
FN_DEFAULT_MODE_FALSE | public short FN_DEFAULT_MODE_FALSE(Code) | | |
FN_DEFAULT_MODE_TRUE | public short FN_DEFAULT_MODE_TRUE(Code) | | |
KEEP_ALIVE_TIMEOUT | public long KEEP_ALIVE_TIMEOUT(Code) | | |
LOGFILE | public static String[] LOGFILE(Code) | | LOGGING (will be moved to an extra object...
|
LVL_HALT | final public static short LVL_HALT(Code) | | |
LVL_MAJOR | final public static short LVL_MAJOR(Code) | | |
LVL_MINOR | final public static short LVL_MINOR(Code) | | |
LVL_VERBOSE | final public static short LVL_VERBOSE(Code) | | |
LVL_VERY_VERBOSE | final public static short LVL_VERY_VERBOSE(Code) | | |
MSG_AUTH | final public static short MSG_AUTH(Code) | | |
MSG_CONFIG | final public static short MSG_CONFIG(Code) | | |
MSG_ERROR | final public static short MSG_ERROR(Code) | | |
MSG_STATE | final public static short MSG_STATE(Code) | | |
MSG_TRAFFIC | final public static short MSG_TRAFFIC(Code) | | |
READER_MAX_QUEUEREADER_MAX_QUEUE_USAGEMAX_READERSMAX_BAN_DURATIONDEFAULT_BAN_DURATIONFLOOD_PROTECT_TOLERANCFLOOD_BAN_DURATIONREADBUFFER_SIZEMAX_USERSCOLOR_CHANGE_INTERVALMAX_USERNAME_LENGTHMAX_DIE_NUMBERMAX_DIE_EYESTCP_RECEIVE_BUFFER_WINDOWLOG_QUEUE_SIZEMAX_REQUESTS_PER_PROXY_IPMAX_REQUESTS_PER_IPMAX_SUUSERS_PER_STARTGROUPINITIAL_RESPONSE_QUEUEMAX_RESPONSE_QUEUEMAX_GROUPNAME_LENGTHMAX_GROUPTHEME_LENGTHADMIN_XMLRPC_PORTTOOL_PROTECT_COUNTERTOOL_PROTECT_TOLERANCTOOL_BAN_DURATIONTOOL_PROTECT_MINMILLSTOOL_PROTECT_MINCOUNTERJOIN_PUNISHED_COUNTER | public int READER_MAX_QUEUEREADER_MAX_QUEUE_USAGEMAX_READERSMAX_BAN_DURATIONDEFAULT_BAN_DURATIONFLOOD_PROTECT_TOLERANCFLOOD_BAN_DURATIONREADBUFFER_SIZEMAX_USERSCOLOR_CHANGE_INTERVALMAX_USERNAME_LENGTHMAX_DIE_NUMBERMAX_DIE_EYESTCP_RECEIVE_BUFFER_WINDOWLOG_QUEUE_SIZEMAX_REQUESTS_PER_PROXY_IPMAX_REQUESTS_PER_IPMAX_SUUSERS_PER_STARTGROUPINITIAL_RESPONSE_QUEUEMAX_RESPONSE_QUEUEMAX_GROUPNAME_LENGTHMAX_GROUPTHEME_LENGTHADMIN_XMLRPC_PORTTOOL_PROTECT_COUNTERTOOL_PROTECT_TOLERANCTOOL_BAN_DURATIONTOOL_PROTECT_MINMILLSTOOL_PROTECT_MINCOUNTERJOIN_PUNISHED_COUNTER(Code) | | |
REQUEST_TYPE_HTTP | final public static int REQUEST_TYPE_HTTP(Code) | | |
TOUCH_USER_DELAYREADER_MAX_IDLETIMEFILE_CHECK_INTERVALFLOOD_PROTECT_MILLISUSER_TIMEOUTUSER_AWAY_TIMEOUTUSER_REMOVE_SCHEDULE_TIMEHOST_BAN_DURATIONVIP_TIMEOUTREADER_TIMEOUTLOGIN_TIMEOUT | public long TOUCH_USER_DELAYREADER_MAX_IDLETIMEFILE_CHECK_INTERVALFLOOD_PROTECT_MILLISUSER_TIMEOUTUSER_AWAY_TIMEOUTUSER_REMOVE_SCHEDULE_TIMEHOST_BAN_DURATIONVIP_TIMEOUTREADER_TIMEOUTLOGIN_TIMEOUT(Code) | | |
TRACE_CREATE_AND_FINALIZE | public static boolean TRACE_CREATE_AND_FINALIZE(Code) | | |
UNAME_PREFIX_GODUNAME_PREFIX_GUESTUNAME_PREFIX_MODERATORUNAME_PREFIX_PUNISHEDUNAME_PREFIX_SUUNAME_PREFIX_VIPUNAME_SUFFIX_GODUNAME_SUFFIX_GUESTUNAME_SUFFIX_MODERATORUNAME_SUFFIX_PUNISHEDUNAME_SUFFIX_SUUNAME_SUFFIX_VIP | public String UNAME_PREFIX_GODUNAME_PREFIX_GUESTUNAME_PREFIX_MODERATORUNAME_PREFIX_PUNISHEDUNAME_PREFIX_SUUNAME_PREFIX_VIPUNAME_SUFFIX_GODUNAME_SUFFIX_GUESTUNAME_SUFFIX_MODERATORUNAME_SUFFIX_PUNISHEDUNAME_SUFFIX_SUUNAME_SUFFIX_VIP(Code) | | |
defaultCsEnc | public CharsetEncoder defaultCsEnc(Code) | | |
startupTime | final public static long startupTime(Code) | | |
banUser | public void banUser(User u, String msgTemplate, String message, long millis, String bannedBy)(Code) | | Used to ban a user from the server. Name and cookie are baned
If the ban-duration is reached, this ban will be removed by the main-thread
Parameters: u - the user object Parameters: msgTemplate - the message template to use for this ban (eg. user.flood) Parameters: millis - how long this user will be banned |
banUser | public void banUser(Vector v, String message, long millis, String bannedBy)(Code) | | ban all users contained in given vector
Parameters: v - vector containing users Parameters: message - reason for the kick Parameters: millis - milliseconds this user will be banned Parameters: bannedBy - name of the banner (may be Server in case of floodprotection |
changed | public void changed()(Code) | | |
checkLogLvl | public static boolean checkLogLvl(short type, short lvl)(Code) | | allows to check for logability of a message in advance of
performance critical messages
|
created | public void created()(Code) | | |
debug | public static void debug(Object o, String prefix, Throwable t, short type, short lvl)(Code) | | Debuging method configured by the loglevel mechanism
Parameters: prefix - to write before other stuff Parameters: t - is the throwable to print the stacktrace from Parameters: type - the type of message, konstants with MSG_ prefix are used here Parameters: lvl - the level of atention to use here, konstants with LVL_ prefix are used here |
filePresent | public boolean filePresent()(Code) | | |
formatDefaultTimeStamp | public static String formatDefaultTimeStamp(long ts)(Code) | | |
getConfigDir | public File getConfigDir()(Code) | | returns the directory of the main server config. other classes can
fetch their configs from there (e.g. the Authenticator-classes.
|
getUrl | public String getUrl()(Code) | | returns http-url to this server
the http-url to this server |
getVersion | public static String getVersion()(Code) | | returns the version of this server
version of server |
initServer | public void initServer()(Code) | | |
isBanned | public boolean isBanned(Object o)(Code) | | checks if this Object is associated to a ban
Parameters: o - the Object to check boolean true if this Object is associated with a ban |
isRunning | public boolean isRunning()(Code) | | |
lastModified | public long lastModified()(Code) | | |
log | public static void log(Object o, String msg, short type, short lvl)(Code) | | Logging method configured by the loglevel mechanism
Parameters: msg - the message to log Parameters: type - the type of message (MSG_ prefixed konstants are used here) Parameters: lvl - the level of attention to use here (LVL_ prefixed konstants are used here) |
main | public static void main(String args)(Code) | | the main-method of server is responsible for:
.) reading in the configuration
.) initializing the server
.) starting the neccessary threads
If this task's are completed this main-thread will
be used to remove bans which are not valid anymore
Parameters: args - the base-path may be given @commandline. Usage: freecs.Server -b=[path to mainfolder] |
readConfig | public void readConfig()(Code) | | |
removed | public void removed()(Code) | | |
startShutdown | public void startShutdown()(Code) | | QUERY-METHODS (used for retriefing values...)
|
|
|