Skip to content

Instantly share code, notes, and snippets.

@sappenin
Last active November 23, 2015 23:10
Show Gist options
  • Save sappenin/a94e9d1da4f51fb905eb to your computer and use it in GitHub Desktop.
Save sappenin/a94e9d1da4f51fb905eb to your computer and use it in GitHub Desktop.
Create a new instance of an Instacount client
final InstacountClientParams myClientParams = new AbstractInstacountClientParams(false) {
@Override
public String getInstacountApplicationId()
{
... // Your Instacount Application Id
}
@Override
public String getInstacountReadOnlyApplicationKey()
{
... // Your Instacount Read-Only Application Key
}
@Override
public String getInstacountReadWriteApplicationKey()
{
... // Your Instacount Read-Only Application Key
}
@Override
public String getClientIdentifier()
{
... // Your Instacount Read-Write Application Key
}
};
final Instacount client = Instacount.Builder.build(params);
try
{
final IncrementShardedCounterResponse response = client.incrementShardedCounter("my-bean-counter");
// Do something else...
}
catch(InstacountClientException e)
{
// Handle potential instacount error condition...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment