idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
28,500 | 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 . |
28,501 | 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 ) ) { result = asyncExpectedResponse . then ( ) ; } else { result = asyncExpectedResponse . flatMap ( response -> handleRestResponseReturnType ( response , methodParser , monoTypeParam ) ) ; } } else if ( FluxUtil . isFluxByteBuf ( returnType ) ) { result = asyncExpectedResponse . flatMapMany ( ar -> ar . sourceResponse ( ) . body ( ) ) ; } else if ( TypeUtil . isTypeOrSubTypeOf ( returnType , void . class ) || TypeUtil . isTypeOrSubTypeOf ( returnType , Void . class ) ) { asyncExpectedResponse . block ( ) ; result = null ; } else { result = asyncExpectedResponse . flatMap ( httpResponse -> handleRestResponseReturnType ( httpResponse , methodParser , returnType ) ) . block ( ) ; } return result ; } | Handle the provided asynchronous HTTP response and return the deserialized value . |
28,502 | public void incrementRetryCount ( String clientId ) { Integer retryCount = this . retryCounts . get ( clientId ) ; this . retryCounts . put ( clientId , retryCount == null ? 1 : retryCount + 1 ) ; } | Increments the number of successive retry attempts made by a client . |
28,503 | public void resetRetryCount ( String clientId ) { Integer currentRetryCount = this . retryCounts . get ( clientId ) ; if ( currentRetryCount != null && currentRetryCount . intValue ( ) != 0 ) { this . retryCounts . put ( clientId , 0 ) ; } } | Resets the number of retry attempts made by a client . This method is called by the client when retried operation succeeds . |
28,504 | 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 ; } | Determines if an exception is retry - able or not . Only transient exceptions should be retried . |
28,505 | 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 ) ; } | 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 . |
28,506 | 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 ) ; } | First 4 bytes are in reverse order 5th and 6th bytes are in reverse order 7th and 8th bytes are also in reverse order |
28,507 | public static int getDataSerializedSize ( Message amqpMessage ) { if ( amqpMessage == null ) { return 0 ; } int payloadSize = getPayloadSize ( amqpMessage ) ; 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 ; } | Remove this .. Too many cases too many types ... |
28,508 | 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 ; } | This is not super stable for some reason |
28,509 | public void delete ( String resourceGroupName , String resourceName , ItemScopePath scopePath ) { deleteWithServiceResponseAsync ( resourceGroupName , resourceName , scopePath ) . toBlocking ( ) . single ( ) . body ( ) ; } | Deletes a specific Analytics Items defined within an Application Insights component . |
28,510 | public JobInfo addJobNotificationSubscription ( JobNotificationSubscription jobNotificationSubscription ) { getContent ( ) . addJobNotificationSubscriptionType ( new JobNotificationSubscriptionType ( ) . setNotificationEndPointId ( jobNotificationSubscription . getNotificationEndPointId ( ) ) . setTargetJobState ( jobNotificationSubscription . getTargetJobState ( ) . getCode ( ) ) ) ; return this ; } | Adds the job notification subscription . |
28,511 | public Observable < ServerInner > beginCreateOrUpdateAsync ( String resourceGroupName , String serverName , ServerInner parameters ) { return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , parameters ) . map ( new Func1 < ServiceResponse < ServerInner > , ServerInner > ( ) { public ServerInner call ( ServiceResponse < ServerInner > response ) { return response . body ( ) ; } } ) ; } | Creates or updates a server . |
28,512 | @ JsonProperty ( "n" ) @ JsonSerialize ( using = Base64UrlJsonSerializer . class ) @ JsonDeserialize ( using = Base64UrlJsonDeserializer . class ) public byte [ ] n ( ) { return ByteExtensions . clone ( this . n ) ; } | Get the n value . |
28,513 | @ JsonProperty ( "e" ) @ JsonSerialize ( using = Base64UrlJsonSerializer . class ) @ JsonDeserialize ( using = Base64UrlJsonDeserializer . class ) public byte [ ] e ( ) { return ByteExtensions . clone ( this . e ) ; } | Get the e value . |
28,514 | @ JsonProperty ( "d" ) @ JsonSerialize ( using = Base64UrlJsonSerializer . class ) @ JsonDeserialize ( using = Base64UrlJsonDeserializer . class ) public byte [ ] d ( ) { return ByteExtensions . clone ( this . d ) ; } | Get the d value . |
28,515 | @ JsonProperty ( "p" ) @ JsonSerialize ( using = Base64UrlJsonSerializer . class ) @ JsonDeserialize ( using = Base64UrlJsonDeserializer . class ) public byte [ ] p ( ) { return ByteExtensions . clone ( this . p ) ; } | Get the RSA secret prime value . |
28,516 | @ JsonProperty ( "q" ) @ JsonSerialize ( using = Base64UrlJsonSerializer . class ) @ JsonDeserialize ( using = Base64UrlJsonDeserializer . class ) public byte [ ] q ( ) { return ByteExtensions . clone ( this . q ) ; } | Get RSA secret prime with p < ; q value . |
28,517 | @ JsonProperty ( "k" ) @ JsonSerialize ( using = Base64UrlJsonSerializer . class ) @ JsonDeserialize ( using = Base64UrlJsonDeserializer . class ) public byte [ ] k ( ) { return ByteExtensions . clone ( this . k ) ; } | Get Symmetric key value . |
28,518 | @ JsonProperty ( "key_hsm" ) @ JsonSerialize ( using = Base64UrlJsonSerializer . class ) @ JsonDeserialize ( using = Base64UrlJsonDeserializer . class ) public byte [ ] t ( ) { return ByteExtensions . clone ( this . t ) ; } | Get HSM Token value used with Bring Your Own Key . |
28,519 | @ JsonProperty ( "x" ) @ JsonSerialize ( using = Base64UrlJsonSerializer . class ) @ JsonDeserialize ( using = Base64UrlJsonDeserializer . class ) public byte [ ] x ( ) { return ByteExtensions . clone ( this . x ) ; } | Get the x value . |
28,520 | @ JsonProperty ( "y" ) @ JsonSerialize ( using = Base64UrlJsonSerializer . class ) @ JsonDeserialize ( using = Base64UrlJsonDeserializer . class ) public byte [ ] y ( ) { return ByteExtensions . clone ( this . y ) ; } | Get the y value . |
28,521 | private RSAPrivateKeySpec getRSAPrivateKeySpec ( ) { return new RSAPrivateCrtKeySpec ( toBigInteger ( n ) , toBigInteger ( e ) , toBigInteger ( d ) , toBigInteger ( p ) , toBigInteger ( q ) , toBigInteger ( dp ) , toBigInteger ( dq ) , toBigInteger ( qi ) ) ; } | Get the RSA private key spec value . |
28,522 | 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 ) ; } } | Get the RSA public key value . |
28,523 | 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 ) ; } } | Get the RSA private key value . |
28,524 | private void checkRSACompatible ( ) { if ( ! JsonWebKeyType . RSA . equals ( kty ) && ! JsonWebKeyType . RSA_HSM . equals ( kty ) ) { throw new UnsupportedOperationException ( "Not an RSA key" ) ; } } | Verifies if the key is an RSA key . |
28,525 | 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 ; } | Converts RSA key pair to JSON web key . |
28,526 | public KeyPair toRSA ( boolean includePrivateParameters , Provider provider ) { checkRSACompatible ( ) ; if ( includePrivateParameters ) { return new KeyPair ( getRSAPublicKey ( provider ) , getRSAPrivateKey ( provider ) ) ; } else { return new KeyPair ( getRSAPublicKey ( provider ) , null ) ; } } | Converts JSON web key to RSA key pair and include the private key if set to true . |
28,527 | 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 ) ; } } | Converts EC key pair to JSON web key . |
28,528 | 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 ) ; KeyPair apair = kpg . generateKeyPair ( ) ; ECPublicKey apub = ( ECPublicKey ) apair . getPublic ( ) ; ECParameterSpec aspec = apub . getParams ( ) ; EllipticCurve acurve = aspec . getCurve ( ) ; if ( acurve . equals ( crv ) ) { return curve ; } } throw new NoSuchAlgorithmException ( "Curve not supported." ) ; } catch ( GeneralSecurityException e ) { throw new IllegalStateException ( e ) ; } } | Matches the curve of the keyPair to supported curves . |
28,529 | public static JsonWebKey fromAes ( SecretKey secretKey ) { if ( secretKey == null ) { return null ; } return new JsonWebKey ( ) . withK ( secretKey . getEncoded ( ) ) . withKty ( JsonWebKeyType . OCT ) ; } | Converts AES key to JSON web key . |
28,530 | public SecretKey toAes ( ) { if ( k == null ) { return null ; } SecretKey secretKey = new SecretKeySpec ( k , "AES" ) ; return secretKey ; } | Converts JSON web key to AES key . |
28,531 | 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 ; } | Clear key materials . |
28,532 | 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 ( ) ; } | open should be called only once - we use FaultTolerantObject for that |
28,533 | public void close ( final OperationResult < Void , Exception > onGraceFullClose ) { this . onGraceFullClose = onGraceFullClose ; this . sendLink . close ( ) ; this . receiveLink . close ( ) ; } | close should be called exactly once - we use FaultTolerantObject for that |
28,534 | 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 ; final byte [ ] bytes = new byte [ payloadSize ] ; final int encodedSize = message . encode ( bytes , 0 , payloadSize ) ; receiveLink . flow ( 1 ) ; sendLink . send ( bytes , 0 , encodedSize ) ; sendLink . advance ( ) ; } | & assumes that this is run on Opened Object |
28,535 | 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 ; } | Creates message body of AMQPValue type . |
28,536 | 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 ; } | 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 . |
28,537 | 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 ; } | 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 . |
28,538 | public Observable < ServerVulnerabilityAssessmentInner > getAsync ( String resourceGroupName , String serverName ) { return getWithServiceResponseAsync ( resourceGroupName , serverName ) . map ( new Func1 < ServiceResponse < ServerVulnerabilityAssessmentInner > , ServerVulnerabilityAssessmentInner > ( ) { public ServerVulnerabilityAssessmentInner call ( ServiceResponse < ServerVulnerabilityAssessmentInner > response ) { return response . body ( ) ; } } ) ; } | Gets the server s vulnerability assessment . |
28,539 | public Observable < ServerVulnerabilityAssessmentInner > createOrUpdateAsync ( String resourceGroupName , String serverName , ServerVulnerabilityAssessmentInner parameters ) { return createOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , parameters ) . map ( new Func1 < ServiceResponse < ServerVulnerabilityAssessmentInner > , ServerVulnerabilityAssessmentInner > ( ) { public ServerVulnerabilityAssessmentInner call ( ServiceResponse < ServerVulnerabilityAssessmentInner > response ) { return response . body ( ) ; } } ) ; } | Creates or updates the server s vulnerability assessment . |
28,540 | public Observable < Page < WorkflowRunInner > > listNextAsync ( final String nextPageLink ) { return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < WorkflowRunInner > > , Page < WorkflowRunInner > > ( ) { public Page < WorkflowRunInner > call ( ServiceResponse < Page < WorkflowRunInner > > response ) { return response . body ( ) ; } } ) ; } | Gets a list of workflow runs . |
28,541 | public Observable < ApplicationInsightsComponentBillingFeaturesInner > getAsync ( String resourceGroupName , String resourceName ) { return getWithServiceResponseAsync ( resourceGroupName , resourceName ) . map ( new Func1 < ServiceResponse < ApplicationInsightsComponentBillingFeaturesInner > , ApplicationInsightsComponentBillingFeaturesInner > ( ) { public ApplicationInsightsComponentBillingFeaturesInner call ( ServiceResponse < ApplicationInsightsComponentBillingFeaturesInner > response ) { return response . body ( ) ; } } ) ; } | Returns current billing features for an Application Insights component . |
28,542 | public Observable < OperationStatusResponseInner > deleteAsync ( String resourceGroupName , String vmScaleSetName ) { return deleteWithServiceResponseAsync ( resourceGroupName , vmScaleSetName ) . map ( new Func1 < ServiceResponse < OperationStatusResponseInner > , OperationStatusResponseInner > ( ) { public OperationStatusResponseInner call ( ServiceResponse < OperationStatusResponseInner > response ) { return response . body ( ) ; } } ) ; } | Deletes a VM scale set . |
28,543 | 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 ; } | Get the content key authorization policy options restrictions . |
28,544 | public void delete ( String resourceGroupName , String labAccountName , String galleryImageName ) { deleteWithServiceResponseAsync ( resourceGroupName , labAccountName , galleryImageName ) . toBlocking ( ) . single ( ) . body ( ) ; } | Delete gallery image . |
28,545 | public Observable < ManagedBackupShortTermRetentionPolicyInner > getAsync ( String resourceGroupName , String managedInstanceName , String databaseName ) { return getWithServiceResponseAsync ( resourceGroupName , managedInstanceName , databaseName ) . map ( new Func1 < ServiceResponse < ManagedBackupShortTermRetentionPolicyInner > , ManagedBackupShortTermRetentionPolicyInner > ( ) { public ManagedBackupShortTermRetentionPolicyInner call ( ServiceResponse < ManagedBackupShortTermRetentionPolicyInner > response ) { return response . body ( ) ; } } ) ; } | Gets a managed database s short term retention policy . |
28,546 | private Duration determineDelayDuration ( HttpResponse response ) { int code = response . statusCode ( ) ; if ( code != HttpResponseStatus . TOO_MANY_REQUESTS . code ( ) && code != HttpResponseStatus . SERVICE_UNAVAILABLE . code ( ) ) { return this . delayDuration ; } String retryHeader = response . headerValue ( RETRY_AFTER_MS_HEADER ) ; if ( retryHeader == null || retryHeader . isEmpty ( ) ) { return this . delayDuration ; } return Duration . ofMillis ( Integer . parseInt ( retryHeader ) ) ; } | Determines the delay duration that should be waited before retrying . |
28,547 | 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 . |
28,548 | public void visitToken ( DetailAST token ) { 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 ; } } | Processes a token from the required tokens list when the TreeWalker visits it . |
28,549 | 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 ; } } | Determines if the class extends ServiceClient . |
28,550 | private boolean visibilityIsPublicOrProtected ( DetailAST constructorToken ) { DetailAST modifierToken = constructorToken . findFirstToken ( TokenTypes . MODIFIERS ) ; if ( modifierToken == null ) { return false ; } return TokenUtil . findFirstTokenByPredicate ( modifierToken , node -> node . getType ( ) == TokenTypes . LITERAL_PUBLIC || node . getType ( ) == TokenTypes . LITERAL_PROTECTED ) . isPresent ( ) ; } | Checks if the constructor is using the public or protected scope . |
28,551 | 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 ) ; } | Checks if the method node is public static and named builder . |
28,552 | 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." ) ; } } | runFrequency implemented only for TimeUnit granularity - Seconds |
28,553 | public Observable < RoleInner > getAsync ( String deviceName , String name , String resourceGroupName ) { return getWithServiceResponseAsync ( deviceName , name , resourceGroupName ) . map ( new Func1 < ServiceResponse < RoleInner > , RoleInner > ( ) { public RoleInner call ( ServiceResponse < RoleInner > response ) { return response . body ( ) ; } } ) ; } | Gets a specific role by name . |
28,554 | void initialize ( HostContext hostContext ) throws InvalidKeyException , URISyntaxException , StorageException { this . hostContext = hostContext ; if ( this . storageContainerName == null ) { this . storageContainerName = this . hostContext . getEventHubPath ( ) ; } 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 ) ; 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 ) ; this . renewRequestOptions . setMaximumExecutionTimeInMs ( this . hostContext . getPartitionManagerOptions ( ) . getLeaseDurationInSeconds ( ) * 1000 ) ; } | hence we don t want it in the constructor . |
28,555 | public CompletableFuture < Void > createAllLeasesIfNotExists ( List < String > partitionIds ) { CompletableFuture < Void > future = null ; 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 ) { if ( blobCount == partitionIds . size ( ) ) { future = CompletableFuture . completedFuture ( null ) ; } else { 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 ; } | Because it happens during startup when no user code is running it cannot deadlock with checkpointing . |
28,556 | public Observable < ProviderInner > getAsync ( String resourceProviderNamespace , String expand ) { return getWithServiceResponseAsync ( resourceProviderNamespace , expand ) . map ( new Func1 < ServiceResponse < ProviderInner > , ProviderInner > ( ) { public ProviderInner call ( ServiceResponse < ProviderInner > response ) { return response . body ( ) ; } } ) ; } | Gets the specified resource provider . |
28,557 | public ServiceFuture < OperationStatusResponseInner > beginRestartAsync ( String resourceGroupName , String vmScaleSetName , String instanceId , final ServiceCallback < OperationStatusResponseInner > serviceCallback ) { return ServiceFuture . fromResponse ( beginRestartWithServiceResponseAsync ( resourceGroupName , vmScaleSetName , instanceId ) , serviceCallback ) ; } | Restarts a virtual machine in a VM scale set . |
28,558 | public ServiceFuture < OperationStatusResponseInner > beginStartAsync ( String resourceGroupName , String vmScaleSetName , String instanceId , final ServiceCallback < OperationStatusResponseInner > serviceCallback ) { return ServiceFuture . fromResponse ( beginStartWithServiceResponseAsync ( resourceGroupName , vmScaleSetName , instanceId ) , serviceCallback ) ; } | Starts a virtual machine in a VM scale set . |
28,559 | public ServiceFuture < OperationStatusResponseInner > beginRedeployAsync ( String resourceGroupName , String vmScaleSetName , String instanceId , final ServiceCallback < OperationStatusResponseInner > serviceCallback ) { return ServiceFuture . fromResponse ( beginRedeployWithServiceResponseAsync ( resourceGroupName , vmScaleSetName , instanceId ) , serviceCallback ) ; } | Redeploys a virtual machine in a VM scale set . |
28,560 | public static boolean isCompleted ( String operationState ) { return operationState == null || operationState . length ( ) == 0 || SUCCEEDED . equalsIgnoreCase ( operationState ) || isFailedOrCanceled ( operationState ) ; } | Get whether or not the provided operation state represents a completed state . |
28,561 | public void delete ( String resourceGroupName , String domainName ) { deleteWithServiceResponseAsync ( resourceGroupName , domainName ) . toBlocking ( ) . single ( ) . body ( ) ; } | Delete a domain . Delete a domain . |
28,562 | public static void main ( String [ ] args ) throws NoSuchAlgorithmException , InvalidKeyException , IOException { String connectionString = "endpoint={endpoint_value};id={id_value};name={secret_value}" ; ConfigurationAsyncClient client = ConfigurationAsyncClient . builder ( ) . credentials ( new ConfigurationClientCredentials ( connectionString ) ) . build ( ) ; 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 ) ; Flux . merge ( addConfigurations ( client , BETA , "https://beta-storage.core.windows.net" , betaSetting ) , addConfigurations ( client , PRODUCTION , "https://production-storage.core.windows.net" , productionSetting ) ) . blockLast ( ) ; 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 ( ) ) ; } } ) ; Flux . fromArray ( new String [ ] { BETA , PRODUCTION } ) . flatMap ( set -> client . listSettings ( new SettingSelector ( ) . label ( set ) ) ) . map ( client :: deleteSetting ) . blockLast ( ) ; } | Entry point to the configuration set sample . Creates two sets of configuration values and fetches values from the beta configuration set . |
28,563 | public Observable < SignalRResourceInner > getByResourceGroupAsync ( String resourceGroupName , String resourceName ) { return getByResourceGroupWithServiceResponseAsync ( resourceGroupName , resourceName ) . map ( new Func1 < ServiceResponse < SignalRResourceInner > , SignalRResourceInner > ( ) { public SignalRResourceInner call ( ServiceResponse < SignalRResourceInner > response ) { return response . body ( ) ; } } ) ; } | Get the SignalR service and its properties . |
28,564 | public WorkflowTriggerCallbackUrlInner listCallbackUrl ( String resourceGroupName , String workflowName , String versionId , String triggerName , GetCallbackUrlParameters parameters ) { return listCallbackUrlWithServiceResponseAsync ( resourceGroupName , workflowName , versionId , triggerName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ; } | Get the callback url for a trigger of a workflow version . |
28,565 | public Observable < DataWarehouseUserActivityInner > getAsync ( String resourceGroupName , String serverName , String databaseName ) { return getWithServiceResponseAsync ( resourceGroupName , serverName , databaseName ) . map ( new Func1 < ServiceResponse < DataWarehouseUserActivityInner > , DataWarehouseUserActivityInner > ( ) { public DataWarehouseUserActivityInner call ( ServiceResponse < DataWarehouseUserActivityInner > response ) { return response . body ( ) ; } } ) ; } | Gets the user activities of a data warehouse which includes running and suspended queries . |
28,566 | public Observable < List < UsageInner > > listByAutomationAccountAsync ( String resourceGroupName , String automationAccountName ) { return listByAutomationAccountWithServiceResponseAsync ( resourceGroupName , automationAccountName ) . map ( new Func1 < ServiceResponse < List < UsageInner > > , List < UsageInner > > ( ) { public List < UsageInner > call ( ServiceResponse < List < UsageInner > > response ) { return response . body ( ) ; } } ) ; } | Retrieve the usage for the account id . |
28,567 | public Observable < ShareInner > getAsync ( String deviceName , String name , String resourceGroupName ) { return getWithServiceResponseAsync ( deviceName , name , resourceGroupName ) . map ( new Func1 < ServiceResponse < ShareInner > , ShareInner > ( ) { public ShareInner call ( ServiceResponse < ShareInner > response ) { return response . body ( ) ; } } ) ; } | Gets a share by name . |
28,568 | 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 ; } | Initializes an instance of JacksonMapperAdapter with default configurations applied to the object mapper . |
28,569 | public static boolean isCertificateOperationIdentifier ( String identifier ) { identifier = verifyNonEmpty ( identifier , "identifier" ) ; URI baseUri ; try { baseUri = new URI ( identifier ) ; } catch ( URISyntaxException e ) { return false ; } 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 ; } | Verifies whether the identifier belongs to a key vault certificate operation . |
28,570 | public ServiceFuture < CheckAvailabilityResultInner > checkAvailabilityAsync ( CheckAvailabilityParameters parameters , final ServiceCallback < CheckAvailabilityResultInner > serviceCallback ) { return ServiceFuture . fromResponse ( checkAvailabilityWithServiceResponseAsync ( parameters ) , serviceCallback ) ; } | 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 . |
28,571 | public Observable < ProtectionContainerResourceInner > getAsync ( String vaultName , String resourceGroupName , String fabricName , String containerName ) { return getWithServiceResponseAsync ( vaultName , resourceGroupName , fabricName , containerName ) . map ( new Func1 < ServiceResponse < ProtectionContainerResourceInner > , ProtectionContainerResourceInner > ( ) { public ProtectionContainerResourceInner call ( ServiceResponse < ProtectionContainerResourceInner > response ) { return response . body ( ) ; } } ) ; } | Gets details of the specific container registered to your Recovery Services vault . |
28,572 | public ServiceFuture < Void > refreshAsync ( String vaultName , String resourceGroupName , String fabricName , final ServiceCallback < Void > serviceCallback ) { return ServiceFuture . fromResponse ( refreshWithServiceResponseAsync ( vaultName , resourceGroupName , fabricName ) , serviceCallback ) ; } | 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 . |
28,573 | 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 ( ) ; } | Provides the details of the backed up item . This is an asynchronous operation . To know the status of the operation call the GetItemOperationResult API . |
28,574 | public static EntityGetOperation < AssetInfo > get ( LinkInfo < AssetInfo > link ) { return new DefaultGetOperation < AssetInfo > ( link . getHref ( ) , AssetInfo . class ) ; } | Get the asset at the given link |
28,575 | public static DefaultListOperation < AssetInfo > list ( LinkInfo < AssetInfo > link ) { return new DefaultListOperation < AssetInfo > ( link . getHref ( ) , new GenericType < ListResult < AssetInfo > > ( ) { } ) ; } | Create an operation that will list all the assets at the given link . |
28,576 | 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 ) ; } | Link content key . |
28,577 | public static EntityUnlinkOperation unlinkContentKey ( String assetId , String contentKeyId ) { return new EntityUnlinkOperation ( ENTITY_SET , assetId , "ContentKeys" , contentKeyId ) ; } | unlink a content key . |
28,578 | 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 ) ; } | Link delivery policy |
28,579 | public static EntityUnlinkOperation unlinkDeliveryPolicy ( String assetId , String adpId ) { return new EntityUnlinkOperation ( ENTITY_SET , assetId , "DeliveryPolicies" , adpId ) ; } | unlink an asset delivery policy |
28,580 | public static JWEObject deserialize ( String json ) throws IOException { ObjectMapper mapper = new ObjectMapper ( ) ; return mapper . readValue ( json , JWEObject . class ) ; } | Construct JWEObject from json string . |
28,581 | public static TokenProvider createSharedAccessSignatureTokenProvider ( String sasKeyName , String sasKey ) { return new SharedAccessSignatureTokenProvider ( sasKeyName , sasKey , SecurityConstants . DEFAULT_SAS_TOKEN_VALIDITY_IN_SECONDS ) ; } | 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 . |
28,582 | 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 ) ; } | 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 . |
28,583 | public static TokenProvider createAzureActiveDirectoryTokenProvider ( String authorityUrl , String clientId , String clientSecret ) throws MalformedURLException { AuthenticationContext authContext = createAuthenticationContext ( authorityUrl ) ; return new AzureActiveDirectoryTokenProvider ( authContext , new ClientCredential ( clientId , clientSecret ) ) ; } | 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 . |
28,584 | public Mono < Response < ConfigurationSetting > > addSetting ( ConfigurationSetting setting ) { validateSetting ( setting ) ; return service . setKey ( serviceEndpoint , setting . key ( ) , setting . label ( ) , setting , null , getETagValue ( ETAG_ANY ) ) ; } | Adds a configuration value in the service if that key and label does not exist . The label value of the ConfigurationSetting is optional . |
28,585 | public Mono < Response < ConfigurationSetting > > setSetting ( ConfigurationSetting setting ) { validateSetting ( setting ) ; return service . setKey ( serviceEndpoint , setting . key ( ) , setting . label ( ) , setting , getETagValue ( setting . etag ( ) ) , null ) ; } | Creates or updates a configuration value in the service . Partial updates are not supported and the entire configuration setting is updated . |
28,586 | public Mono < Response < ConfigurationSetting > > updateSetting ( ConfigurationSetting setting ) { validateSetting ( setting ) ; String etag = setting . etag ( ) == null ? ETAG_ANY : setting . etag ( ) ; return service . setKey ( serviceEndpoint , setting . key ( ) , setting . label ( ) , setting , getETagValue ( etag ) , null ) ; } | Updates an existing configuration value in the service . The setting must already exist . Partial updates are not supported the entire configuration value is replaced . |
28,587 | 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 ( ) ; } | Generates a string that is logged in traces . Excludes secrets |
28,588 | public static Element getEnvelope ( SOAPMessage m ) { try { return m . getSOAPPart ( ) . getEnvelope ( ) ; } catch ( Exception e ) { throw S1SystemError . wrap ( e ) ; } } | Get envelope element quite |
28,589 | public static SOAPMessage createSoapFromStream ( Map < String , String > headers , InputStream is ) { return createSoapFromStream ( null , headers , is ) ; } | Create message from stream with headers |
28,590 | public static void validateMessage ( String basePath , Document wsdl , SOAPMessage msg ) throws XSDFormatException , XSDValidationException { LOG . debug ( "Validating message on WSDL" ) ; NodeList schemaNodes = wsdl . getElementsByTagNameNS ( XMLConstants . W3C_XML_SCHEMA_NS_URI , "schema" ) ; int nrSchemas = schemaNodes . getLength ( ) ; Source [ ] schemas = new Source [ nrSchemas ] ; for ( int i = 0 ; i < nrSchemas ; i ++ ) { schemas [ i ] = new DOMSource ( schemaNodes . item ( i ) ) ; } Element body = null ; try { body = msg . getSOAPBody ( ) ; } catch ( SOAPException e ) { throw S1SystemError . wrap ( e ) ; } if ( msg . getAttachments ( ) . hasNext ( ) ) { body = ( Element ) body . cloneNode ( true ) ; NodeList nl = body . getElementsByTagNameNS ( "http://www.w3.org/2004/08/xop/include" , "Include" ) ; for ( int i = 0 ; i < nl . getLength ( ) ; i ++ ) { Node n = nl . item ( i ) ; n . getParentNode ( ) . removeChild ( n ) ; } } for ( Element el : XMLFormat . getChildElementList ( body , null , null ) ) { XMLFormat . validate ( basePath , schemas , el ) ; } } | Validate message on wsdl |
28,591 | public static InputStream toInputStream ( SOAPMessage msg ) { if ( msg == null ) return null ; ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; try { msg . writeTo ( os ) ; } catch ( Exception e ) { throw S1SystemError . wrap ( e ) ; } return new ByteArrayInputStream ( os . toByteArray ( ) ) ; } | Write message with attachments to stream |
28,592 | public String joinWith ( String separator , Object ... join ) { return Joiner . on ( separator ) . join ( delegate . get ( ) , EMPTY , join ) ; } | Returns a new string that append the specified string to the delegate string with specified separator |
28,593 | public M update ( String asNewDelegate ) { this . delegate = Optional . of ( asNewDelegate ) ; updateHandle ( ) ; return THIS ( ) ; } | Update the given string as the new delegate string |
28,594 | public boolean containAll ( String ... containWith ) { for ( String contain : containWith ) { if ( ! contain ( contain ) ) { return false ; } } return true ; } | Checks if delegate string contains all string in the given string array |
28,595 | public boolean containsAll ( List < String > containWith ) { return containAll ( checkNotNull ( containWith ) . toArray ( new String [ containWith . size ( ) ] ) ) ; } | Checks if delegate string contains all string in the given string list |
28,596 | public boolean contains ( List < String > containWith ) { return contain ( checkNotNull ( containWith ) . toArray ( new String [ containWith . size ( ) ] ) ) ; } | Checks if delegate string contains any string in the given string list |
28,597 | public int indexs ( final Integer fromIndex , String ... indexWith ) { int index = INDEX_NONE_EXISTS ; final String target = ignoreCase ? delegate . get ( ) . toLowerCase ( ) : delegate . get ( ) ; for ( String input : indexWith ) { String target2 = ignoreCase ? input . toLowerCase ( ) : input ; if ( ( index = target . indexOf ( target2 , fromIndex ) ) >= 0 ) { return index ; } } return index ; } | Search delegate string to find the first index of any string in the given string list starting at the specified index |
28,598 | public static Map < String , Object > toMap ( LoggingEvent e ) { final Map < String , Object > m = Objects . newHashMap ( "name" , e . getLoggerName ( ) , "date" , new Date ( e . getTimeStamp ( ) ) , "level" , e . getLevel ( ) . toString ( ) , "thread" , e . getThreadName ( ) , "message" , "" + e . getMessage ( ) , "fileName" , e . getLocationInformation ( ) . getFileName ( ) , "methodName" , e . getLocationInformation ( ) . getMethodName ( ) , "lineNumber" , e . getLocationInformation ( ) . getLineNumber ( ) , "requestId" , e . getMDC ( "requestId" ) , "sessionId" , e . getMDC ( "sessionId" ) , "freeMemory" , Runtime . getRuntime ( ) . freeMemory ( ) , "throwable" , null ) ; if ( e . getThrowableInformation ( ) != null && e . getThrowableInformation ( ) . getThrowable ( ) != null ) { Throwable t = e . getThrowableInformation ( ) . getThrowable ( ) ; m . put ( "throwable" , Objects . newHashMap ( "message" , t . getMessage ( ) , "class" , t . getClass ( ) . getName ( ) , "stackTrace" , getStackTrace ( t ) ) ) ; } return m ; } | Convert logging event to map |
28,599 | public static Map < String , Object > getLogClasses ( ) { SortedMap < String , Object > loggers = new TreeMap < String , Object > ( ) ; Map < String , Object > res = Objects . newHashMap ( "level" , LogManager . getRootLogger ( ) . getLevel ( ) . toString ( ) . toUpperCase ( ) , "loggers" , loggers ) ; Enumeration < Category > en = LogManager . getCurrentLoggers ( ) ; while ( en . hasMoreElements ( ) ) { Category e = en . nextElement ( ) ; loggers . put ( e . getName ( ) , e . getEffectiveLevel ( ) . toString ( ) . toUpperCase ( ) ) ; } return res ; } | Get all log classes names |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.