code
stringlengths
73
34.1k
label
stringclasses
1 value
protected String getFeatureTypeParametersAsString(boolean showBounds) { List<JvmTypeParameter> typeParameters = getDeclaredTypeParameters(); if(!typeParameters.isEmpty()) { StringBuilder b = new StringBuilder(); b.append("<"); for(int i=0; i<typeParameters.size(); ++i) { JvmTypeParameter typeParameter ...
java
protected String getTypeArgumentsAsString(List<? extends LightweightTypeReference> typeArguments) { if(!typeArguments.isEmpty()) { StringBuilder b = new StringBuilder(); b.append("<"); for(int i=0; i<typeArguments.size(); ++i) { b.append(typeArguments.get(i).getHumanReadableName()); if(i < typeArgume...
java
@Override public ILinkingCandidate getPreferredCandidate(ILinkingCandidate other) { if (other instanceof AbstractPendingLinkingCandidate) { AbstractPendingLinkingCandidate<?> right = (AbstractPendingLinkingCandidate<?>) other; CandidateCompareResult candidateCompareResult = compareTo(right); switch(candidat...
java
public int getArityMismatch() { JvmIdentifiableElement identifiable = getFeature(); if (identifiable instanceof JvmExecutable) { return getArityMismatch((JvmExecutable) identifiable, getArguments()); } else if (getExpression() instanceof XAssignment) { return getArguments().size() - 1; } else { return ...
java
public <T extends Object> void forEach(final ITreeAppendable appendable, final Iterable<T> elements, final Procedure1<? super LoopParams> loopInitializer, final Procedure1<? super T> procedure) { boolean _isEmpty = IterableExtensions.isEmpty(elements); if (_isEmpty) { return; } LoopParams _loopPar...
java
public <T extends Object> void forEachWithShortcut(final ITreeAppendable appendable, final Iterable<T> elements, final Procedure1<? super T> procedure) { int _size = IterableExtensions.size(elements); boolean _equals = (_size == 1); if (_equals) { T _head = IterableExtensions.<T>head(elements); ...
java
protected void processAsPropertyNames(QualifiedName name, NameAcceptor acceptor) { String nameAsPropertyName = tryGetAsPropertyName(name.toString()); if (nameAsPropertyName != null) { if (featureCall == null || featureCall instanceof XAssignment) { String aliasedSetter = "set" + nameAsPropertyName; accep...
java
private boolean handleOverridesAndConflicts(JvmOperation operation, Multimap<String, AbstractResolvedOperation> processedOperations) { String simpleName = operation.getSimpleName(); if (!processedOperations.containsKey(simpleName)) { return true; } List<AbstractResolvedOperation> conflictingOperations = null...
java
public static UnboundTypeReference create(ITypeExpectation expectation, XExpression expression, JvmTypeParameter typeParameter) { return expectation.createUnboundTypeReference(expression, typeParameter); }
java
public void tryResolve(boolean constraintsAreSignificant) { if (internalIsResolved()) return; List<LightweightBoundTypeArgument> hints = getAllHints(); if (!hints.isEmpty() && hasSignificantHints(hints, constraintsAreSignificant)) { resolveWithHints(hints); } }
java
public boolean canResolveTo(LightweightTypeReference reference) { if (internalIsResolved()) return reference.isAssignableFrom(resolvedTo, new TypeConformanceComputationArgument(false, true, true, true, false, false /* TODO do we need to support synonmys here? */)); List<LightweightBoundTypeArgument> hints = getA...
java
public LightweightTypeReference resolve() { if (internalIsResolved()) return resolvedTo; List<LightweightBoundTypeArgument> allHints = getAllHints(); if (!allHints.isEmpty() && resolveWithHints(allHints)) { LightweightTypeReference result = internalGetResolvedTo(); if (result != null) { return result...
java
public ITreeAppendable compile(XBlockExpression expr, ITreeAppendable b, LightweightTypeReference expectedReturnType) { final boolean isPrimitiveVoidExpected = expectedReturnType.isPrimitiveVoid(); final boolean isPrimitiveVoid = isPrimitiveVoid(expr); final boolean earlyExit = isEarlyExit(expr); final boolean...
java
@Deprecated protected final boolean isVariableDeclarationRequired(XExpression expr, ITreeAppendable b) { return isVariableDeclarationRequired(expr, b, true); }
java
public int parseArgument(Options opt, String[] args, int start) throws BadCommandLineException, IOException { int consumed = 0; final String optionPrefix = "-" + getOptionName() + "-"; final int optionPrefixLength = optionPrefix.length(); final String arg = args[start]; final int equalsPosition = arg.ind...
java
public static List<GrantedAuthority> buildAuthorities(final List<CommonProfile> profiles) { final List<GrantedAuthority> authorities = new ArrayList<>(); for (final CommonProfile profile : profiles) { final Set<String> roles = profile.getRoles(); for (final String role : roles) {...
java
public static void populateAuthentication(final LinkedHashMap<String, CommonProfile> profiles) { if (profiles != null && profiles.size() > 0) { final List<CommonProfile> listProfiles = ProfileHelper.flatIntoAProfileList(profiles); try { if (IS_FULLY_AUTHENTICATED_AUTHORIZ...
java
public CMAEditorInterface update(CMAEditorInterface editor) { final String spaceId = getSpaceIdOrThrow(editor, "editor"); if (editor.getSystem().getContentType() == null) { throw new IllegalArgumentException("ContentType of editor interface may not be null!"); } if (editor.getSystem().getContentTy...
java
public Integer delete(CMAWebhook webhook) { final String webhookId = getResourceIdOrThrow(webhook, "webhook"); final String spaceId = getSpaceIdOrThrow(webhook, "webhook"); return service.delete(spaceId, webhookId).blockingFirst().code(); }
java
public CMAArray<CMAWebhook> fetchAll(Map<String, String> query) { throwIfEnvironmentIdIsSet(); return fetchAll(spaceId, query); }
java
public CMAArray<CMAWebhookCall> calls(CMAWebhook webhook) { final String spaceId = getSpaceIdOrThrow(webhook, "webhook"); final String webhookId = getResourceIdOrThrow(webhook, "webhook"); return service.calls(spaceId, webhookId).blockingFirst(); }
java
public CMAWebhookCallDetail callDetails(CMAWebhookCall call) { final String spaceId = getSpaceIdOrThrow(call, "call"); final String callId = getResourceIdOrThrow(call, "call"); assertNotNull(call.getSystem().getCreatedBy().getId(), "webhook.sys.createdBy"); final String webhookId = call.getSystem().getC...
java
public CMAWebhookHealth health(CMAWebhook webhook) { final String spaceId = getSpaceIdOrThrow(webhook, "webhook"); final String webhookId = getResourceIdOrThrow(webhook, "webhook"); return service.health(spaceId, webhookId).blockingFirst(); }
java
public CMAEnvironmentStatus getStatus() { final CMALink link = system.getEnvironmentalStatus(); if (link == null) { return null; } final String id = link.getId().toLowerCase(); for (final CMAEnvironmentStatus status : CMAEnvironmentStatus.values()) { final String statusName = status.na...
java
public Integer delete(CMAEnvironment environment) { assertNotNull(environment.getSpaceId(), "spaceId"); assertNotNull(environment.getId(), "environmentId"); return service.delete( getVersionOrThrow(environment, "version"), environment.getSpaceId(), environment.getId() ).blocking...
java
@SuppressWarnings("unchecked") public <T> T getField(String key, String locale) { if (fields == null) { return null; } LinkedHashMap<String, Object> field = fields.get(key); if (field == null) { return null; } else { return (T) field.get(locale); } }
java
public CMAEntry setFields(LinkedHashMap<String, LinkedHashMap<String, Object>> fields) { this.fields = fields; return this; }
java
public CMARole addPolicy(CMAPolicy policy) { if (policies == null) { policies = new ArrayList<CMAPolicy>(); } policies.add(policy); return this; }
java
@Override public JsonElement serialize(CMAEntry src, Type type, JsonSerializationContext context) { JsonObject fields = new JsonObject(); for (Map.Entry<String, LinkedHashMap<String, Object>> field : src.getFields().entrySet()) { LinkedHashMap<String, Object> value = field.getValue(); if (value ==...
java
@Override public JsonElement serialize(CMAField field, Type type, JsonSerializationContext context) { JsonObject json = new JsonObject(); add(json, ATTR_ID, field.getId()); add(json, ATTR_NAME, field.getName()); add(json, ATTR_TYPE, field.getType()); add(json, ATTR_LINK_TYPE, field.getLinkType())...
java
@Override public Response intercept(Chain chain) throws IOException { final Request request = chain.request(); final Request.Builder builder = request.newBuilder() .addHeader(HEADER_NAME, contentType); if (request.body() != null) { rewriteBodyWithCustomContentType(request, builder); } ...
java
public CMAArray<CMASpaceMembership> fetchAll(Map<String, String> query) { throwIfEnvironmentIdIsSet(); return fetchAll(spaceId, query); }
java
public CMASpaceMembership fetchOne(String spaceId, String membershipId) { assertNotNull(spaceId, "spaceId"); assertNotNull(membershipId, "membershipId"); return service.fetchOne(spaceId, membershipId).blockingFirst(); }
java
public CMAArray<CMAUiExtension> fetchAll(Map<String, String> query) { return fetchAll(spaceId, environmentId, query); }
java
public CMAUiExtension update(CMAUiExtension extension) { assertNotNull(extension, "extension"); final Integer version = getVersionOrThrow(extension, "update"); final String id = getResourceIdOrThrow(extension, "extension"); final String spaceId = getSpaceIdOrThrow(extension, "extension"); assertNotN...
java
public Integer delete(CMAUiExtension extension) { assertNotNull(extension, "extension"); final Integer version = getVersionOrThrow(extension, "update"); final String spaceId = getSpaceIdOrThrow(extension, "extension"); assertNotNull(extension.getEnvironmentId(), "environmentId"); final String enviro...
java
public Integer delete(CMAAsset asset) { final String assetId = getResourceIdOrThrow(asset, "asset"); final String spaceId = getSpaceIdOrThrow(asset, "asset"); final String environmentId = asset.getEnvironmentId(); return service.delete(spaceId, environmentId, assetId).blockingFirst().code(); }
java
public Integer process(CMAAsset asset, String locale) { assertNotNull(asset, "asset"); final String assetId = getResourceIdOrThrow(asset, "asset"); final String spaceId = getSpaceIdOrThrow(asset, "asset"); final String environmentId = asset.getEnvironmentId(); return service.process(spaceId, enviro...
java
public CMAAsset publish(CMAAsset asset) { assertNotNull(asset, "asset"); final String assetId = getResourceIdOrThrow(asset, "asset"); final String spaceId = getSpaceIdOrThrow(asset, "asset"); final String environmentId = asset.getEnvironmentId(); return service.publish( asset.getSystem().ge...
java
public CMAAsset unPublish(CMAAsset asset) { assertNotNull(asset, "asset"); final String assetId = getResourceIdOrThrow(asset, "asset"); final String spaceId = getSpaceIdOrThrow(asset, "asset"); final String environmentId = asset.getEnvironmentId(); return service.unPublish(spaceId, environmentId, ...
java
public CMAAsset update(CMAAsset asset) { assertNotNull(asset, "asset"); final String assetId = getResourceIdOrThrow(asset, "asset"); final String spaceId = getSpaceIdOrThrow(asset, "asset"); final String environmentId = asset.getEnvironmentId(); final Integer version = getVersionOrThrow(asset, "upda...
java
@SuppressWarnings("unchecked") public <T extends CMAResource> T setSystem(CMASystem system) { this.system = system; return (T) this; }
java
@SuppressWarnings("unchecked") public <T extends CMAResource> T setId(String id) { getSystem().setId(id); return (T) this; }
java
@SuppressWarnings("unchecked") public <T extends CMAResource> T setVersion(Integer version) { getSystem().setVersion(version); return (T) this; }
java
@SuppressWarnings("unchecked") public <T extends CMAResource> T setSpaceId(String spaceId) { if (getSystem().getSpace() == null) { getSystem().space = new CMALink(CMAType.Space); } getSystem().space.setId(spaceId); return (T) this; }
java
public Integer delete(CMAContentType contentType) { final String spaceId = getSpaceIdOrThrow(contentType, "contentType"); final String environmentId = contentType.getEnvironmentId(); final String contentTypeId = getResourceIdOrThrow(contentType, "contentType"); return service.delete(spaceId, environmen...
java
public CMAArray<CMAContentType> fetchAll( String spaceId, String environmentId, Map<String, String> query) { assertNotNull(spaceId, "spaceId"); DefaultQueryParameter.putIfNotSet(query, DefaultQueryParameter.FETCH); return service.fetchAll(spaceId, environmentId, query).blockingFirst(); }
java
public CMAContentType publish(CMAContentType contentType) { assertNotNull(contentType, "contentType"); final String contentTypeId = getResourceIdOrThrow(contentType, "contentType"); final String spaceId = getSpaceIdOrThrow(contentType, "contentType"); final String environmentId = contentType.getEnviron...
java
public CMAContentType update(CMAContentType contentType) { assertNotNull(contentType, "contentType"); assertNotNull(contentType.getName(), "contentType.name"); final String contentTypeId = getResourceIdOrThrow(contentType, "contentType"); final String spaceId = getSpaceIdOrThrow(contentType, "contentTy...
java
public CMAArray<CMASnapshot> fetchAllSnapshots(CMAContentType contentType) { assertNotNull(contentType, "contentType"); final String contentTypeId = getResourceIdOrThrow(contentType, "contentType"); final String spaceId = getSpaceIdOrThrow(contentType, "contentType"); final String environmentId = conte...
java
public CMASnapshot fetchOneSnapshot(CMAContentType contentType, String snapshotId) { assertNotNull(contentType, "contentType"); assertNotNull(snapshotId, "snapshotId"); final String contentTypeId = getResourceIdOrThrow(contentType, "contentType"); final String spaceId = getSpaceIdOrThrow(contentType, "...
java
@Override public CMASnapshot deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { final CMASnapshot result = new CMASnapshot(); final JsonObject jsonObject = json.getAsJsonObject(); final CMASystem system = context.deserialize(jsonObject.get("sy...
java
public Integer delete(CMAEntry entry) { assertNotNull(entry.getSpaceId(), "spaceId"); assertNotNull(entry.getEnvironmentId(), "environmentId"); assertNotNull(entry.getId(), "entryId"); return service.delete( entry.getSpaceId(), entry.getEnvironmentId(), entry.getId() ).block...
java
public CMAEntry fetchOne(String spaceId, String environmentId, String entryId) { assertNotNull(spaceId, "spaceId"); assertNotNull(environmentId, "environmentId"); assertNotNull(entryId, "entryId"); return service.fetchOne(spaceId, environmentId, entryId).blockingFirst(); }
java
public CMAEntry publish(CMAEntry entry) { assertNotNull(entry, "entry"); final String entryId = getResourceIdOrThrow(entry, "entry"); final String environmentId = entry.getEnvironmentId(); final String spaceId = getSpaceIdOrThrow(entry, "entry"); return service.publish( entry.getSystem().ge...
java
public CMAEntry unPublish(CMAEntry entry) { assertNotNull(entry, "entry"); final String entryId = getResourceIdOrThrow(entry, "entry"); final String spaceId = getSpaceIdOrThrow(entry, "entry"); final String environmentId = entry.getEnvironmentId(); return service.unPublish(spaceId, environmentId, e...
java
public CMAEntry update(CMAEntry entry) { assertNotNull(entry, "entry"); final String entryId = getResourceIdOrThrow(entry, "entry"); final String spaceId = getSpaceIdOrThrow(entry, "entry"); final String environmentId = entry.getEnvironmentId(); final Integer version = getVersionOrThrow(entry, "upda...
java
public CMAArray<CMASnapshot> fetchAllSnapshots(CMAEntry entry) { assertNotNull(entry, "entry"); final String entryId = getResourceIdOrThrow(entry, "entry"); final String spaceId = getSpaceIdOrThrow(entry, "entry"); final String environmentId = entry.getEnvironmentId(); return service.fetchAllSnaps...
java
public CMASnapshot fetchOneSnapshot(CMAEntry entry, String snapshotId) { assertNotNull(entry, "entry"); assertNotNull(snapshotId, "snapshotId"); final String entryId = getResourceIdOrThrow(entry, "entry"); final String spaceId = getSpaceIdOrThrow(entry, "entry"); final String environmentId = entry....
java
@Override public Response intercept(Chain chain) throws IOException { final Request request = chain.request(); final Response response = chain.proceed(request); if (!response.isSuccessful()) { throw new CMAHttpException(request, response); } return response; }
java
@Override public Response intercept(Chain chain) throws IOException { final Response response = chain.proceed(chain.request()); final Headers headers = response.headers(); final Map<String, List<String>> mappedHeaders = headers.toMultimap(); final RateLimits limits = new RateLimits.DefaultParser().pars...
java
static CMARichNode resolveRichNode(Map<String, Object> rawNode) { final String type = (String) rawNode.get("nodeType"); if (RESOLVER_MAP.containsKey(type)) { return RESOLVER_MAP.get(type).resolve(rawNode); } else { return null; } }
java
public CMAPersonalAccessToken addScope(Scope scope) { if (scopes == null) { scopes = new ArrayList<Scope>(); } scopes.add(scope); return this; }
java
public CMASpace create(CMASpace space) { assertNotNull(space, "space"); final CMASystem system = space.getSystem(); space.setSystem(null); try { return service.create(space).blockingFirst(); } finally { space.setSystem(system); } }
java
public CMASpace create(String spaceName, String organizationId) { assertNotNull(spaceName, "spaceName"); assertNotNull(organizationId, "organizationId"); return service.create(organizationId, new CMASpace().setName(spaceName).setSystem(null)) .blockingFirst(); }
java
public CMASpace create(CMASpace space, String organizationId) { assertNotNull(space, "space"); assertNotNull(space.getName(), "spaceName"); assertNotNull(organizationId, "organizationId"); final CMASystem system = space.getSystem(); space.setSystem(null); try { return service.create(orga...
java
public CMAArray<CMASpace> fetchAll(Map<String, String> query) { DefaultQueryParameter.putIfNotSet(query, DefaultQueryParameter.FETCH); return service.fetchAll(query).blockingFirst(); }
java
public CMASpace update(CMASpace space) { assertNotNull(space, "space"); assertNotNull(space.getName(), "space.name"); final String spaceId = getResourceIdOrThrow(space, "space"); final Integer version = getVersionOrThrow(space, "update"); final CMASystem system = space.getSystem(); space.setSys...
java
static void putIfNotSet(Map<String, String> target, Map<String, String> defaults) { for (final String key : defaults.keySet()) { if (!target.containsKey(key)) { target.put(key, defaults.get(key)); } } }
java
public CMASpaceMembership setRoles(CMALink... roles) { if (roles == null) { throw new IllegalArgumentException("Roles cannot be null!"); } if (roles.length <= 0) { throw new IllegalArgumentException("Roles cannot be empty!"); } this.roles = new ArrayList<CMALink>(Arrays.asList(roles)); ...
java
public CMASpaceMembership addRole(CMALink role) { if (role == null) { throw new IllegalArgumentException("Role cannot be null!"); } if (roles == null) { roles = new ArrayList<CMALink>(); } this.roles.add(role); return this; }
java
public CMASpaceMembership setEmail(String email) { if (email == null) { throw new IllegalArgumentException("email cannot be null."); } if (!email.contains("@")) { throw new IllegalArgumentException("email needs to contain an '@' symbol."); } this.email = email; return this; }
java
private void setCallbackExecutor(Builder clientBuilder) { if (clientBuilder.callbackExecutor == null) { callbackExecutor = Platform.get().callbackExecutor(); } else { callbackExecutor = clientBuilder.callbackExecutor; } }
java
private Retrofit.Builder setEndpoint(Retrofit.Builder retrofitBuilder, String endpoint) { if (endpoint != null) { return retrofitBuilder.baseUrl(endpoint); } return retrofitBuilder; }
java
public CMAContentType addField(CMAField field) { if (fields == null) { fields = new ArrayList<CMAField>(); } fields.add(field); return this; }
java
public CMAArray<CMAApiKey> fetchAll(Map<String, String> query) { throwIfEnvironmentIdIsSet(); return fetchAll(spaceId, query); }
java
public CMAApiKey update(CMAApiKey key) { assertNotNull(key, "key"); final String keyId = getResourceIdOrThrow(key, "key"); final String spaceId = getSpaceIdOrThrow(key, "key"); final Integer version = getVersionOrThrow(key, "update"); final CMASystem system = key.getSystem(); key.setSystem(null...
java
public CMAApiKey create(String spaceId, CMAApiKey key) { assertNotNull(spaceId, "spaceId"); assertNotNull(key, "key"); return service.create(spaceId, key).blockingFirst(); }
java
public int delete(CMAApiKey key) { assertNotNull(key, "key"); final String space = getSpaceIdOrThrow(key, "key"); final String id = getResourceIdOrThrow(key, "key"); return service.delete(space, id).blockingFirst().code(); }
java
static byte[] readAllBytes(InputStream stream) throws IOException { int bytesRead = 0; byte[] currentChunk = new byte[255]; final List<byte[]> chunks = new ArrayList<byte[]>(); while ((bytesRead = stream.read(currentChunk)) != -1) { chunks.add(copyOf(currentChunk, bytesRead)); } if (chunk...
java
public int delete(CMAUpload upload) { final String uploadId = getResourceIdOrThrow(upload, "upload"); final String spaceId = getSpaceIdOrThrow(upload, "upload"); final Response<Void> response = service.delete(spaceId, uploadId).blockingFirst(); return response.code(); }
java
public CMAArray<CMARole> fetchAll(Map<String, String> query) { throwIfEnvironmentIdIsSet(); return fetchAll(spaceId, query); }
java
@Override public Response intercept(Chain chain) throws IOException { final Request request = chain.request(); return chain.proceed(request.newBuilder() .addHeader(name, value) .build()); }
java
public CMAWebhook addTopic(CMAWebhookTopic topic) { if (this.topics == null) { this.topics = new ArrayList<CMAWebhookTopic>(); } this.topics.add(topic); return this; }
java
public CMAWebhook addHeader(String key, String value) { if (this.headers == null) { this.headers = new ArrayList<CMAWebhookHeader>(); } this.headers.add(new CMAWebhookHeader(key, value)); return this; }
java
public CMAWebhook setBasicAuthorization(String user, String password) { this.user = user; this.password = password; return this; }
java
public void close() { Closeable closable = getClosable(); try { LOG.closingResponse(this); closable.close(); LOG.successfullyClosedResponse(this); } catch (IOException e) { throw LOG.exceptionWhileClosingResponse(e); } }
java
public static SearchSortGeoDistance sortGeoDistance(double locationLon, double locationLat, String field) { return new SearchSortGeoDistance(locationLon, locationLat, field); }
java
public List<InetAddress> nodes() { List<InetAddress> allNodes = new ArrayList<InetAddress>(); BucketConfig config = bucketConfig.get(); for (NodeInfo nodeInfo : config.nodes()) { try { allNodes.add(InetAddress.getByName(nodeInfo.hostname().address())); } c...
java
public static AsyncSearchQueryResult fromHttp429(String payload) { SearchStatus status = new DefaultSearchStatus(1L, 1L, 0L); SearchMetrics metrics = new DefaultSearchMetrics(0L, 0L, 0d); return new DefaultAsyncSearchQueryResult( status, Observable.<SearchQueryRo...
java
@Deprecated public static AsyncSearchQueryResult fromIndexNotFound(final String indexName) { //dummy default values SearchStatus status = new DefaultSearchStatus(1L, 1L, 0L); SearchMetrics metrics = new DefaultSearchMetrics(0L, 0L, 0d); return new DefaultAsyncSearchQueryResult( ...
java
private static String extractName(final Field fieldReference) { com.couchbase.client.java.repository.annotation.Field annotation = fieldReference.getAnnotation(com.couchbase.client.java.repository.annotation.Field.class); if (annotation == null || annotation.value() == null || annotation.val...
java
public byte[] rawContent(String path) { if (path == null) { return null; } for (SubdocOperationResult<OPERATION> result : resultList) { if (path.equals(result.path())) { return interpretResultRaw(result); } } return null; }
java
public ResponseStatus status(String path) { if (path == null) { return null; } for (SubdocOperationResult<OPERATION> result : resultList) { if (path.equals(result.path())) { return result.status(); } } return null; }
java
public boolean exists(String path) { if (path == null) { return false; } for (SubdocOperationResult<OPERATION> result : resultList) { if (path.equals(result.path()) && !(result.value() instanceof Exception)) { return true; } } r...
java
public boolean exists(int specIndex) { return specIndex >= 0 && specIndex < resultList.size() && !(resultList.get(specIndex).value() instanceof Exception); }
java
private static boolean shouldRetry(JsonObject errorJson) { if (errorJson == null) return false; Integer code = errorJson.getInt(ERROR_FIELD_CODE); String msg = errorJson.getString(ERROR_FIELD_MSG); if (code == null || msg == null) return false; if (code == 4050 || code == 4070 ...
java
protected Observable<AsyncN1qlQueryResult> retryPrepareAndExecuteOnce(Throwable error, N1qlQuery query, CouchbaseEnvironment env, long timeout, TimeUnit timeUnit) { if (error instanceof QueryExecutionException && shouldRetry(((QueryExecutionException) error).getN1qlError())) { queryC...
java
protected Observable<AsyncN1qlQueryResult> prepareAndExecute(final N1qlQuery query, final CouchbaseEnvironment env, final long timeout, final TimeUnit timeUnit) { return prepare(query.statement()) .flatMap(new Func1<PreparedPayload, Observable<AsyncN1qlQueryResult>>() { @Over...
java
protected Observable<AsyncN1qlQueryResult> executePrepared(final N1qlQuery query, PreparedPayload payload, CouchbaseEnvironment env, long timeout, TimeUnit timeUnit) { PreparedN1qlQuery preparedQuery; if (query instanceof ParameterizedN1qlQuery) { ParameterizedN1qlQuery pq = (ParameterizedN1...
java