I am trying to connect to Google App Engine's Datastore from my local machine in Java. I will not be using the service with an application on GAE, it will be on AWS.
What I tried
I tried using
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
, but I think it is for when the application is hosted on GAE.
Right now, I have Google Storage up and running using a json credentials file fetched with the System Variable GOOGLE_APPLICATION_CREDENTIALS. The connection works fine, so my guess is that I might have to do something similar to Storage. I did something like this for Storage :
HttpTransport transport = GoogleNetHttpTransport.newTrustedTransport();
JsonFactory jsonFactory = new JacksonFactory();
GoogleCredential credential = GoogleCredential.getApplicationDefault(transport, jsonFactory);
if (credential.createScopedRequired()) {
Collection<String> bigqueryScopes = StorageScopes.all();
credential = credential.createScoped(bigqueryScopes);
}
Storage client = new Storage.Builder(transport, jsonFactory, credential)
.setApplicationName("APPLICATION_NAME")
.build();
The question
So my question is : How can I connect to Google App Engine Datastore from outside of Google App Engine?
Thank you for your help!