[jcifs] Upcoming Changes
Michael B Allen
mba2000 at ioplex.com
Tue Sep 28 02:57:38 GMT 2004
Chris will be happy to hear I have implemented getAllByName. That's by
"Name" not "Address". The getAllByName call will return an array of
NbtAddresses with a name. Currently I think the only query that actually
returns more than one RDATA record is the 0x1C domain controller lookup.
This method will be used to implement a much more robust domain controller
lookup and load balancing. The plan is to query for the list of domain
controllers and save the array. Then I will add a getDomainContoller
method that will choose an entry by rotating through a range of the
beginning of the array. The range will initially start at 1 (ie. always
picks the first entry). At any time the range can be increased. An entry
can be excluded from contention by setting the element to null (which also
implicitly increases the range). The range will be based on a policy that
considers the number of open sessions (ie. resources) to each domain
controller (e.g. when a fraction of jcifs.smb.client.ssnLimit is reached).
The range would be capped at jcifs.netbios.lookupRespLimit.
This will give a lot smoother load balancing because it will evenly
distribute sessions accross DCs with each request. An element in the DC
array will be set to null by the getDomainContoller call or any other
caller that determines the DC is not fit for service. Finally, the array
of DCs will be repopulated every jcifs.netbios.cachePolicy seconds. It is
noteworty that the getAllByName call does not query the name service
cache. The name service cache will no longer influence DC aquisition other
than to refresh the DC array. The behavior of returning a different
address from getByName each time the cachePolicy expired has been removed.
A 0x1C getByName call will just return the first entry returned by WINS
(the old behavior).
Another change will be to make the NTLM HTTP negotiation fully stateful by
putting an Object to hold the session key and DC address into the session
right from the start. This is necessary to ensure that subsequent
negotiation is conducted with the DC from which the session key was
obtained. It might be preduent to permit a type-1-message to be honored
even if the object doesn't exist for backwards compatibility with servers
that might have a tendency to close connections.
More information about the jcifs