Jason,
Sorry... Was in a hurry this afternoon & should have provided a bit
more detail on my question.
I was wondering if you'd consider adding as part of your update a
couple of factory classes, one for the client and one for users.
What we've done is created a simple XML file that has the keys & id in
it. Since you get one client per app per provider, this works out
well. Here's what it looks like:
<applications>
<application id="ClientSample">
<provider id="ORKUT_SANDBOX"
class="org.opensocial.providers.OrkutSandboxProvider">
<entry key="DEBUG">false</entry>
<entry key="CONSUMER_KEY">
orkut.com:623061448914</entry>
<entry key="CONSUMER_SECRET">uynAeXiWTisflWX99KU1D2q5</entry>
</provider>
</application>
</applications>
These can be any key/value pair at all, including the REST/RPC
endpoints. The advantage is that we could probably eliminate a number
of the specialized subclasses that are already there and just
configure the endpoints. We'd only have to specialize in the case of
something like MySpace, where there's actual processing that needs to
be done. Come to think of it, we'd probably want an interface here as
well.
We then have something similar for users:
<people>
<person canonicalId="jane.doe">
<provider name="GOOGLE">1xxx966</provider>
<provider name="ORKUT_SANDBOX">0xxx752</provider>
<provider name="SHINDIG">jane.doe</provider>
<provider name="FRIENDCONNECT">1xxx426</provider>
</person>
</people>
I can now write something like...
String providerName = "ORKUT_SANDBOX"; //could continue to
be the enum, constant, et.
OpenSocialClient c = OpenSocialClientFactory.instance
().getClient("ClientSample", providerName);
String userId = OpenSocialPersonIdManager.instance
().getUserIdForProvider("jane.doe", providerName);
Collection<OpenSocialPerson> friends = c.fetchFriends();
......
Is this in line with some of the work you are doing?
Thanks again,
-Mark W.