You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */packagecom.google.gcloud;publicabstractclassBaseService<OextendsServiceOptions> implementsService<O> { privatefinalOoptions; protectedBaseService(Ooptions) { this.options = options; } @OverridepublicOoptions() { returnoptions; }}
1
+
/*
2
+
* Copyright 2015 Google Inc. All Rights Reserved.
3
+
*
4
+
* Licensed under the Apache License, Version 2.0 (the "License");
5
+
* you may not use this file except in compliance with the License.
6
+
* You may obtain a copy of the License at
7
+
*
8
+
* http://www.apache.org/licenses/LICENSE-2.0
9
+
*
10
+
* Unless required by applicable law or agreed to in writing, software
11
+
* distributed under the License is distributed on an "AS IS" BASIS,
12
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+
* See the License for the specific language governing permissions and
/* * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */packagecom.google.gcloud;publicinterfaceService<OextendsServiceOptions> { Ooptions();}
1
+
/*
2
+
* Copyright 2015 Google Inc. All Rights Reserved.
3
+
*
4
+
* Licensed under the Apache License, Version 2.0 (the "License");
5
+
* you may not use this file except in compliance with the License.
6
+
* You may obtain a copy of the License at
7
+
*
8
+
* http://www.apache.org/licenses/LICENSE-2.0
9
+
*
10
+
* Unless required by applicable law or agreed to in writing, software
11
+
* distributed under the License is distributed on an "AS IS" BASIS,
12
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+
* See the License for the specific language governing permissions and
/* * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */packagecom.google.gcloud.spi;importcom.google.gcloud.ServiceOptions;importjava.io.Serializable;/** * A base interface for all service RPC factories. * Loading of a factory implementation is done via {@link java.util.ServiceLoader}. */publicinterfaceServiceRpcFactory<S, OextendsServiceOptions> extendsSerializable { Screate(Ooptions);}
1
+
/*
2
+
* Copyright 2015 Google Inc. All Rights Reserved.
3
+
*
4
+
* Licensed under the Apache License, Version 2.0 (the "License");
5
+
* you may not use this file except in compliance with the License.
6
+
* You may obtain a copy of the License at
7
+
*
8
+
* http://www.apache.org/licenses/LICENSE-2.0
9
+
*
10
+
* Unless required by applicable law or agreed to in writing, software
11
+
* distributed under the License is distributed on an "AS IS" BASIS,
12
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+
* See the License for the specific language governing permissions and
14
+
* limitations under the License.
15
+
*/
16
+
17
+
packagecom.google.gcloud.spi;
18
+
19
+
importcom.google.gcloud.ServiceOptions;
20
+
21
+
importjava.io.Serializable;
22
+
23
+
/**
24
+
* A base interface for all service RPC factories.
25
+
* Loading of a factory implementation is done via {@link java.util.ServiceLoader}.
/* * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */packagecom.google.gcloud.spi;importcom.google.api.services.datastore.DatastoreV1.AllocateIdsRequest;importcom.google.api.services.datastore.DatastoreV1.AllocateIdsResponse;importcom.google.api.services.datastore.DatastoreV1.BeginTransactionRequest;importcom.google.api.services.datastore.DatastoreV1.BeginTransactionResponse;importcom.google.api.services.datastore.DatastoreV1.CommitRequest;importcom.google.api.services.datastore.DatastoreV1.CommitResponse;importcom.google.api.services.datastore.DatastoreV1.LookupRequest;importcom.google.api.services.datastore.DatastoreV1.LookupResponse;importcom.google.api.services.datastore.DatastoreV1.RollbackRequest;importcom.google.api.services.datastore.DatastoreV1.RollbackResponse;importcom.google.api.services.datastore.DatastoreV1.RunQueryRequest;importcom.google.api.services.datastore.DatastoreV1.RunQueryResponse;/** * Provides access to the remote Datastore service. */publicinterfaceDatastoreRpc { publicclassDatastoreRpcExceptionextendsException { /** * The reason for the exception. * * @see <a href="https://cloud.google.com/datastore/docs/concepts/errors#Error_Codes">Google Cloud Datastore error codes</a> */publicenumReason { ABORTED(true, "Request aborted", 409), DEADLINE_EXCEEDED(true, "Deadline exceeded", 403), FAILED_PRECONDITION(false, "Invalid request", 412), INTERNAL(false, "Server returned an error", 500), INVALID_ARGUMENT(false, "Request parameter has an invalid value", 400), PERMISSION_DENIED(false, "Unauthorized request", 403), RESOURCE_EXHAUSTED(false, "Quota exceeded", 402), UNAVAILABLE(true, "Could not reach service", 503); privatefinalbooleanretryable; privatefinalStringdescription; privatefinalinthttpStatus; privateReason(booleanretryable, Stringdescription, inthttpStatus) { this.retryable = retryable; this.description = description; this.httpStatus = httpStatus; } publicbooleanretryable() { returnretryable; } publicStringdescription() { returndescription; } publicinthttpStatus() { returnhttpStatus; } } privatefinalStringreason; privatefinalinthttpStatus; privatefinalbooleanretryable; publicDatastoreRpcException(Reasonreason) { this(reason.name(), reason.httpStatus, reason.retryable, reason.description); } publicDatastoreRpcException(Stringreason, inthttpStatus, booleanretryable, Stringmessage) { super(message); this.reason = reason; this.httpStatus = httpStatus; this.retryable = retryable; } publicStringreason() { returnreason; } publicinthttpStatus() { returnhttpStatus; } publicbooleanretryable() { returnretryable; } } AllocateIdsResponseallocateIds(AllocateIdsRequestrequest) throwsDatastoreRpcException; BeginTransactionResponsebeginTransaction(BeginTransactionRequestrequest) throwsDatastoreRpcException; CommitResponsecommit(CommitRequestrequest) throwsDatastoreRpcException; LookupResponselookup(LookupRequestrequest) throwsDatastoreRpcException; RollbackResponserollback(RollbackRequestrequest) throwsDatastoreRpcException; RunQueryResponserunQuery(RunQueryRequestrequest) throwsDatastoreRpcException;}
1
+
/*
2
+
* Copyright 2015 Google Inc. All Rights Reserved.
3
+
*
4
+
* Licensed under the Apache License, Version 2.0 (the "License");
5
+
* you may not use this file except in compliance with the License.
6
+
* You may obtain a copy of the License at
7
+
*
8
+
* http://www.apache.org/licenses/LICENSE-2.0
9
+
*
10
+
* Unless required by applicable law or agreed to in writing, software
11
+
* distributed under the License is distributed on an "AS IS" BASIS,
12
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+
* See the License for the specific language governing permissions and
0 commit comments