
Public Member Functions | |
| void | exceptionCaught (IoSession session, Throwable cause) throws CharacterCodingException |
| void | messageReceived (IoSession session, Object message) throws CharacterCodingException |
| void | messageSent (IoSession session, Object message) |
| ServerSessionHandler (Cache cache, String memcachedVersion, boolean verbosity, int idle) | |
| void | sessionClosed (IoSession session) |
| void | sessionCreated (IoSession session) |
| void | sessionIdle (IoSession session, IdleStatus status) |
| void | sessionOpened (IoSession session) |
Public Attributes | |
| int | curr_conns |
| int | idle_limit |
| int | started |
| int | total_conns |
| boolean | verbose |
| String | version |
Static Public Attributes | |
| static long | bytes_read |
| static long | bytes_written |
| static long | curr_bytes |
| static CharsetEncoder | ENCODER = Charset.forName("US-ASCII").newEncoder() |
Protected Member Functions | |
| String | add (MCElement e) |
| String | append (MCElement element) |
| String | cas (Long cas_key, MCElement e) |
| String | delete (String key, int time) |
| String | flush_all (int expire) |
| boolean | flush_all () |
| MCElement | get (String key) |
| String | get_add (String key, int mod) |
| String | getStoreResponseString (Cache.StoreResponse storeResponse) |
| void | initStats () |
| boolean | is_there (String key) |
| final int | Now () |
| String | prepend (MCElement element) |
| String | replace (MCElement e) |
| String | set (MCElement e) |
| String | stat (String arg) |
Protected Attributes | |
| Cache | cache |
Package Attributes | |
| final Logger | logger = LoggerFactory.getLogger(ServerSessionHandler.class) |
Private Member Functions | |
| String | getDeleteResponseString (Cache.DeleteResponse deleteResponse) |
| ServerSessionHandler | ( | Cache | cache, | |
| String | memcachedVersion, | |||
| boolean | verbosity, | |||
| int | idle | |||
| ) |
Construct the server session handler
| cache | the cache to use | |
| memcachedVersion | the version string to return to clients | |
| verbosity | verbosity level for debugging | |
| idle | how long sessions can be idle for |
Add an element to the cache
| e | the element to add |
Append bytes to an element in the cache
| element | the element to append to |
Check and set an element in the cache
| cas_key | the unique cas id for the element, to match against | |
| e | the element to set |
the message response string
Handle the deletion of an item from the cache.
| key | the key for the item | |
| time | only delete the element if time (time in seconds) |
| void exceptionCaught | ( | IoSession | session, | |
| Throwable | cause | |||
| ) | throws CharacterCodingException |
Triggered when an exception is caught by the protocol handler
| session | the MINA session | |
| cause | the exception |
| String flush_all | ( | int | expire | ) | [protected] |
Flush all cache entries with a timestamp after a given expiration time
| expire | the flush time in seconds |
| boolean flush_all | ( | ) | [protected] |
Flush all cache entries
Get an element from the cache
| key | the key for the element to lookup |
Increment an (integer) element in the cache
| key | the key to increment | |
| mod | the amount to add to the value |
| String getDeleteResponseString | ( | Cache.DeleteResponse | deleteResponse | ) | [private] |
| String getStoreResponseString | ( | Cache.StoreResponse | storeResponse | ) | [protected] |
Find the string response message which is equivalent to a response to a set/add/replace message in the cache
| storeResponse | the response code |
| void initStats | ( | ) | [protected] |
Initialize all statistic counters
| boolean is_there | ( | String | key | ) | [protected] |
Check whether an element is in the cache and non-expired
| key | the key for the element to lookup |
| void messageReceived | ( | IoSession | session, | |
| Object | message | |||
| ) | throws CharacterCodingException |
Handle the reception of an inbound command, which has already been pre-processed by the CommandDecoder.
| session | the MINA session | |
| message | the message itself |
| CharacterCodingException |
| void messageSent | ( | IoSession | session, | |
| Object | message | |||
| ) |
Called on message delivery.
| session | the MINA session | |
| message | the message sent |
| final int Now | ( | ) | [protected] |
Prepend bytes to an element in the cache
| element | the element to append to |
Replace an element in the cache
| e | the element to replace |
| void sessionClosed | ( | IoSession | session | ) |
Handle the closing of a session.
| session | the MINA session object |
| void sessionCreated | ( | IoSession | session | ) |
Handle the creation of a new protocol session.
| session | the MINA session object |
| void sessionIdle | ( | IoSession | session, | |
| IdleStatus | status | |||
| ) |
Triggered when a session has gone idle.
| session | the MINA session | |
| status | the idle status |
| void sessionOpened | ( | IoSession | session | ) |
Handle the opening of a new session.
| session | the MINA session object |
Set an element in the cache
| e | the element to set |
Return runtime statistics
| arg | additional arguments to the stats command |
long bytes_read [static] |
long bytes_written [static] |
long curr_bytes [static] |
| int curr_conns |
CharsetEncoder ENCODER = Charset.forName("US-ASCII").newEncoder() [static] |
| int idle_limit |
final Logger logger = LoggerFactory.getLogger(ServerSessionHandler.class) [package] |
| int started |
| int total_conns |
| boolean verbose |
1.5.8