Commit Graph

102 Commits

Author SHA1 Message Date
Michael Bayne a1aa2d77ae Revamping/cleanup of how we handle authentication usernames as well as chained
authenticators and chained session factories. We can share a lot more code this
way and the implicit requirement that the default authenticator/factory had to
be configured before anyone else configured a chanied author/factory is gone.

The other big change is that Credentials doesn't require a username
(UsernamePasswordCreds inherits that username so most derived classes don't
notice any difference). Instead we require that a canonical authentication
username be determined and configured in AuthingConnection during the
authentication process. This canonical username is then used to resolve the
client session and map everything in the client manager.

This is pretty much exactly what was going on before except that we were doing
it all in an ad hoc way by jamming a new name into Credentials during the
authentication process and also doing jiggery pokery in
PresentsSession.assignStartingUsername. That all goes away and/or becomes
cleaner and more explicit.

This is going to impact some Yohoho jiggery pokery, which I will shortly commit
a patch for, but we're going to need to test it. Omelets, eggs, etc.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5828 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-06-20 00:56:01 +00:00
Michael Bayne 3f19fcacf2 Moved Lifecycle to samskivert (my initial desire to do this came from a
non-work project). I promise to stop fooling around now.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5805 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-27 19:16:49 +00:00
Michael Bayne e87c86dc2c Let's make the Lifecycle a bit more abstract and decouple it from all the
server business. I'd move the whole kit and kaboodle to samskivert but that
would mean moving the DependencyGraph as well...


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5804 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-27 19:09:47 +00:00
Michael Bayne 0a20b36c8e Out with ShutdownManager, in with LifecycleManager which handles both
initialization and shutdown. This will obviate the need for a lot of manual
wiring up. ShutdownManager still works and passes through to LifecycleManager,
but switching to the new deal is encouraged.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5802 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-27 18:32:45 +00:00
Michael Bayne a66c27a169 Track various peer stats.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5760 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-29 22:10:31 +00:00
Michael Bayne a2d6549121 Comment fix.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5747 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-27 19:48:00 +00:00
Ray Greenwell d1d6aa50d9 Unburden init() from things that can be injected.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5715 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-11 01:21:19 +00:00
Ray Greenwell 24760fa266 Create our PeerNode object through injection.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5714 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-11 01:12:16 +00:00
Ray Greenwell 18d36176a3 The PeerNode is the thing that calls clientLoggedOn/Off on the PeerManager,
so let's keep with that pattern for any clients there when the
peer itself connects or disconnects.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5713 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-04-10 22:25:35 +00:00
Michael Bayne 688f2580ed Varargified log calls.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5697 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-03-26 00:02:19 +00:00
Ray Greenwell 647a25dfdc Even better: have the base PeerManager call clientLoggedOn and clientLoggedOff
for every client on another node when it connects or disconnects from that node.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5696 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-03-25 23:10:02 +00:00
Michael Bayne dec9e7ee70 Execute clearClientInfo() in a transaction on NodeObject so that when derived
classes naturally remove extra crap from the NodeObject as a result of the
client departing this node, it all goes out in a single event. Cross-server
traffic-- go!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5684 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-03-11 19:27:33 +00:00
Michael Bayne 4a7cb2c82f Rethink! Instead of hacking up the peer ClientInfo system for the one thing
that actually needs to look clients up by visible name (chat forwarding), we'll
just leave things as is (as in mapped by auth username) and take care of our
own shit in ClientPeerManager.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5683 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-03-11 17:47:35 +00:00
Michael Bayne 65f4810832 Nixed unused import.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5649 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-02-03 01:43:14 +00:00
Ray Greenwell b2b8f57454 - Monitor logins to other nodes, boot any local sessions with the same
authentication name.
- Use new (ca. 2002) pattern of creating an overridable listener,
rather than making the whole class a listener.

Mdb told me to add this at the msoy level, but I think it belongs here.
Presents simply expects a user to be in one place.

