Last active
November 23, 2015 23:10
-
-
Save sappenin/a94e9d1da4f51fb905eb to your computer and use it in GitHub Desktop.
Create a new instance of an Instacount client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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