From fcdd0878cd8e534218a5ce8529f7f89127c0680d Mon Sep 17 00:00:00 2001 From: Andre Sollie Date: Mon, 7 Aug 2017 08:35:08 +0200 Subject: [PATCH 01/31] - Fixing potentially for ever loop if something is in illegal state. Eg. Web app is stopped and some code tries to access classes that is on in classpath. --- .../internal/channel/common/TransmissionNetworkOutput.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java b/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java index 3476983fbcf..8824675d10a 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java +++ b/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java @@ -176,6 +176,9 @@ public boolean send(Transmission transmission) { if (ioe instanceof ConnectTimeoutException) { transmissionPolicyManager.suspendInSeconds(TransmissionPolicy.BLOCKED_BUT_CAN_BE_PERSISTED, DEFAULT_BACKOFF_TIME_SECONDS); } + } catch (IllegalStateException e) { + suspendTransmissions(TransmissionPolicy.BLOCKED_AND_CANNOT_BE_PERSISTED, response); + InternalLogger.INSTANCE.error("Failed to send, illegal state exception: %s", e.getMessage()); } catch (Exception e) { InternalLogger.INSTANCE.error("Failed to send, unexpected exception: %s", e.getMessage()); } catch (Throwable t) { From 2281a852025a71e2fc82ac25702634b1d3e26a0a Mon Sep 17 00:00:00 2001 From: Dmitry-Matveev Date: Tue, 15 Aug 2017 12:05:41 -0700 Subject: [PATCH 02/31] Increasing version number to 1.0.10 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 678f735831d..a300693b915 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ // Project properties -version=1.0.9 +version=1.0.10 group=com.microsoft.azure From 1e28bc373373ec53e969378d81f8402542d678e4 Mon Sep 17 00:00:00 2001 From: Dmitry-Matveev Date: Tue, 15 Aug 2017 15:33:55 -0700 Subject: [PATCH 03/31] Adding ThirdPartyNotices.txt --- ThirdPartyNotices.txt | 607 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 607 insertions(+) create mode 100644 ThirdPartyNotices.txt diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt new file mode 100644 index 00000000000..86bc21126d1 --- /dev/null +++ b/ThirdPartyNotices.txt @@ -0,0 +1,607 @@ +THIRD-PARTY SOFTWARE NOTICES AND INFORMATION +Do Not Translate or Localize + +Microsoft Application Insights Java Software Development Kit consists of material from the project(s) listed below (collectively, �Distributed Code�). Microsoft Corporation ("Microsoft") is not the original author of some of the Distributed Code. The original copyright notices and licenses, under which Microsoft received such Distributed Code, are set out below. This Distributed Code are licensed to you under their original license terms set forth below. Microsoft reserves all other rights not expressly granted under these terms, whether by implication, estoppel or otherwise. + +1. Apache Commons-codec version 1.9 (http://commons.apache.org/proper/commons-codec/download_codec.cgi) +2. Apache Commons Lang3 version 3.1 (http://commons.apache.org/proper/commons-lang/) +3. Apache Commons Logging version 1.2 (http://commons.apache.org/proper/commons-logging/) +4. Apache Commons-io version 2.4 (http://commons.apache.org/proper/commons-io/) +5. Apache HttpComponents Client version 4.5.3 (http://hc.apache.org/downloads.cgi) +6. Apache HttpComponents Core version 4.4.6 (http://hc.apache.org/downloads.cgi) +7. Application Insights SDK for Java version 0.9.6 (https://github.com/Microsoft/AppInsights-Java) +8. ASM version 5.0.3 (http://asm.ow2.org/) +9. ASM Commons version 5.0.3 (http://asm.ow2.org/) +10. Guava version 12.0.1 (http://code.google.com/p/guava-libraries/) +11. INFOMAS PCM Application Suite version 3.0.4 (https://github.com/rmuller/infomas-asl) +12. JSR-305 version 2.0.1 (http://code.google.com/p/jsr-305/) + +%% Apache Commons-codec NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2002-2013 The Apache Software Foundation +This product includes software developed at The Apache Software Foundation (http://www.apache.org/). + +src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java contains test data from http://aspell.net/test/orig/batch0.tab. +Copyright (c) 2002 Kevin Atkinson (kevina@gnu.org) + +/* + + * Licensed to the Apache Software Foundation (ASF) under one or more + + * contributor license agreements. See the NOTICE file distributed with + + * this work for additional information regarding copyright ownership. + + * The ASF licenses this file to You under the Apache License, Version 2.0 + + * (the "License"); you may not use this file except in compliance with + + * the License. You may obtain a copy of the License at + + * + + * http://www.apache.org/licenses/LICENSE-2.0 + + * + + * Unless required by applicable law or agreed to in writing, software + + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + + * See the License for the specific language governing permissions and + + * limitations under the License. + +*/ + +Apache License 2.0, January 2004 + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +1. Definitions. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1. You must give any other recipients of the Work or Derivative Works a copy of this License; and +2. You must cause any modified files to carry prominent notices stating that You changed the files; and +3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. +========================================= +END OF Apache Commons-codec NOTICES, INFORMATION, AND LICENSE + +%% Apache Commons Lang3 NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright � 2001-2014 The Apache Software Foundation +This product includes software developed at The Apache Software Foundation (http://www.apache.org/). +This product includes software from the Spring Framework, under the Apache License 2.0 (see: StringUtils.containsWhitespace()) + +Apache License 2.0, January 2004 + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +1. Definitions. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1. You must give any other recipients of the Work or Derivative Works a copy of this License; and +2. You must cause any modified files to carry prominent notices stating that You changed the files; and +3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. +========================================= +END OF Apache Commons Lang3 NOTICES, INFORMATION, AND LICENSE + +%% Apache Commons Logging NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2003-2007 The Apache Software Foundation +This product includes software developed by The Apache Software Foundation (http://www.apache.org/). + +/* + + * Licensed to the Apache Software Foundation (ASF) under one or more + + * contributor license agreements. See the NOTICE file distributed with + + * this work for additional information regarding copyright ownership. + + * The ASF licenses this file to You under the Apache License, Version 2.0 + + * (the "License"); you may not use this file except in compliance with + + * the License. You may obtain a copy of the License at + + * + + * http://www.apache.org/licenses/LICENSE-2.0 + + * + + * Unless required by applicable law or agreed to in writing, software + + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + + * See the License for the specific language governing permissions and + + * limitations under the License. + +*/ + +Apache License 2.0, January 2004 + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +1. Definitions. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1. You must give any other recipients of the Work or Derivative Works a copy of this License; and +2. You must cause any modified files to carry prominent notices stating that You changed the files; and +3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. +========================================= +END OF Apache Commons Logging NOTICES, INFORMATION, AND LICENSE + +%% Apache Commons-io NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2002-2012 The Apache Software Foundation +This product includes software developed by The Apache Software Foundation (http://www.apache.org/). + +Apache License 2.0, January 2004 + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +1. Definitions. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1. You must give any other recipients of the Work or Derivative Works a copy of this License; and +2. You must cause any modified files to carry prominent notices stating that You changed the files; and +3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +========================================= +END OF Apache Commons-io NOTICES, INFORMATION, AND LICENSE + +%% Apache HttpComponents Client NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 1999-2014 The Apache Software Foundation +This product includes software developed at The Apache Software Foundation (http://www.apache.org/). + +/* + * ==================================================================== + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + */ + +Apache License 2.0, January 2004 + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +1. Definitions. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1. You must give any other recipients of the Work or Derivative Works a copy of this License; and +2. You must cause any modified files to carry prominent notices stating that You changed the files; and +3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +========================================= +END OF Apache HttpComponents Client NOTICES, INFORMATION, AND LICENSE + +%% Apache HttpComponents Core NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright 2005-2014 The Apache Software Foundation +This product includes software developed at The Apache Software Foundation (http://www.apache.org/). +This project contains annotations derived from JCIP-ANNOTATIONS +Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net + +/* + * ==================================================================== + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + */ + +Apache License 2.0, January 2004 + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +1. Definitions. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1. You must give any other recipients of the Work or Derivative Works a copy of this License; and +2. You must cause any modified files to carry prominent notices stating that You changed the files; and +3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +========================================= +END OF Apache HttpComponents Core NOTICES, INFORMATION, AND LICENSE + +%% Application Insights SDK for Java NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Microsoft Corporation All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +========================================= +END OF Application Insights SDK for Java NOTICES, INFORMATION, AND LICENSE + +%% ASM NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2000-2011 INRIA, France Telecom +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. +========================================= +END OF ASM NOTICES, INFORMATION, AND LICENSE + +%% ASM Commons NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2000-2011 INRIA, France Telecom +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. +========================================= +END OF ASM Commons NOTICES, INFORMATION, AND LICENSE + +%% Guava NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) The Guava Authors + +Apache License 2.0, January 2004 + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +1. Definitions. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1. You must give any other recipients of the Work or Derivative Works a copy of this License; and +2. You must cause any modified files to carry prominent notices stating that You changed the files; and +3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +========================================= +END OF Guava NOTICES, INFORMATION, AND LICENSE + +%% INFOMAS PCM Application Suite NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2011 - 2014 XIAM Solutions B.V. + +Apache License 2.0, January 2004 + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +1. Definitions. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1. You must give any other recipients of the Work or Derivative Works a copy of this License; and +2. You must cause any modified files to carry prominent notices stating that You changed the files; and +3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +========================================= +END OF INFOMAS PCM Application Suite NOTICES, INFORMATION, AND LICENSE + +%% JSR-305 NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Copyright (c) 2007-2009, JSR305 expert group +All rights reserved. + +http://www.opensource.org/licenses/bsd-license.php + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the JSR305 expert group nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +========================================= +END OF JSR-305 NOTICES, INFORMATION, AND LICENSE + + +%% Apache Avalon LogKit NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +/* + + ============================================================================ + The Apache Software License, Version 1.1 + ============================================================================ + + Copyright (C) 1997-2003 The Apache Software Foundation. All rights reserved. + + Redistribution and use in source and binary forms, with or without modifica- + tion, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + 3. The end-user documentation included with the redistribution, if any, must + include the following acknowledgment: "This product includes software + developed by the Apache Software Foundation (http://www.apache.org/)." + Alternately, this acknowledgment may appear in the software itself, if + and wherever such third-party acknowledgments normally appear. + + 4. The names "LogKit", "Jakarta" and "Apache Software Foundation" must not + be used to endorse or promote products derived from this software without + prior written permission. For written permission, please contact + apache@apache.org. + + 5. Products derived from this software may not be called "Apache", nor may + "Apache" appear in their name, without prior written permission of the + Apache Software Foundation. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + This software consists of voluntary contributions made by many individuals + on behalf of the Apache Software Foundation. For more information on the + Apache Software Foundation, please see . + +*/ +========================================= +END OF Apache Avalon LogKit NOTICES, INFORMATION, AND LICENSE + + +%% File with code "[b]ased on" libc crypt C implementation from Poul-Henning Kamp + (commons-codec v1.9) NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp + * ---------------------------------------------------------------------------- + */ +========================================= +END OF LogKit NOTICES, INFORMATION, AND LICENSE \ No newline at end of file From 958eee5dabe9439b381529a0b2c39417404999e0 Mon Sep 17 00:00:00 2001 From: Dmitry-Matveev Date: Tue, 15 Aug 2017 16:02:35 -0700 Subject: [PATCH 04/31] Addressing comments in TPN.txt --- ThirdPartyNotices.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index 86bc21126d1..3107aaf4765 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -1,7 +1,7 @@ THIRD-PARTY SOFTWARE NOTICES AND INFORMATION Do Not Translate or Localize -Microsoft Application Insights Java Software Development Kit consists of material from the project(s) listed below (collectively, �Distributed Code�). Microsoft Corporation ("Microsoft") is not the original author of some of the Distributed Code. The original copyright notices and licenses, under which Microsoft received such Distributed Code, are set out below. This Distributed Code are licensed to you under their original license terms set forth below. Microsoft reserves all other rights not expressly granted under these terms, whether by implication, estoppel or otherwise. +Microsoft Application Insights Java Software Development Kit consists of material from the project(s) listed below (collectively, "Distributed Code"). Microsoft Corporation ("Microsoft") is not the original author of some of the Distributed Code. The original copyright notices and licenses, under which Microsoft received such Distributed Code, are set out below. This Distributed Code are licensed to you under their original license terms set forth below. Microsoft reserves all other rights not expressly granted under these terms, whether by implication, estoppel or otherwise. 1. Apache Commons-codec version 1.9 (http://commons.apache.org/proper/commons-codec/download_codec.cgi) 2. Apache Commons Lang3 version 3.1 (http://commons.apache.org/proper/commons-lang/) @@ -87,7 +87,7 @@ END OF Apache Commons-codec NOTICES, INFORMATION, AND LICENSE %% Apache Commons Lang3 NOTICES, INFORMATION, AND LICENSE BEGIN HERE ========================================= -Copyright � 2001-2014 The Apache Software Foundation +Copyright (c) 2001-2014 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). This product includes software from the Spring Framework, under the Apache License 2.0 (see: StringUtils.containsWhitespace()) From d7959b69debcde67b58b54ac96c6ec57cb94e802 Mon Sep 17 00:00:00 2001 From: Adnan Yaqoob Date: Sat, 19 Aug 2017 18:57:13 +0800 Subject: [PATCH 05/31] fixes custom timestamp bug Do not set telemetry timestamp if it already exists --- .../com/microsoft/applicationinsights/TelemetryClient.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/microsoft/applicationinsights/TelemetryClient.java b/core/src/main/java/com/microsoft/applicationinsights/TelemetryClient.java index 988a5ba21e7..80173d18260 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/TelemetryClient.java +++ b/core/src/main/java/com/microsoft/applicationinsights/TelemetryClient.java @@ -394,7 +394,9 @@ public void track(Telemetry telemetry) { return; } - telemetry.setTimestamp(new Date()); + if (telemetry.getTimestamp() == null) { + telemetry.setTimestamp(new Date()); + } TelemetryContext ctx = this.getContext(); From 6483a3cb65d41892c357eaa9a2bf624d59ae23d9 Mon Sep 17 00:00:00 2001 From: Clemens Wolff Date: Mon, 21 Aug 2017 09:10:20 -0700 Subject: [PATCH 06/31] Add second environment variable to configure ikey None of the other SDKs use the `APPLICATION_INSIGHTS_IKEY` environment variable to configure the instrumentation key for Application Insights and instead use `APPINSIGHTS_INSTRUMENTATIONKEY`. For consistency with the other SDKs (e.g. Dot-Net https://aka.ms/n2ruy1 or Node https://aka.ms/v8r0pk) this Java SDK should also support the more common environment variable name to avoid confusion for developers who have experience with the non-Java SDKs. --- .../config/TelemetryConfigurationFactory.java | 22 ++++++++++++++----- .../TelemetryConfigurationFactoryTest.java | 11 ++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/microsoft/applicationinsights/internal/config/TelemetryConfigurationFactory.java b/core/src/main/java/com/microsoft/applicationinsights/internal/config/TelemetryConfigurationFactory.java index 1747dcfde4d..927b4c1d926 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/internal/config/TelemetryConfigurationFactory.java +++ b/core/src/main/java/com/microsoft/applicationinsights/internal/config/TelemetryConfigurationFactory.java @@ -60,6 +60,7 @@ public enum TelemetryConfigurationFactory { private String performanceCountersSection = DEFAULT_PERFORMANCE_MODULES_PACKAGE; final static String EXTERNAL_PROPERTY_IKEY_NAME = "APPLICATION_INSIGHTS_IKEY"; + final static String EXTERNAL_PROPERTY_IKEY_NAME_SECONDARY = "APPINSIGHTS_INSTRUMENTATIONKEY"; private AppInsightsConfigurationBuilder builder = new JaxbAppInsightsConfigurationBuilder(); @@ -208,28 +209,39 @@ private void setTelemetryProcessors(ApplicationInsightsXmlConfiguration appConfi /** * Setting an instrumentation key: - * First we try the system property '-DAPPLICATION_INSIGHTS_IKEY=i_key' - * Next we will try the environment variable 'APPLICATION_INSIGHTS_IKEY', + * First we try the system property '-DAPPLICATION_INSIGHTS_IKEY=i_key' or '-DAPPINSIGHTS_INSTRUMENTATIONKEY=i_key' + * Next we will try the environment variable 'APPLICATION_INSIGHTS_IKEY' or 'APPINSIGHTS_INSTRUMENTATIONKEY' * Next we will try to fetch the i-key from the ApplicationInsights.xml * @param userConfiguration The configuration that was represents the user's configuration in ApplicationInsights.xml. * @param configuration The configuration class. */ private void setInstrumentationKey(ApplicationInsightsXmlConfiguration userConfiguration, TelemetryConfiguration configuration) { try { - // First, check whether an i-key was provided as a java system property i.e. '-DAPPLICATION_INSIGHTS_IKEY=i_key' - String ikey = System.getProperty(EXTERNAL_PROPERTY_IKEY_NAME); + String ikey; + // First, check whether an i-key was provided as a java system property i.e. '-DAPPLICATION_INSIGHTS_IKEY=i_key', or '-DAPPINSIGHTS_INSTRUMENTATIONKEY=i_key' + ikey = System.getProperty(EXTERNAL_PROPERTY_IKEY_NAME); + if (!Strings.isNullOrEmpty(ikey)) { + configuration.setInstrumentationKey(ikey); + return; + } + ikey = System.getProperty(EXTERNAL_PROPERTY_IKEY_NAME_SECONDARY); if (!Strings.isNullOrEmpty(ikey)) { configuration.setInstrumentationKey(ikey); return; } - // Second, try to find the i-key as an environment variable 'APPLICATION_INSIGHTS_IKEY' + // Second, try to find the i-key as an environment variable 'APPLICATION_INSIGHTS_IKEY' or 'APPINSIGHTS_INSTRUMENTATIONKEY' ikey = System.getenv(EXTERNAL_PROPERTY_IKEY_NAME); if (!Strings.isNullOrEmpty(ikey)) { configuration.setInstrumentationKey(ikey); return; } + ikey = System.getenv(EXTERNAL_PROPERTY_IKEY_NAME_SECONDARY); + if (!Strings.isNullOrEmpty(ikey)) { + configuration.setInstrumentationKey(ikey); + return; + } // Else, try to find the i-key in ApplicationInsights.xml if (userConfiguration != null) { diff --git a/core/src/test/java/com/microsoft/applicationinsights/internal/config/TelemetryConfigurationFactoryTest.java b/core/src/test/java/com/microsoft/applicationinsights/internal/config/TelemetryConfigurationFactoryTest.java index e0243cca92c..d44037b4637 100644 --- a/core/src/test/java/com/microsoft/applicationinsights/internal/config/TelemetryConfigurationFactoryTest.java +++ b/core/src/test/java/com/microsoft/applicationinsights/internal/config/TelemetryConfigurationFactoryTest.java @@ -117,6 +117,17 @@ public void systemPropertyIKeyBeforeConfigurationIKeyTest() { } } + @Test + public void systemPropertyIKeySecondaryBeforeConfigurationIKeyTest() { + try { + System.setProperty(TelemetryConfigurationFactory.EXTERNAL_PROPERTY_IKEY_NAME_SECONDARY, APP_INSIGHTS_IKEY_TEST_VALUE); + ikeyTest(MOCK_IKEY, APP_INSIGHTS_IKEY_TEST_VALUE); + } finally { + // Avoid any influence on other unit tests + System.getProperties().remove(TelemetryConfigurationFactory.EXTERNAL_PROPERTY_IKEY_NAME_SECONDARY); + } + } + @Test public void testWithEmptySections() { AppInsightsConfigurationBuilder mockParser = Mockito.mock(AppInsightsConfigurationBuilder.class); From 27ad0a32ab7b473b95085ce9d98b6a9623f050d3 Mon Sep 17 00:00:00 2001 From: Clemens Wolff Date: Mon, 21 Aug 2017 12:48:55 -0700 Subject: [PATCH 07/31] Fix header markdown for rendering on Github --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1ffecdb33b..0a435280e40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -#CHANGELOG +# CHANGELOG ## Version 1.0.10 - Schema updated to the latest version. Changes in internal namespace `core/src/main/java/com/microsoft/applicationinsights/internal/schemav2`. From 83bb6357eceed9dfb313e13c1d2a154c81112422 Mon Sep 17 00:00:00 2001 From: Clemens Wolff Date: Mon, 21 Aug 2017 12:49:23 -0700 Subject: [PATCH 08/31] Add changelog entry for new environment variable --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a435280e40..ae456cbc21c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Methods `getExceptionHandledAt` and `setExceptionHandledAt` of `ExceptionTelemetry` marked obsolete and do not do anything. - Obsolete methods of `RemoteDependencyTelemetry`: `getCount`, `setCount`, `getMin`, `setMin`, `getMax`, `setMax`, `getStdDev`, `setStdDev`, `getDependencyKind`, `setDependencyKind`, `getAsync`, `setAsync`, `getDependencySource`, `setDependencySource`. - Obsolete methods of `RequestTelemetry`: `getHttpMethod`, `setHttpMethod`. +- Add option to configure instrumentation key via `APPINSIGHTS_INSTRUMENTATIONKEY` environment variable for consistency with other SDKs. ## Version 1.0.9 - Fix the issue of infinite retry and connection drain on certificate error by updating the version of http client packaged with the SDK. From e9118acfc4cea8e382810648148f3ede2389a91c Mon Sep 17 00:00:00 2001 From: Adnan Yaqoob Date: Tue, 22 Aug 2017 13:37:19 +0800 Subject: [PATCH 09/31] adds custom telemetry timestamp test --- .../applicationinsights/TelemetryClientTests.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/test/java/com/microsoft/applicationinsights/TelemetryClientTests.java b/core/src/test/java/com/microsoft/applicationinsights/TelemetryClientTests.java index 43a83d18e4e..0727f16b928 100644 --- a/core/src/test/java/com/microsoft/applicationinsights/TelemetryClientTests.java +++ b/core/src/test/java/com/microsoft/applicationinsights/TelemetryClientTests.java @@ -381,6 +381,15 @@ public void testTrackPageViewWithPageViewTelemetry() { verifyAndGetLastEventSent(); } + @Test + public void testTrackWithCustomTelemetryTimestamp() { + Date timestamp = new Date(10000); + client.track(new RequestTelemetry("Name", timestamp, 1, "200", true)); + + Telemetry telemetry = verifyAndGetLastEventSent(); + assertEquals(telemetry.getTimestamp(), timestamp); + } + @Test public void testTrack() { TraceTelemetry telemetry = new TraceTelemetry("test"); From a0e8f435a9be2c0e40af8429e44bf41e5041196c Mon Sep 17 00:00:00 2001 From: Dmitry-Matveev Date: Tue, 22 Aug 2017 14:30:50 -0700 Subject: [PATCH 10/31] Update ChangeLog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae456cbc21c..9ef53d6bdcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Obsolete methods of `RemoteDependencyTelemetry`: `getCount`, `setCount`, `getMin`, `setMin`, `getMax`, `setMax`, `getStdDev`, `setStdDev`, `getDependencyKind`, `setDependencyKind`, `getAsync`, `setAsync`, `getDependencySource`, `setDependencySource`. - Obsolete methods of `RequestTelemetry`: `getHttpMethod`, `setHttpMethod`. - Add option to configure instrumentation key via `APPINSIGHTS_INSTRUMENTATIONKEY` environment variable for consistency with other SDKs. +- Fix the issue where `track(...)` of `TelemetryClient` class was overwriting the provided telemetry timestamp. ## Version 1.0.9 - Fix the issue of infinite retry and connection drain on certificate error by updating the version of http client packaged with the SDK. From 2559a4c0e85d0f58f634006aae5f52e16208c5a4 Mon Sep 17 00:00:00 2001 From: Andre Sollie Date: Wed, 23 Aug 2017 07:20:40 +0200 Subject: [PATCH 11/31] Just shutting down the transmissing when a illegal state exception occure. --- .../internal/channel/common/TransmissionNetworkOutput.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java b/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java index 8824675d10a..f76e2d9e9e3 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java +++ b/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java @@ -66,6 +66,7 @@ public final class TransmissionNetworkOutput implements TransmissionOutput { private final static String DEFAULT_SERVER_URI = "https://dc.services.visualstudio.com/v2/track"; private final static int DEFAULT_BACKOFF_TIME_SECONDS = 300; + private final static long SHUTDOWN_TIME = 1L; // For future use: re-send a failed transmission back to the dispatcher private TransmissionDispatcher transmissionDispatcher; @@ -177,7 +178,7 @@ public boolean send(Transmission transmission) { transmissionPolicyManager.suspendInSeconds(TransmissionPolicy.BLOCKED_BUT_CAN_BE_PERSISTED, DEFAULT_BACKOFF_TIME_SECONDS); } } catch (IllegalStateException e) { - suspendTransmissions(TransmissionPolicy.BLOCKED_AND_CANNOT_BE_PERSISTED, response); + transmissionPolicyManager.stop(SHUTDOWN_TIME, TimeUnit.SECONDS); InternalLogger.INSTANCE.error("Failed to send, illegal state exception: %s", e.getMessage()); } catch (Exception e) { InternalLogger.INSTANCE.error("Failed to send, unexpected exception: %s", e.getMessage()); From 4dcc3e7e37446ebe173b784600651dc71b8aff84 Mon Sep 17 00:00:00 2001 From: Andre Sollie Date: Thu, 24 Aug 2017 10:25:09 +0200 Subject: [PATCH 12/31] If a IllegalStateException occurs, we need to suspend. App will most likely not recover. This will prevent forever loop. --- .../internal/channel/common/TransmissionNetworkOutput.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java b/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java index f76e2d9e9e3..81b0d6be0ed 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java +++ b/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java @@ -66,7 +66,9 @@ public final class TransmissionNetworkOutput implements TransmissionOutput { private final static String DEFAULT_SERVER_URI = "https://dc.services.visualstudio.com/v2/track"; private final static int DEFAULT_BACKOFF_TIME_SECONDS = 300; - private final static long SHUTDOWN_TIME = 1L; + + // Back of fast if we most likely will recover and the consequences is big. + private final static int CRITICAL_BACKOFF_TIME_SECONDS = 30; // For future use: re-send a failed transmission back to the dispatcher private TransmissionDispatcher transmissionDispatcher; @@ -178,8 +180,8 @@ public boolean send(Transmission transmission) { transmissionPolicyManager.suspendInSeconds(TransmissionPolicy.BLOCKED_BUT_CAN_BE_PERSISTED, DEFAULT_BACKOFF_TIME_SECONDS); } } catch (IllegalStateException e) { - transmissionPolicyManager.stop(SHUTDOWN_TIME, TimeUnit.SECONDS); InternalLogger.INSTANCE.error("Failed to send, illegal state exception: %s", e.getMessage()); + transmissionPolicyManager.suspendInSeconds(TransmissionPolicy.BLOCKED_BUT_CAN_BE_PERSISTED, CRITICAL_BACKOFF_TIME_SECONDS); } catch (Exception e) { InternalLogger.INSTANCE.error("Failed to send, unexpected exception: %s", e.getMessage()); } catch (Throwable t) { From 2aa19f993c79edbd0555f43569be9837ec2f2ffb Mon Sep 17 00:00:00 2001 From: dhaval24 Date: Thu, 24 Aug 2017 11:28:19 -0700 Subject: [PATCH 13/31] Reverting remove null check in setSampleRate() --- .../applicationinsights/internal/schemav2/Envelope.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/microsoft/applicationinsights/internal/schemav2/Envelope.java b/core/src/main/java/com/microsoft/applicationinsights/internal/schemav2/Envelope.java index 82b8b3ca40d..c452c0daec6 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/internal/schemav2/Envelope.java +++ b/core/src/main/java/com/microsoft/applicationinsights/internal/schemav2/Envelope.java @@ -139,8 +139,11 @@ public double getSampleRate() { /** * Sets the SampleRate property. */ - public void setSampleRate(double value) { - this.sampleRate = value; + public void setSampleRate(Double value) { + if (value != null) { + this.sampleRate = value; + } + } /** From 2fcfc95f06c608b244a63ee6ec845ba128213671 Mon Sep 17 00:00:00 2001 From: dhaval24 Date: Thu, 24 Aug 2017 11:29:53 -0700 Subject: [PATCH 14/31] fixing duration write method --- .../telemetry/JsonTelemetryDataSerializer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java b/core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java index 305b7e67fa2..e431195b6ee 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java +++ b/core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java @@ -69,7 +69,7 @@ public void close() throws IOException { public void write(String name, Duration value) throws IOException { writeName(name); - out.write(String.valueOf(value)); + write(String.valueOf(value)); separator = JSON_SEPARATOR; } From 7d02375dfa258b3b9c7d84f0ae5fb833720b06fc Mon Sep 17 00:00:00 2001 From: Dhaval Doshi Date: Thu, 24 Aug 2017 11:35:52 -0700 Subject: [PATCH 15/31] Updating readme for fixing telemetry pushing issue --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae456cbc21c..bf8c540d0b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # CHANGELOG ## Version 1.0.10 +- Fixed Request Telemetry Sending bug with new schema - Schema updated to the latest version. Changes in internal namespace `core/src/main/java/com/microsoft/applicationinsights/internal/schemav2`. - Class `SendableData` in internal namespace deleted. - Class `com.microsoft.applicationinsights.telemetry.BaseSampleSourceTelemetry` takes generic class qualifier `Domain` instead of `SendableData`. From 70eb0d2b2d2c1b2b9554b44ba74e1d9b8ff851f5 Mon Sep 17 00:00:00 2001 From: dhaval24 Date: Thu, 24 Aug 2017 12:59:38 -0700 Subject: [PATCH 16/31] update null check location --- .../applicationinsights/internal/schemav2/Envelope.java | 5 +---- .../telemetry/BaseSampleSourceTelemetry.java | 4 +++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/microsoft/applicationinsights/internal/schemav2/Envelope.java b/core/src/main/java/com/microsoft/applicationinsights/internal/schemav2/Envelope.java index c452c0daec6..e3862f63fae 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/internal/schemav2/Envelope.java +++ b/core/src/main/java/com/microsoft/applicationinsights/internal/schemav2/Envelope.java @@ -139,11 +139,8 @@ public double getSampleRate() { /** * Sets the SampleRate property. */ - public void setSampleRate(Double value) { - if (value != null) { + public void setSampleRate(double value) { this.sampleRate = value; - } - } /** diff --git a/core/src/main/java/com/microsoft/applicationinsights/telemetry/BaseSampleSourceTelemetry.java b/core/src/main/java/com/microsoft/applicationinsights/telemetry/BaseSampleSourceTelemetry.java index ed59c9c8adb..c7651f47d57 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/telemetry/BaseSampleSourceTelemetry.java +++ b/core/src/main/java/com/microsoft/applicationinsights/telemetry/BaseSampleSourceTelemetry.java @@ -17,6 +17,8 @@ public void reset() { @Override protected void setSampleRate(Envelope envelope) { Double currentSP = getSamplingPercentage(); - envelope.setSampleRate(currentSP); + if (currentSP != null) { + envelope.setSampleRate(currentSP); + } } } From ca0a6a787a8a1ec3021fcfc8b2a24faa8092b1a7 Mon Sep 17 00:00:00 2001 From: leantk Date: Thu, 7 Sep 2017 10:36:35 -0400 Subject: [PATCH 17/31] Delay retrying to send telemetry if an exception is hit --- .../common/TransmissionNetworkOutput.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java b/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java index 3476983fbcf..05957f6db11 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java +++ b/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java @@ -135,6 +135,7 @@ public boolean send(Transmission transmission) { HttpResponse response = null; HttpPost request = null; + boolean shouldBackoff = false; try { request = createTransmissionPostRequest(transmission); httpClient.enhanceRequest(request); @@ -160,32 +161,32 @@ public boolean send(Transmission transmission) { } } catch (ConnectionPoolTimeoutException e) { InternalLogger.INSTANCE.error("Failed to send, connection pool timeout exception"); + shouldBackoff = true; } catch (SocketException e) { InternalLogger.INSTANCE.error("Failed to send, socket timeout exception"); - // backoff retry if no connection is found - if (e instanceof ConnectException) { - transmissionPolicyManager.suspendInSeconds(TransmissionPolicy.BLOCKED_BUT_CAN_BE_PERSISTED, DEFAULT_BACKOFF_TIME_SECONDS); - } + shouldBackoff = true; } catch (UnknownHostException e) { InternalLogger.INSTANCE.error("Failed to send, wrong host address or cannot reach address due to network issues, exception: %s", e.getMessage()); - // backoff retry if host unknown - transmissionPolicyManager.suspendInSeconds(TransmissionPolicy.BLOCKED_BUT_CAN_BE_PERSISTED, DEFAULT_BACKOFF_TIME_SECONDS); + shouldBackoff = true; } catch (IOException ioe) { InternalLogger.INSTANCE.error("Failed to send, exception: %s", ioe.getMessage()); - // backoff retry if no connection is found - if (ioe instanceof ConnectTimeoutException) { - transmissionPolicyManager.suspendInSeconds(TransmissionPolicy.BLOCKED_BUT_CAN_BE_PERSISTED, DEFAULT_BACKOFF_TIME_SECONDS); - } + shouldBackoff = true; } catch (Exception e) { InternalLogger.INSTANCE.error("Failed to send, unexpected exception: %s", e.getMessage()); + shouldBackoff = true; } catch (Throwable t) { InternalLogger.INSTANCE.error("Failed to send, unexpected error: %s", t.getMessage()); + shouldBackoff = true; } finally { if (request != null) { request.releaseConnection(); } httpClient.dispose(response); + // backoff before trying again + if (shouldBackoff) { + transmissionPolicyManager.suspendInSeconds(TransmissionPolicy.BLOCKED_BUT_CAN_BE_PERSISTED, DEFAULT_BACKOFF_TIME_SECONDS); + } } } From cab4ab24a86b2a6a98f53b79ac4694c6e231567a Mon Sep 17 00:00:00 2001 From: dhaval24 Date: Sun, 10 Sep 2017 14:36:05 -0700 Subject: [PATCH 18/31] Fixing custom event sending bug --- CHANGELOG.md | 5 +- .../common/SanitizationUtils.java | 54 +++++++++++++++++++ .../JsonTelemetryDataSerializer.java | 4 +- 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 core/src/main/java/com/microsoft/applicationinsights/common/SanitizationUtils.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 25626cc984e..cee59600167 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ # CHANGELOG ## Version 1.0.10 -- Fixed Request Telemetry Sending bug with new schema +- Fix issue of sending custom event. +- Method `sanitizeStringForJSON` takes string input and converts it to JSON friendly string. +- Class `com.microsoft.applicationinsights.common.SanitizationUtils` has methods to sanitize string for JSON. +- Fixed Request Telemetry Sending bug with new schema. - Schema updated to the latest version. Changes in internal namespace `core/src/main/java/com/microsoft/applicationinsights/internal/schemav2`. - Class `SendableData` in internal namespace deleted. - Class `com.microsoft.applicationinsights.telemetry.BaseSampleSourceTelemetry` takes generic class qualifier `Domain` instead of `SendableData`. diff --git a/core/src/main/java/com/microsoft/applicationinsights/common/SanitizationUtils.java b/core/src/main/java/com/microsoft/applicationinsights/common/SanitizationUtils.java new file mode 100644 index 00000000000..b6b58eacf67 --- /dev/null +++ b/core/src/main/java/com/microsoft/applicationinsights/common/SanitizationUtils.java @@ -0,0 +1,54 @@ +package com.microsoft.applicationinsights.common; + +import java.text.StringCharacterIterator; + +/** + * Created by dhdoshi on 09/10/2017 + * + * This class provides utility functions to sanitize strings + * for various formats. Currently it supports JSON sanitization + */ +public final class SanitizationUtils { + + /** + * This method appends escape characters to input String to prevent + * JSON Sanitization failure + * @param text + * @return Sanitized String suitable for JSON + */ + public static String sanitizeStringForJSON(String text) { + + final StringBuilder result = new StringBuilder(); + StringCharacterIterator iterator = new StringCharacterIterator(text); + for (char curr = iterator.current(); curr != iterator.DONE; curr = iterator.next()) { + if( curr == '\"' ){ + result.append("\\\""); + } + else if(curr == '\\'){ + result.append("\\\\"); + } + else if(curr == '/'){ + result.append("\\/"); + } + else if(curr == '\b'){ + result.append("\\b"); + } + else if(curr == '\f'){ + result.append("\\f"); + } + else if(curr == '\n'){ + result.append("\\n"); + } + else if(curr == '\r'){ + result.append("\\r"); + } + else if(curr == '\t'){ + result.append("\\t"); + } + else { + result.append(curr); + } + } + return result.toString(); + } +} diff --git a/core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java b/core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java index e431195b6ee..98a2cea09c0 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java +++ b/core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java @@ -29,6 +29,7 @@ import com.google.common.base.Strings; +import com.microsoft.applicationinsights.common.SanitizationUtils; import com.microsoft.applicationinsights.internal.schemav2.*; import com.microsoft.applicationinsights.internal.util.LocalStringsUtils; @@ -273,8 +274,9 @@ private void write(T item) throws IOException { { out.write(String.valueOf(item)); } else { + String sanitizedItem = SanitizationUtils.sanitizeStringForJSON(String.valueOf(item)); out.write(JSON_COMMA); - out.write(String.valueOf(item)); + out.write(sanitizedItem); out.write(JSON_COMMA); } } From 1f0805a6c410d3ac379aca8f9178985ac15b8ae5 Mon Sep 17 00:00:00 2001 From: dhaval24 Date: Sun, 10 Sep 2017 14:36:55 -0700 Subject: [PATCH 19/31] adding test case for sanitization --- .../common/SanitizationUtilsTests.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java diff --git a/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java b/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java new file mode 100644 index 00000000000..ec9692dbccb --- /dev/null +++ b/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java @@ -0,0 +1,13 @@ +package com.microsoft.applicationinsights.common; + +import org.junit.Assert; +import org.junit.Test; + +public class SanitizationUtilsTests { + + @Test + public void testSanitizeStringForJSON() { + String result = SanitizationUtils.sanitizeStringForJSON("{\"entityType\":\"CONTACTNAME\",\"contactField\":\"\",\"query\":\"zuck\",\"candidates\":[{\"id\":\"2\",\"name\":\"Andrew Zuck\",\"aliases\":[],\"phoneNumbers\":[{\"type\":\"MOBILENUMBER\",\"number\":\"+1 (555) 222-2222\"}],\"emailAddresses\":[],\"streetAddresses\":[]}],\"scores\":{\"2\":2.327993297520463}}"); + Assert.assertEquals(result, "{\\\"entityType\\\":\\\"CONTACTNAME\\\",\\\"contactField\\\":\\\"\\\",\\\"query\\\":\\\"zuck\\\",\\\"candidates\\\":[{\\\"id\\\":\\\"2\\\",\\\"name\\\":\\\"Andrew Zuck\\\",\\\"aliases\\\":[],\\\"phoneNumbers\\\":[{\\\"type\\\":\\\"MOBILENUMBER\\\",\\\"number\\\":\\\"+1 (555) 222-2222\\\"}],\\\"emailAddresses\\\":[],\\\"streetAddresses\\\":[]}],\\\"scores\\\":{\\\"2\\\":2.327993297520463}}"); + } +} From 46fc0e4d015dfe5d727536755baaf22a6a4eb8f3 Mon Sep 17 00:00:00 2001 From: Gustavo Lima Date: Tue, 12 Sep 2017 10:35:08 -0700 Subject: [PATCH 20/31] Fixing reliability issue with JedisMethodVisitor. (#423) * Jedis Visitor Changes * Hooking up Jedis visitor * remove printstack * Update changelog * fixed typo --- CHANGELOG.md | 1 + .../internal/agent/DefaultMethodVisitor.java | 30 ++++++++-- .../agent/redis/JedisClassDataProvider.java | 4 +- .../agent/redis/JedisMethodVisitor.java | 3 + .../agent/redis/JedisMethodVisitorV2.java | 55 +++++++++++++++++++ .../coresync/AgentNotificationsHandler.java | 6 ++ .../coresync/InstrumentedClassType.java | 3 +- .../impl/ImplementationsCoordinator.java | 11 ++++ .../agent/CoreAgentNotificationsHandler.java | 10 ++++ 9 files changed, 115 insertions(+), 8 deletions(-) create mode 100644 agent/src/main/java/com/microsoft/applicationinsights/agent/internal/agent/redis/JedisMethodVisitorV2.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 25626cc984e..fea7bbf10d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # CHANGELOG ## Version 1.0.10 +- Fixed reliability issue with Jedis client dependency collector - Fixed Request Telemetry Sending bug with new schema - Schema updated to the latest version. Changes in internal namespace `core/src/main/java/com/microsoft/applicationinsights/internal/schemav2`. - Class `SendableData` in internal namespace deleted. diff --git a/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/agent/DefaultMethodVisitor.java b/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/agent/DefaultMethodVisitor.java index c33316168e6..c063942166b 100644 --- a/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/agent/DefaultMethodVisitor.java +++ b/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/agent/DefaultMethodVisitor.java @@ -86,11 +86,11 @@ public DefaultMethodVisitor(MethodInstrumentationDecision decision, protected void byteCodeForMethodExit(int opcode) { Object[] args = null; - String methodSignature = FINISH_METHOD_DEFAULT_SIGNATURE; + String methodSignature = getOnExitMethodDefaultSignature(); switch (translateExitCode(opcode)) { case EXIT_WITH_EXCEPTION: args = new Object[] { getMethodName(), duplicateTopStackToTempVariable(Type.getType(Throwable.class)) }; - methodSignature = FINISH_METHOD_EXCEPTION_SIGNATURE; + methodSignature = getOnExitMethodExceptionSignature(); break; case EXIT_WITH_RETURN_VALUE: @@ -103,7 +103,7 @@ protected void byteCodeForMethodExit(int opcode) { } if (args != null) { - activateEnumMethod(ImplementationsCoordinator.class, FINISH_DETECT_METHOD_NAME, methodSignature, args); + activateEnumMethod(ImplementationsCoordinator.class, getOnExitMethodName(), methodSignature, args); } } @@ -143,8 +143,28 @@ protected void onMethodEnter() { activateEnumMethod( ImplementationsCoordinator.class, - START_DETECT_METHOD_NAME, - START_DETECT_METHOD_SIGNATURE, + getOnEnterMethodName(), + getOnEnterMethodSignature(), getMethodName()); } + + protected String getOnEnterMethodName() { + return START_DETECT_METHOD_NAME; + } + + protected String getOnEnterMethodSignature() { + return START_DETECT_METHOD_SIGNATURE; + } + + protected String getOnExitMethodName() { + return FINISH_DETECT_METHOD_NAME; + } + + protected String getOnExitMethodDefaultSignature() { + return FINISH_METHOD_DEFAULT_SIGNATURE; + } + + protected String getOnExitMethodExceptionSignature() { + return FINISH_METHOD_EXCEPTION_SIGNATURE; + } } diff --git a/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/agent/redis/JedisClassDataProvider.java b/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/agent/redis/JedisClassDataProvider.java index 675d18695a3..9828bd03168 100644 --- a/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/agent/redis/JedisClassDataProvider.java +++ b/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/agent/redis/JedisClassDataProvider.java @@ -46,13 +46,13 @@ public JedisClassDataProvider(Map classesToIns public void add() { try { ClassInstrumentationData data = - new ClassInstrumentationData(JEDIS_CLASS_NAME, InstrumentedClassType.OTHER) + new ClassInstrumentationData(JEDIS_CLASS_NAME, InstrumentedClassType.Redis) .setReportCaughtExceptions(false) .setReportExecutionTime(true); MethodVisitorFactory methodVisitorFactory = new MethodVisitorFactory() { @Override public MethodVisitor create(MethodInstrumentationDecision decision, int access, String desc, String owner, String methodName, MethodVisitor methodVisitor, ClassToMethodTransformationData additionalData) { - return new JedisMethodVisitor(access, desc, JEDIS_CLASS_NAME, methodName, methodVisitor, additionalData); + return new JedisMethodVisitorV2(access, desc, JEDIS_CLASS_NAME, methodName, methodVisitor, additionalData); } }; data.addAllMethods(false, true, methodVisitorFactory); diff --git a/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/agent/redis/JedisMethodVisitor.java b/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/agent/redis/JedisMethodVisitor.java index 5dc1389ef4e..8f83a0bc664 100644 --- a/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/agent/redis/JedisMethodVisitor.java +++ b/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/agent/redis/JedisMethodVisitor.java @@ -30,9 +30,12 @@ import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; + /** * Created by gupele on 8/6/2015. + * @deprecated Replaced with JedisMethodVisitorV2 */ +@Deprecated final class JedisMethodVisitor extends DefaultMethodVisitor { private final static String FINISH_DETECT_METHOD_NAME = "methodFinished"; private final static String FINISH_METHOD_DEFAULT_SIGNATURE = "(Ljava/lang/String;J[Ljava/lang/Object;Ljava/lang/Throwable;)V"; diff --git a/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/agent/redis/JedisMethodVisitorV2.java b/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/agent/redis/JedisMethodVisitorV2.java new file mode 100644 index 00000000000..67ca0867cbe --- /dev/null +++ b/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/agent/redis/JedisMethodVisitorV2.java @@ -0,0 +1,55 @@ +/* + * ApplicationInsights-Java + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * Permission is hereby granted, free of charge, to any person obtaining a copy of this + * software and associated documentation files (the ""Software""), to deal in the Software + * without restriction, including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, and to permit + * persons to whom the Software is furnished to do so, subject to the following conditions: + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.microsoft.applicationinsights.agent.internal.agent.redis; + +import com.microsoft.applicationinsights.agent.internal.agent.DefaultMethodVisitor; +import com.microsoft.applicationinsights.agent.internal.agent.ClassToMethodTransformationData; + +import org.objectweb.asm.MethodVisitor; + +/** + * The class is responsible for instrumenting Jedis client methods. + */ +final class JedisMethodVisitorV2 extends DefaultMethodVisitor { + private final static String ON_ENTER_METHOD_NAME = "jedisMethodStarted"; + private final static String ON_ENTER_METHOD_SIGNATURE = "(Ljava/lang/String;)V"; + + public JedisMethodVisitorV2(int access, + String desc, + String owner, + String methodName, + MethodVisitor methodVisitor, + ClassToMethodTransformationData additionalData) { + super(false, true, 0, access, desc, owner, methodName, methodVisitor, additionalData); + } + + @Override + protected String getOnEnterMethodName() { + return ON_ENTER_METHOD_NAME; + } + + @Override + protected String getOnEnterMethodSignature() { + return ON_ENTER_METHOD_SIGNATURE; + } + +} diff --git a/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/AgentNotificationsHandler.java b/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/AgentNotificationsHandler.java index 36265492f7d..2a55f270ac1 100644 --- a/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/AgentNotificationsHandler.java +++ b/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/AgentNotificationsHandler.java @@ -97,6 +97,12 @@ public interface AgentNotificationsHandler { */ void preparedStatementExecuteBatchMethodStarted(String classAndMethodNames, PreparedStatement statement, String sqlStatement, int batchCounter); + /** + * Called before methods in the Jedis client class are executed. + * @param classAndMethodNames The name of the class and method separated by '.' + */ + void jedisMethodStarted(String classAndMethodNames); + /** * A 'regular' method enter. Non HTTP/SQL method * @param classAndMethodNames The name of the class and method separated by '.' diff --git a/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/InstrumentedClassType.java b/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/InstrumentedClassType.java index f048a93803d..a3c7750681e 100644 --- a/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/InstrumentedClassType.java +++ b/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/InstrumentedClassType.java @@ -27,5 +27,6 @@ public enum InstrumentedClassType { SQL, HTTP, - OTHER + OTHER, + Redis } diff --git a/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/impl/ImplementationsCoordinator.java b/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/impl/ImplementationsCoordinator.java index bd89047740a..4645f6a6eb2 100644 --- a/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/impl/ImplementationsCoordinator.java +++ b/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/impl/ImplementationsCoordinator.java @@ -175,6 +175,17 @@ public void sqlStatementMethodStarted(String name, Statement statement, String s } } + @Override + public void jedisMethodStarted(String name) { + try { + AgentNotificationsHandler implementation = getImplementation(); + if (implementation != null) { + implementation.jedisMethodStarted(name); + } + } catch (Throwable t) { + } + } + @Override public void methodStarted(String name) { try { diff --git a/core/src/main/java/com/microsoft/applicationinsights/internal/agent/CoreAgentNotificationsHandler.java b/core/src/main/java/com/microsoft/applicationinsights/internal/agent/CoreAgentNotificationsHandler.java index aa0777d6aee..7f597242f19 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/internal/agent/CoreAgentNotificationsHandler.java +++ b/core/src/main/java/com/microsoft/applicationinsights/internal/agent/CoreAgentNotificationsHandler.java @@ -155,6 +155,16 @@ public void httpMethodFinished(String identifier, String method, String uri, int telemetryClient.track(telemetry); } + @Override + public void jedisMethodStarted(String name) { + int index = name.lastIndexOf('#'); + if (index != -1) { + name = name.substring(0, index); + } + + startMethod(InstrumentedClassType.Redis.toString(), name, new String[]{}); + } + @Override public void methodStarted(String name) { int index = name.lastIndexOf('#'); From cc310f790d24187f36e7ec36464eaae2ea9ff3e4 Mon Sep 17 00:00:00 2001 From: dhaval24 Date: Tue, 12 Sep 2017 10:50:27 -0700 Subject: [PATCH 21/31] adding missing escape character \' and missing test --- .../applicationinsights/common/SanitizationUtils.java | 3 +++ .../common/SanitizationUtilsTests.java | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/microsoft/applicationinsights/common/SanitizationUtils.java b/core/src/main/java/com/microsoft/applicationinsights/common/SanitizationUtils.java index b6b58eacf67..76afa10d9be 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/common/SanitizationUtils.java +++ b/core/src/main/java/com/microsoft/applicationinsights/common/SanitizationUtils.java @@ -24,6 +24,9 @@ public static String sanitizeStringForJSON(String text) { if( curr == '\"' ){ result.append("\\\""); } + else if (curr == '\'') { + result.append("\\\'"); + } else if(curr == '\\'){ result.append("\\\\"); } diff --git a/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java b/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java index ec9692dbccb..9da3793f86f 100644 --- a/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java +++ b/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java @@ -7,7 +7,12 @@ public class SanitizationUtilsTests { @Test public void testSanitizeStringForJSON() { - String result = SanitizationUtils.sanitizeStringForJSON("{\"entityType\":\"CONTACTNAME\",\"contactField\":\"\",\"query\":\"zuck\",\"candidates\":[{\"id\":\"2\",\"name\":\"Andrew Zuck\",\"aliases\":[],\"phoneNumbers\":[{\"type\":\"MOBILENUMBER\",\"number\":\"+1 (555) 222-2222\"}],\"emailAddresses\":[],\"streetAddresses\":[]}],\"scores\":{\"2\":2.327993297520463}}"); - Assert.assertEquals(result, "{\\\"entityType\\\":\\\"CONTACTNAME\\\",\\\"contactField\\\":\\\"\\\",\\\"query\\\":\\\"zuck\\\",\\\"candidates\\\":[{\\\"id\\\":\\\"2\\\",\\\"name\\\":\\\"Andrew Zuck\\\",\\\"aliases\\\":[],\\\"phoneNumbers\\\":[{\\\"type\\\":\\\"MOBILENUMBER\\\",\\\"number\\\":\\\"+1 (555) 222-2222\\\"}],\\\"emailAddresses\\\":[],\\\"streetAddresses\\\":[]}],\\\"scores\\\":{\\\"2\\\":2.327993297520463}}"); + String result = SanitizationUtils.sanitizeStringForJSON("{\"entityType\":\"CONTACTNAME\",\"contactField\":\"\"," + + "\"query\":\"zuck\",\"candidates\":[{\"id\":\"2\",\"name\":\"Andrew Zuck\",\"aliases\":[],\"phoneNumbers\":[{\"type\":\"MOBILENUMBER\",\"number\":\"+1 (555) 222-2222\"}],\"emailAddresses\":[],\"streetAddresses\":[]}],\"scores\":{\"2\":2.327993297520463}}"); + Assert.assertEquals(result, "{\\\"entityType\\\":\\\"CONTACTNAME\\\",\\\"contactField\\\":\\\"\\\",\\\"query\\\":\\\"zuck\\\",\\\"candidates\\\":[{\\\"id\\\":\\\"2\\\",\\\"name\\\":\\\"Andrew Zuck\\\",\\\"aliases\\\":[],\\\"phoneNumbers\\\":[{\\\"type\\\":\\\"MOBILENUMBER\\\",\\\"number\\\":\\\"+1 (555) 222-2222\\\"}],\\\"emailAddresses\\\"" + + ":[],\\\"streetAddresses\\\":[]}],\\\"scores\\\":{\\\"2\\\":2.327993297520463}}"); + + String resutl1 = SanitizationUtils.sanitizeStringForJSON("\'\f\b\f\n\n\t/\\"); + Assert.assertEquals(resutl1, "\\\\\\'\\\\f\\\\b\\\\f\\\\n\\\\r\\\\t\\/\\\\\n"); } } From bad01c5df6753fd5b41572c3ae6b522fcdf2169f Mon Sep 17 00:00:00 2001 From: dhaval24 Date: Tue, 12 Sep 2017 10:55:13 -0700 Subject: [PATCH 22/31] fixing previous commit test case --- .../applicationinsights/common/SanitizationUtilsTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java b/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java index 9da3793f86f..070d9ca1558 100644 --- a/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java +++ b/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java @@ -12,7 +12,7 @@ public void testSanitizeStringForJSON() { Assert.assertEquals(result, "{\\\"entityType\\\":\\\"CONTACTNAME\\\",\\\"contactField\\\":\\\"\\\",\\\"query\\\":\\\"zuck\\\",\\\"candidates\\\":[{\\\"id\\\":\\\"2\\\",\\\"name\\\":\\\"Andrew Zuck\\\",\\\"aliases\\\":[],\\\"phoneNumbers\\\":[{\\\"type\\\":\\\"MOBILENUMBER\\\",\\\"number\\\":\\\"+1 (555) 222-2222\\\"}],\\\"emailAddresses\\\"" + ":[],\\\"streetAddresses\\\":[]}],\\\"scores\\\":{\\\"2\\\":2.327993297520463}}"); - String resutl1 = SanitizationUtils.sanitizeStringForJSON("\'\f\b\f\n\n\t/\\"); - Assert.assertEquals(resutl1, "\\\\\\'\\\\f\\\\b\\\\f\\\\n\\\\r\\\\t\\/\\\\\n"); + String resutl1 = SanitizationUtils.sanitizeStringForJSON("\\'\\f\\b\\f\\n\\r\\t/\\"); + Assert.assertEquals(resutl1, "\\\\\\'\\\\f\\\\b\\\\f\\\\n\\\\r\\\\t\\/\\\\"); } } From 1fd87c23189fa31edcb242eb957ba9ee7172a898 Mon Sep 17 00:00:00 2001 From: dhaval24 Date: Tue, 12 Sep 2017 11:29:04 -0700 Subject: [PATCH 23/31] resolving merge conflict --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cee59600167..7c301e1cdc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ - Method `sanitizeStringForJSON` takes string input and converts it to JSON friendly string. - Class `com.microsoft.applicationinsights.common.SanitizationUtils` has methods to sanitize string for JSON. - Fixed Request Telemetry Sending bug with new schema. +- Fixed reliability issue with Jedis client dependency collector +- Fixed Request Telemetry Sending bug with new schema - Schema updated to the latest version. Changes in internal namespace `core/src/main/java/com/microsoft/applicationinsights/internal/schemav2`. - Class `SendableData` in internal namespace deleted. - Class `com.microsoft.applicationinsights.telemetry.BaseSampleSourceTelemetry` takes generic class qualifier `Domain` instead of `SendableData`. From 1f60a6425d2f117d85207b10cdbc77f623d2b31f Mon Sep 17 00:00:00 2001 From: dhaval24 Date: Tue, 12 Sep 2017 17:29:38 -0700 Subject: [PATCH 24/31] Adding truncate methods removing unnecessary test as following covers all --- .../common/SanitizationUtils.java | 6 +++++- .../JsonTelemetryDataSerializer.java | 19 +++++++++++++++++-- .../common/SanitizationUtilsTests.java | 7 +++---- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/com/microsoft/applicationinsights/common/SanitizationUtils.java b/core/src/main/java/com/microsoft/applicationinsights/common/SanitizationUtils.java index 76afa10d9be..34c24484e12 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/common/SanitizationUtils.java +++ b/core/src/main/java/com/microsoft/applicationinsights/common/SanitizationUtils.java @@ -48,9 +48,13 @@ else if(curr == '\r'){ else if(curr == '\t'){ result.append("\\t"); } - else { + else if (!Character.isISOControl(curr)){ result.append(curr); } + else { + result.append("\\u"); + result.append((String.format( "%04x", Integer.valueOf(curr)))); + } } return result.toString(); } diff --git a/core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java b/core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java index 98a2cea09c0..0508a6ce27f 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java +++ b/core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java @@ -276,7 +276,7 @@ private void write(T item) throws IOException { } else { String sanitizedItem = SanitizationUtils.sanitizeStringForJSON(String.valueOf(item)); out.write(JSON_COMMA); - out.write(sanitizedItem); + out.write(truncateValueToMaxLength(sanitizedItem)); out.write(JSON_COMMA); } } @@ -297,9 +297,10 @@ private String createJsonFor(T value) throws IOExce } private void writeName(String name) throws IOException { + String sanitizedName = SanitizationUtils.sanitizeStringForJSON(name); out.write(separator); out.write(JSON_COMMA); - out.write(name); + out.write(truncateKeyToMaxLength(sanitizedName)); out.write(JSON_COMMA); out.write(JSON_NAME_VALUE_SEPARATOR); } @@ -349,4 +350,18 @@ protected void writeEscapedString(String value) throws IOException { } } } + + private String truncateValueToMaxLength(String value) { + if (value.length() > 8192) { + return value.substring(0, 8192); + } + return value; + } + + private String truncateKeyToMaxLength(String key) { + if (key.length() > 150) { + return key.substring(0, 150); + } + return key; + } } diff --git a/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java b/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java index 070d9ca1558..3596b8154ec 100644 --- a/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java +++ b/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java @@ -7,12 +7,11 @@ public class SanitizationUtilsTests { @Test public void testSanitizeStringForJSON() { - String result = SanitizationUtils.sanitizeStringForJSON("{\"entityType\":\"CONTACTNAME\",\"contactField\":\"\"," + - "\"query\":\"zuck\",\"candidates\":[{\"id\":\"2\",\"name\":\"Andrew Zuck\",\"aliases\":[],\"phoneNumbers\":[{\"type\":\"MOBILENUMBER\",\"number\":\"+1 (555) 222-2222\"}],\"emailAddresses\":[],\"streetAddresses\":[]}],\"scores\":{\"2\":2.327993297520463}}"); - Assert.assertEquals(result, "{\\\"entityType\\\":\\\"CONTACTNAME\\\",\\\"contactField\\\":\\\"\\\",\\\"query\\\":\\\"zuck\\\",\\\"candidates\\\":[{\\\"id\\\":\\\"2\\\",\\\"name\\\":\\\"Andrew Zuck\\\",\\\"aliases\\\":[],\\\"phoneNumbers\\\":[{\\\"type\\\":\\\"MOBILENUMBER\\\",\\\"number\\\":\\\"+1 (555) 222-2222\\\"}],\\\"emailAddresses\\\"" + - ":[],\\\"streetAddresses\\\":[]}],\\\"scores\\\":{\\\"2\\\":2.327993297520463}}"); String resutl1 = SanitizationUtils.sanitizeStringForJSON("\\'\\f\\b\\f\\n\\r\\t/\\"); Assert.assertEquals(resutl1, "\\\\\\'\\\\f\\\\b\\\\f\\\\n\\\\r\\\\t\\/\\\\"); + + String resultControlCharVer = SanitizationUtils.sanitizeStringForJSON("\u0000"); + Assert.assertEquals(resultControlCharVer, "\\u0000"); } } From 819f72ab517900d7e10192fc197a7fa87a081139 Mon Sep 17 00:00:00 2001 From: dhaval24 Date: Wed, 13 Sep 2017 10:56:26 -0700 Subject: [PATCH 25/31] reducing scope to package-private, fixing corner case and generalizing truncate method --- CHANGELOG.md | 5 +-- .../JsonTelemetryDataSerializer.java | 32 ++++++++----------- .../SanitizationUtils.java | 20 ++++++++---- .../common/SanitizationUtilsTests.java | 17 ---------- .../telemetry/SanitizationUtilsTests.java | 18 +++++++++++ 5 files changed, 48 insertions(+), 44 deletions(-) rename core/src/main/java/com/microsoft/applicationinsights/{common => telemetry}/SanitizationUtils.java (72%) delete mode 100644 core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java create mode 100644 core/src/test/java/com/microsoft/applicationinsights/telemetry/SanitizationUtilsTests.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c301e1cdc9..003de31bae5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ # CHANGELOG ## Version 1.0.10 -- Fix issue of sending custom event. +- Fixed Exceeded property length leads to lost event. +- Fixed issue of sending custom event. - Method `sanitizeStringForJSON` takes string input and converts it to JSON friendly string. -- Class `com.microsoft.applicationinsights.common.SanitizationUtils` has methods to sanitize string for JSON. +- Class `com.microsoft.applicationinsights.telemetry.SanitizationUtils` has methods to sanitize string for JSON. - Fixed Request Telemetry Sending bug with new schema. - Fixed reliability issue with Jedis client dependency collector - Fixed Request Telemetry Sending bug with new schema diff --git a/core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java b/core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java index 0508a6ce27f..21bccde4f7a 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java +++ b/core/src/main/java/com/microsoft/applicationinsights/telemetry/JsonTelemetryDataSerializer.java @@ -21,18 +21,16 @@ package com.microsoft.applicationinsights.telemetry; +import com.google.common.base.Strings; +import com.microsoft.applicationinsights.internal.schemav2.DataPointType; +import com.microsoft.applicationinsights.internal.util.LocalStringsUtils; + import java.io.BufferedWriter; import java.io.IOException; import java.io.StringWriter; import java.io.Writer; import java.util.*; -import com.google.common.base.Strings; - -import com.microsoft.applicationinsights.common.SanitizationUtils; -import com.microsoft.applicationinsights.internal.schemav2.*; -import com.microsoft.applicationinsights.internal.util.LocalStringsUtils; - /** * This class knows how to transform data that is relevant to {@link Telemetry} instances into JSON. */ @@ -274,9 +272,10 @@ private void write(T item) throws IOException { { out.write(String.valueOf(item)); } else { - String sanitizedItem = SanitizationUtils.sanitizeStringForJSON(String.valueOf(item)); + String truncatedName = truncate(String.valueOf(item), 8192); + String sanitizedItem = SanitizationUtils.sanitizeStringForJSON(truncatedName, false); out.write(JSON_COMMA); - out.write(truncateValueToMaxLength(sanitizedItem)); + out.write(sanitizedItem); out.write(JSON_COMMA); } } @@ -297,10 +296,11 @@ private String createJsonFor(T value) throws IOExce } private void writeName(String name) throws IOException { - String sanitizedName = SanitizationUtils.sanitizeStringForJSON(name); + String truncatedString = truncate(name, 150); + String sanitizedName = SanitizationUtils.sanitizeStringForJSON(truncatedString, true); out.write(separator); out.write(JSON_COMMA); - out.write(truncateKeyToMaxLength(sanitizedName)); + out.write(sanitizedName); out.write(JSON_COMMA); out.write(JSON_NAME_VALUE_SEPARATOR); } @@ -351,17 +351,11 @@ protected void writeEscapedString(String value) throws IOException { } } - private String truncateValueToMaxLength(String value) { - if (value.length() > 8192) { - return value.substring(0, 8192); + private String truncate(String value, int len) { + if (value.length() > len) { + return value.substring(0, len); } return value; } - private String truncateKeyToMaxLength(String key) { - if (key.length() > 150) { - return key.substring(0, 150); - } - return key; - } } diff --git a/core/src/main/java/com/microsoft/applicationinsights/common/SanitizationUtils.java b/core/src/main/java/com/microsoft/applicationinsights/telemetry/SanitizationUtils.java similarity index 72% rename from core/src/main/java/com/microsoft/applicationinsights/common/SanitizationUtils.java rename to core/src/main/java/com/microsoft/applicationinsights/telemetry/SanitizationUtils.java index 34c24484e12..98d2f022c1c 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/common/SanitizationUtils.java +++ b/core/src/main/java/com/microsoft/applicationinsights/telemetry/SanitizationUtils.java @@ -1,4 +1,4 @@ -package com.microsoft.applicationinsights.common; +package com.microsoft.applicationinsights.telemetry; import java.text.StringCharacterIterator; @@ -8,7 +8,7 @@ * This class provides utility functions to sanitize strings * for various formats. Currently it supports JSON sanitization */ -public final class SanitizationUtils { + final class SanitizationUtils { /** * This method appends escape characters to input String to prevent @@ -16,11 +16,14 @@ public final class SanitizationUtils { * @param text * @return Sanitized String suitable for JSON */ - public static String sanitizeStringForJSON(String text) { + static String sanitizeStringForJSON(String text, boolean isKey) { final StringBuilder result = new StringBuilder(); StringCharacterIterator iterator = new StringCharacterIterator(text); - for (char curr = iterator.current(); curr != iterator.DONE; curr = iterator.next()) { + + // allowing delta for the characters to be appended + int maxAllowedLength = isKey ? 148 : 8190; + for (char curr = iterator.current(); curr != iterator.DONE && result.length() < maxAllowedLength; curr = iterator.next()) { if( curr == '\"' ){ result.append("\\\""); } @@ -52,8 +55,13 @@ else if (!Character.isISOControl(curr)){ result.append(curr); } else { - result.append("\\u"); - result.append((String.format( "%04x", Integer.valueOf(curr)))); + if (result.length() + 7 < 8192) { // needs 7 more character space to be appended + result.append("\\u"); + result.append((String.format( "%04x", Integer.valueOf(curr)))); + } + else { + break; + } } } return result.toString(); diff --git a/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java b/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java deleted file mode 100644 index 3596b8154ec..00000000000 --- a/core/src/test/java/com/microsoft/applicationinsights/common/SanitizationUtilsTests.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.microsoft.applicationinsights.common; - -import org.junit.Assert; -import org.junit.Test; - -public class SanitizationUtilsTests { - - @Test - public void testSanitizeStringForJSON() { - - String resutl1 = SanitizationUtils.sanitizeStringForJSON("\\'\\f\\b\\f\\n\\r\\t/\\"); - Assert.assertEquals(resutl1, "\\\\\\'\\\\f\\\\b\\\\f\\\\n\\\\r\\\\t\\/\\\\"); - - String resultControlCharVer = SanitizationUtils.sanitizeStringForJSON("\u0000"); - Assert.assertEquals(resultControlCharVer, "\\u0000"); - } -} diff --git a/core/src/test/java/com/microsoft/applicationinsights/telemetry/SanitizationUtilsTests.java b/core/src/test/java/com/microsoft/applicationinsights/telemetry/SanitizationUtilsTests.java new file mode 100644 index 00000000000..66af3a837d7 --- /dev/null +++ b/core/src/test/java/com/microsoft/applicationinsights/telemetry/SanitizationUtilsTests.java @@ -0,0 +1,18 @@ +package com.microsoft.applicationinsights.telemetry; + +import com.microsoft.applicationinsights.telemetry.SanitizationUtils; +import org.junit.Assert; +import org.junit.Test; + +public class SanitizationUtilsTests { + + @Test + public void testSanitizeStringForJSON() { + + String result1 = SanitizationUtils.sanitizeStringForJSON("\\'\\f\\b\\f\\n\\r\\t/\\", false); + Assert.assertEquals(result1, "\\\\\\'\\\\f\\\\b\\\\f\\\\n\\\\r\\\\t\\/\\\\"); + + String resultControlCharVer = SanitizationUtils.sanitizeStringForJSON("\u0000", true); + Assert.assertEquals(resultControlCharVer, "\\u0000"); + } +} From f33c22042e2a4740f9d778b5c18dbf556dc315fc Mon Sep 17 00:00:00 2001 From: dhaval24 Date: Thu, 14 Sep 2017 15:46:22 -0700 Subject: [PATCH 26/31] Making CHANGELOG.md more human friendly --- CHANGELOG.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 003de31bae5..a1f77632a06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,8 @@ # CHANGELOG ## Version 1.0.10 -- Fixed Exceeded property length leads to lost event. -- Fixed issue of sending custom event. -- Method `sanitizeStringForJSON` takes string input and converts it to JSON friendly string. -- Class `com.microsoft.applicationinsights.telemetry.SanitizationUtils` has methods to sanitize string for JSON. +- Fixed issue #403 (Exceeding property length invalidates custom event) +- Fixed issue #401 (Custom key and property sanitized) - Fixed Request Telemetry Sending bug with new schema. - Fixed reliability issue with Jedis client dependency collector - Fixed Request Telemetry Sending bug with new schema From 0c99bb64fa057aef533c2956d0b766770c4c269d Mon Sep 17 00:00:00 2001 From: Andre Sollie Date: Fri, 15 Sep 2017 12:31:47 +0200 Subject: [PATCH 27/31] Changed back to default backoff time. --- .../internal/channel/common/TransmissionNetworkOutput.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java b/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java index 81b0d6be0ed..6650b462819 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java +++ b/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java @@ -67,9 +67,6 @@ public final class TransmissionNetworkOutput implements TransmissionOutput { private final static String DEFAULT_SERVER_URI = "https://dc.services.visualstudio.com/v2/track"; private final static int DEFAULT_BACKOFF_TIME_SECONDS = 300; - // Back of fast if we most likely will recover and the consequences is big. - private final static int CRITICAL_BACKOFF_TIME_SECONDS = 30; - // For future use: re-send a failed transmission back to the dispatcher private TransmissionDispatcher transmissionDispatcher; @@ -181,7 +178,7 @@ public boolean send(Transmission transmission) { } } catch (IllegalStateException e) { InternalLogger.INSTANCE.error("Failed to send, illegal state exception: %s", e.getMessage()); - transmissionPolicyManager.suspendInSeconds(TransmissionPolicy.BLOCKED_BUT_CAN_BE_PERSISTED, CRITICAL_BACKOFF_TIME_SECONDS); + transmissionPolicyManager.suspendInSeconds(TransmissionPolicy.BLOCKED_BUT_CAN_BE_PERSISTED, DEFAULT_BACKOFF_TIME_SECONDS); } catch (Exception e) { InternalLogger.INSTANCE.error("Failed to send, unexpected exception: %s", e.getMessage()); } catch (Throwable t) { From af83baf3657d0f32c7dff64be7a1629aefd3d9ba Mon Sep 17 00:00:00 2001 From: leantk Date: Fri, 15 Sep 2017 09:42:07 -0400 Subject: [PATCH 28/31] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25626cc984e..eb685285406 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Obsolete methods of `RequestTelemetry`: `getHttpMethod`, `setHttpMethod`. - Add option to configure instrumentation key via `APPINSIGHTS_INSTRUMENTATIONKEY` environment variable for consistency with other SDKs. - Fix the issue where `track(...)` of `TelemetryClient` class was overwriting the provided telemetry timestamp. +- Changed the policy on failed sent requests to delay retrying for 5 minutes instead of immediately retrying. ## Version 1.0.9 - Fix the issue of infinite retry and connection drain on certificate error by updating the version of http client packaged with the SDK. From 59ff2109025fb27e0c712f2efc0626ee44ef839b Mon Sep 17 00:00:00 2001 From: Andre Sollie Date: Mon, 7 Aug 2017 08:35:08 +0200 Subject: [PATCH 29/31] - Fixing potentially for ever loop if something is in illegal state. Eg. Web app is stopped and some code tries to access classes that is on in classpath. --- .../internal/channel/common/TransmissionNetworkOutput.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java b/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java index 05957f6db11..45ed288686e 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java +++ b/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java @@ -171,6 +171,9 @@ public boolean send(Transmission transmission) { } catch (IOException ioe) { InternalLogger.INSTANCE.error("Failed to send, exception: %s", ioe.getMessage()); shouldBackoff = true; + } catch (IllegalStateException e) { + InternalLogger.INSTANCE.error("Failed to send, illegal state exception: %s", e.getMessage()); + shouldBackoff = true; } catch (Exception e) { InternalLogger.INSTANCE.error("Failed to send, unexpected exception: %s", e.getMessage()); shouldBackoff = true; From 23b273ec89d6cc0436dce0aa5d5a8299db20632f Mon Sep 17 00:00:00 2001 From: Andre Sollie Date: Thu, 24 Aug 2017 10:25:09 +0200 Subject: [PATCH 30/31] If a IllegalStateException occurs, we need to suspend. App will most likely not recover. This will prevent forever loop. --- .../internal/channel/common/TransmissionNetworkOutput.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java b/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java index 45ed288686e..59b3d9e412a 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java +++ b/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java @@ -66,6 +66,7 @@ public final class TransmissionNetworkOutput implements TransmissionOutput { private final static String DEFAULT_SERVER_URI = "https://dc.services.visualstudio.com/v2/track"; private final static int DEFAULT_BACKOFF_TIME_SECONDS = 300; + private final static long SHUTDOWN_TIME = 1L; // For future use: re-send a failed transmission back to the dispatcher private TransmissionDispatcher transmissionDispatcher; From 322f477e5cb14af9271937ee5381885cb3a2a2ae Mon Sep 17 00:00:00 2001 From: Andre Sollie Date: Mon, 18 Sep 2017 09:34:27 +0200 Subject: [PATCH 31/31] Removing unused parameter. --- .../internal/channel/common/TransmissionNetworkOutput.java | 1 - 1 file changed, 1 deletion(-) diff --git a/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java b/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java index 59b3d9e412a..45ed288686e 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java +++ b/core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionNetworkOutput.java @@ -66,7 +66,6 @@ public final class TransmissionNetworkOutput implements TransmissionOutput { private final static String DEFAULT_SERVER_URI = "https://dc.services.visualstudio.com/v2/track"; private final static int DEFAULT_BACKOFF_TIME_SECONDS = 300; - private final static long SHUTDOWN_TIME = 1L; // For future use: re-send a failed transmission back to the dispatcher private TransmissionDispatcher transmissionDispatcher;