It also occurs to me that we probably want something more sophisticated:
there may be unpersisted data connected to the session that should
be flushed prior to the session starting on another node. We may
want something like a lock when users log-in, so that other nodes
can terminate the session and flush any persistent data FIRST.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5635 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-01-15 23:19:02 +00:00
Michael Bayne 96fb4752b3 Make it easy to determine how many (if any) nodes on which your function was
called.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5631 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-01-10 22:51:26 +00:00
Michael Bayne 457c8a59d6 Allow reporters to be registered for different report types and the type to be
specified at report generation time.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5564 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-19 19:53:46 +00:00
Michael Bayne 9a67119557 Added type to generateReport().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5563 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-19 19:43:36 +00:00
Michael Bayne 034284e103 Tuple.create -> Tuple.newTuple.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5559 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-18 21:15:43 +00:00
Michael Bayne 01ac320432 When a peer connects to us, turn around and immediately connect back to them.
Don't wait up to 60 seconds for the next peer refresh interval.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5514 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 01:33:23 +00:00
Michael Bayne 89f02fc728 Created ServerCommunicator which does all I/O using the ConnectionManager's
polled socket system. This much more cleanly and efficiently integrates peer
(and other server to server) connections into the normal server I/O framework
and should also eliminate for good the annoying server hangs that result when
our old blocking client I/O threads got their pants wedged.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5510 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 00:27:07 +00:00
Michael Bayne b81ccde75b ClientFactory -> SessionFactory, etc.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5509 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-06 18:24:44 +00:00
Michael Bayne c69630b7e0 PresentsClient -> PresentsSession (Jamie's suggestion) and associated changes
on down the client.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5508 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-06 18:04:42 +00:00
Michael Bayne 7d4a594929 Truth in method naming.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5484 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-30 22:31:15 +00:00
Michael Bayne ce7cc1bc96 Added PeerService.generateReport().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5467 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-26 20:19:32 +00:00
Dave Hoover 657aafaedb And of course, if I were thinking this morning, I would've rerun the organize imports
thing before committing instead of just going "oh yeah, I've been having this stuff
sitting around uncommitted for a while waiting on it to be blessed" and missing
out on things that'd changed in the meantime.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5400 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-09-26 17:35:29 +00:00
Dave Hoover 8856120403 Import cleanups
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5399 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-09-26 17:29:59 +00:00
Michael Bayne dc4e4315da If we request to invoke an action directly on a node, do the right thing if
that node is us.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5380 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-09-17 23:08:02 +00:00
Dave Hoover 7ee6ace683 Javadoc warnings cleanups.
Note: this involves generated code from a samskivert patch I only just sent to mdb,
but he's in a meeting, so that won't show up for a little.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5369 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-09-12 17:59:26 +00:00
Michael Bayne 8114439855 Handle having a null caller.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5368 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-09-11 23:35:09 +00:00
Michael Bayne 1852e79477 Decode the action on the local server from the bytes so that we can catch a
failure to implement a zero arg constructor even in a developer's single server
test environment.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5367 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-09-11 23:32:57 +00:00
Michael Bayne d9ee8b91d1 We want to hear about the exception as well.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5337 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-08-25 15:29:33 +00:00
Tom Conkling c1442d8b17 Include the Throwable in the warning here
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5313 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-08-12 00:51:01 +00:00
Michael Bayne eda49af57b Let's just use a runnable there. Having the node action turns out not to be
super useful. If one really needs it they can keep a final reference around.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5304 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-08-10 02:16:54 +00:00
Michael Bayne 2cb05c165d A few things:
- switched to Google Base's Function interface instead of rolling our own
various function interfaces;
- added invokeNodeAction() that invokes directly on a single node with no
checking;
- added an onDropped callback that will be invoked if a node action fails to
match any nodes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5302 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-08-10 01:16:31 +00:00
Michael Bayne 8ba97d2f70 Switch NodeAction to use the Presents streaming system instead of
Serializable. I wanted to avoid having to declare a bazillion no argument
constructors, but it's too annoying to have to make all the Presents streamable
classes that one naturally wants to send between servers also Serializable.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5301 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-08-09 23:04:35 +00:00
Michael Bayne 0b6d823e8a Fixed ChainedResultListener declaration.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5281 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-08-01 13:19:24 +00:00
Michael Bayne 725f656197 Fixed a bunch of type safety bits pointed out by the latest version of Eclipse.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5274 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-30 12:58:51 +00:00
Michael Bayne 5c4ab96880 Styley stylopolis.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5252 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-22 14:01:51 +00:00
Michael Bayne c743432676 More style changes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5248 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-22 13:02:13 +00:00
Dave Hoover 6b1d65553f And finally, narya gets the imports/overrides/regen love.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5241 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-18 23:20:17 +00:00
Michael Bayne e41dda3018 Style fixes and import pruning. Beware, CheckStyle is (finally) coming to town.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5240 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-18 18:32:59 +00:00
Michael Bayne f043a81ee4 Maps cleanup; inject dependencies into NodeAction instances.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5211 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-29 14:09:54 +00:00
Michael Bayne c2d5b28b39 Make the PeerManager and CrowdPeerManager abstract to ensure that a failure to
bind something to PeerManager.class will result in initialization failure.

A system that uses the peer services needs to extend PeerManager or
CrowdPeerManager with a concrete PeerManager and then
bind(PeerManager.class).to(SomePeerManager.class) to properly satisfy the
dependency.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5171 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 20:55:33 +00:00
Michael Bayne 0128f6525a Modify PresentsClient and ClientResolver creation so that we can inject
dependencies into both. Moved the legacy statics into CrowdServer so that at
least Presents can be pure (we should probably eventually move them into
BangServer and PiracyServer and fix everything else). Added some useful manager
references to PlaceManager delegate (_omgr, _invmgr) that handle the majority
of their service needs.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5170 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 20:23:49 +00:00
Michael Bayne cfc240fa9c Wait scratch that. I'm apparently feeling schizophrenic.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5167 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 15:21:08 +00:00
Michael Bayne f8029e2fff Actually it is handy to have the node record.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5166 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 15:20:26 +00:00
Michael Bayne a8e5c3e324 Don't need the record in createPeerNode().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5164 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 14:08:58 +00:00
Michael Bayne 8c37ca7bfa Three things:
- Inject the auth Invoker.
- Inject the Authenticator and formalize the chaining authenticator pattern.
- Simplify PeerNode creation and make the PeerAuthenticator a chainer.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5162 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 13:04:27 +00:00
Michael Bayne 3aefc93838 Holy fruity beverage Batman! I'm taking the plunge and switching to Guice for
dependency resolution and management. Things are currently in a state of
transition, but the important patterns have been established and I'll aim to
sweep through all of Narya, Nenya and Vilya in the near future and do
everything properly.

Going through the other million-odd lines of code we have scattered across our
various projects that use these libraries is not something I plan to do, so
we'll be maintaining backward compatibility with the old static member method,
though I hope to strive toward eradication of that usage entirely in MSOY while
we still have a fighting chance.

Given that some of our projects will continue to use the static member method
in perpetuity, I'm not going to @Deprecate those fields because that would fill
their logs with so much spam that they'd have to turn off deprecation warnings
which would make life worse for them. So instead we'll settle for the big scary
comment warning people away from the old bits.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5153 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-07 17:44:48 +00:00