id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1 value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
35,900 | Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/util/FluxUtil.java | FluxUtil.collectByteBufStream | public static Mono<ByteBuf> collectByteBufStream(Flux<ByteBuf> stream, boolean autoReleaseEnabled) {
if (autoReleaseEnabled) {
Mono<ByteBuf> mergedCbb = Mono.using(
// Resource supplier
() -> {
CompositeByteBuf initialCbb = Unpooled.compositeBuffer();
return initialCbb;
},
// source Mono creator
(CompositeByteBuf initialCbb) -> {
Mono<CompositeByteBuf> reducedCbb = stream.reduce(initialCbb, (CompositeByteBuf currentCbb, ByteBuf nextBb) -> {
CompositeByteBuf updatedCbb = currentCbb.addComponent(nextBb.retain());
return updatedCbb;
});
//
return reducedCbb
.doOnNext((CompositeByteBuf cbb) -> cbb.writerIndex(cbb.capacity()))
.filter((CompositeByteBuf cbb) -> cbb.isReadable());
},
// Resource cleaner
(CompositeByteBuf finalCbb) -> finalCbb.release());
return mergedCbb;
} else {
return stream.collect(Unpooled::compositeBuffer,
(cbb1, buffer) -> cbb1.addComponent(true, Unpooled.wrappedBuffer(buffer)))
.filter((CompositeByteBuf cbb) -> cbb.isReadable())
.map(bb -> bb);
}
} | java | public static Mono<ByteBuf> collectByteBufStream(Flux<ByteBuf> stream, boolean autoReleaseEnabled) {
if (autoReleaseEnabled) {
Mono<ByteBuf> mergedCbb = Mono.using(
// Resource supplier
() -> {
CompositeByteBuf initialCbb = Unpooled.compositeBuffer();
return initialCbb;
},
// source Mono creator
(CompositeByteBuf initialCbb) -> {
Mono<CompositeByteBuf> reducedCbb = stream.reduce(initialCbb, (CompositeByteBuf currentCbb, ByteBuf nextBb) -> {
CompositeByteBuf updatedCbb = currentCbb.addComponent(nextBb.retain());
return updatedCbb;
});
//
return reducedCbb
.doOnNext((CompositeByteBuf cbb) -> cbb.writerIndex(cbb.capacity()))
.filter((CompositeByteBuf cbb) -> cbb.isReadable());
},
// Resource cleaner
(CompositeByteBuf finalCbb) -> finalCbb.release());
return mergedCbb;
} else {
return stream.collect(Unpooled::compositeBuffer,
(cbb1, buffer) -> cbb1.addComponent(true, Unpooled.wrappedBuffer(buffer)))
.filter((CompositeByteBuf cbb) -> cbb.isReadable())
.map(bb -> bb);
}
} | [
"public",
"static",
"Mono",
"<",
"ByteBuf",
">",
"collectByteBufStream",
"(",
"Flux",
"<",
"ByteBuf",
">",
"stream",
",",
"boolean",
"autoReleaseEnabled",
")",
"{",
"if",
"(",
"autoReleaseEnabled",
")",
"{",
"Mono",
"<",
"ByteBuf",
">",
"mergedCbb",
"=",
"Mo... | Collects byte buffers emitted by a Flux into a ByteBuf.
@param stream A stream which emits ByteBuf instances.
@param autoReleaseEnabled if ByteBuf instances in stream gets automatically released as they consumed
@return A Mono which emits the concatenation of all the byte buffers given by the source Flux. | [
"Collects",
"byte",
"buffers",
"emitted",
"by",
"a",
"Flux",
"into",
"a",
"ByteBuf",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/util/FluxUtil.java#L120-L148 |
35,901 | Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/TasksImpl.java | TasksImpl.terminate | public void terminate(String jobId, String taskId, TaskTerminateOptions taskTerminateOptions) {
terminateWithServiceResponseAsync(jobId, taskId, taskTerminateOptions).toBlocking().single().body();
} | java | public void terminate(String jobId, String taskId, TaskTerminateOptions taskTerminateOptions) {
terminateWithServiceResponseAsync(jobId, taskId, taskTerminateOptions).toBlocking().single().body();
} | [
"public",
"void",
"terminate",
"(",
"String",
"jobId",
",",
"String",
"taskId",
",",
"TaskTerminateOptions",
"taskTerminateOptions",
")",
"{",
"terminateWithServiceResponseAsync",
"(",
"jobId",
",",
"taskId",
",",
"taskTerminateOptions",
")",
".",
"toBlocking",
"(",
... | Terminates the specified task.
When the task has been terminated, it moves to the completed state. For multi-instance tasks, the terminate task operation applies synchronously to the primary task; subtasks are then terminated asynchronously in the background.
@param jobId The ID of the job containing the task.
@param taskId The ID of the task to terminate.
@param taskTerminateOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@throws BatchErrorException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent | [
"Terminates",
"the",
"specified",
"task",
".",
"When",
"the",
"task",
"has",
"been",
"terminated",
"it",
"moves",
"to",
"the",
"completed",
"state",
".",
"For",
"multi",
"-",
"instance",
"tasks",
"the",
"terminate",
"task",
"operation",
"applies",
"synchronous... | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/TasksImpl.java#L1942-L1944 |
35,902 | Azure/azure-sdk-for-java | authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java | RoleAssignmentsInner.getByIdAsync | public Observable<RoleAssignmentInner> getByIdAsync(String roleAssignmentId) {
return getByIdWithServiceResponseAsync(roleAssignmentId).map(new Func1<ServiceResponse<RoleAssignmentInner>, RoleAssignmentInner>() {
@Override
public RoleAssignmentInner call(ServiceResponse<RoleAssignmentInner> response) {
return response.body();
}
});
} | java | public Observable<RoleAssignmentInner> getByIdAsync(String roleAssignmentId) {
return getByIdWithServiceResponseAsync(roleAssignmentId).map(new Func1<ServiceResponse<RoleAssignmentInner>, RoleAssignmentInner>() {
@Override
public RoleAssignmentInner call(ServiceResponse<RoleAssignmentInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"RoleAssignmentInner",
">",
"getByIdAsync",
"(",
"String",
"roleAssignmentId",
")",
"{",
"return",
"getByIdWithServiceResponseAsync",
"(",
"roleAssignmentId",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponse",
"<",
"RoleAssignme... | Gets a role assignment by ID.
@param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and resource type. Use the format, /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the RoleAssignmentInner object | [
"Gets",
"a",
"role",
"assignment",
"by",
"ID",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java#L1101-L1108 |
35,903 | Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionVaultsInner.java | BackupLongTermRetentionVaultsInner.getAsync | public Observable<BackupLongTermRetentionVaultInner> getAsync(String resourceGroupName, String serverName) {
return getWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<BackupLongTermRetentionVaultInner>, BackupLongTermRetentionVaultInner>() {
@Override
public BackupLongTermRetentionVaultInner call(ServiceResponse<BackupLongTermRetentionVaultInner> response) {
return response.body();
}
});
} | java | public Observable<BackupLongTermRetentionVaultInner> getAsync(String resourceGroupName, String serverName) {
return getWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<BackupLongTermRetentionVaultInner>, BackupLongTermRetentionVaultInner>() {
@Override
public BackupLongTermRetentionVaultInner call(ServiceResponse<BackupLongTermRetentionVaultInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"BackupLongTermRetentionVaultInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
")",
".",
"map",
"(",
"n... | Gets a server backup long term retention vault.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the BackupLongTermRetentionVaultInner object | [
"Gets",
"a",
"server",
"backup",
"long",
"term",
"retention",
"vault",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionVaultsInner.java#L110-L117 |
35,904 | Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionVaultsInner.java | BackupLongTermRetentionVaultsInner.listByServerAsync | public Observable<List<BackupLongTermRetentionVaultInner>> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<List<BackupLongTermRetentionVaultInner>>, List<BackupLongTermRetentionVaultInner>>() {
@Override
public List<BackupLongTermRetentionVaultInner> call(ServiceResponse<List<BackupLongTermRetentionVaultInner>> response) {
return response.body();
}
});
} | java | public Observable<List<BackupLongTermRetentionVaultInner>> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<List<BackupLongTermRetentionVaultInner>>, List<BackupLongTermRetentionVaultInner>>() {
@Override
public List<BackupLongTermRetentionVaultInner> call(ServiceResponse<List<BackupLongTermRetentionVaultInner>> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"List",
"<",
"BackupLongTermRetentionVaultInner",
">",
">",
"listByServerAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"listByServerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serve... | Gets server backup long term retention vaults in a server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<BackupLongTermRetentionVaultInner> object | [
"Gets",
"server",
"backup",
"long",
"term",
"retention",
"vaults",
"in",
"a",
"server",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionVaultsInner.java#L374-L381 |
35,905 | Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/RestProxy.java | RestProxy.send | public Mono<HttpResponse> send(HttpRequest request, ContextData contextData) {
return httpPipeline.send(httpPipeline.newContext(request, contextData));
} | java | public Mono<HttpResponse> send(HttpRequest request, ContextData contextData) {
return httpPipeline.send(httpPipeline.newContext(request, contextData));
} | [
"public",
"Mono",
"<",
"HttpResponse",
">",
"send",
"(",
"HttpRequest",
"request",
",",
"ContextData",
"contextData",
")",
"{",
"return",
"httpPipeline",
".",
"send",
"(",
"httpPipeline",
".",
"newContext",
"(",
"request",
",",
"contextData",
")",
")",
";",
... | Send the provided request asynchronously, applying any request policies provided to the HttpClient instance.
@param request the HTTP request to send
@param contextData the context
@return a {@link Mono} that emits HttpResponse asynchronously | [
"Send",
"the",
"provided",
"request",
"asynchronously",
"applying",
"any",
"request",
"policies",
"provided",
"to",
"the",
"HttpClient",
"instance",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/RestProxy.java#L113-L115 |
35,906 | Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/RestProxy.java | RestProxy.handleRestReturnType | public final Object handleRestReturnType(Mono<HttpDecodedResponse> asyncHttpDecodedResponse, final SwaggerMethodParser methodParser, final Type returnType) {
final Mono<HttpDecodedResponse> asyncExpectedResponse = ensureExpectedStatus(asyncHttpDecodedResponse, methodParser);
final Object result;
if (TypeUtil.isTypeOrSubTypeOf(returnType, Mono.class)) {
final Type monoTypeParam = TypeUtil.getTypeArgument(returnType);
if (TypeUtil.isTypeOrSubTypeOf(monoTypeParam, Void.class)) {
// ProxyMethod ReturnType: Mono<Void>
result = asyncExpectedResponse.then();
} else {
// ProxyMethod ReturnType: Mono<? extends RestResponseBase<?, ?>>
result = asyncExpectedResponse.flatMap(response ->
handleRestResponseReturnType(response, methodParser, monoTypeParam));
}
} else if (FluxUtil.isFluxByteBuf(returnType)) {
// ProxyMethod ReturnType: Flux<ByteBuf>
result = asyncExpectedResponse.flatMapMany(ar -> ar.sourceResponse().body());
} else if (TypeUtil.isTypeOrSubTypeOf(returnType, void.class) || TypeUtil.isTypeOrSubTypeOf(returnType, Void.class)) {
// ProxyMethod ReturnType: Void
asyncExpectedResponse.block();
result = null;
} else {
// ProxyMethod ReturnType: T where T != async (Mono, Flux) or sync Void
// Block the deserialization until a value T is received
result = asyncExpectedResponse
.flatMap(httpResponse -> handleRestResponseReturnType(httpResponse, methodParser, returnType))
.block();
}
return result;
} | java | public final Object handleRestReturnType(Mono<HttpDecodedResponse> asyncHttpDecodedResponse, final SwaggerMethodParser methodParser, final Type returnType) {
final Mono<HttpDecodedResponse> asyncExpectedResponse = ensureExpectedStatus(asyncHttpDecodedResponse, methodParser);
final Object result;
if (TypeUtil.isTypeOrSubTypeOf(returnType, Mono.class)) {
final Type monoTypeParam = TypeUtil.getTypeArgument(returnType);
if (TypeUtil.isTypeOrSubTypeOf(monoTypeParam, Void.class)) {
// ProxyMethod ReturnType: Mono<Void>
result = asyncExpectedResponse.then();
} else {
// ProxyMethod ReturnType: Mono<? extends RestResponseBase<?, ?>>
result = asyncExpectedResponse.flatMap(response ->
handleRestResponseReturnType(response, methodParser, monoTypeParam));
}
} else if (FluxUtil.isFluxByteBuf(returnType)) {
// ProxyMethod ReturnType: Flux<ByteBuf>
result = asyncExpectedResponse.flatMapMany(ar -> ar.sourceResponse().body());
} else if (TypeUtil.isTypeOrSubTypeOf(returnType, void.class) || TypeUtil.isTypeOrSubTypeOf(returnType, Void.class)) {
// ProxyMethod ReturnType: Void
asyncExpectedResponse.block();
result = null;
} else {
// ProxyMethod ReturnType: T where T != async (Mono, Flux) or sync Void
// Block the deserialization until a value T is received
result = asyncExpectedResponse
.flatMap(httpResponse -> handleRestResponseReturnType(httpResponse, methodParser, returnType))
.block();
}
return result;
} | [
"public",
"final",
"Object",
"handleRestReturnType",
"(",
"Mono",
"<",
"HttpDecodedResponse",
">",
"asyncHttpDecodedResponse",
",",
"final",
"SwaggerMethodParser",
"methodParser",
",",
"final",
"Type",
"returnType",
")",
"{",
"final",
"Mono",
"<",
"HttpDecodedResponse",... | Handle the provided asynchronous HTTP response and return the deserialized value.
@param asyncHttpDecodedResponse the asynchronous HTTP response to the original HTTP request
@param methodParser the SwaggerMethodParser that the request originates from
@param returnType the type of value that will be returned
@return the deserialized result | [
"Handle",
"the",
"provided",
"asynchronous",
"HTTP",
"response",
"and",
"return",
"the",
"deserialized",
"value",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/RestProxy.java#L488-L516 |
35,907 | Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/RetryPolicy.java | RetryPolicy.incrementRetryCount | public void incrementRetryCount(String clientId)
{
Integer retryCount = this.retryCounts.get(clientId);
this.retryCounts.put(clientId, retryCount == null ? 1 : retryCount + 1);
} | java | public void incrementRetryCount(String clientId)
{
Integer retryCount = this.retryCounts.get(clientId);
this.retryCounts.put(clientId, retryCount == null ? 1 : retryCount + 1);
} | [
"public",
"void",
"incrementRetryCount",
"(",
"String",
"clientId",
")",
"{",
"Integer",
"retryCount",
"=",
"this",
".",
"retryCounts",
".",
"get",
"(",
"clientId",
")",
";",
"this",
".",
"retryCounts",
".",
"put",
"(",
"clientId",
",",
"retryCount",
"==",
... | Increments the number of successive retry attempts made by a client.
@param clientId id of the client retrying a failed operation | [
"Increments",
"the",
"number",
"of",
"successive",
"retry",
"attempts",
"made",
"by",
"a",
"client",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/RetryPolicy.java#L39-L43 |
35,908 | Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/RetryPolicy.java | RetryPolicy.resetRetryCount | public void resetRetryCount(String clientId)
{
Integer currentRetryCount = this.retryCounts.get(clientId);
if (currentRetryCount != null && currentRetryCount.intValue() != 0)
{
this.retryCounts.put(clientId, 0);
}
} | java | public void resetRetryCount(String clientId)
{
Integer currentRetryCount = this.retryCounts.get(clientId);
if (currentRetryCount != null && currentRetryCount.intValue() != 0)
{
this.retryCounts.put(clientId, 0);
}
} | [
"public",
"void",
"resetRetryCount",
"(",
"String",
"clientId",
")",
"{",
"Integer",
"currentRetryCount",
"=",
"this",
".",
"retryCounts",
".",
"get",
"(",
"clientId",
")",
";",
"if",
"(",
"currentRetryCount",
"!=",
"null",
"&&",
"currentRetryCount",
".",
"int... | Resets the number of retry attempts made by a client. This method is called by the client when retried operation succeeds.
@param clientId id of the client that just retried a failed operation and succeeded. | [
"Resets",
"the",
"number",
"of",
"retry",
"attempts",
"made",
"by",
"a",
"client",
".",
"This",
"method",
"is",
"called",
"by",
"the",
"client",
"when",
"retried",
"operation",
"succeeds",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/RetryPolicy.java#L49-L56 |
35,909 | Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/RetryPolicy.java | RetryPolicy.isRetryableException | public static boolean isRetryableException(Exception exception)
{
if (exception == null)
{
throw new IllegalArgumentException("exception cannot be null");
}
if (exception instanceof ServiceBusException)
{
return ((ServiceBusException) exception).getIsTransient();
}
return false;
} | java | public static boolean isRetryableException(Exception exception)
{
if (exception == null)
{
throw new IllegalArgumentException("exception cannot be null");
}
if (exception instanceof ServiceBusException)
{
return ((ServiceBusException) exception).getIsTransient();
}
return false;
} | [
"public",
"static",
"boolean",
"isRetryableException",
"(",
"Exception",
"exception",
")",
"{",
"if",
"(",
"exception",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"exception cannot be null\"",
")",
";",
"}",
"if",
"(",
"exception",
... | Determines if an exception is retry-able or not. Only transient exceptions should be retried.
@param exception exception encountered by an operation, to be determined if it is retry-able.
@return true if the exception is retry-able (like ServerBusy or other transient exception), else returns false | [
"Determines",
"if",
"an",
"exception",
"is",
"retry",
"-",
"able",
"or",
"not",
".",
"Only",
"transient",
"exceptions",
"should",
"be",
"retried",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/RetryPolicy.java#L63-L76 |
35,910 | Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/RetryPolicy.java | RetryPolicy.getDefault | public static RetryPolicy getDefault()
{
return new RetryExponential(
ClientConstants.DEFAULT_RERTRY_MIN_BACKOFF,
ClientConstants.DEFAULT_RERTRY_MAX_BACKOFF,
ClientConstants.DEFAULT_MAX_RETRY_COUNT,
ClientConstants.DEFAULT_RETRY);
} | java | public static RetryPolicy getDefault()
{
return new RetryExponential(
ClientConstants.DEFAULT_RERTRY_MIN_BACKOFF,
ClientConstants.DEFAULT_RERTRY_MAX_BACKOFF,
ClientConstants.DEFAULT_MAX_RETRY_COUNT,
ClientConstants.DEFAULT_RETRY);
} | [
"public",
"static",
"RetryPolicy",
"getDefault",
"(",
")",
"{",
"return",
"new",
"RetryExponential",
"(",
"ClientConstants",
".",
"DEFAULT_RERTRY_MIN_BACKOFF",
",",
"ClientConstants",
".",
"DEFAULT_RERTRY_MAX_BACKOFF",
",",
"ClientConstants",
".",
"DEFAULT_MAX_RETRY_COUNT",... | Retry policy that provides exponentially increasing retry intervals with each successive failure. This policy is suitable for use by use most client applications and is also the default policy
if no retry policy is specified.
@return a retry policy that provides exponentially increasing retry intervals | [
"Retry",
"policy",
"that",
"provides",
"exponentially",
"increasing",
"retry",
"intervals",
"with",
"each",
"successive",
"failure",
".",
"This",
"policy",
"is",
"suitable",
"for",
"use",
"by",
"use",
"most",
"client",
"applications",
"and",
"is",
"also",
"the",... | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/RetryPolicy.java#L83-L90 |
35,911 | Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/Util.java | Util.convertDotNetBytesToUUID | public static UUID convertDotNetBytesToUUID(byte[] dotNetBytes)
{
if(dotNetBytes == null || dotNetBytes.length != GUIDSIZE)
{
return new UUID(0l, 0l);
}
byte[] reOrderedBytes = new byte[GUIDSIZE];
for(int i=0; i<GUIDSIZE; i++)
{
int indexInReorderedBytes;
switch(i)
{
case 0:
indexInReorderedBytes = 3;
break;
case 1:
indexInReorderedBytes = 2;
break;
case 2:
indexInReorderedBytes = 1;
break;
case 3:
indexInReorderedBytes = 0;
break;
case 4:
indexInReorderedBytes = 5;
break;
case 5:
indexInReorderedBytes = 4;
break;
case 6:
indexInReorderedBytes = 7;
break;
case 7:
indexInReorderedBytes = 6;
break;
default:
indexInReorderedBytes = i;
}
reOrderedBytes[indexInReorderedBytes] = dotNetBytes[i];
}
ByteBuffer buffer = ByteBuffer.wrap(reOrderedBytes);
long mostSignificantBits = buffer.getLong();
long leastSignificantBits = buffer.getLong();
return new UUID(mostSignificantBits, leastSignificantBits);
} | java | public static UUID convertDotNetBytesToUUID(byte[] dotNetBytes)
{
if(dotNetBytes == null || dotNetBytes.length != GUIDSIZE)
{
return new UUID(0l, 0l);
}
byte[] reOrderedBytes = new byte[GUIDSIZE];
for(int i=0; i<GUIDSIZE; i++)
{
int indexInReorderedBytes;
switch(i)
{
case 0:
indexInReorderedBytes = 3;
break;
case 1:
indexInReorderedBytes = 2;
break;
case 2:
indexInReorderedBytes = 1;
break;
case 3:
indexInReorderedBytes = 0;
break;
case 4:
indexInReorderedBytes = 5;
break;
case 5:
indexInReorderedBytes = 4;
break;
case 6:
indexInReorderedBytes = 7;
break;
case 7:
indexInReorderedBytes = 6;
break;
default:
indexInReorderedBytes = i;
}
reOrderedBytes[indexInReorderedBytes] = dotNetBytes[i];
}
ByteBuffer buffer = ByteBuffer.wrap(reOrderedBytes);
long mostSignificantBits = buffer.getLong();
long leastSignificantBits = buffer.getLong();
return new UUID(mostSignificantBits, leastSignificantBits);
} | [
"public",
"static",
"UUID",
"convertDotNetBytesToUUID",
"(",
"byte",
"[",
"]",
"dotNetBytes",
")",
"{",
"if",
"(",
"dotNetBytes",
"==",
"null",
"||",
"dotNetBytes",
".",
"length",
"!=",
"GUIDSIZE",
")",
"{",
"return",
"new",
"UUID",
"(",
"0l",
",",
"0l",
... | First 4 bytes are in reverse order, 5th and 6th bytes are in reverse order, 7th and 8th bytes are also in reverse order | [
"First",
"4",
"bytes",
"are",
"in",
"reverse",
"order",
"5th",
"and",
"6th",
"bytes",
"are",
"in",
"reverse",
"order",
"7th",
"and",
"8th",
"bytes",
"are",
"also",
"in",
"reverse",
"order"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/Util.java#L215-L263 |
35,912 | Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/Util.java | Util.getDataSerializedSize | public static int getDataSerializedSize(Message amqpMessage)
{
if (amqpMessage == null)
{
return 0;
}
int payloadSize = getPayloadSize(amqpMessage);
// EventData - accepts only PartitionKey - which is a String & stuffed into MessageAnnotation
MessageAnnotations messageAnnotations = amqpMessage.getMessageAnnotations();
ApplicationProperties applicationProperties = amqpMessage.getApplicationProperties();
int annotationsSize = 0;
int applicationPropertiesSize = 0;
if (messageAnnotations != null)
{
annotationsSize += Util.sizeof(messageAnnotations.getValue());
}
if (applicationProperties != null)
{
applicationPropertiesSize += Util.sizeof(applicationProperties.getValue());
}
return annotationsSize + applicationPropertiesSize + payloadSize;
} | java | public static int getDataSerializedSize(Message amqpMessage)
{
if (amqpMessage == null)
{
return 0;
}
int payloadSize = getPayloadSize(amqpMessage);
// EventData - accepts only PartitionKey - which is a String & stuffed into MessageAnnotation
MessageAnnotations messageAnnotations = amqpMessage.getMessageAnnotations();
ApplicationProperties applicationProperties = amqpMessage.getApplicationProperties();
int annotationsSize = 0;
int applicationPropertiesSize = 0;
if (messageAnnotations != null)
{
annotationsSize += Util.sizeof(messageAnnotations.getValue());
}
if (applicationProperties != null)
{
applicationPropertiesSize += Util.sizeof(applicationProperties.getValue());
}
return annotationsSize + applicationPropertiesSize + payloadSize;
} | [
"public",
"static",
"int",
"getDataSerializedSize",
"(",
"Message",
"amqpMessage",
")",
"{",
"if",
"(",
"amqpMessage",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"int",
"payloadSize",
"=",
"getPayloadSize",
"(",
"amqpMessage",
")",
";",
"// EventData - a... | Remove this.. Too many cases, too many types... | [
"Remove",
"this",
"..",
"Too",
"many",
"cases",
"too",
"many",
"types",
"..."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/Util.java#L346-L373 |
35,913 | Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/Util.java | Util.readMessageFromDelivery | static Message readMessageFromDelivery(Receiver receiveLink, Delivery delivery)
{
int msgSize = delivery.pending();
byte[] buffer = new byte[msgSize];
int read = receiveLink.recv(buffer, 0, msgSize);
Message message = Proton.message();
message.decode(buffer, 0, read);
return message;
} | java | static Message readMessageFromDelivery(Receiver receiveLink, Delivery delivery)
{
int msgSize = delivery.pending();
byte[] buffer = new byte[msgSize];
int read = receiveLink.recv(buffer, 0, msgSize);
Message message = Proton.message();
message.decode(buffer, 0, read);
return message;
} | [
"static",
"Message",
"readMessageFromDelivery",
"(",
"Receiver",
"receiveLink",
",",
"Delivery",
"delivery",
")",
"{",
"int",
"msgSize",
"=",
"delivery",
".",
"pending",
"(",
")",
";",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"msgSize",
"]",
";... | This is not super stable for some reason | [
"This",
"is",
"not",
"super",
"stable",
"for",
"some",
"reason"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/Util.java#L411-L421 |
35,914 | Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnalyticsItemsInner.java | AnalyticsItemsInner.delete | public void delete(String resourceGroupName, String resourceName, ItemScopePath scopePath) {
deleteWithServiceResponseAsync(resourceGroupName, resourceName, scopePath).toBlocking().single().body();
} | java | public void delete(String resourceGroupName, String resourceName, ItemScopePath scopePath) {
deleteWithServiceResponseAsync(resourceGroupName, resourceName, scopePath).toBlocking().single().body();
} | [
"public",
"void",
"delete",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ItemScopePath",
"scopePath",
")",
"{",
"deleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
",",
"scopePath",
")",
".",
"toBlocking",
"(",
... | Deletes a specific Analytics Items defined within an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param scopePath Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'analyticsItems', 'myanalyticsItems'
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent | [
"Deletes",
"a",
"specific",
"Analytics",
"Items",
"defined",
"within",
"an",
"Application",
"Insights",
"component",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnalyticsItemsInner.java#L673-L675 |
35,915 | Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/JobInfo.java | JobInfo.addJobNotificationSubscription | public JobInfo addJobNotificationSubscription(
JobNotificationSubscription jobNotificationSubscription) {
getContent().addJobNotificationSubscriptionType(
new JobNotificationSubscriptionType()
.setNotificationEndPointId(
jobNotificationSubscription
.getNotificationEndPointId())
.setTargetJobState(
jobNotificationSubscription.getTargetJobState()
.getCode()));
return this;
} | java | public JobInfo addJobNotificationSubscription(
JobNotificationSubscription jobNotificationSubscription) {
getContent().addJobNotificationSubscriptionType(
new JobNotificationSubscriptionType()
.setNotificationEndPointId(
jobNotificationSubscription
.getNotificationEndPointId())
.setTargetJobState(
jobNotificationSubscription.getTargetJobState()
.getCode()));
return this;
} | [
"public",
"JobInfo",
"addJobNotificationSubscription",
"(",
"JobNotificationSubscription",
"jobNotificationSubscription",
")",
"{",
"getContent",
"(",
")",
".",
"addJobNotificationSubscriptionType",
"(",
"new",
"JobNotificationSubscriptionType",
"(",
")",
".",
"setNotificationE... | Adds the job notification subscription.
@param jobNotificationSubscription
the job notification subscription
@return the job info | [
"Adds",
"the",
"job",
"notification",
"subscription",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/JobInfo.java#L177-L188 |
35,916 | Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ServersInner.java | ServersInner.beginCreateOrUpdateAsync | public Observable<ServerInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, ServerInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerInner>, ServerInner>() {
@Override
public ServerInner call(ServiceResponse<ServerInner> response) {
return response.body();
}
});
} | java | public Observable<ServerInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, ServerInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerInner>, ServerInner>() {
@Override
public ServerInner call(ServiceResponse<ServerInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"ServerInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"ServerInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Creates or updates a server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param parameters The requested server resource state.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ServerInner object | [
"Creates",
"or",
"updates",
"a",
"server",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ServersInner.java#L538-L545 |
35,917 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.n | @JsonProperty("n")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] n() {
return ByteExtensions.clone(this.n);
} | java | @JsonProperty("n")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] n() {
return ByteExtensions.clone(this.n);
} | [
"@",
"JsonProperty",
"(",
"\"n\"",
")",
"@",
"JsonSerialize",
"(",
"using",
"=",
"Base64UrlJsonSerializer",
".",
"class",
")",
"@",
"JsonDeserialize",
"(",
"using",
"=",
"Base64UrlJsonDeserializer",
".",
"class",
")",
"public",
"byte",
"[",
"]",
"n",
"(",
")... | Get the n value.
@return the n value | [
"Get",
"the",
"n",
"value",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L225-L230 |
35,918 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.e | @JsonProperty("e")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] e() {
return ByteExtensions.clone(this.e);
} | java | @JsonProperty("e")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] e() {
return ByteExtensions.clone(this.e);
} | [
"@",
"JsonProperty",
"(",
"\"e\"",
")",
"@",
"JsonSerialize",
"(",
"using",
"=",
"Base64UrlJsonSerializer",
".",
"class",
")",
"@",
"JsonDeserialize",
"(",
"using",
"=",
"Base64UrlJsonDeserializer",
".",
"class",
")",
"public",
"byte",
"[",
"]",
"e",
"(",
")... | Get the e value.
@return the e value | [
"Get",
"the",
"e",
"value",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L249-L254 |
35,919 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.d | @JsonProperty("d")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] d() {
return ByteExtensions.clone(this.d);
} | java | @JsonProperty("d")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] d() {
return ByteExtensions.clone(this.d);
} | [
"@",
"JsonProperty",
"(",
"\"d\"",
")",
"@",
"JsonSerialize",
"(",
"using",
"=",
"Base64UrlJsonSerializer",
".",
"class",
")",
"@",
"JsonDeserialize",
"(",
"using",
"=",
"Base64UrlJsonDeserializer",
".",
"class",
")",
"public",
"byte",
"[",
"]",
"d",
"(",
")... | Get the d value.
@return the d value | [
"Get",
"the",
"d",
"value",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L273-L278 |
35,920 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.p | @JsonProperty("p")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] p() {
return ByteExtensions.clone(this.p);
} | java | @JsonProperty("p")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] p() {
return ByteExtensions.clone(this.p);
} | [
"@",
"JsonProperty",
"(",
"\"p\"",
")",
"@",
"JsonSerialize",
"(",
"using",
"=",
"Base64UrlJsonSerializer",
".",
"class",
")",
"@",
"JsonDeserialize",
"(",
"using",
"=",
"Base64UrlJsonDeserializer",
".",
"class",
")",
"public",
"byte",
"[",
"]",
"p",
"(",
")... | Get the RSA secret prime value.
@return the RSA secret prime value. | [
"Get",
"the",
"RSA",
"secret",
"prime",
"value",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L369-L374 |
35,921 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.q | @JsonProperty("q")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] q() {
return ByteExtensions.clone(this.q);
} | java | @JsonProperty("q")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] q() {
return ByteExtensions.clone(this.q);
} | [
"@",
"JsonProperty",
"(",
"\"q\"",
")",
"@",
"JsonSerialize",
"(",
"using",
"=",
"Base64UrlJsonSerializer",
".",
"class",
")",
"@",
"JsonDeserialize",
"(",
"using",
"=",
"Base64UrlJsonDeserializer",
".",
"class",
")",
"public",
"byte",
"[",
"]",
"q",
"(",
")... | Get RSA secret prime, with p < q value.
@return the RSA secret prime, with p < q value. | [
"Get",
"RSA",
"secret",
"prime",
"with",
"p",
"<",
";",
"q",
"value",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L393-L398 |
35,922 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.k | @JsonProperty("k")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] k() {
return ByteExtensions.clone(this.k);
} | java | @JsonProperty("k")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] k() {
return ByteExtensions.clone(this.k);
} | [
"@",
"JsonProperty",
"(",
"\"k\"",
")",
"@",
"JsonSerialize",
"(",
"using",
"=",
"Base64UrlJsonSerializer",
".",
"class",
")",
"@",
"JsonDeserialize",
"(",
"using",
"=",
"Base64UrlJsonDeserializer",
".",
"class",
")",
"public",
"byte",
"[",
"]",
"k",
"(",
")... | Get Symmetric key value.
@return the symmetric key value. | [
"Get",
"Symmetric",
"key",
"value",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L417-L422 |
35,923 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.t | @JsonProperty("key_hsm")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] t() {
return ByteExtensions.clone(this.t);
} | java | @JsonProperty("key_hsm")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] t() {
return ByteExtensions.clone(this.t);
} | [
"@",
"JsonProperty",
"(",
"\"key_hsm\"",
")",
"@",
"JsonSerialize",
"(",
"using",
"=",
"Base64UrlJsonSerializer",
".",
"class",
")",
"@",
"JsonDeserialize",
"(",
"using",
"=",
"Base64UrlJsonDeserializer",
".",
"class",
")",
"public",
"byte",
"[",
"]",
"t",
"("... | Get HSM Token value, used with Bring Your Own Key.
@return HSM Token, used with Bring Your Own Key. | [
"Get",
"HSM",
"Token",
"value",
"used",
"with",
"Bring",
"Your",
"Own",
"Key",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L441-L446 |
35,924 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.x | @JsonProperty("x")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] x() {
return ByteExtensions.clone(this.x);
} | java | @JsonProperty("x")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] x() {
return ByteExtensions.clone(this.x);
} | [
"@",
"JsonProperty",
"(",
"\"x\"",
")",
"@",
"JsonSerialize",
"(",
"using",
"=",
"Base64UrlJsonSerializer",
".",
"class",
")",
"@",
"JsonDeserialize",
"(",
"using",
"=",
"Base64UrlJsonDeserializer",
".",
"class",
")",
"public",
"byte",
"[",
"]",
"x",
"(",
")... | Get the x value.
@return the x value | [
"Get",
"the",
"x",
"value",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L501-L506 |
35,925 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.y | @JsonProperty("y")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] y() {
return ByteExtensions.clone(this.y);
} | java | @JsonProperty("y")
@JsonSerialize(using = Base64UrlJsonSerializer.class)
@JsonDeserialize(using = Base64UrlJsonDeserializer.class)
public byte[] y() {
return ByteExtensions.clone(this.y);
} | [
"@",
"JsonProperty",
"(",
"\"y\"",
")",
"@",
"JsonSerialize",
"(",
"using",
"=",
"Base64UrlJsonSerializer",
".",
"class",
")",
"@",
"JsonDeserialize",
"(",
"using",
"=",
"Base64UrlJsonDeserializer",
".",
"class",
")",
"public",
"byte",
"[",
"]",
"y",
"(",
")... | Get the y value.
@return the y value | [
"Get",
"the",
"y",
"value",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L525-L530 |
35,926 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.getRSAPrivateKeySpec | private RSAPrivateKeySpec getRSAPrivateKeySpec() {
return new RSAPrivateCrtKeySpec(toBigInteger(n), toBigInteger(e), toBigInteger(d), toBigInteger(p),
toBigInteger(q), toBigInteger(dp), toBigInteger(dq), toBigInteger(qi));
} | java | private RSAPrivateKeySpec getRSAPrivateKeySpec() {
return new RSAPrivateCrtKeySpec(toBigInteger(n), toBigInteger(e), toBigInteger(d), toBigInteger(p),
toBigInteger(q), toBigInteger(dp), toBigInteger(dq), toBigInteger(qi));
} | [
"private",
"RSAPrivateKeySpec",
"getRSAPrivateKeySpec",
"(",
")",
"{",
"return",
"new",
"RSAPrivateCrtKeySpec",
"(",
"toBigInteger",
"(",
"n",
")",
",",
"toBigInteger",
"(",
"e",
")",
",",
"toBigInteger",
"(",
"d",
")",
",",
"toBigInteger",
"(",
"p",
")",
",... | Get the RSA private key spec value.
@return the RSA private key spec value | [
"Get",
"the",
"RSA",
"private",
"key",
"spec",
"value",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L559-L563 |
35,927 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.getRSAPublicKey | private PublicKey getRSAPublicKey(Provider provider) {
try {
RSAPublicKeySpec publicKeySpec = getRSAPublicKeySpec();
KeyFactory factory = provider != null ? KeyFactory.getInstance("RSA", provider)
: KeyFactory.getInstance("RSA");
return factory.generatePublic(publicKeySpec);
} catch (GeneralSecurityException e) {
throw new IllegalStateException(e);
}
} | java | private PublicKey getRSAPublicKey(Provider provider) {
try {
RSAPublicKeySpec publicKeySpec = getRSAPublicKeySpec();
KeyFactory factory = provider != null ? KeyFactory.getInstance("RSA", provider)
: KeyFactory.getInstance("RSA");
return factory.generatePublic(publicKeySpec);
} catch (GeneralSecurityException e) {
throw new IllegalStateException(e);
}
} | [
"private",
"PublicKey",
"getRSAPublicKey",
"(",
"Provider",
"provider",
")",
"{",
"try",
"{",
"RSAPublicKeySpec",
"publicKeySpec",
"=",
"getRSAPublicKeySpec",
"(",
")",
";",
"KeyFactory",
"factory",
"=",
"provider",
"!=",
"null",
"?",
"KeyFactory",
".",
"getInstan... | Get the RSA public key value.
@param provider
the Java security provider.
@return the RSA public key value | [
"Get",
"the",
"RSA",
"public",
"key",
"value",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L572-L583 |
35,928 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.getRSAPrivateKey | private PrivateKey getRSAPrivateKey(Provider provider) {
try {
RSAPrivateKeySpec privateKeySpec = getRSAPrivateKeySpec();
KeyFactory factory = provider != null ? KeyFactory.getInstance("RSA", provider)
: KeyFactory.getInstance("RSA");
return factory.generatePrivate(privateKeySpec);
} catch (GeneralSecurityException e) {
throw new IllegalStateException(e);
}
} | java | private PrivateKey getRSAPrivateKey(Provider provider) {
try {
RSAPrivateKeySpec privateKeySpec = getRSAPrivateKeySpec();
KeyFactory factory = provider != null ? KeyFactory.getInstance("RSA", provider)
: KeyFactory.getInstance("RSA");
return factory.generatePrivate(privateKeySpec);
} catch (GeneralSecurityException e) {
throw new IllegalStateException(e);
}
} | [
"private",
"PrivateKey",
"getRSAPrivateKey",
"(",
"Provider",
"provider",
")",
"{",
"try",
"{",
"RSAPrivateKeySpec",
"privateKeySpec",
"=",
"getRSAPrivateKeySpec",
"(",
")",
";",
"KeyFactory",
"factory",
"=",
"provider",
"!=",
"null",
"?",
"KeyFactory",
".",
"getI... | Get the RSA private key value.
@param provider
the Java security provider.
@return the RSA private key value | [
"Get",
"the",
"RSA",
"private",
"key",
"value",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L592-L603 |
35,929 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.checkRSACompatible | private void checkRSACompatible() {
if (!JsonWebKeyType.RSA.equals(kty) && !JsonWebKeyType.RSA_HSM.equals(kty)) {
throw new UnsupportedOperationException("Not an RSA key");
}
} | java | private void checkRSACompatible() {
if (!JsonWebKeyType.RSA.equals(kty) && !JsonWebKeyType.RSA_HSM.equals(kty)) {
throw new UnsupportedOperationException("Not an RSA key");
}
} | [
"private",
"void",
"checkRSACompatible",
"(",
")",
"{",
"if",
"(",
"!",
"JsonWebKeyType",
".",
"RSA",
".",
"equals",
"(",
"kty",
")",
"&&",
"!",
"JsonWebKeyType",
".",
"RSA_HSM",
".",
"equals",
"(",
"kty",
")",
")",
"{",
"throw",
"new",
"UnsupportedOpera... | Verifies if the key is an RSA key. | [
"Verifies",
"if",
"the",
"key",
"is",
"an",
"RSA",
"key",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L631-L635 |
35,930 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.fromRSA | public static JsonWebKey fromRSA(KeyPair keyPair) {
RSAPrivateCrtKey privateKey = (RSAPrivateCrtKey) keyPair.getPrivate();
JsonWebKey key = null;
if (privateKey != null) {
key = new JsonWebKey().withKty(JsonWebKeyType.RSA).withN(toByteArray(privateKey.getModulus()))
.withE(toByteArray(privateKey.getPublicExponent()))
.withD(toByteArray(privateKey.getPrivateExponent())).withP(toByteArray(privateKey.getPrimeP()))
.withQ(toByteArray(privateKey.getPrimeQ())).withDp(toByteArray(privateKey.getPrimeExponentP()))
.withDq(toByteArray(privateKey.getPrimeExponentQ()))
.withQi(toByteArray(privateKey.getCrtCoefficient()));
} else {
RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();
key = new JsonWebKey().withKty(JsonWebKeyType.RSA).withN(toByteArray(publicKey.getModulus()))
.withE(toByteArray(publicKey.getPublicExponent())).withD(null).withP(null).withQ(null).withDp(null)
.withDq(null).withQi(null);
}
return key;
} | java | public static JsonWebKey fromRSA(KeyPair keyPair) {
RSAPrivateCrtKey privateKey = (RSAPrivateCrtKey) keyPair.getPrivate();
JsonWebKey key = null;
if (privateKey != null) {
key = new JsonWebKey().withKty(JsonWebKeyType.RSA).withN(toByteArray(privateKey.getModulus()))
.withE(toByteArray(privateKey.getPublicExponent()))
.withD(toByteArray(privateKey.getPrivateExponent())).withP(toByteArray(privateKey.getPrimeP()))
.withQ(toByteArray(privateKey.getPrimeQ())).withDp(toByteArray(privateKey.getPrimeExponentP()))
.withDq(toByteArray(privateKey.getPrimeExponentQ()))
.withQi(toByteArray(privateKey.getCrtCoefficient()));
} else {
RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();
key = new JsonWebKey().withKty(JsonWebKeyType.RSA).withN(toByteArray(publicKey.getModulus()))
.withE(toByteArray(publicKey.getPublicExponent())).withD(null).withP(null).withQ(null).withDp(null)
.withDq(null).withQi(null);
}
return key;
} | [
"public",
"static",
"JsonWebKey",
"fromRSA",
"(",
"KeyPair",
"keyPair",
")",
"{",
"RSAPrivateCrtKey",
"privateKey",
"=",
"(",
"RSAPrivateCrtKey",
")",
"keyPair",
".",
"getPrivate",
"(",
")",
";",
"JsonWebKey",
"key",
"=",
"null",
";",
"if",
"(",
"privateKey",
... | Converts RSA key pair to JSON web key.
@param keyPair
RSA key pair
@return the JSON web key, converted from RSA key pair. | [
"Converts",
"RSA",
"key",
"pair",
"to",
"JSON",
"web",
"key",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L666-L689 |
35,931 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.toRSA | public KeyPair toRSA(boolean includePrivateParameters, Provider provider) {
// Must be RSA
checkRSACompatible();
if (includePrivateParameters) {
return new KeyPair(getRSAPublicKey(provider), getRSAPrivateKey(provider));
} else {
return new KeyPair(getRSAPublicKey(provider), null);
}
} | java | public KeyPair toRSA(boolean includePrivateParameters, Provider provider) {
// Must be RSA
checkRSACompatible();
if (includePrivateParameters) {
return new KeyPair(getRSAPublicKey(provider), getRSAPrivateKey(provider));
} else {
return new KeyPair(getRSAPublicKey(provider), null);
}
} | [
"public",
"KeyPair",
"toRSA",
"(",
"boolean",
"includePrivateParameters",
",",
"Provider",
"provider",
")",
"{",
"// Must be RSA",
"checkRSACompatible",
"(",
")",
";",
"if",
"(",
"includePrivateParameters",
")",
"{",
"return",
"new",
"KeyPair",
"(",
"getRSAPublicKey... | Converts JSON web key to RSA key pair and include the private key if set to
true.
@param provider
the Java security provider.
@param includePrivateParameters
true if the RSA key pair should include the private key. False
otherwise.
@return RSA key pair | [
"Converts",
"JSON",
"web",
"key",
"to",
"RSA",
"key",
"pair",
"and",
"include",
"the",
"private",
"key",
"if",
"set",
"to",
"true",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L724-L734 |
35,932 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.fromEC | public static JsonWebKey fromEC(KeyPair keyPair, Provider provider) {
ECPublicKey apub = (ECPublicKey) keyPair.getPublic();
ECPoint point = apub.getW();
ECPrivateKey apriv = (ECPrivateKey) keyPair.getPrivate();
if (apriv != null) {
return new JsonWebKey().withKty(JsonWebKeyType.EC).withCrv(getCurveFromKeyPair(keyPair, provider))
.withX(point.getAffineX().toByteArray()).withY(point.getAffineY().toByteArray())
.withD(apriv.getS().toByteArray()).withKty(JsonWebKeyType.EC);
} else {
return new JsonWebKey().withKty(JsonWebKeyType.EC).withCrv(getCurveFromKeyPair(keyPair, provider))
.withX(point.getAffineX().toByteArray()).withY(point.getAffineY().toByteArray())
.withKty(JsonWebKeyType.EC);
}
} | java | public static JsonWebKey fromEC(KeyPair keyPair, Provider provider) {
ECPublicKey apub = (ECPublicKey) keyPair.getPublic();
ECPoint point = apub.getW();
ECPrivateKey apriv = (ECPrivateKey) keyPair.getPrivate();
if (apriv != null) {
return new JsonWebKey().withKty(JsonWebKeyType.EC).withCrv(getCurveFromKeyPair(keyPair, provider))
.withX(point.getAffineX().toByteArray()).withY(point.getAffineY().toByteArray())
.withD(apriv.getS().toByteArray()).withKty(JsonWebKeyType.EC);
} else {
return new JsonWebKey().withKty(JsonWebKeyType.EC).withCrv(getCurveFromKeyPair(keyPair, provider))
.withX(point.getAffineX().toByteArray()).withY(point.getAffineY().toByteArray())
.withKty(JsonWebKeyType.EC);
}
} | [
"public",
"static",
"JsonWebKey",
"fromEC",
"(",
"KeyPair",
"keyPair",
",",
"Provider",
"provider",
")",
"{",
"ECPublicKey",
"apub",
"=",
"(",
"ECPublicKey",
")",
"keyPair",
".",
"getPublic",
"(",
")",
";",
"ECPoint",
"point",
"=",
"apub",
".",
"getW",
"("... | Converts EC key pair to JSON web key.
@param keyPair
EC key pair
@param provider
Java security provider
@return the JSON web key, converted from EC key pair. | [
"Converts",
"EC",
"key",
"pair",
"to",
"JSON",
"web",
"key",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L818-L833 |
35,933 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.getCurveFromKeyPair | private static JsonWebKeyCurveName getCurveFromKeyPair(KeyPair keyPair, Provider provider) {
try {
ECPublicKey key = (ECPublicKey) keyPair.getPublic();
ECParameterSpec spec = key.getParams();
EllipticCurve crv = spec.getCurve();
List<JsonWebKeyCurveName> curveList = Arrays.asList(JsonWebKeyCurveName.P_256, JsonWebKeyCurveName.P_384,
JsonWebKeyCurveName.P_521, JsonWebKeyCurveName.P_256K);
for (JsonWebKeyCurveName curve : curveList) {
ECGenParameterSpec gps = new ECGenParameterSpec(CURVE_TO_SPEC_NAME.get(curve));
KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC", provider);
kpg.initialize(gps);
// Generate dummy keypair to get parameter spec.
KeyPair apair = kpg.generateKeyPair();
ECPublicKey apub = (ECPublicKey) apair.getPublic();
ECParameterSpec aspec = apub.getParams();
EllipticCurve acurve = aspec.getCurve();
// Matches the parameter spec
if (acurve.equals(crv)) {
return curve;
}
}
// Did not find a supported curve.
throw new NoSuchAlgorithmException("Curve not supported.");
} catch (GeneralSecurityException e) {
throw new IllegalStateException(e);
}
} | java | private static JsonWebKeyCurveName getCurveFromKeyPair(KeyPair keyPair, Provider provider) {
try {
ECPublicKey key = (ECPublicKey) keyPair.getPublic();
ECParameterSpec spec = key.getParams();
EllipticCurve crv = spec.getCurve();
List<JsonWebKeyCurveName> curveList = Arrays.asList(JsonWebKeyCurveName.P_256, JsonWebKeyCurveName.P_384,
JsonWebKeyCurveName.P_521, JsonWebKeyCurveName.P_256K);
for (JsonWebKeyCurveName curve : curveList) {
ECGenParameterSpec gps = new ECGenParameterSpec(CURVE_TO_SPEC_NAME.get(curve));
KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC", provider);
kpg.initialize(gps);
// Generate dummy keypair to get parameter spec.
KeyPair apair = kpg.generateKeyPair();
ECPublicKey apub = (ECPublicKey) apair.getPublic();
ECParameterSpec aspec = apub.getParams();
EllipticCurve acurve = aspec.getCurve();
// Matches the parameter spec
if (acurve.equals(crv)) {
return curve;
}
}
// Did not find a supported curve.
throw new NoSuchAlgorithmException("Curve not supported.");
} catch (GeneralSecurityException e) {
throw new IllegalStateException(e);
}
} | [
"private",
"static",
"JsonWebKeyCurveName",
"getCurveFromKeyPair",
"(",
"KeyPair",
"keyPair",
",",
"Provider",
"provider",
")",
"{",
"try",
"{",
"ECPublicKey",
"key",
"=",
"(",
"ECPublicKey",
")",
"keyPair",
".",
"getPublic",
"(",
")",
";",
"ECParameterSpec",
"s... | Matches the curve of the keyPair to supported curves. | [
"Matches",
"the",
"curve",
"of",
"the",
"keyPair",
"to",
"supported",
"curves",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L836-L868 |
35,934 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.fromAes | public static JsonWebKey fromAes(SecretKey secretKey) {
if (secretKey == null) {
return null;
}
return new JsonWebKey().withK(secretKey.getEncoded()).withKty(JsonWebKeyType.OCT);
} | java | public static JsonWebKey fromAes(SecretKey secretKey) {
if (secretKey == null) {
return null;
}
return new JsonWebKey().withK(secretKey.getEncoded()).withKty(JsonWebKeyType.OCT);
} | [
"public",
"static",
"JsonWebKey",
"fromAes",
"(",
"SecretKey",
"secretKey",
")",
"{",
"if",
"(",
"secretKey",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"JsonWebKey",
"(",
")",
".",
"withK",
"(",
"secretKey",
".",
"getEncoded",
... | Converts AES key to JSON web key.
@param secretKey
AES key
@return the JSON web key, converted from AES key. | [
"Converts",
"AES",
"key",
"to",
"JSON",
"web",
"key",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L877-L883 |
35,935 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.toAes | public SecretKey toAes() {
if (k == null) {
return null;
}
SecretKey secretKey = new SecretKeySpec(k, "AES");
return secretKey;
} | java | public SecretKey toAes() {
if (k == null) {
return null;
}
SecretKey secretKey = new SecretKeySpec(k, "AES");
return secretKey;
} | [
"public",
"SecretKey",
"toAes",
"(",
")",
"{",
"if",
"(",
"k",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"SecretKey",
"secretKey",
"=",
"new",
"SecretKeySpec",
"(",
"k",
",",
"\"AES\"",
")",
";",
"return",
"secretKey",
";",
"}"
] | Converts JSON web key to AES key.
@return AES key | [
"Converts",
"JSON",
"web",
"key",
"to",
"AES",
"key",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L890-L897 |
35,936 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.clearMemory | public void clearMemory() {
zeroArray(k);
k = null;
zeroArray(n);
n = null;
zeroArray(e);
e = null;
zeroArray(d);
d = null;
zeroArray(dp);
dp = null;
zeroArray(dq);
dq = null;
zeroArray(qi);
qi = null;
zeroArray(p);
p = null;
zeroArray(q);
q = null;
zeroArray(t);
t = null;
zeroArray(x);
x = null;
zeroArray(y);
y = null;
} | java | public void clearMemory() {
zeroArray(k);
k = null;
zeroArray(n);
n = null;
zeroArray(e);
e = null;
zeroArray(d);
d = null;
zeroArray(dp);
dp = null;
zeroArray(dq);
dq = null;
zeroArray(qi);
qi = null;
zeroArray(p);
p = null;
zeroArray(q);
q = null;
zeroArray(t);
t = null;
zeroArray(x);
x = null;
zeroArray(y);
y = null;
} | [
"public",
"void",
"clearMemory",
"(",
")",
"{",
"zeroArray",
"(",
"k",
")",
";",
"k",
"=",
"null",
";",
"zeroArray",
"(",
"n",
")",
";",
"n",
"=",
"null",
";",
"zeroArray",
"(",
"e",
")",
";",
"e",
"=",
"null",
";",
"zeroArray",
"(",
"d",
")",
... | Clear key materials. | [
"Clear",
"key",
"materials",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L1110-L1135 |
35,937 | Azure/azure-sdk-for-java | eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseChannel.java | RequestResponseChannel.open | public void open(final OperationResult<Void, Exception> onOpen, final OperationResult<Void, Exception> onClose) {
this.onOpen = onOpen;
this.onClose = onClose;
this.sendLink.open();
this.receiveLink.open();
} | java | public void open(final OperationResult<Void, Exception> onOpen, final OperationResult<Void, Exception> onClose) {
this.onOpen = onOpen;
this.onClose = onClose;
this.sendLink.open();
this.receiveLink.open();
} | [
"public",
"void",
"open",
"(",
"final",
"OperationResult",
"<",
"Void",
",",
"Exception",
">",
"onOpen",
",",
"final",
"OperationResult",
"<",
"Void",
",",
"Exception",
">",
"onClose",
")",
"{",
"this",
".",
"onOpen",
"=",
"onOpen",
";",
"this",
".",
"on... | open should be called only once - we use FaultTolerantObject for that | [
"open",
"should",
"be",
"called",
"only",
"once",
"-",
"we",
"use",
"FaultTolerantObject",
"for",
"that"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseChannel.java#L75-L81 |
35,938 | Azure/azure-sdk-for-java | eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseChannel.java | RequestResponseChannel.close | public void close(final OperationResult<Void, Exception> onGraceFullClose) {
this.onGraceFullClose = onGraceFullClose;
this.sendLink.close();
this.receiveLink.close();
} | java | public void close(final OperationResult<Void, Exception> onGraceFullClose) {
this.onGraceFullClose = onGraceFullClose;
this.sendLink.close();
this.receiveLink.close();
} | [
"public",
"void",
"close",
"(",
"final",
"OperationResult",
"<",
"Void",
",",
"Exception",
">",
"onGraceFullClose",
")",
"{",
"this",
".",
"onGraceFullClose",
"=",
"onGraceFullClose",
";",
"this",
".",
"sendLink",
".",
"close",
"(",
")",
";",
"this",
".",
... | close should be called exactly once - we use FaultTolerantObject for that | [
"close",
"should",
"be",
"called",
"exactly",
"once",
"-",
"we",
"use",
"FaultTolerantObject",
"for",
"that"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseChannel.java#L84-L89 |
35,939 | Azure/azure-sdk-for-java | eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseChannel.java | RequestResponseChannel.request | public void request(
final Message message,
final OperationResult<Message, Exception> onResponse) {
if (message == null) {
throw new IllegalArgumentException("message cannot be null");
}
if (message.getMessageId() != null) {
throw new IllegalArgumentException("message.getMessageId() should be null");
}
if (message.getReplyTo() != null) {
throw new IllegalArgumentException("message.getReplyTo() should be null");
}
message.setMessageId("request" + UnsignedLong.valueOf(this.requestId.incrementAndGet()).toString());
message.setReplyTo(this.replyTo);
this.inflightRequests.put(message.getMessageId(), onResponse);
sendLink.delivery(UUID.randomUUID().toString().replace("-", StringUtil.EMPTY).getBytes(UTF_8));
final int payloadSize = AmqpUtil.getDataSerializedSize(message) + 512; // need buffer for headers
final byte[] bytes = new byte[payloadSize];
final int encodedSize = message.encode(bytes, 0, payloadSize);
receiveLink.flow(1);
sendLink.send(bytes, 0, encodedSize);
sendLink.advance();
} | java | public void request(
final Message message,
final OperationResult<Message, Exception> onResponse) {
if (message == null) {
throw new IllegalArgumentException("message cannot be null");
}
if (message.getMessageId() != null) {
throw new IllegalArgumentException("message.getMessageId() should be null");
}
if (message.getReplyTo() != null) {
throw new IllegalArgumentException("message.getReplyTo() should be null");
}
message.setMessageId("request" + UnsignedLong.valueOf(this.requestId.incrementAndGet()).toString());
message.setReplyTo(this.replyTo);
this.inflightRequests.put(message.getMessageId(), onResponse);
sendLink.delivery(UUID.randomUUID().toString().replace("-", StringUtil.EMPTY).getBytes(UTF_8));
final int payloadSize = AmqpUtil.getDataSerializedSize(message) + 512; // need buffer for headers
final byte[] bytes = new byte[payloadSize];
final int encodedSize = message.encode(bytes, 0, payloadSize);
receiveLink.flow(1);
sendLink.send(bytes, 0, encodedSize);
sendLink.advance();
} | [
"public",
"void",
"request",
"(",
"final",
"Message",
"message",
",",
"final",
"OperationResult",
"<",
"Message",
",",
"Exception",
">",
"onResponse",
")",
"{",
"if",
"(",
"message",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\... | & assumes that this is run on Opened Object | [
"&",
"assumes",
"that",
"this",
"is",
"run",
"on",
"Opened",
"Object"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseChannel.java#L102-L129 |
35,940 | Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/MessageBody.java | MessageBody.fromValueData | public static MessageBody fromValueData(Object value)
{
if(value == null)
{
throw new IllegalArgumentException("Value data is null.");
}
MessageBody body = new MessageBody();
body.bodyType = MessageBodyType.VALUE;
body.valueData = value;
body.sequenceData = null;
body.binaryData = null;
return body;
} | java | public static MessageBody fromValueData(Object value)
{
if(value == null)
{
throw new IllegalArgumentException("Value data is null.");
}
MessageBody body = new MessageBody();
body.bodyType = MessageBodyType.VALUE;
body.valueData = value;
body.sequenceData = null;
body.binaryData = null;
return body;
} | [
"public",
"static",
"MessageBody",
"fromValueData",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Value data is null.\"",
")",
";",
"}",
"MessageBody",
"body",
"=",
"new",
"Mes... | Creates message body of AMQPValue type.
@param value AMQPValue content of the message. It must be of a type supported by AMQP.
@return MessageBody instance wrapping around the value data. | [
"Creates",
"message",
"body",
"of",
"AMQPValue",
"type",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/MessageBody.java#L28-L41 |
35,941 | Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/MessageBody.java | MessageBody.fromSequenceData | public static MessageBody fromSequenceData(List<List<Object>> sequenceData)
{
if(sequenceData == null || sequenceData.size() == 0 || sequenceData.size() > 1)
{
throw new IllegalArgumentException("Sequence data is null or has more than one collection in it.");
}
MessageBody body = new MessageBody();
body.bodyType = MessageBodyType.SEQUENCE;
body.valueData = null;
body.sequenceData = sequenceData;
body.binaryData = null;
return body;
} | java | public static MessageBody fromSequenceData(List<List<Object>> sequenceData)
{
if(sequenceData == null || sequenceData.size() == 0 || sequenceData.size() > 1)
{
throw new IllegalArgumentException("Sequence data is null or has more than one collection in it.");
}
MessageBody body = new MessageBody();
body.bodyType = MessageBodyType.SEQUENCE;
body.valueData = null;
body.sequenceData = sequenceData;
body.binaryData = null;
return body;
} | [
"public",
"static",
"MessageBody",
"fromSequenceData",
"(",
"List",
"<",
"List",
"<",
"Object",
">",
">",
"sequenceData",
")",
"{",
"if",
"(",
"sequenceData",
"==",
"null",
"||",
"sequenceData",
".",
"size",
"(",
")",
"==",
"0",
"||",
"sequenceData",
".",
... | Creates a message body from a list of AMQPSequence sections.Each AMQPSequence section is in turn a list of objects.
Please note that this version of the SDK supports only one AMQPSequence section in a message. It means only a list of exactly one sequence in it is accepted as message body.
@param sequenceData a list of AMQPSequence sections. Each AMQPSequence section is in turn a list of objects. Every object in each list must of a type supported by AMQP.
@return MessageBody instance wrapping around the sequence data. | [
"Creates",
"a",
"message",
"body",
"from",
"a",
"list",
"of",
"AMQPSequence",
"sections",
".",
"Each",
"AMQPSequence",
"section",
"is",
"in",
"turn",
"a",
"list",
"of",
"objects",
".",
"Please",
"note",
"that",
"this",
"version",
"of",
"the",
"SDK",
"suppo... | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/MessageBody.java#L49-L62 |
35,942 | Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/MessageBody.java | MessageBody.fromBinaryData | public static MessageBody fromBinaryData(List<byte[]> binaryData)
{
if(binaryData == null || binaryData.size() == 0 || binaryData.size() > 1)
{
throw new IllegalArgumentException("Binary data is null or has more than one byte array in it.");
}
MessageBody body = new MessageBody();
body.bodyType = MessageBodyType.BINARY;
body.valueData = null;
body.sequenceData = null;
body.binaryData = binaryData;
return body;
} | java | public static MessageBody fromBinaryData(List<byte[]> binaryData)
{
if(binaryData == null || binaryData.size() == 0 || binaryData.size() > 1)
{
throw new IllegalArgumentException("Binary data is null or has more than one byte array in it.");
}
MessageBody body = new MessageBody();
body.bodyType = MessageBodyType.BINARY;
body.valueData = null;
body.sequenceData = null;
body.binaryData = binaryData;
return body;
} | [
"public",
"static",
"MessageBody",
"fromBinaryData",
"(",
"List",
"<",
"byte",
"[",
"]",
">",
"binaryData",
")",
"{",
"if",
"(",
"binaryData",
"==",
"null",
"||",
"binaryData",
".",
"size",
"(",
")",
"==",
"0",
"||",
"binaryData",
".",
"size",
"(",
")"... | Creates a message body from a list of Data sections.Each Data section is a byte array.
Please note that this version of the SDK supports only one Data section in a message. It means only a list of exactly one byte array in it is accepted as message body.
@param binaryData a list of byte arrays.
@return MessageBody instance wrapping around the binary data. | [
"Creates",
"a",
"message",
"body",
"from",
"a",
"list",
"of",
"Data",
"sections",
".",
"Each",
"Data",
"section",
"is",
"a",
"byte",
"array",
".",
"Please",
"note",
"that",
"this",
"version",
"of",
"the",
"SDK",
"supports",
"only",
"one",
"Data",
"sectio... | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/MessageBody.java#L70-L83 |
35,943 | Azure/azure-sdk-for-java | sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ServerVulnerabilityAssessmentsInner.java | ServerVulnerabilityAssessmentsInner.getAsync | public Observable<ServerVulnerabilityAssessmentInner> getAsync(String resourceGroupName, String serverName) {
return getWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<ServerVulnerabilityAssessmentInner>, ServerVulnerabilityAssessmentInner>() {
@Override
public ServerVulnerabilityAssessmentInner call(ServiceResponse<ServerVulnerabilityAssessmentInner> response) {
return response.body();
}
});
} | java | public Observable<ServerVulnerabilityAssessmentInner> getAsync(String resourceGroupName, String serverName) {
return getWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<ServerVulnerabilityAssessmentInner>, ServerVulnerabilityAssessmentInner>() {
@Override
public ServerVulnerabilityAssessmentInner call(ServiceResponse<ServerVulnerabilityAssessmentInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"ServerVulnerabilityAssessmentInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
")",
".",
"map",
"(",
"... | Gets the server's vulnerability assessment.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server for which the vulnerability assessment is defined.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ServerVulnerabilityAssessmentInner object | [
"Gets",
"the",
"server",
"s",
"vulnerability",
"assessment",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ServerVulnerabilityAssessmentsInner.java#L122-L129 |
35,944 | Azure/azure-sdk-for-java | sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ServerVulnerabilityAssessmentsInner.java | ServerVulnerabilityAssessmentsInner.createOrUpdateAsync | public Observable<ServerVulnerabilityAssessmentInner> createOrUpdateAsync(String resourceGroupName, String serverName, ServerVulnerabilityAssessmentInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerVulnerabilityAssessmentInner>, ServerVulnerabilityAssessmentInner>() {
@Override
public ServerVulnerabilityAssessmentInner call(ServiceResponse<ServerVulnerabilityAssessmentInner> response) {
return response.body();
}
});
} | java | public Observable<ServerVulnerabilityAssessmentInner> createOrUpdateAsync(String resourceGroupName, String serverName, ServerVulnerabilityAssessmentInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerVulnerabilityAssessmentInner>, ServerVulnerabilityAssessmentInner>() {
@Override
public ServerVulnerabilityAssessmentInner call(ServiceResponse<ServerVulnerabilityAssessmentInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"ServerVulnerabilityAssessmentInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"ServerVulnerabilityAssessmentInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
... | Creates or updates the server's vulnerability assessment.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server for which the vulnerability assessment is defined.
@param parameters The requested resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ServerVulnerabilityAssessmentInner object | [
"Creates",
"or",
"updates",
"the",
"server",
"s",
"vulnerability",
"assessment",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ServerVulnerabilityAssessmentsInner.java#L212-L219 |
35,945 | Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowRunsInner.java | WorkflowRunsInner.listNextAsync | public Observable<Page<WorkflowRunInner>> listNextAsync(final String nextPageLink) {
return listNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<WorkflowRunInner>>, Page<WorkflowRunInner>>() {
@Override
public Page<WorkflowRunInner> call(ServiceResponse<Page<WorkflowRunInner>> response) {
return response.body();
}
});
} | java | public Observable<Page<WorkflowRunInner>> listNextAsync(final String nextPageLink) {
return listNextWithServiceResponseAsync(nextPageLink)
.map(new Func1<ServiceResponse<Page<WorkflowRunInner>>, Page<WorkflowRunInner>>() {
@Override
public Page<WorkflowRunInner> call(ServiceResponse<Page<WorkflowRunInner>> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"Page",
"<",
"WorkflowRunInner",
">",
">",
"listNextAsync",
"(",
"final",
"String",
"nextPageLink",
")",
"{",
"return",
"listNextWithServiceResponseAsync",
"(",
"nextPageLink",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceRespons... | Gets a list of workflow runs.
@param nextPageLink The NextLink from the previous successful call to List operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<WorkflowRunInner> object | [
"Gets",
"a",
"list",
"of",
"workflow",
"runs",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowRunsInner.java#L562-L570 |
35,946 | Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentCurrentBillingFeaturesInner.java | ComponentCurrentBillingFeaturesInner.getAsync | public Observable<ApplicationInsightsComponentBillingFeaturesInner> getAsync(String resourceGroupName, String resourceName) {
return getWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<ApplicationInsightsComponentBillingFeaturesInner>, ApplicationInsightsComponentBillingFeaturesInner>() {
@Override
public ApplicationInsightsComponentBillingFeaturesInner call(ServiceResponse<ApplicationInsightsComponentBillingFeaturesInner> response) {
return response.body();
}
});
} | java | public Observable<ApplicationInsightsComponentBillingFeaturesInner> getAsync(String resourceGroupName, String resourceName) {
return getWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<ApplicationInsightsComponentBillingFeaturesInner>, ApplicationInsightsComponentBillingFeaturesInner>() {
@Override
public ApplicationInsightsComponentBillingFeaturesInner call(ServiceResponse<ApplicationInsightsComponentBillingFeaturesInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"ApplicationInsightsComponentBillingFeaturesInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".",
... | Returns current billing features for an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ApplicationInsightsComponentBillingFeaturesInner object | [
"Returns",
"current",
"billing",
"features",
"for",
"an",
"Application",
"Insights",
"component",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentCurrentBillingFeaturesInner.java#L102-L109 |
35,947 | Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.deleteAsync | public Observable<OperationStatusResponseInner> deleteAsync(String resourceGroupName, String vmScaleSetName) {
return deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Override
public OperationStatusResponseInner call(ServiceResponse<OperationStatusResponseInner> response) {
return response.body();
}
});
} | java | public Observable<OperationStatusResponseInner> deleteAsync(String resourceGroupName, String vmScaleSetName) {
return deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Override
public OperationStatusResponseInner call(ServiceResponse<OperationStatusResponseInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"OperationStatusResponseInner",
">",
"deleteAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
")",
"{",
"return",
"deleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetName",
")",
".",
"map",
... | Deletes a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Deletes",
"a",
"VM",
"scale",
"set",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L572-L579 |
35,948 | Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyAuthorizationPolicyOptionInfo.java | ContentKeyAuthorizationPolicyOptionInfo.getRestrictions | public List<ContentKeyAuthorizationPolicyRestriction> getRestrictions() {
List<ContentKeyAuthorizationPolicyRestriction> result = new ArrayList<ContentKeyAuthorizationPolicyRestriction>();
List<ContentKeyAuthorizationPolicyRestrictionType> restrictionsTypes = getContent().getRestrictions();
if (restrictionsTypes != null) {
for (ContentKeyAuthorizationPolicyRestrictionType restrictionType : restrictionsTypes) {
ContentKeyAuthorizationPolicyRestriction contentKeyAuthPolicyRestriction = new ContentKeyAuthorizationPolicyRestriction(
restrictionType.getName(), restrictionType.getKeyRestrictionType(),
restrictionType.getRequirements());
result.add(contentKeyAuthPolicyRestriction);
}
}
return result;
} | java | public List<ContentKeyAuthorizationPolicyRestriction> getRestrictions() {
List<ContentKeyAuthorizationPolicyRestriction> result = new ArrayList<ContentKeyAuthorizationPolicyRestriction>();
List<ContentKeyAuthorizationPolicyRestrictionType> restrictionsTypes = getContent().getRestrictions();
if (restrictionsTypes != null) {
for (ContentKeyAuthorizationPolicyRestrictionType restrictionType : restrictionsTypes) {
ContentKeyAuthorizationPolicyRestriction contentKeyAuthPolicyRestriction = new ContentKeyAuthorizationPolicyRestriction(
restrictionType.getName(), restrictionType.getKeyRestrictionType(),
restrictionType.getRequirements());
result.add(contentKeyAuthPolicyRestriction);
}
}
return result;
} | [
"public",
"List",
"<",
"ContentKeyAuthorizationPolicyRestriction",
">",
"getRestrictions",
"(",
")",
"{",
"List",
"<",
"ContentKeyAuthorizationPolicyRestriction",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"ContentKeyAuthorizationPolicyRestriction",
">",
"(",
")",
";",
... | Get the content key authorization policy options restrictions.
@return the restrictions. | [
"Get",
"the",
"content",
"key",
"authorization",
"policy",
"options",
"restrictions",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyAuthorizationPolicyOptionInfo.java#L87-L101 |
35,949 | Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImagesInner.java | GalleryImagesInner.delete | public void delete(String resourceGroupName, String labAccountName, String galleryImageName) {
deleteWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName).toBlocking().single().body();
} | java | public void delete(String resourceGroupName, String labAccountName, String galleryImageName) {
deleteWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName).toBlocking().single().body();
} | [
"public",
"void",
"delete",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"galleryImageName",
")",
"{",
"deleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"labAccountName",
",",
"galleryImageName",
")",
".",
"toBlockin... | Delete gallery image.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param galleryImageName The name of the gallery Image.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent | [
"Delete",
"gallery",
"image",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImagesInner.java#L651-L653 |
35,950 | Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ManagedBackupShortTermRetentionPoliciesInner.java | ManagedBackupShortTermRetentionPoliciesInner.getAsync | public Observable<ManagedBackupShortTermRetentionPolicyInner> getAsync(String resourceGroupName, String managedInstanceName, String databaseName) {
return getWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName).map(new Func1<ServiceResponse<ManagedBackupShortTermRetentionPolicyInner>, ManagedBackupShortTermRetentionPolicyInner>() {
@Override
public ManagedBackupShortTermRetentionPolicyInner call(ServiceResponse<ManagedBackupShortTermRetentionPolicyInner> response) {
return response.body();
}
});
} | java | public Observable<ManagedBackupShortTermRetentionPolicyInner> getAsync(String resourceGroupName, String managedInstanceName, String databaseName) {
return getWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName).map(new Func1<ServiceResponse<ManagedBackupShortTermRetentionPolicyInner>, ManagedBackupShortTermRetentionPolicyInner>() {
@Override
public ManagedBackupShortTermRetentionPolicyInner call(ServiceResponse<ManagedBackupShortTermRetentionPolicyInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"ManagedBackupShortTermRetentionPolicyInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"managedInstanceName",
",",
"String",
"databaseName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Gets a managed database's short term retention policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param managedInstanceName The name of the managed instance.
@param databaseName The name of the database.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ManagedBackupShortTermRetentionPolicyInner object | [
"Gets",
"a",
"managed",
"database",
"s",
"short",
"term",
"retention",
"policy",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ManagedBackupShortTermRetentionPoliciesInner.java#L131-L138 |
35,951 | Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/http/policy/RetryPolicy.java | RetryPolicy.determineDelayDuration | private Duration determineDelayDuration(HttpResponse response) {
int code = response.statusCode();
// Response will not have a retry-after-ms header.
if (code != HttpResponseStatus.TOO_MANY_REQUESTS.code()
&& code != HttpResponseStatus.SERVICE_UNAVAILABLE.code()) {
return this.delayDuration;
}
String retryHeader = response.headerValue(RETRY_AFTER_MS_HEADER);
// Retry header is missing or empty, return the default delay duration.
if (retryHeader == null || retryHeader.isEmpty()) {
return this.delayDuration;
}
// Use the response delay duration, the server returned it for a reason.
return Duration.ofMillis(Integer.parseInt(retryHeader));
} | java | private Duration determineDelayDuration(HttpResponse response) {
int code = response.statusCode();
// Response will not have a retry-after-ms header.
if (code != HttpResponseStatus.TOO_MANY_REQUESTS.code()
&& code != HttpResponseStatus.SERVICE_UNAVAILABLE.code()) {
return this.delayDuration;
}
String retryHeader = response.headerValue(RETRY_AFTER_MS_HEADER);
// Retry header is missing or empty, return the default delay duration.
if (retryHeader == null || retryHeader.isEmpty()) {
return this.delayDuration;
}
// Use the response delay duration, the server returned it for a reason.
return Duration.ofMillis(Integer.parseInt(retryHeader));
} | [
"private",
"Duration",
"determineDelayDuration",
"(",
"HttpResponse",
"response",
")",
"{",
"int",
"code",
"=",
"response",
".",
"statusCode",
"(",
")",
";",
"// Response will not have a retry-after-ms header.",
"if",
"(",
"code",
"!=",
"HttpResponseStatus",
".",
"TOO... | Determines the delay duration that should be waited before retrying.
@param response HTTP response
@return If the HTTP response has a retry-after-ms header that will be returned,
otherwise the duration used during the construction of the policy. | [
"Determines",
"the",
"delay",
"duration",
"that",
"should",
"be",
"waited",
"before",
"retrying",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/http/policy/RetryPolicy.java#L85-L103 |
35,952 | Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java | PersonGroupPersonsImpl.delete | public void delete(String personGroupId, UUID personId) {
deleteWithServiceResponseAsync(personGroupId, personId).toBlocking().single().body();
} | java | public void delete(String personGroupId, UUID personId) {
deleteWithServiceResponseAsync(personGroupId, personId).toBlocking().single().body();
} | [
"public",
"void",
"delete",
"(",
"String",
"personGroupId",
",",
"UUID",
"personId",
")",
"{",
"deleteWithServiceResponseAsync",
"(",
"personGroupId",
",",
"personId",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
"(",
")",
";",
"... | Delete an existing person from a person group. Persisted face images of the person will also be deleted.
@param personGroupId Id referencing a particular person group.
@param personId Id referencing a particular person.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws APIErrorException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent | [
"Delete",
"an",
"existing",
"person",
"from",
"a",
"person",
"group",
".",
"Persisted",
"face",
"images",
"of",
"the",
"person",
"will",
"also",
"be",
"deleted",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java#L451-L453 |
35,953 | Azure/azure-sdk-for-java | eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/ServiceClientChecks.java | ServiceClientChecks.visitToken | @Override
public void visitToken(DetailAST token) {
// Failed to load ServiceClient's class, don't validate anything.
if (this.serviceClientClass == null) {
return;
}
switch (token.getType()) {
case TokenTypes.PACKAGE_DEF:
this.extendsServiceClient = extendsServiceClient(token);
break;
case TokenTypes.CTOR_DEF:
if (this.extendsServiceClient && visibilityIsPublicOrProtected(token)) {
log(token, CONSTRUCTOR_ERROR_MESSAGE);
}
break;
case TokenTypes.METHOD_DEF:
if (this.extendsServiceClient && !this.hasStaticBuilder && methodIsStaticBuilder(token)) {
this.hasStaticBuilder = true;
}
break;
}
} | java | @Override
public void visitToken(DetailAST token) {
// Failed to load ServiceClient's class, don't validate anything.
if (this.serviceClientClass == null) {
return;
}
switch (token.getType()) {
case TokenTypes.PACKAGE_DEF:
this.extendsServiceClient = extendsServiceClient(token);
break;
case TokenTypes.CTOR_DEF:
if (this.extendsServiceClient && visibilityIsPublicOrProtected(token)) {
log(token, CONSTRUCTOR_ERROR_MESSAGE);
}
break;
case TokenTypes.METHOD_DEF:
if (this.extendsServiceClient && !this.hasStaticBuilder && methodIsStaticBuilder(token)) {
this.hasStaticBuilder = true;
}
break;
}
} | [
"@",
"Override",
"public",
"void",
"visitToken",
"(",
"DetailAST",
"token",
")",
"{",
"// Failed to load ServiceClient's class, don't validate anything.",
"if",
"(",
"this",
".",
"serviceClientClass",
"==",
"null",
")",
"{",
"return",
";",
"}",
"switch",
"(",
"token... | Processes a token from the required tokens list when the TreeWalker visits it.
@param token Node in the AST. | [
"Processes",
"a",
"token",
"from",
"the",
"required",
"tokens",
"list",
"when",
"the",
"TreeWalker",
"visits",
"it",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/ServiceClientChecks.java#L78-L100 |
35,954 | Azure/azure-sdk-for-java | eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/ServiceClientChecks.java | ServiceClientChecks.extendsServiceClient | private boolean extendsServiceClient(DetailAST packageDefinitionToken) {
String packageName = FullIdent.createFullIdent(packageDefinitionToken.findFirstToken(TokenTypes.DOT)).getText();
if (packageName.startsWith("com.microsoft")) {
return false;
}
DetailAST classDefinitionToken = packageDefinitionToken.findFirstToken(TokenTypes.CLASS_DEF);
if (classDefinitionToken == null) {
return false;
}
String className = classDefinitionToken.findFirstToken(TokenTypes.IDENT).getText();
try {
Class<?> clazz = Class.forName(packageName + "." + className);
return this.serviceClientClass.isAssignableFrom(clazz);
} catch (ClassNotFoundException ex) {
log(classDefinitionToken, String.format(FAILED_TO_LOAD_MESSAGE, className));
return false;
}
} | java | private boolean extendsServiceClient(DetailAST packageDefinitionToken) {
String packageName = FullIdent.createFullIdent(packageDefinitionToken.findFirstToken(TokenTypes.DOT)).getText();
if (packageName.startsWith("com.microsoft")) {
return false;
}
DetailAST classDefinitionToken = packageDefinitionToken.findFirstToken(TokenTypes.CLASS_DEF);
if (classDefinitionToken == null) {
return false;
}
String className = classDefinitionToken.findFirstToken(TokenTypes.IDENT).getText();
try {
Class<?> clazz = Class.forName(packageName + "." + className);
return this.serviceClientClass.isAssignableFrom(clazz);
} catch (ClassNotFoundException ex) {
log(classDefinitionToken, String.format(FAILED_TO_LOAD_MESSAGE, className));
return false;
}
} | [
"private",
"boolean",
"extendsServiceClient",
"(",
"DetailAST",
"packageDefinitionToken",
")",
"{",
"String",
"packageName",
"=",
"FullIdent",
".",
"createFullIdent",
"(",
"packageDefinitionToken",
".",
"findFirstToken",
"(",
"TokenTypes",
".",
"DOT",
")",
")",
".",
... | Determines if the class extends ServiceClient.
@param packageDefinitionToken Package definition token.
@return True if the package is not in "com.microsoft", the file is a class definition, and the class extends ServiceClient. | [
"Determines",
"if",
"the",
"class",
"extends",
"ServiceClient",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/ServiceClientChecks.java#L118-L138 |
35,955 | Azure/azure-sdk-for-java | eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/ServiceClientChecks.java | ServiceClientChecks.visibilityIsPublicOrProtected | private boolean visibilityIsPublicOrProtected(DetailAST constructorToken) {
DetailAST modifierToken = constructorToken.findFirstToken(TokenTypes.MODIFIERS);
// No modifiers means package private.
if (modifierToken == null) {
return false;
}
return TokenUtil.findFirstTokenByPredicate(modifierToken,
node -> node.getType() == TokenTypes.LITERAL_PUBLIC || node.getType() == TokenTypes.LITERAL_PROTECTED)
.isPresent();
} | java | private boolean visibilityIsPublicOrProtected(DetailAST constructorToken) {
DetailAST modifierToken = constructorToken.findFirstToken(TokenTypes.MODIFIERS);
// No modifiers means package private.
if (modifierToken == null) {
return false;
}
return TokenUtil.findFirstTokenByPredicate(modifierToken,
node -> node.getType() == TokenTypes.LITERAL_PUBLIC || node.getType() == TokenTypes.LITERAL_PROTECTED)
.isPresent();
} | [
"private",
"boolean",
"visibilityIsPublicOrProtected",
"(",
"DetailAST",
"constructorToken",
")",
"{",
"DetailAST",
"modifierToken",
"=",
"constructorToken",
".",
"findFirstToken",
"(",
"TokenTypes",
".",
"MODIFIERS",
")",
";",
"// No modifiers means package private.",
"if"... | Checks if the constructor is using the public or protected scope.
@param constructorToken Construction token.
@return True if the constructor has a public or protected modifier token. | [
"Checks",
"if",
"the",
"constructor",
"is",
"using",
"the",
"public",
"or",
"protected",
"scope",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/ServiceClientChecks.java#L145-L156 |
35,956 | Azure/azure-sdk-for-java | eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/ServiceClientChecks.java | ServiceClientChecks.methodIsStaticBuilder | private boolean methodIsStaticBuilder(DetailAST methodToken) {
DetailAST modifierToken = methodToken.findFirstToken(TokenTypes.MODIFIERS);
if (modifierToken == null) {
return false;
}
if (modifierToken.findFirstToken(TokenTypes.LITERAL_STATIC) == null
|| modifierToken.findFirstToken(TokenTypes.LITERAL_PUBLIC) == null) {
return false;
}
return methodToken.findFirstToken(TokenTypes.IDENT).getText().equals(BUILDER_METHOD_NAME);
} | java | private boolean methodIsStaticBuilder(DetailAST methodToken) {
DetailAST modifierToken = methodToken.findFirstToken(TokenTypes.MODIFIERS);
if (modifierToken == null) {
return false;
}
if (modifierToken.findFirstToken(TokenTypes.LITERAL_STATIC) == null
|| modifierToken.findFirstToken(TokenTypes.LITERAL_PUBLIC) == null) {
return false;
}
return methodToken.findFirstToken(TokenTypes.IDENT).getText().equals(BUILDER_METHOD_NAME);
} | [
"private",
"boolean",
"methodIsStaticBuilder",
"(",
"DetailAST",
"methodToken",
")",
"{",
"DetailAST",
"modifierToken",
"=",
"methodToken",
".",
"findFirstToken",
"(",
"TokenTypes",
".",
"MODIFIERS",
")",
";",
"if",
"(",
"modifierToken",
"==",
"null",
")",
"{",
... | Checks if the method node is public static and named builder.
@param methodToken Method node
@return True if the method is public static and is named builder | [
"Checks",
"if",
"the",
"method",
"node",
"is",
"public",
"static",
"and",
"named",
"builder",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eng/code-quality-reports/src/main/java/com/azure/tools/checkstyle/checks/ServiceClientChecks.java#L163-L175 |
35,957 | Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/Timer.java | Timer.schedule | public static ScheduledFuture<?> schedule(Runnable runnable, Duration runFrequency, TimerType timerType)
{
switch (timerType)
{
case OneTimeRun:
return executor.schedule(runnable, runFrequency.toMillis(), TimeUnit.MILLISECONDS);
case RepeatRun:
return executor.scheduleWithFixedDelay(runnable, runFrequency.toMillis(), runFrequency.toMillis(), TimeUnit.MILLISECONDS);
default:
throw new UnsupportedOperationException("Unsupported timer pattern.");
}
} | java | public static ScheduledFuture<?> schedule(Runnable runnable, Duration runFrequency, TimerType timerType)
{
switch (timerType)
{
case OneTimeRun:
return executor.schedule(runnable, runFrequency.toMillis(), TimeUnit.MILLISECONDS);
case RepeatRun:
return executor.scheduleWithFixedDelay(runnable, runFrequency.toMillis(), runFrequency.toMillis(), TimeUnit.MILLISECONDS);
default:
throw new UnsupportedOperationException("Unsupported timer pattern.");
}
} | [
"public",
"static",
"ScheduledFuture",
"<",
"?",
">",
"schedule",
"(",
"Runnable",
"runnable",
",",
"Duration",
"runFrequency",
",",
"TimerType",
"timerType",
")",
"{",
"switch",
"(",
"timerType",
")",
"{",
"case",
"OneTimeRun",
":",
"return",
"executor",
".",... | runFrequency implemented only for TimeUnit granularity - Seconds | [
"runFrequency",
"implemented",
"only",
"for",
"TimeUnit",
"granularity",
"-",
"Seconds"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/Timer.java#L35-L48 |
35,958 | Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/RolesInner.java | RolesInner.getAsync | public Observable<RoleInner> getAsync(String deviceName, String name, String resourceGroupName) {
return getWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1<ServiceResponse<RoleInner>, RoleInner>() {
@Override
public RoleInner call(ServiceResponse<RoleInner> response) {
return response.body();
}
});
} | java | public Observable<RoleInner> getAsync(String deviceName, String name, String resourceGroupName) {
return getWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1<ServiceResponse<RoleInner>, RoleInner>() {
@Override
public RoleInner call(ServiceResponse<RoleInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"RoleInner",
">",
"getAsync",
"(",
"String",
"deviceName",
",",
"String",
"name",
",",
"String",
"resourceGroupName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"deviceName",
",",
"name",
",",
"resourceGroupName",
")",
"."... | Gets a specific role by name.
@param deviceName The device name.
@param name The role name.
@param resourceGroupName The resource group name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the RoleInner object | [
"Gets",
"a",
"specific",
"role",
"by",
"name",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/RolesInner.java#L255-L262 |
35,959 | Azure/azure-sdk-for-java | eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/AzureStorageCheckpointLeaseManager.java | AzureStorageCheckpointLeaseManager.initialize | void initialize(HostContext hostContext) throws InvalidKeyException, URISyntaxException, StorageException {
this.hostContext = hostContext;
if (this.storageContainerName == null) {
this.storageContainerName = this.hostContext.getEventHubPath();
}
// Validate that the event hub name is also a legal storage container name.
// Regex pattern is copied from .NET version. The syntax for Java regexes seems to be the same.
// Error message is also copied from .NET version.
Pattern p = Pattern.compile("^(?-i)(?:[a-z0-9]|(?<=[0-9a-z])-(?=[0-9a-z])){3,63}$");
Matcher m = p.matcher(this.storageContainerName);
if (!m.find()) {
throw new IllegalArgumentException("EventHub names must conform to the following rules to be able to use it with EventProcessorHost: "
+ "Must start with a letter or number, and can contain only letters, numbers, and the dash (-) character. "
+ "Every dash (-) character must be immediately preceded and followed by a letter or number; consecutive dashes are not permitted in container names. "
+ "All letters in a container name must be lowercase. "
+ "Must be from 3 to 63 characters long.");
}
this.storageClient = CloudStorageAccount.parse(this.storageConnectionString).createCloudBlobClient();
this.eventHubContainer = this.storageClient.getContainerReference(this.storageContainerName);
// storageBlobPrefix is either empty or a real user-supplied string. Either way we can just
// stick it on the front and get the desired result.
this.consumerGroupDirectory = this.eventHubContainer.getDirectoryReference(this.storageBlobPrefix + this.hostContext.getConsumerGroupName());
this.gson = new Gson();
this.leaseOperationOptions.setMaximumExecutionTimeInMs(this.hostContext.getPartitionManagerOptions().getLeaseDurationInSeconds() * 1000);
this.storageClient.setDefaultRequestOptions(this.leaseOperationOptions);
this.checkpointOperationOptions.setMaximumExecutionTimeInMs(this.hostContext.getPartitionManagerOptions().getCheckpointTimeoutInSeconds() * 1000);
// The only option that .NET sets on renewRequestOptions is ServerTimeout, which doesn't exist in Java equivalent.
// Keep it separate in case we need to change something later.
// Only used for leases, not checkpoints, so set max execution time to lease value
this.renewRequestOptions.setMaximumExecutionTimeInMs(this.hostContext.getPartitionManagerOptions().getLeaseDurationInSeconds() * 1000);
} | java | void initialize(HostContext hostContext) throws InvalidKeyException, URISyntaxException, StorageException {
this.hostContext = hostContext;
if (this.storageContainerName == null) {
this.storageContainerName = this.hostContext.getEventHubPath();
}
// Validate that the event hub name is also a legal storage container name.
// Regex pattern is copied from .NET version. The syntax for Java regexes seems to be the same.
// Error message is also copied from .NET version.
Pattern p = Pattern.compile("^(?-i)(?:[a-z0-9]|(?<=[0-9a-z])-(?=[0-9a-z])){3,63}$");
Matcher m = p.matcher(this.storageContainerName);
if (!m.find()) {
throw new IllegalArgumentException("EventHub names must conform to the following rules to be able to use it with EventProcessorHost: "
+ "Must start with a letter or number, and can contain only letters, numbers, and the dash (-) character. "
+ "Every dash (-) character must be immediately preceded and followed by a letter or number; consecutive dashes are not permitted in container names. "
+ "All letters in a container name must be lowercase. "
+ "Must be from 3 to 63 characters long.");
}
this.storageClient = CloudStorageAccount.parse(this.storageConnectionString).createCloudBlobClient();
this.eventHubContainer = this.storageClient.getContainerReference(this.storageContainerName);
// storageBlobPrefix is either empty or a real user-supplied string. Either way we can just
// stick it on the front and get the desired result.
this.consumerGroupDirectory = this.eventHubContainer.getDirectoryReference(this.storageBlobPrefix + this.hostContext.getConsumerGroupName());
this.gson = new Gson();
this.leaseOperationOptions.setMaximumExecutionTimeInMs(this.hostContext.getPartitionManagerOptions().getLeaseDurationInSeconds() * 1000);
this.storageClient.setDefaultRequestOptions(this.leaseOperationOptions);
this.checkpointOperationOptions.setMaximumExecutionTimeInMs(this.hostContext.getPartitionManagerOptions().getCheckpointTimeoutInSeconds() * 1000);
// The only option that .NET sets on renewRequestOptions is ServerTimeout, which doesn't exist in Java equivalent.
// Keep it separate in case we need to change something later.
// Only used for leases, not checkpoints, so set max execution time to lease value
this.renewRequestOptions.setMaximumExecutionTimeInMs(this.hostContext.getPartitionManagerOptions().getLeaseDurationInSeconds() * 1000);
} | [
"void",
"initialize",
"(",
"HostContext",
"hostContext",
")",
"throws",
"InvalidKeyException",
",",
"URISyntaxException",
",",
"StorageException",
"{",
"this",
".",
"hostContext",
"=",
"hostContext",
";",
"if",
"(",
"this",
".",
"storageContainerName",
"==",
"null",... | hence we don't want it in the constructor. | [
"hence",
"we",
"don",
"t",
"want",
"it",
"in",
"the",
"constructor",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/AzureStorageCheckpointLeaseManager.java#L85-L122 |
35,960 | Azure/azure-sdk-for-java | eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/AzureStorageCheckpointLeaseManager.java | AzureStorageCheckpointLeaseManager.createAllLeasesIfNotExists | @Override
public CompletableFuture<Void> createAllLeasesIfNotExists(List<String> partitionIds) {
CompletableFuture<Void> future = null;
// Optimization: list the blobs currently existing in the directory. If there are the
// expected number of blobs, then we can skip doing the creates.
int blobCount = 0;
try {
Iterable<ListBlobItem> leaseBlobs = this.consumerGroupDirectory.listBlobs("", true, null, this.leaseOperationOptions, null);
Iterator<ListBlobItem> blobIterator = leaseBlobs.iterator();
while (blobIterator.hasNext()) {
blobCount++;
blobIterator.next();
}
} catch (URISyntaxException | StorageException e) {
TRACE_LOGGER.error(this.hostContext.withHost("Exception checking lease existence - leaseContainerName: " + this.storageContainerName + " consumerGroupName: "
+ this.hostContext.getConsumerGroupName() + " storageBlobPrefix: " + this.storageBlobPrefix), e);
future = new CompletableFuture<Void>();
future.completeExceptionally(LoggingUtils.wrapException(e, EventProcessorHostActionStrings.CREATING_LEASES));
}
if (future == null) {
// No error checking the list, so keep going
if (blobCount == partitionIds.size()) {
// All expected blobs found, so short-circuit
future = CompletableFuture.completedFuture(null);
} else {
// Create the blobs in parallel
ArrayList<CompletableFuture<CompleteLease>> createFutures = new ArrayList<CompletableFuture<CompleteLease>>();
for (String id : partitionIds) {
CompletableFuture<CompleteLease> oneCreate = CompletableFuture.supplyAsync(() -> {
CompleteLease returnLease = null;
try {
returnLease = createLeaseIfNotExistsInternal(id, this.leaseOperationOptions);
} catch (URISyntaxException | IOException | StorageException e) {
TRACE_LOGGER.error(this.hostContext.withHostAndPartition(id,
"Exception creating lease - leaseContainerName: " + this.storageContainerName + " consumerGroupName: " + this.hostContext.getConsumerGroupName()
+ " storageBlobPrefix: " + this.storageBlobPrefix), e);
throw LoggingUtils.wrapException(e, EventProcessorHostActionStrings.CREATING_LEASES);
}
return returnLease;
}, this.hostContext.getExecutor());
createFutures.add(oneCreate);
}
CompletableFuture<?>[] dummy = new CompletableFuture<?>[createFutures.size()];
future = CompletableFuture.allOf(createFutures.toArray(dummy));
}
}
return future;
} | java | @Override
public CompletableFuture<Void> createAllLeasesIfNotExists(List<String> partitionIds) {
CompletableFuture<Void> future = null;
// Optimization: list the blobs currently existing in the directory. If there are the
// expected number of blobs, then we can skip doing the creates.
int blobCount = 0;
try {
Iterable<ListBlobItem> leaseBlobs = this.consumerGroupDirectory.listBlobs("", true, null, this.leaseOperationOptions, null);
Iterator<ListBlobItem> blobIterator = leaseBlobs.iterator();
while (blobIterator.hasNext()) {
blobCount++;
blobIterator.next();
}
} catch (URISyntaxException | StorageException e) {
TRACE_LOGGER.error(this.hostContext.withHost("Exception checking lease existence - leaseContainerName: " + this.storageContainerName + " consumerGroupName: "
+ this.hostContext.getConsumerGroupName() + " storageBlobPrefix: " + this.storageBlobPrefix), e);
future = new CompletableFuture<Void>();
future.completeExceptionally(LoggingUtils.wrapException(e, EventProcessorHostActionStrings.CREATING_LEASES));
}
if (future == null) {
// No error checking the list, so keep going
if (blobCount == partitionIds.size()) {
// All expected blobs found, so short-circuit
future = CompletableFuture.completedFuture(null);
} else {
// Create the blobs in parallel
ArrayList<CompletableFuture<CompleteLease>> createFutures = new ArrayList<CompletableFuture<CompleteLease>>();
for (String id : partitionIds) {
CompletableFuture<CompleteLease> oneCreate = CompletableFuture.supplyAsync(() -> {
CompleteLease returnLease = null;
try {
returnLease = createLeaseIfNotExistsInternal(id, this.leaseOperationOptions);
} catch (URISyntaxException | IOException | StorageException e) {
TRACE_LOGGER.error(this.hostContext.withHostAndPartition(id,
"Exception creating lease - leaseContainerName: " + this.storageContainerName + " consumerGroupName: " + this.hostContext.getConsumerGroupName()
+ " storageBlobPrefix: " + this.storageBlobPrefix), e);
throw LoggingUtils.wrapException(e, EventProcessorHostActionStrings.CREATING_LEASES);
}
return returnLease;
}, this.hostContext.getExecutor());
createFutures.add(oneCreate);
}
CompletableFuture<?>[] dummy = new CompletableFuture<?>[createFutures.size()];
future = CompletableFuture.allOf(createFutures.toArray(dummy));
}
}
return future;
} | [
"@",
"Override",
"public",
"CompletableFuture",
"<",
"Void",
">",
"createAllLeasesIfNotExists",
"(",
"List",
"<",
"String",
">",
"partitionIds",
")",
"{",
"CompletableFuture",
"<",
"Void",
">",
"future",
"=",
"null",
";",
"// Optimization: list the blobs currently exi... | Because it happens during startup, when no user code is running, it cannot deadlock with checkpointing. | [
"Because",
"it",
"happens",
"during",
"startup",
"when",
"no",
"user",
"code",
"is",
"running",
"it",
"cannot",
"deadlock",
"with",
"checkpointing",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/AzureStorageCheckpointLeaseManager.java#L354-L406 |
35,961 | Azure/azure-sdk-for-java | resources/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/resources/v2016_09_01/implementation/ProvidersInner.java | ProvidersInner.getAsync | public Observable<ProviderInner> getAsync(String resourceProviderNamespace, String expand) {
return getWithServiceResponseAsync(resourceProviderNamespace, expand).map(new Func1<ServiceResponse<ProviderInner>, ProviderInner>() {
@Override
public ProviderInner call(ServiceResponse<ProviderInner> response) {
return response.body();
}
});
} | java | public Observable<ProviderInner> getAsync(String resourceProviderNamespace, String expand) {
return getWithServiceResponseAsync(resourceProviderNamespace, expand).map(new Func1<ServiceResponse<ProviderInner>, ProviderInner>() {
@Override
public ProviderInner call(ServiceResponse<ProviderInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"ProviderInner",
">",
"getAsync",
"(",
"String",
"resourceProviderNamespace",
",",
"String",
"expand",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceProviderNamespace",
",",
"expand",
")",
".",
"map",
"(",
"new",
"Func... | Gets the specified resource provider.
@param resourceProviderNamespace The namespace of the resource provider.
@param expand The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ProviderInner object | [
"Gets",
"the",
"specified",
"resource",
"provider",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/resources/v2016_09_01/implementation/ProvidersInner.java#L568-L575 |
35,962 | Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java | VirtualMachineScaleSetVMsInner.beginRestartAsync | public ServiceFuture<OperationStatusResponseInner> beginRestartAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback<OperationStatusResponseInner> serviceCallback) {
return ServiceFuture.fromResponse(beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback);
} | java | public ServiceFuture<OperationStatusResponseInner> beginRestartAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback<OperationStatusResponseInner> serviceCallback) {
return ServiceFuture.fromResponse(beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"OperationStatusResponseInner",
">",
"beginRestartAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"String",
"instanceId",
",",
"final",
"ServiceCallback",
"<",
"OperationStatusResponseInner",
">",
"serviceCal... | Restarts a virtual machine in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@param instanceId The instance ID of the virtual machine.
@param serviceCallback the async ServiceCallback to handle successful and failed responses.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceFuture} object | [
"Restarts",
"a",
"virtual",
"machine",
"in",
"a",
"VM",
"scale",
"set",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java#L1744-L1746 |
35,963 | Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java | VirtualMachineScaleSetVMsInner.beginStartAsync | public ServiceFuture<OperationStatusResponseInner> beginStartAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback<OperationStatusResponseInner> serviceCallback) {
return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback);
} | java | public ServiceFuture<OperationStatusResponseInner> beginStartAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback<OperationStatusResponseInner> serviceCallback) {
return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"OperationStatusResponseInner",
">",
"beginStartAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"String",
"instanceId",
",",
"final",
"ServiceCallback",
"<",
"OperationStatusResponseInner",
">",
"serviceCallb... | Starts a virtual machine in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@param instanceId The instance ID of the virtual machine.
@param serviceCallback the async ServiceCallback to handle successful and failed responses.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceFuture} object | [
"Starts",
"a",
"virtual",
"machine",
"in",
"a",
"VM",
"scale",
"set",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java#L1914-L1916 |
35,964 | Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java | VirtualMachineScaleSetVMsInner.beginRedeployAsync | public ServiceFuture<OperationStatusResponseInner> beginRedeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback<OperationStatusResponseInner> serviceCallback) {
return ServiceFuture.fromResponse(beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback);
} | java | public ServiceFuture<OperationStatusResponseInner> beginRedeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback<OperationStatusResponseInner> serviceCallback) {
return ServiceFuture.fromResponse(beginRedeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"OperationStatusResponseInner",
">",
"beginRedeployAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"String",
"instanceId",
",",
"final",
"ServiceCallback",
"<",
"OperationStatusResponseInner",
">",
"serviceCa... | Redeploys a virtual machine in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@param instanceId The instance ID of the virtual machine.
@param serviceCallback the async ServiceCallback to handle successful and failed responses.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceFuture} object | [
"Redeploys",
"a",
"virtual",
"machine",
"in",
"a",
"VM",
"scale",
"set",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java#L2084-L2086 |
35,965 | Azure/azure-sdk-for-java | common/azure-common-mgmt/src/main/java/com/azure/common/mgmt/OperationState.java | OperationState.isCompleted | public static boolean isCompleted(String operationState) {
return operationState == null
|| operationState.length() == 0
|| SUCCEEDED.equalsIgnoreCase(operationState)
|| isFailedOrCanceled(operationState);
} | java | public static boolean isCompleted(String operationState) {
return operationState == null
|| operationState.length() == 0
|| SUCCEEDED.equalsIgnoreCase(operationState)
|| isFailedOrCanceled(operationState);
} | [
"public",
"static",
"boolean",
"isCompleted",
"(",
"String",
"operationState",
")",
"{",
"return",
"operationState",
"==",
"null",
"||",
"operationState",
".",
"length",
"(",
")",
"==",
"0",
"||",
"SUCCEEDED",
".",
"equalsIgnoreCase",
"(",
"operationState",
")",... | Get whether or not the provided operation state represents a completed state.
@param operationState The operation state to check.
@return Whether or not the provided operation state represents a completed state. | [
"Get",
"whether",
"or",
"not",
"the",
"provided",
"operation",
"state",
"represents",
"a",
"completed",
"state",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common-mgmt/src/main/java/com/azure/common/mgmt/OperationState.java#L35-L40 |
35,966 | Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java | DomainsInner.delete | public void delete(String resourceGroupName, String domainName) {
deleteWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().body();
} | java | public void delete(String resourceGroupName, String domainName) {
deleteWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().body();
} | [
"public",
"void",
"delete",
"(",
"String",
"resourceGroupName",
",",
"String",
"domainName",
")",
"{",
"deleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"domainName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
"(",
"... | Delete a domain.
Delete a domain.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param domainName Name of the domain.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent | [
"Delete",
"a",
"domain",
".",
"Delete",
"a",
"domain",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java#L1017-L1019 |
35,967 | Azure/azure-sdk-for-java | applicationconfig/client/src/samples/java/ConfigurationSets.java | ConfigurationSets.main | public static void main(String[] args) throws NoSuchAlgorithmException, InvalidKeyException, IOException {
// The connection string value can be obtained by going to your App Configuration instance in the Azure portal
// and navigating to "Access Keys" page under the "Settings" section.
String connectionString = "endpoint={endpoint_value};id={id_value};name={secret_value}";
// Instantiate a configuration client that will be used to call the configuration service.
ConfigurationAsyncClient client = ConfigurationAsyncClient.builder()
.credentials(new ConfigurationClientCredentials(connectionString))
.build();
// Demonstrates two different complex objects being stored in Azure App Configuration; one used for beta and the
// other used for production.
ComplexConfiguration betaSetting = new ComplexConfiguration().endpointUri("https://beta.endpoint.com").name("beta-name").numberOfInstances(1);
ComplexConfiguration productionSetting = new ComplexConfiguration().endpointUri("https://production.endpoint.com").name("production-name").numberOfInstances(2);
// Adding one configuration set for beta testing and another for production to Azure App Configuration.
// blockLast() is added here to prevent execution before both sets of configuration values have been added to
// the service.
Flux.merge(
addConfigurations(client, BETA, "https://beta-storage.core.windows.net", betaSetting),
addConfigurations(client, PRODUCTION, "https://production-storage.core.windows.net", productionSetting)
).blockLast();
// For your services, you can select settings with "beta" or "production" label, depending on what you want your
// services to communicate with. The sample below fetches all of the "beta" settings.
SettingSelector selector = new SettingSelector().label(BETA);
client.listSettings(selector).toStream().forEach(setting -> {
System.out.println("Key: " + setting.key());
if ("application/json".equals(setting.contentType())) {
try {
ComplexConfiguration kv = MAPPER.readValue(setting.value(), ComplexConfiguration.class);
System.out.println("Value: " + kv.toString());
} catch (IOException e) {
System.err.println(String.format("Could not deserialize %s%n%s", setting.value(), e.toString()));
}
} else {
System.out.println("Value: " + setting.value());
}
});
// For the BETA and PRODUCTION sets, we fetch all of the settings we created in each set, and delete them.
// Blocking so that the program does not exit before these tasks have completed.
Flux.fromArray(new String[]{BETA, PRODUCTION})
.flatMap(set -> client.listSettings(new SettingSelector().label(set)))
.map(client::deleteSetting)
.blockLast();
} | java | public static void main(String[] args) throws NoSuchAlgorithmException, InvalidKeyException, IOException {
// The connection string value can be obtained by going to your App Configuration instance in the Azure portal
// and navigating to "Access Keys" page under the "Settings" section.
String connectionString = "endpoint={endpoint_value};id={id_value};name={secret_value}";
// Instantiate a configuration client that will be used to call the configuration service.
ConfigurationAsyncClient client = ConfigurationAsyncClient.builder()
.credentials(new ConfigurationClientCredentials(connectionString))
.build();
// Demonstrates two different complex objects being stored in Azure App Configuration; one used for beta and the
// other used for production.
ComplexConfiguration betaSetting = new ComplexConfiguration().endpointUri("https://beta.endpoint.com").name("beta-name").numberOfInstances(1);
ComplexConfiguration productionSetting = new ComplexConfiguration().endpointUri("https://production.endpoint.com").name("production-name").numberOfInstances(2);
// Adding one configuration set for beta testing and another for production to Azure App Configuration.
// blockLast() is added here to prevent execution before both sets of configuration values have been added to
// the service.
Flux.merge(
addConfigurations(client, BETA, "https://beta-storage.core.windows.net", betaSetting),
addConfigurations(client, PRODUCTION, "https://production-storage.core.windows.net", productionSetting)
).blockLast();
// For your services, you can select settings with "beta" or "production" label, depending on what you want your
// services to communicate with. The sample below fetches all of the "beta" settings.
SettingSelector selector = new SettingSelector().label(BETA);
client.listSettings(selector).toStream().forEach(setting -> {
System.out.println("Key: " + setting.key());
if ("application/json".equals(setting.contentType())) {
try {
ComplexConfiguration kv = MAPPER.readValue(setting.value(), ComplexConfiguration.class);
System.out.println("Value: " + kv.toString());
} catch (IOException e) {
System.err.println(String.format("Could not deserialize %s%n%s", setting.value(), e.toString()));
}
} else {
System.out.println("Value: " + setting.value());
}
});
// For the BETA and PRODUCTION sets, we fetch all of the settings we created in each set, and delete them.
// Blocking so that the program does not exit before these tasks have completed.
Flux.fromArray(new String[]{BETA, PRODUCTION})
.flatMap(set -> client.listSettings(new SettingSelector().label(set)))
.map(client::deleteSetting)
.blockLast();
} | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
",",
"IOException",
"{",
"// The connection string value can be obtained by going to your App Configuration instance in the Azure portal",
"... | Entry point to the configuration set sample. Creates two sets of configuration values and fetches values from the
"beta" configuration set.
@param args Unused. Arguments to the program.
@throws NoSuchAlgorithmException when credentials cannot be created because the service cannot resolve the
HMAC-SHA256 algorithm.
@throws InvalidKeyException when credentials cannot be created because the connection string is invalid.
@throws IOException If the service is unable to deserialize the complex configuration object. | [
"Entry",
"point",
"to",
"the",
"configuration",
"set",
"sample",
".",
"Creates",
"two",
"sets",
"of",
"configuration",
"values",
"and",
"fetches",
"values",
"from",
"the",
"beta",
"configuration",
"set",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationconfig/client/src/samples/java/ConfigurationSets.java#L47-L94 |
35,968 | Azure/azure-sdk-for-java | signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java | SignalRsInner.getByResourceGroupAsync | public Observable<SignalRResourceInner> getByResourceGroupAsync(String resourceGroupName, String resourceName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<SignalRResourceInner>, SignalRResourceInner>() {
@Override
public SignalRResourceInner call(ServiceResponse<SignalRResourceInner> response) {
return response.body();
}
});
} | java | public Observable<SignalRResourceInner> getByResourceGroupAsync(String resourceGroupName, String resourceName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<SignalRResourceInner>, SignalRResourceInner>() {
@Override
public SignalRResourceInner call(ServiceResponse<SignalRResourceInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"SignalRResourceInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".",... | Get the SignalR service and its properties.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param resourceName The name of the SignalR resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the SignalRResourceInner object | [
"Get",
"the",
"SignalR",
"service",
"and",
"its",
"properties",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java#L935-L942 |
35,969 | Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowVersionsInner.java | WorkflowVersionsInner.listCallbackUrl | public WorkflowTriggerCallbackUrlInner listCallbackUrl(String resourceGroupName, String workflowName, String versionId, String triggerName, GetCallbackUrlParameters parameters) {
return listCallbackUrlWithServiceResponseAsync(resourceGroupName, workflowName, versionId, triggerName, parameters).toBlocking().single().body();
} | java | public WorkflowTriggerCallbackUrlInner listCallbackUrl(String resourceGroupName, String workflowName, String versionId, String triggerName, GetCallbackUrlParameters parameters) {
return listCallbackUrlWithServiceResponseAsync(resourceGroupName, workflowName, versionId, triggerName, parameters).toBlocking().single().body();
} | [
"public",
"WorkflowTriggerCallbackUrlInner",
"listCallbackUrl",
"(",
"String",
"resourceGroupName",
",",
"String",
"workflowName",
",",
"String",
"versionId",
",",
"String",
"triggerName",
",",
"GetCallbackUrlParameters",
"parameters",
")",
"{",
"return",
"listCallbackUrlWi... | Get the callback url for a trigger of a workflow version.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param versionId The workflow versionId.
@param triggerName The workflow trigger name.
@param parameters The callback URL parameters.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
@return the WorkflowTriggerCallbackUrlInner object if successful. | [
"Get",
"the",
"callback",
"url",
"for",
"a",
"trigger",
"of",
"a",
"workflow",
"version",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowVersionsInner.java#L527-L529 |
35,970 | Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DataWarehouseUserActivitiesInner.java | DataWarehouseUserActivitiesInner.getAsync | public Observable<DataWarehouseUserActivityInner> getAsync(String resourceGroupName, String serverName, String databaseName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<DataWarehouseUserActivityInner>, DataWarehouseUserActivityInner>() {
@Override
public DataWarehouseUserActivityInner call(ServiceResponse<DataWarehouseUserActivityInner> response) {
return response.body();
}
});
} | java | public Observable<DataWarehouseUserActivityInner> getAsync(String resourceGroupName, String serverName, String databaseName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<DataWarehouseUserActivityInner>, DataWarehouseUserActivityInner>() {
@Override
public DataWarehouseUserActivityInner call(ServiceResponse<DataWarehouseUserActivityInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"DataWarehouseUserActivityInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
... | Gets the user activities of a data warehouse which includes running and suspended queries.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the DataWarehouseUserActivityInner object | [
"Gets",
"the",
"user",
"activities",
"of",
"a",
"data",
"warehouse",
"which",
"includes",
"running",
"and",
"suspended",
"queries",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DataWarehouseUserActivitiesInner.java#L98-L105 |
35,971 | Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/UsagesInner.java | UsagesInner.listByAutomationAccountAsync | public Observable<List<UsageInner>> listByAutomationAccountAsync(String resourceGroupName, String automationAccountName) {
return listByAutomationAccountWithServiceResponseAsync(resourceGroupName, automationAccountName).map(new Func1<ServiceResponse<List<UsageInner>>, List<UsageInner>>() {
@Override
public List<UsageInner> call(ServiceResponse<List<UsageInner>> response) {
return response.body();
}
});
} | java | public Observable<List<UsageInner>> listByAutomationAccountAsync(String resourceGroupName, String automationAccountName) {
return listByAutomationAccountWithServiceResponseAsync(resourceGroupName, automationAccountName).map(new Func1<ServiceResponse<List<UsageInner>>, List<UsageInner>>() {
@Override
public List<UsageInner> call(ServiceResponse<List<UsageInner>> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"List",
"<",
"UsageInner",
">",
">",
"listByAutomationAccountAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
")",
"{",
"return",
"listByAutomationAccountWithServiceResponseAsync",
"(",
"resourceGroupName",
","... | Retrieve the usage for the account id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<UsageInner> object | [
"Retrieve",
"the",
"usage",
"for",
"the",
"account",
"id",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/UsagesInner.java#L96-L103 |
35,972 | Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/SharesInner.java | SharesInner.getAsync | public Observable<ShareInner> getAsync(String deviceName, String name, String resourceGroupName) {
return getWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1<ServiceResponse<ShareInner>, ShareInner>() {
@Override
public ShareInner call(ServiceResponse<ShareInner> response) {
return response.body();
}
});
} | java | public Observable<ShareInner> getAsync(String deviceName, String name, String resourceGroupName) {
return getWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1<ServiceResponse<ShareInner>, ShareInner>() {
@Override
public ShareInner call(ServiceResponse<ShareInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"ShareInner",
">",
"getAsync",
"(",
"String",
"deviceName",
",",
"String",
"name",
",",
"String",
"resourceGroupName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"deviceName",
",",
"name",
",",
"resourceGroupName",
")",
".... | Gets a share by name.
@param deviceName The device name.
@param name The share name.
@param resourceGroupName The resource group name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ShareInner object | [
"Gets",
"a",
"share",
"by",
"name",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/SharesInner.java#L264-L271 |
35,973 | Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/serializer/jackson/JacksonAdapter.java | JacksonAdapter.initializeObjectMapper | private static <T extends ObjectMapper> T initializeObjectMapper(T mapper) {
mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
.configure(SerializationFeature.WRITE_EMPTY_JSON_ARRAYS, true)
.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false)
.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true)
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true)
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.registerModule(new JavaTimeModule())
.registerModule(ByteArraySerializer.getModule())
.registerModule(Base64UrlSerializer.getModule())
.registerModule(DateTimeSerializer.getModule())
.registerModule(DateTimeRfc1123Serializer.getModule())
.registerModule(DurationSerializer.getModule());
mapper.setVisibility(mapper.getSerializationConfig().getDefaultVisibilityChecker()
.withFieldVisibility(JsonAutoDetect.Visibility.ANY)
.withSetterVisibility(JsonAutoDetect.Visibility.NONE)
.withGetterVisibility(JsonAutoDetect.Visibility.NONE)
.withIsGetterVisibility(JsonAutoDetect.Visibility.NONE));
return mapper;
} | java | private static <T extends ObjectMapper> T initializeObjectMapper(T mapper) {
mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
.configure(SerializationFeature.WRITE_EMPTY_JSON_ARRAYS, true)
.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false)
.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true)
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true)
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.registerModule(new JavaTimeModule())
.registerModule(ByteArraySerializer.getModule())
.registerModule(Base64UrlSerializer.getModule())
.registerModule(DateTimeSerializer.getModule())
.registerModule(DateTimeRfc1123Serializer.getModule())
.registerModule(DurationSerializer.getModule());
mapper.setVisibility(mapper.getSerializationConfig().getDefaultVisibilityChecker()
.withFieldVisibility(JsonAutoDetect.Visibility.ANY)
.withSetterVisibility(JsonAutoDetect.Visibility.NONE)
.withGetterVisibility(JsonAutoDetect.Visibility.NONE)
.withIsGetterVisibility(JsonAutoDetect.Visibility.NONE));
return mapper;
} | [
"private",
"static",
"<",
"T",
"extends",
"ObjectMapper",
">",
"T",
"initializeObjectMapper",
"(",
"T",
"mapper",
")",
"{",
"mapper",
".",
"configure",
"(",
"SerializationFeature",
".",
"WRITE_DATES_AS_TIMESTAMPS",
",",
"false",
")",
".",
"configure",
"(",
"Seri... | Initializes an instance of JacksonMapperAdapter with default configurations
applied to the object mapper.
@param mapper the object mapper to use. | [
"Initializes",
"an",
"instance",
"of",
"JacksonMapperAdapter",
"with",
"default",
"configurations",
"applied",
"to",
"the",
"object",
"mapper",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/serializer/jackson/JacksonAdapter.java#L143-L163 |
35,974 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/CertificateOperationIdentifier.java | CertificateOperationIdentifier.isCertificateOperationIdentifier | public static boolean isCertificateOperationIdentifier(String identifier) {
identifier = verifyNonEmpty(identifier, "identifier");
URI baseUri;
try {
baseUri = new URI(identifier);
} catch (URISyntaxException e) {
return false;
}
// Path is of the form "/certificates/[name]/pending"
String[] segments = baseUri.getPath().split("/");
if (segments.length != 4) {
return false;
}
if (!(segments[1]).equals("certificates")) {
return false;
}
if (!(segments[3]).equals("pending")) {
return false;
}
return true;
} | java | public static boolean isCertificateOperationIdentifier(String identifier) {
identifier = verifyNonEmpty(identifier, "identifier");
URI baseUri;
try {
baseUri = new URI(identifier);
} catch (URISyntaxException e) {
return false;
}
// Path is of the form "/certificates/[name]/pending"
String[] segments = baseUri.getPath().split("/");
if (segments.length != 4) {
return false;
}
if (!(segments[1]).equals("certificates")) {
return false;
}
if (!(segments[3]).equals("pending")) {
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"isCertificateOperationIdentifier",
"(",
"String",
"identifier",
")",
"{",
"identifier",
"=",
"verifyNonEmpty",
"(",
"identifier",
",",
"\"identifier\"",
")",
";",
"URI",
"baseUri",
";",
"try",
"{",
"baseUri",
"=",
"new",
"URI",
"(... | Verifies whether the identifier belongs to a key vault certificate operation.
@param identifier the key vault certificate operation identifier.
@return true if the identifier belongs to a key vault certificate operation. False otherwise. | [
"Verifies",
"whether",
"the",
"identifier",
"belongs",
"to",
"a",
"key",
"vault",
"certificate",
"operation",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/CertificateOperationIdentifier.java#L19-L44 |
35,975 | Azure/azure-sdk-for-java | notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesInner.java | NamespacesInner.checkAvailabilityAsync | public ServiceFuture<CheckAvailabilityResultInner> checkAvailabilityAsync(CheckAvailabilityParameters parameters, final ServiceCallback<CheckAvailabilityResultInner> serviceCallback) {
return ServiceFuture.fromResponse(checkAvailabilityWithServiceResponseAsync(parameters), serviceCallback);
} | java | public ServiceFuture<CheckAvailabilityResultInner> checkAvailabilityAsync(CheckAvailabilityParameters parameters, final ServiceCallback<CheckAvailabilityResultInner> serviceCallback) {
return ServiceFuture.fromResponse(checkAvailabilityWithServiceResponseAsync(parameters), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"CheckAvailabilityResultInner",
">",
"checkAvailabilityAsync",
"(",
"CheckAvailabilityParameters",
"parameters",
",",
"final",
"ServiceCallback",
"<",
"CheckAvailabilityResultInner",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
... | Checks the availability of the given service namespace across all Azure subscriptions. This is useful because the domain name is created based on the service namespace name.
@param parameters The namespace name.
@param serviceCallback the async ServiceCallback to handle successful and failed responses.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceFuture} object | [
"Checks",
"the",
"availability",
"of",
"the",
"given",
"service",
"namespace",
"across",
"all",
"Azure",
"subscriptions",
".",
"This",
"is",
"useful",
"because",
"the",
"domain",
"name",
"is",
"created",
"based",
"on",
"the",
"service",
"namespace",
"name",
".... | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesInner.java#L165-L167 |
35,976 | Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainersInner.java | ProtectionContainersInner.getAsync | public Observable<ProtectionContainerResourceInner> getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName) {
return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName).map(new Func1<ServiceResponse<ProtectionContainerResourceInner>, ProtectionContainerResourceInner>() {
@Override
public ProtectionContainerResourceInner call(ServiceResponse<ProtectionContainerResourceInner> response) {
return response.body();
}
});
} | java | public Observable<ProtectionContainerResourceInner> getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName) {
return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName).map(new Func1<ServiceResponse<ProtectionContainerResourceInner>, ProtectionContainerResourceInner>() {
@Override
public ProtectionContainerResourceInner call(ServiceResponse<ProtectionContainerResourceInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"ProtectionContainerResourceInner",
">",
"getAsync",
"(",
"String",
"vaultName",
",",
"String",
"resourceGroupName",
",",
"String",
"fabricName",
",",
"String",
"containerName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"vaultN... | Gets details of the specific container registered to your Recovery Services vault.
@param vaultName The name of the Recovery Services vault.
@param resourceGroupName The name of the resource group associated with the Recovery Services vault.
@param fabricName The fabric name associated with the container.
@param containerName The container name used for this GET operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ProtectionContainerResourceInner object | [
"Gets",
"details",
"of",
"the",
"specific",
"container",
"registered",
"to",
"your",
"Recovery",
"Services",
"vault",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainersInner.java#L116-L123 |
35,977 | Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainersInner.java | ProtectionContainersInner.refreshAsync | public ServiceFuture<Void> refreshAsync(String vaultName, String resourceGroupName, String fabricName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(refreshWithServiceResponseAsync(vaultName, resourceGroupName, fabricName), serviceCallback);
} | java | public ServiceFuture<Void> refreshAsync(String vaultName, String resourceGroupName, String fabricName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(refreshWithServiceResponseAsync(vaultName, resourceGroupName, fabricName), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"Void",
">",
"refreshAsync",
"(",
"String",
"vaultName",
",",
"String",
"resourceGroupName",
",",
"String",
"fabricName",
",",
"final",
"ServiceCallback",
"<",
"Void",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
"."... | Discovers the containers in the subscription that can be protected in a Recovery Services vault. This is an asynchronous operation. To learn the status of the operation, use the GetRefreshOperationResult API.
@param vaultName The name of the Recovery Services vault.
@param resourceGroupName The name of the resource group associated with the Recovery Services vault.
@param fabricName The fabric name associated with the container.
@param serviceCallback the async ServiceCallback to handle successful and failed responses.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceFuture} object | [
"Discovers",
"the",
"containers",
"in",
"the",
"subscription",
"that",
"can",
"be",
"protected",
"in",
"a",
"Recovery",
"Services",
"vault",
".",
"This",
"is",
"an",
"asynchronous",
"operation",
".",
"To",
"learn",
"the",
"status",
"of",
"the",
"operation",
... | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainersInner.java#L379-L381 |
35,978 | Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_12_01/implementation/ProtectedItemsInner.java | ProtectedItemsInner.get | public ProtectedItemResourceInner get(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String filter) {
return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter).toBlocking().single().body();
} | java | public ProtectedItemResourceInner get(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String filter) {
return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter).toBlocking().single().body();
} | [
"public",
"ProtectedItemResourceInner",
"get",
"(",
"String",
"vaultName",
",",
"String",
"resourceGroupName",
",",
"String",
"fabricName",
",",
"String",
"containerName",
",",
"String",
"protectedItemName",
",",
"String",
"filter",
")",
"{",
"return",
"getWithService... | Provides the details of the backed up item. This is an asynchronous operation. To know the status of the operation, call the GetItemOperationResult API.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@param fabricName Fabric name associated with the backed up item.
@param containerName Container name associated with the backed up item.
@param protectedItemName Backed up item name whose details are to be fetched.
@param filter OData filter options.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
@return the ProtectedItemResourceInner object if successful. | [
"Provides",
"the",
"details",
"of",
"the",
"backed",
"up",
"item",
".",
"This",
"is",
"an",
"asynchronous",
"operation",
".",
"To",
"know",
"the",
"status",
"of",
"the",
"operation",
"call",
"the",
"GetItemOperationResult",
"API",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_12_01/implementation/ProtectedItemsInner.java#L187-L189 |
35,979 | Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java | Asset.get | public static EntityGetOperation<AssetInfo> get(LinkInfo<AssetInfo> link) {
return new DefaultGetOperation<AssetInfo>(link.getHref(),
AssetInfo.class);
} | java | public static EntityGetOperation<AssetInfo> get(LinkInfo<AssetInfo> link) {
return new DefaultGetOperation<AssetInfo>(link.getHref(),
AssetInfo.class);
} | [
"public",
"static",
"EntityGetOperation",
"<",
"AssetInfo",
">",
"get",
"(",
"LinkInfo",
"<",
"AssetInfo",
">",
"link",
")",
"{",
"return",
"new",
"DefaultGetOperation",
"<",
"AssetInfo",
">",
"(",
"link",
".",
"getHref",
"(",
")",
",",
"AssetInfo",
".",
"... | Get the asset at the given link
@param link
the link
@return the get operation | [
"Get",
"the",
"asset",
"at",
"the",
"given",
"link"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java#L191-L194 |
35,980 | Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java | Asset.list | public static DefaultListOperation<AssetInfo> list(LinkInfo<AssetInfo> link) {
return new DefaultListOperation<AssetInfo>(link.getHref(),
new GenericType<ListResult<AssetInfo>>() {
});
} | java | public static DefaultListOperation<AssetInfo> list(LinkInfo<AssetInfo> link) {
return new DefaultListOperation<AssetInfo>(link.getHref(),
new GenericType<ListResult<AssetInfo>>() {
});
} | [
"public",
"static",
"DefaultListOperation",
"<",
"AssetInfo",
">",
"list",
"(",
"LinkInfo",
"<",
"AssetInfo",
">",
"link",
")",
"{",
"return",
"new",
"DefaultListOperation",
"<",
"AssetInfo",
">",
"(",
"link",
".",
"getHref",
"(",
")",
",",
"new",
"GenericTy... | Create an operation that will list all the assets at the given link.
@param link
Link to request assets from.
@return The list operation. | [
"Create",
"an",
"operation",
"that",
"will",
"list",
"all",
"the",
"assets",
"at",
"the",
"given",
"link",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java#L214-L218 |
35,981 | Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java | Asset.linkContentKey | public static EntityLinkOperation linkContentKey(String assetId,
String contentKeyId) {
String escapedContentKeyId = null;
try {
escapedContentKeyId = URLEncoder.encode(contentKeyId, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new InvalidParameterException("contentKeyId");
}
URI contentKeyUri = URI.create(String.format("ContentKeys('%s')",
escapedContentKeyId));
return new EntityLinkOperation(ENTITY_SET, assetId, "ContentKeys",
contentKeyUri);
} | java | public static EntityLinkOperation linkContentKey(String assetId,
String contentKeyId) {
String escapedContentKeyId = null;
try {
escapedContentKeyId = URLEncoder.encode(contentKeyId, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new InvalidParameterException("contentKeyId");
}
URI contentKeyUri = URI.create(String.format("ContentKeys('%s')",
escapedContentKeyId));
return new EntityLinkOperation(ENTITY_SET, assetId, "ContentKeys",
contentKeyUri);
} | [
"public",
"static",
"EntityLinkOperation",
"linkContentKey",
"(",
"String",
"assetId",
",",
"String",
"contentKeyId",
")",
"{",
"String",
"escapedContentKeyId",
"=",
"null",
";",
"try",
"{",
"escapedContentKeyId",
"=",
"URLEncoder",
".",
"encode",
"(",
"contentKeyId... | Link content key.
@param assetId
the asset id
@param contentKeyId
the content key id
@return the entity action operation | [
"Link",
"content",
"key",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java#L326-L338 |
35,982 | Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java | Asset.unlinkContentKey | public static EntityUnlinkOperation unlinkContentKey(String assetId,
String contentKeyId) {
return new EntityUnlinkOperation(ENTITY_SET, assetId, "ContentKeys", contentKeyId);
} | java | public static EntityUnlinkOperation unlinkContentKey(String assetId,
String contentKeyId) {
return new EntityUnlinkOperation(ENTITY_SET, assetId, "ContentKeys", contentKeyId);
} | [
"public",
"static",
"EntityUnlinkOperation",
"unlinkContentKey",
"(",
"String",
"assetId",
",",
"String",
"contentKeyId",
")",
"{",
"return",
"new",
"EntityUnlinkOperation",
"(",
"ENTITY_SET",
",",
"assetId",
",",
"\"ContentKeys\"",
",",
"contentKeyId",
")",
";",
"}... | unlink a content key.
@param assetId
the asset id
@param contentKeyId
the content key id
@return the entity action operation | [
"unlink",
"a",
"content",
"key",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java#L349-L352 |
35,983 | Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java | Asset.linkDeliveryPolicy | public static EntityLinkOperation linkDeliveryPolicy(String assetId,
String deliveryPolicyId) {
String escapedContentKeyId = null;
try {
escapedContentKeyId = URLEncoder.encode(deliveryPolicyId, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new InvalidParameterException("deliveryPolicyId");
}
URI contentKeyUri = URI.create(String.format("AssetDeliveryPolicies('%s')",
escapedContentKeyId));
return new EntityLinkOperation(ENTITY_SET, assetId, "DeliveryPolicies",
contentKeyUri);
} | java | public static EntityLinkOperation linkDeliveryPolicy(String assetId,
String deliveryPolicyId) {
String escapedContentKeyId = null;
try {
escapedContentKeyId = URLEncoder.encode(deliveryPolicyId, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new InvalidParameterException("deliveryPolicyId");
}
URI contentKeyUri = URI.create(String.format("AssetDeliveryPolicies('%s')",
escapedContentKeyId));
return new EntityLinkOperation(ENTITY_SET, assetId, "DeliveryPolicies",
contentKeyUri);
} | [
"public",
"static",
"EntityLinkOperation",
"linkDeliveryPolicy",
"(",
"String",
"assetId",
",",
"String",
"deliveryPolicyId",
")",
"{",
"String",
"escapedContentKeyId",
"=",
"null",
";",
"try",
"{",
"escapedContentKeyId",
"=",
"URLEncoder",
".",
"encode",
"(",
"deli... | Link delivery policy
@param assetId
the asset id
@param deliveryPolicyId
the content key id
@return the entity action operation | [
"Link",
"delivery",
"policy"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java#L363-L375 |
35,984 | Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java | Asset.unlinkDeliveryPolicy | public static EntityUnlinkOperation unlinkDeliveryPolicy(String assetId,
String adpId) {
return new EntityUnlinkOperation(ENTITY_SET, assetId, "DeliveryPolicies", adpId);
} | java | public static EntityUnlinkOperation unlinkDeliveryPolicy(String assetId,
String adpId) {
return new EntityUnlinkOperation(ENTITY_SET, assetId, "DeliveryPolicies", adpId);
} | [
"public",
"static",
"EntityUnlinkOperation",
"unlinkDeliveryPolicy",
"(",
"String",
"assetId",
",",
"String",
"adpId",
")",
"{",
"return",
"new",
"EntityUnlinkOperation",
"(",
"ENTITY_SET",
",",
"assetId",
",",
"\"DeliveryPolicies\"",
",",
"adpId",
")",
";",
"}"
] | unlink an asset delivery policy
@param assetId
the asset id
@param adpId
the asset delivery policy id
@return the entity action operation | [
"unlink",
"an",
"asset",
"delivery",
"policy"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java#L386-L389 |
35,985 | Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/JWEObject.java | JWEObject.deserialize | public static JWEObject deserialize(String json) throws IOException {
ObjectMapper mapper = new ObjectMapper();
return mapper.readValue(json, JWEObject.class);
} | java | public static JWEObject deserialize(String json) throws IOException {
ObjectMapper mapper = new ObjectMapper();
return mapper.readValue(json, JWEObject.class);
} | [
"public",
"static",
"JWEObject",
"deserialize",
"(",
"String",
"json",
")",
"throws",
"IOException",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"return",
"mapper",
".",
"readValue",
"(",
"json",
",",
"JWEObject",
".",
"class",
... | Construct JWEObject from json string.
@param json
json string.
@return Constructed JWEObject | [
"Construct",
"JWEObject",
"from",
"json",
"string",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/JWEObject.java#L119-L122 |
35,986 | Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/security/TokenProvider.java | TokenProvider.createSharedAccessSignatureTokenProvider | public static TokenProvider createSharedAccessSignatureTokenProvider(String sasKeyName, String sasKey)
{
return new SharedAccessSignatureTokenProvider(sasKeyName, sasKey, SecurityConstants.DEFAULT_SAS_TOKEN_VALIDITY_IN_SECONDS);
} | java | public static TokenProvider createSharedAccessSignatureTokenProvider(String sasKeyName, String sasKey)
{
return new SharedAccessSignatureTokenProvider(sasKeyName, sasKey, SecurityConstants.DEFAULT_SAS_TOKEN_VALIDITY_IN_SECONDS);
} | [
"public",
"static",
"TokenProvider",
"createSharedAccessSignatureTokenProvider",
"(",
"String",
"sasKeyName",
",",
"String",
"sasKey",
")",
"{",
"return",
"new",
"SharedAccessSignatureTokenProvider",
"(",
"sasKeyName",
",",
"sasKey",
",",
"SecurityConstants",
".",
"DEFAUL... | Creates a Shared Access Signature token provider with the given key name and key value. Returned token provider creates tokens
with validity of 20 minutes. This is a utility method.
@param sasKeyName SAS key name
@param sasKey SAS key value
@return an instance of Shared Access Signature token provider with the given key name, key value. | [
"Creates",
"a",
"Shared",
"Access",
"Signature",
"token",
"provider",
"with",
"the",
"given",
"key",
"name",
"and",
"key",
"value",
".",
"Returned",
"token",
"provider",
"creates",
"tokens",
"with",
"validity",
"of",
"20",
"minutes",
".",
"This",
"is",
"a",
... | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/security/TokenProvider.java#L34-L37 |
35,987 | Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/security/TokenProvider.java | TokenProvider.createAzureActiveDirectoryTokenProvider | public static TokenProvider createAzureActiveDirectoryTokenProvider(String authorityUrl, String clientId, String userName, String password) throws MalformedURLException
{
AuthenticationContext authContext = createAuthenticationContext(authorityUrl);
return new AzureActiveDirectoryTokenProvider(authContext, clientId, userName, password);
} | java | public static TokenProvider createAzureActiveDirectoryTokenProvider(String authorityUrl, String clientId, String userName, String password) throws MalformedURLException
{
AuthenticationContext authContext = createAuthenticationContext(authorityUrl);
return new AzureActiveDirectoryTokenProvider(authContext, clientId, userName, password);
} | [
"public",
"static",
"TokenProvider",
"createAzureActiveDirectoryTokenProvider",
"(",
"String",
"authorityUrl",
",",
"String",
"clientId",
",",
"String",
"userName",
",",
"String",
"password",
")",
"throws",
"MalformedURLException",
"{",
"AuthenticationContext",
"authContext... | Creates an Azure Active Directory token provider that acquires a token from the given active directory instance using the given clientId, username and password.
This is a utility method.
@param authorityUrl URL of the Azure Active Directory instance
@param clientId client id of the application
@param userName user name
@param password password
@return an instance of Azure Active Directory token provider
@throws MalformedURLException if the authority URL is not well formed | [
"Creates",
"an",
"Azure",
"Active",
"Directory",
"token",
"provider",
"that",
"acquires",
"a",
"token",
"from",
"the",
"given",
"active",
"directory",
"instance",
"using",
"the",
"given",
"clientId",
"username",
"and",
"password",
".",
"This",
"is",
"a",
"util... | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/security/TokenProvider.java#L60-L64 |
35,988 | Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/security/TokenProvider.java | TokenProvider.createAzureActiveDirectoryTokenProvider | public static TokenProvider createAzureActiveDirectoryTokenProvider(String authorityUrl, String clientId, String clientSecret) throws MalformedURLException
{
AuthenticationContext authContext = createAuthenticationContext(authorityUrl);
return new AzureActiveDirectoryTokenProvider(authContext, new ClientCredential(clientId, clientSecret));
} | java | public static TokenProvider createAzureActiveDirectoryTokenProvider(String authorityUrl, String clientId, String clientSecret) throws MalformedURLException
{
AuthenticationContext authContext = createAuthenticationContext(authorityUrl);
return new AzureActiveDirectoryTokenProvider(authContext, new ClientCredential(clientId, clientSecret));
} | [
"public",
"static",
"TokenProvider",
"createAzureActiveDirectoryTokenProvider",
"(",
"String",
"authorityUrl",
",",
"String",
"clientId",
",",
"String",
"clientSecret",
")",
"throws",
"MalformedURLException",
"{",
"AuthenticationContext",
"authContext",
"=",
"createAuthentica... | Creates an Azure Active Directory token provider that acquires a token from the given active directory instance using the given clientId and client secret.
This is a utility method.
@param authorityUrl URL of the Azure Active Directory instance
@param clientId client id of the application
@param clientSecret client secret of the application
@return an instance of Azure Active Directory token provider
@throws MalformedURLException if the authority URL is not well formed | [
"Creates",
"an",
"Azure",
"Active",
"Directory",
"token",
"provider",
"that",
"acquires",
"a",
"token",
"from",
"the",
"given",
"active",
"directory",
"instance",
"using",
"the",
"given",
"clientId",
"and",
"client",
"secret",
".",
"This",
"is",
"a",
"utility"... | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/security/TokenProvider.java#L75-L79 |
35,989 | Azure/azure-sdk-for-java | applicationconfig/client/src/main/java/com/azure/applicationconfig/ConfigurationAsyncClient.java | ConfigurationAsyncClient.addSetting | public Mono<Response<ConfigurationSetting>> addSetting(ConfigurationSetting setting) {
// Validate that setting and key is not null. The key is used in the service URL so it cannot be null.
validateSetting(setting);
// This service method call is similar to setSetting except we're passing If-Not-Match = "*". If the service
// finds any existing configuration settings, then its e-tag will match and the service will return an error.
return service.setKey(serviceEndpoint, setting.key(), setting.label(), setting, null, getETagValue(ETAG_ANY));
} | java | public Mono<Response<ConfigurationSetting>> addSetting(ConfigurationSetting setting) {
// Validate that setting and key is not null. The key is used in the service URL so it cannot be null.
validateSetting(setting);
// This service method call is similar to setSetting except we're passing If-Not-Match = "*". If the service
// finds any existing configuration settings, then its e-tag will match and the service will return an error.
return service.setKey(serviceEndpoint, setting.key(), setting.label(), setting, null, getETagValue(ETAG_ANY));
} | [
"public",
"Mono",
"<",
"Response",
"<",
"ConfigurationSetting",
">",
">",
"addSetting",
"(",
"ConfigurationSetting",
"setting",
")",
"{",
"// Validate that setting and key is not null. The key is used in the service URL so it cannot be null.",
"validateSetting",
"(",
"setting",
"... | Adds a configuration value in the service if that key and label does not exist. The label value of the
ConfigurationSetting is optional.
@param setting The setting to add to the configuration service.
@return The {@link ConfigurationSetting} that was created, or {@code null}, if a key collision occurs or the key
is an invalid value (which will also throw ServiceRequestException described below).
@throws NullPointerException If {@code setting} is {@code null}.
@throws IllegalArgumentException If {@link ConfigurationSetting#key() key} is {@code null}.
@throws ServiceRequestException If a ConfigurationSetting with the same key and label exists. Or,
{@link ConfigurationSetting#key() key} is an empty string. | [
"Adds",
"a",
"configuration",
"value",
"in",
"the",
"service",
"if",
"that",
"key",
"and",
"label",
"does",
"not",
"exist",
".",
"The",
"label",
"value",
"of",
"the",
"ConfigurationSetting",
"is",
"optional",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationconfig/client/src/main/java/com/azure/applicationconfig/ConfigurationAsyncClient.java#L89-L96 |
35,990 | Azure/azure-sdk-for-java | applicationconfig/client/src/main/java/com/azure/applicationconfig/ConfigurationAsyncClient.java | ConfigurationAsyncClient.setSetting | public Mono<Response<ConfigurationSetting>> setSetting(ConfigurationSetting setting) {
// Validate that setting and key is not null. The key is used in the service URL so it cannot be null.
validateSetting(setting);
// This service method call is similar to addSetting except it will create or update a configuration setting.
// If the user provides an etag value, it is passed in as If-Match = "{etag value}". If the current value in the
// service has a matching etag then it matches, then its value is updated with what the user passed in.
// Otherwise, the service throws an exception because the current configuration value was updated and we have an
// old value locally.
// If no etag value was passed in, then the value is always added or updated.
return service.setKey(serviceEndpoint, setting.key(), setting.label(), setting, getETagValue(setting.etag()), null);
} | java | public Mono<Response<ConfigurationSetting>> setSetting(ConfigurationSetting setting) {
// Validate that setting and key is not null. The key is used in the service URL so it cannot be null.
validateSetting(setting);
// This service method call is similar to addSetting except it will create or update a configuration setting.
// If the user provides an etag value, it is passed in as If-Match = "{etag value}". If the current value in the
// service has a matching etag then it matches, then its value is updated with what the user passed in.
// Otherwise, the service throws an exception because the current configuration value was updated and we have an
// old value locally.
// If no etag value was passed in, then the value is always added or updated.
return service.setKey(serviceEndpoint, setting.key(), setting.label(), setting, getETagValue(setting.etag()), null);
} | [
"public",
"Mono",
"<",
"Response",
"<",
"ConfigurationSetting",
">",
">",
"setSetting",
"(",
"ConfigurationSetting",
"setting",
")",
"{",
"// Validate that setting and key is not null. The key is used in the service URL so it cannot be null.",
"validateSetting",
"(",
"setting",
"... | Creates or updates a configuration value in the service. Partial updates are not supported and the entire
configuration setting is updated.
If {@link ConfigurationSetting#etag() etag} is specified, the configuration value is updated if the current
setting's etag matches. If the etag's value is equal to the wildcard character ({@code "*"}), the setting
will always be updated.
@param setting The configuration setting to create or update.
@return The {@link ConfigurationSetting} that was created or updated, or {@code null}, if the key is an invalid
value, the setting is locked, or an etag was provided but does not match the service's current etag value (which
will also throw ServiceRequestException described below).
@throws NullPointerException If {@code setting} is {@code null}.
@throws IllegalArgumentException If {@link ConfigurationSetting#key() key} is {@code null}.
@throws ServiceRequestException If the {@link ConfigurationSetting#etag() etag} was specified, is not the
wildcard character, and the current configuration value's etag does not match. If the
setting exists and is locked, or {@link ConfigurationSetting#key() key} is an empty string. | [
"Creates",
"or",
"updates",
"a",
"configuration",
"value",
"in",
"the",
"service",
".",
"Partial",
"updates",
"are",
"not",
"supported",
"and",
"the",
"entire",
"configuration",
"setting",
"is",
"updated",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationconfig/client/src/main/java/com/azure/applicationconfig/ConfigurationAsyncClient.java#L130-L141 |
35,991 | Azure/azure-sdk-for-java | applicationconfig/client/src/main/java/com/azure/applicationconfig/ConfigurationAsyncClient.java | ConfigurationAsyncClient.updateSetting | public Mono<Response<ConfigurationSetting>> updateSetting(ConfigurationSetting setting) {
// Validate that setting and key is not null. The key is used in the service URL so it cannot be null.
validateSetting(setting);
String etag = setting.etag() == null ? ETAG_ANY : setting.etag();
return service.setKey(serviceEndpoint, setting.key(), setting.label(), setting, getETagValue(etag), null);
} | java | public Mono<Response<ConfigurationSetting>> updateSetting(ConfigurationSetting setting) {
// Validate that setting and key is not null. The key is used in the service URL so it cannot be null.
validateSetting(setting);
String etag = setting.etag() == null ? ETAG_ANY : setting.etag();
return service.setKey(serviceEndpoint, setting.key(), setting.label(), setting, getETagValue(etag), null);
} | [
"public",
"Mono",
"<",
"Response",
"<",
"ConfigurationSetting",
">",
">",
"updateSetting",
"(",
"ConfigurationSetting",
"setting",
")",
"{",
"// Validate that setting and key is not null. The key is used in the service URL so it cannot be null.",
"validateSetting",
"(",
"setting",
... | Updates an existing configuration value in the service. The setting must already exist. Partial updates are not
supported, the entire configuration value is replaced.
If {@link ConfigurationSetting#etag() etag} is specified, the configuration value is only updated if it matches.
@param setting The setting to add or update in the service.
@return The {@link ConfigurationSetting} that was updated, or {@code null}, if the configuration value does not
exist, is locked, or the key is an invalid value (which will also throw ServiceRequestException described below).
@throws NullPointerException If {@code setting} is {@code null}.
@throws IllegalArgumentException If {@link ConfigurationSetting#key() key} is {@code null}.
@throws ServiceRequestException If a ConfigurationSetting with the same key and label does not
exist, the setting is locked, {@link ConfigurationSetting#key() key} is an empty string, or
{@link ConfigurationSetting#etag() etag} is specified but does not match the current value. | [
"Updates",
"an",
"existing",
"configuration",
"value",
"in",
"the",
"service",
".",
"The",
"setting",
"must",
"already",
"exist",
".",
"Partial",
"updates",
"are",
"not",
"supported",
"the",
"entire",
"configuration",
"value",
"is",
"replaced",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationconfig/client/src/main/java/com/azure/applicationconfig/ConfigurationAsyncClient.java#L173-L180 |
35,992 | Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/ConnectionStringBuilder.java | ConnectionStringBuilder.toLoggableString | public String toLoggableString()
{
StringBuilder connectionStringBuilder = new StringBuilder();
if (this.endpoint != null)
{
connectionStringBuilder.append(String.format(Locale.US, "%s%s%s%s", ENDPOINT_CONFIG_NAME, KEY_VALUE_SEPARATOR,
this.endpoint.toString(), KEY_VALUE_PAIR_DELIMITER));
}
if (!StringUtil.isNullOrWhiteSpace(this.entityPath))
{
connectionStringBuilder.append(String.format(Locale.US, "%s%s%s%s", ENTITY_PATH_CONFIG_NAME,
KEY_VALUE_SEPARATOR, this.entityPath, KEY_VALUE_PAIR_DELIMITER));
}
return connectionStringBuilder.toString();
} | java | public String toLoggableString()
{
StringBuilder connectionStringBuilder = new StringBuilder();
if (this.endpoint != null)
{
connectionStringBuilder.append(String.format(Locale.US, "%s%s%s%s", ENDPOINT_CONFIG_NAME, KEY_VALUE_SEPARATOR,
this.endpoint.toString(), KEY_VALUE_PAIR_DELIMITER));
}
if (!StringUtil.isNullOrWhiteSpace(this.entityPath))
{
connectionStringBuilder.append(String.format(Locale.US, "%s%s%s%s", ENTITY_PATH_CONFIG_NAME,
KEY_VALUE_SEPARATOR, this.entityPath, KEY_VALUE_PAIR_DELIMITER));
}
return connectionStringBuilder.toString();
} | [
"public",
"String",
"toLoggableString",
"(",
")",
"{",
"StringBuilder",
"connectionStringBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"this",
".",
"endpoint",
"!=",
"null",
")",
"{",
"connectionStringBuilder",
".",
"append",
"(",
"String",
... | Generates a string that is logged in traces. Excludes secrets | [
"Generates",
"a",
"string",
"that",
"is",
"logged",
"in",
"traces",
".",
"Excludes",
"secrets"
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/primitives/ConnectionStringBuilder.java#L541-L557 |
35,993 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/dht/Range.java | Range.isWrapAround | public static <T extends RingPosition<T>> boolean isWrapAround(T left, T right)
{
return left.compareTo(right) >= 0;
} | java | public static <T extends RingPosition<T>> boolean isWrapAround(T left, T right)
{
return left.compareTo(right) >= 0;
} | [
"public",
"static",
"<",
"T",
"extends",
"RingPosition",
"<",
"T",
">",
">",
"boolean",
"isWrapAround",
"(",
"T",
"left",
",",
"T",
"right",
")",
"{",
"return",
"left",
".",
"compareTo",
"(",
"right",
")",
">=",
"0",
";",
"}"
] | Tells if the given range is a wrap around. | [
"Tells",
"if",
"the",
"given",
"range",
"is",
"a",
"wrap",
"around",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/dht/Range.java#L258-L261 |
35,994 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/dht/Range.java | Range.subtractContained | private ArrayList<Range<T>> subtractContained(Range<T> contained)
{
ArrayList<Range<T>> difference = new ArrayList<Range<T>>(2);
if (!left.equals(contained.left))
difference.add(new Range<T>(left, contained.left, partitioner));
if (!right.equals(contained.right))
difference.add(new Range<T>(contained.right, right, partitioner));
return difference;
} | java | private ArrayList<Range<T>> subtractContained(Range<T> contained)
{
ArrayList<Range<T>> difference = new ArrayList<Range<T>>(2);
if (!left.equals(contained.left))
difference.add(new Range<T>(left, contained.left, partitioner));
if (!right.equals(contained.right))
difference.add(new Range<T>(contained.right, right, partitioner));
return difference;
} | [
"private",
"ArrayList",
"<",
"Range",
"<",
"T",
">",
">",
"subtractContained",
"(",
"Range",
"<",
"T",
">",
"contained",
")",
"{",
"ArrayList",
"<",
"Range",
"<",
"T",
">>",
"difference",
"=",
"new",
"ArrayList",
"<",
"Range",
"<",
"T",
">",
">",
"("... | Subtracts a portion of this range.
@param contained The range to subtract from this. It must be totally
contained by this range.
@return An ArrayList of the Ranges left after subtracting contained
from this. | [
"Subtracts",
"a",
"portion",
"of",
"this",
"range",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/dht/Range.java#L285-L294 |
35,995 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/dht/Range.java | Range.deoverlap | private static <T extends RingPosition<T>> List<Range<T>> deoverlap(List<Range<T>> ranges)
{
if (ranges.isEmpty())
return ranges;
List<Range<T>> output = new ArrayList<Range<T>>();
Iterator<Range<T>> iter = ranges.iterator();
Range<T> current = iter.next();
@SuppressWarnings("unchecked")
T min = (T) current.partitioner.minValue(current.left.getClass());
while (iter.hasNext())
{
// If current goes to the end of the ring, we're done
if (current.right.equals(min))
{
// If one range is the full range, we return only that
if (current.left.equals(min))
return Collections.<Range<T>>singletonList(current);
output.add(new Range<T>(current.left, min));
return output;
}
Range<T> next = iter.next();
// if next left is equal to current right, we do not intersect per se, but replacing (A, B] and (B, C] by (A, C] is
// legit, and since this avoid special casing and will result in more "optimal" ranges, we do the transformation
if (next.left.compareTo(current.right) <= 0)
{
// We do overlap
// (we've handled current.right.equals(min) already)
if (next.right.equals(min) || current.right.compareTo(next.right) < 0)
current = new Range<T>(current.left, next.right);
}
else
{
output.add(current);
current = next;
}
}
output.add(current);
return output;
} | java | private static <T extends RingPosition<T>> List<Range<T>> deoverlap(List<Range<T>> ranges)
{
if (ranges.isEmpty())
return ranges;
List<Range<T>> output = new ArrayList<Range<T>>();
Iterator<Range<T>> iter = ranges.iterator();
Range<T> current = iter.next();
@SuppressWarnings("unchecked")
T min = (T) current.partitioner.minValue(current.left.getClass());
while (iter.hasNext())
{
// If current goes to the end of the ring, we're done
if (current.right.equals(min))
{
// If one range is the full range, we return only that
if (current.left.equals(min))
return Collections.<Range<T>>singletonList(current);
output.add(new Range<T>(current.left, min));
return output;
}
Range<T> next = iter.next();
// if next left is equal to current right, we do not intersect per se, but replacing (A, B] and (B, C] by (A, C] is
// legit, and since this avoid special casing and will result in more "optimal" ranges, we do the transformation
if (next.left.compareTo(current.right) <= 0)
{
// We do overlap
// (we've handled current.right.equals(min) already)
if (next.right.equals(min) || current.right.compareTo(next.right) < 0)
current = new Range<T>(current.left, next.right);
}
else
{
output.add(current);
current = next;
}
}
output.add(current);
return output;
} | [
"private",
"static",
"<",
"T",
"extends",
"RingPosition",
"<",
"T",
">",
">",
"List",
"<",
"Range",
"<",
"T",
">",
">",
"deoverlap",
"(",
"List",
"<",
"Range",
"<",
"T",
">",
">",
"ranges",
")",
"{",
"if",
"(",
"ranges",
".",
"isEmpty",
"(",
")",... | Given a list of unwrapped ranges sorted by left position, return an
equivalent list of ranges but with no overlapping ranges. | [
"Given",
"a",
"list",
"of",
"unwrapped",
"ranges",
"sorted",
"by",
"left",
"position",
"return",
"an",
"equivalent",
"list",
"of",
"ranges",
"but",
"with",
"no",
"overlapping",
"ranges",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/dht/Range.java#L423-L467 |
35,996 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/dht/Range.java | Range.makeRowRange | public static Range<RowPosition> makeRowRange(Token left, Token right, IPartitioner partitioner)
{
return new Range<RowPosition>(left.maxKeyBound(partitioner), right.maxKeyBound(partitioner), partitioner);
} | java | public static Range<RowPosition> makeRowRange(Token left, Token right, IPartitioner partitioner)
{
return new Range<RowPosition>(left.maxKeyBound(partitioner), right.maxKeyBound(partitioner), partitioner);
} | [
"public",
"static",
"Range",
"<",
"RowPosition",
">",
"makeRowRange",
"(",
"Token",
"left",
",",
"Token",
"right",
",",
"IPartitioner",
"partitioner",
")",
"{",
"return",
"new",
"Range",
"<",
"RowPosition",
">",
"(",
"left",
".",
"maxKeyBound",
"(",
"partiti... | Compute a range of keys corresponding to a given range of token. | [
"Compute",
"a",
"range",
"of",
"keys",
"corresponding",
"to",
"a",
"given",
"range",
"of",
"token",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/dht/Range.java#L473-L476 |
35,997 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/AbstractNativeCell.java | AbstractNativeCell.compareTo | @Inline
public final int compareTo(final Composite that)
{
if (isStatic() != that.isStatic())
{
// Static sorts before non-static no matter what, except for empty which
// always sort first
if (isEmpty())
return that.isEmpty() ? 0 : -1;
if (that.isEmpty())
return 1;
return isStatic() ? -1 : 1;
}
int size = size();
int size2 = that.size();
int minSize = Math.min(size, size2);
int startDelta = 0;
int cellNamesOffset = nameDeltaOffset(size);
for (int i = 0 ; i < minSize ; i++)
{
int endDelta = i < size - 1 ? getShort(nameDeltaOffset(i + 1)) : valueStartOffset() - cellNamesOffset;
long offset = peer + cellNamesOffset + startDelta;
int length = endDelta - startDelta;
int cmp = FastByteOperations.UnsafeOperations.compareTo(null, offset, length, that.get(i));
if (cmp != 0)
return cmp;
startDelta = endDelta;
}
EOC eoc = that.eoc();
if (size == size2)
return this.eoc().compareTo(eoc);
return size < size2 ? this.eoc().prefixComparisonResult : -eoc.prefixComparisonResult;
} | java | @Inline
public final int compareTo(final Composite that)
{
if (isStatic() != that.isStatic())
{
// Static sorts before non-static no matter what, except for empty which
// always sort first
if (isEmpty())
return that.isEmpty() ? 0 : -1;
if (that.isEmpty())
return 1;
return isStatic() ? -1 : 1;
}
int size = size();
int size2 = that.size();
int minSize = Math.min(size, size2);
int startDelta = 0;
int cellNamesOffset = nameDeltaOffset(size);
for (int i = 0 ; i < minSize ; i++)
{
int endDelta = i < size - 1 ? getShort(nameDeltaOffset(i + 1)) : valueStartOffset() - cellNamesOffset;
long offset = peer + cellNamesOffset + startDelta;
int length = endDelta - startDelta;
int cmp = FastByteOperations.UnsafeOperations.compareTo(null, offset, length, that.get(i));
if (cmp != 0)
return cmp;
startDelta = endDelta;
}
EOC eoc = that.eoc();
if (size == size2)
return this.eoc().compareTo(eoc);
return size < size2 ? this.eoc().prefixComparisonResult : -eoc.prefixComparisonResult;
} | [
"@",
"Inline",
"public",
"final",
"int",
"compareTo",
"(",
"final",
"Composite",
"that",
")",
"{",
"if",
"(",
"isStatic",
"(",
")",
"!=",
"that",
".",
"isStatic",
"(",
")",
")",
"{",
"// Static sorts before non-static no matter what, except for empty which",
"// a... | requires isByteOrderComparable to be true. Compares the name components only; ; may need to compare EOC etc still | [
"requires",
"isByteOrderComparable",
"to",
"be",
"true",
".",
"Compares",
"the",
"name",
"components",
"only",
";",
";",
"may",
"need",
"to",
"compare",
"EOC",
"etc",
"still"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/AbstractNativeCell.java#L662-L697 |
35,998 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/CounterMutation.java | CounterMutation.processModifications | private ColumnFamily processModifications(ColumnFamily changesCF)
{
ColumnFamilyStore cfs = Keyspace.open(getKeyspaceName()).getColumnFamilyStore(changesCF.id());
ColumnFamily resultCF = changesCF.cloneMeShallow();
List<CounterUpdateCell> counterUpdateCells = new ArrayList<>(changesCF.getColumnCount());
for (Cell cell : changesCF)
{
if (cell instanceof CounterUpdateCell)
counterUpdateCells.add((CounterUpdateCell)cell);
else
resultCF.addColumn(cell);
}
if (counterUpdateCells.isEmpty())
return resultCF; // only DELETEs
ClockAndCount[] currentValues = getCurrentValues(counterUpdateCells, cfs);
for (int i = 0; i < counterUpdateCells.size(); i++)
{
ClockAndCount currentValue = currentValues[i];
CounterUpdateCell update = counterUpdateCells.get(i);
long clock = currentValue.clock + 1L;
long count = currentValue.count + update.delta();
resultCF.addColumn(new BufferCounterCell(update.name(),
CounterContext.instance().createGlobal(CounterId.getLocalId(), clock, count),
update.timestamp()));
}
return resultCF;
} | java | private ColumnFamily processModifications(ColumnFamily changesCF)
{
ColumnFamilyStore cfs = Keyspace.open(getKeyspaceName()).getColumnFamilyStore(changesCF.id());
ColumnFamily resultCF = changesCF.cloneMeShallow();
List<CounterUpdateCell> counterUpdateCells = new ArrayList<>(changesCF.getColumnCount());
for (Cell cell : changesCF)
{
if (cell instanceof CounterUpdateCell)
counterUpdateCells.add((CounterUpdateCell)cell);
else
resultCF.addColumn(cell);
}
if (counterUpdateCells.isEmpty())
return resultCF; // only DELETEs
ClockAndCount[] currentValues = getCurrentValues(counterUpdateCells, cfs);
for (int i = 0; i < counterUpdateCells.size(); i++)
{
ClockAndCount currentValue = currentValues[i];
CounterUpdateCell update = counterUpdateCells.get(i);
long clock = currentValue.clock + 1L;
long count = currentValue.count + update.delta();
resultCF.addColumn(new BufferCounterCell(update.name(),
CounterContext.instance().createGlobal(CounterId.getLocalId(), clock, count),
update.timestamp()));
}
return resultCF;
} | [
"private",
"ColumnFamily",
"processModifications",
"(",
"ColumnFamily",
"changesCF",
")",
"{",
"ColumnFamilyStore",
"cfs",
"=",
"Keyspace",
".",
"open",
"(",
"getKeyspaceName",
"(",
")",
")",
".",
"getColumnFamilyStore",
"(",
"changesCF",
".",
"id",
"(",
")",
")... | Replaces all the CounterUpdateCell-s with updated regular CounterCell-s | [
"Replaces",
"all",
"the",
"CounterUpdateCell",
"-",
"s",
"with",
"updated",
"regular",
"CounterCell",
"-",
"s"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/CounterMutation.java#L179-L212 |
35,999 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/CounterMutation.java | CounterMutation.getCurrentValuesFromCache | private int getCurrentValuesFromCache(List<CounterUpdateCell> counterUpdateCells,
ColumnFamilyStore cfs,
ClockAndCount[] currentValues)
{
int cacheMisses = 0;
for (int i = 0; i < counterUpdateCells.size(); i++)
{
ClockAndCount cached = cfs.getCachedCounter(key(), counterUpdateCells.get(i).name());
if (cached != null)
currentValues[i] = cached;
else
cacheMisses++;
}
return cacheMisses;
} | java | private int getCurrentValuesFromCache(List<CounterUpdateCell> counterUpdateCells,
ColumnFamilyStore cfs,
ClockAndCount[] currentValues)
{
int cacheMisses = 0;
for (int i = 0; i < counterUpdateCells.size(); i++)
{
ClockAndCount cached = cfs.getCachedCounter(key(), counterUpdateCells.get(i).name());
if (cached != null)
currentValues[i] = cached;
else
cacheMisses++;
}
return cacheMisses;
} | [
"private",
"int",
"getCurrentValuesFromCache",
"(",
"List",
"<",
"CounterUpdateCell",
">",
"counterUpdateCells",
",",
"ColumnFamilyStore",
"cfs",
",",
"ClockAndCount",
"[",
"]",
"currentValues",
")",
"{",
"int",
"cacheMisses",
"=",
"0",
";",
"for",
"(",
"int",
"... | Returns the count of cache misses. | [
"Returns",
"the",
"count",
"of",
"cache",
"misses",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/CounterMutation.java#L235-L249 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.