The SHDefaultAccessPolicy is a simple implementation of the SHAccessPolicy interface. It can be used for common policy cases where you don't care too much about security issues or complex access control algorithms. By default, this class allows every type of access. You can, however, specify a password for this class to require, in which case only clients who connect with the given password are allowed to continue.
This constructor lets you specify the port number, default debug level,
and password. All fields have defaults: (port), if not specified,
will default to the port SH_DEFAULT_PORT, as specified in <sockhop/SockHopConstants.h>.
(debugLevel) defaults to off (0), and (password) defaults to no password
required. If (port) is set to zero, the system will choose an available
port to listen on.
Returns an SHNodeSpec with the port number
set to the port number specified in the constructor. If (password)
was specified in the constructor, the field "password", with the expected
password string, will be added to the SpecMessage of the returned SHNodeSpec.
If no password was specified for this object, then this method always
returns true. If a password was specified, then this method will
only return true if the client's (connectingSpec) has a field named "password"
in its SpecMessage, and that field's contents is a string that matches
our password exactly.
Always returns true.
Always returns true.
Always returns true.
Returns the debug level specified in the constructor.
Returns the string literal "default".
Passes the call on back to SHAccessPolicy::GetAddOnSpec().
Looks for string fields named "port", "password", "debug", "priority",
and "encoding" in (archive). If it doesn't find them, defaults will
be used. "port", "debug", and "priority" should be string representations
of integers, while "password" may be any string. "encoding" may be
one of the following: "none", "batch", "zliblight", "zlibmedium",
or "zlibheavy".
Needed to be an instantiatable BArchivable object. Returns a new SHDefaultAccessPolicy, using the above (BMessage *) constructor.
Dehydration method. Must be called at the beginning of subclass's
Archive() methods.