org.alicebot.server.core
Class FlatFileMultiplexor

java.lang.Object
  extended by org.alicebot.server.core.Multiplexor
      extended by org.alicebot.server.core.FlatFileMultiplexor

public class FlatFileMultiplexor
extends Multiplexor

Presently more a proof-of-concept than anything else, for checking the new Multiplexor architecture.

Uses "flat-file" Java properties files, as in Program B, to store predicate data.

Version:
4.1.3
Author:
Noel Bush

Field Summary
 
Fields inherited from class org.alicebot.server.core.Multiplexor
ASTERISK, avgResponseTime, EMPTY_STRING, HOST_NAME, INPUT, PREDICATE_EMPTY_DEFAULT, QUOTE_MARK, responseCount, SECRET_KEY, SHOW_CONSOLE, SHOW_MATCH_TRACE, SPACE, STAR, startTime, THAT, TOPIC, totalTime, USE_TARGETING, VALUE
 
Constructor Summary
FlatFileMultiplexor()
           
 
Method Summary
 boolean changePassword(java.lang.String userid, java.lang.String password, java.lang.String secretKey, java.lang.String botid)
          Always returns true (FlatFileMultiplexor currently does not support authentication).
 boolean checkUser(java.lang.String userid, java.lang.String password, java.lang.String secretKey, java.lang.String botid)
          Always returns true (FlatFileMultiplexor currently does not support authentication).
 boolean createUser(java.lang.String userid, java.lang.String password, java.lang.String secretKey, java.lang.String botid)
          Always returns true (FlatFileMultiplexor currently does not support authentication).
 java.lang.String loadPredicate(java.lang.String name, java.lang.String userid, java.lang.String botid)
          Loads the value of a predicate from disk.
 void savePredicate(java.lang.String name, java.lang.String value, java.lang.String userid, java.lang.String botid)
          Saves a predicate to disk.
 int useridCount(java.lang.String botid)
          Returns a count of known userids.
 
Methods inherited from class org.alicebot.server.core.Multiplexor
addPulse, averageResponseTime, getInternalResponse, getResponse, initialize, pulse, queriesPerHour
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlatFileMultiplexor

public FlatFileMultiplexor()
Method Detail

checkUser

public boolean checkUser(java.lang.String userid,
                         java.lang.String password,
                         java.lang.String secretKey,
                         java.lang.String botid)
Always returns true (FlatFileMultiplexor currently does not support authentication).

Specified by:
checkUser in class Multiplexor
Parameters:
userid - the userid to check
password - the password to check
secretKey - the secret key that should authenticate this request
Returns:
whether the userid and password combination is valid

createUser

public boolean createUser(java.lang.String userid,
                          java.lang.String password,
                          java.lang.String secretKey,
                          java.lang.String botid)
Always returns true (FlatFileMultiplexor currently does not support authentication).

Specified by:
createUser in class Multiplexor
Parameters:
userid - the userid to use
password - the password to assign
secretKey - the secret key that should authenticate this request
Returns:
whether the creation was successful

changePassword

public boolean changePassword(java.lang.String userid,
                              java.lang.String password,
                              java.lang.String secretKey,
                              java.lang.String botid)
Always returns true (FlatFileMultiplexor currently does not support authentication).

Specified by:
changePassword in class Multiplexor
Parameters:
userid - the userid
password - the new password
secretKey - the secret key that should authenticate this request
Returns:
whether the change was successful

savePredicate

public void savePredicate(java.lang.String name,
                          java.lang.String value,
                          java.lang.String userid,
                          java.lang.String botid)
Saves a predicate to disk.

Specified by:
savePredicate in class Multiplexor
Parameters:
name - predicate name
value - predicate value
userid - user identifier

loadPredicate

public java.lang.String loadPredicate(java.lang.String name,
                                      java.lang.String userid,
                                      java.lang.String botid)
                               throws NoSuchPredicateException
Loads the value of a predicate from disk.

Specified by:
loadPredicate in class Multiplexor
Parameters:
name - predicate name
userid - user identifier
Returns:
the predicate value
Throws:
NoSuchPredicateException - if there is no predicate with this name

useridCount

public int useridCount(java.lang.String botid)
Description copied from class: Multiplexor
Returns a count of known userids. This may be defined differently for different multiplexors.

Specified by:
useridCount in class Multiplexor
Returns:
a count of known userids