Преглед изворни кода

project module re-organization

Jason Rivard пре 7 година
родитељ
комит
b262c05995
100 измењених фајлова са 1352 додато и 915 уклоњено
  1. 2 2
      .gitignore
  2. 1 1
      build/checkstyle-import.xml
  3. 5 5
      build/checkstyle.xml
  4. 0 0
      build/license-header-java.txt
  5. 0 0
      build/license-header-jsp.txt
  6. 0 0
      build/license-header-properties.txt
  7. 0 0
      build/license-header-xml.txt
  8. 0 0
      build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.jar
  9. 0 0
      build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.jar.md5
  10. 0 0
      build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.jar.sha1
  11. 0 0
      build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.pom
  12. 0 0
      build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.pom.md5
  13. 0 0
      build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.pom.sha1
  14. 0 0
      build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/maven-metadata.xml
  15. 0 0
      build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/maven-metadata.xml.md5
  16. 0 0
      build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/maven-metadata.xml.sha1
  17. 0 0
      build/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.jar
  18. 0 0
      build/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.jar.md5
  19. 0 0
      build/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.jar.sha1
  20. 0 0
      build/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.pom
  21. 0 0
      build/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.pom.md5
  22. 0 0
      build/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.pom.sha1
  23. 0 0
      build/local-maven-repo/com/novell/security/nmas/NMASToolkit/maven-metadata.xml
  24. 0 0
      build/local-maven-repo/com/novell/security/nmas/NMASToolkit/maven-metadata.xml.md5
  25. 0 0
      build/local-maven-repo/com/novell/security/nmas/NMASToolkit/maven-metadata.xml.sha1
  26. 0 0
      build/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.jar
  27. 0 0
      build/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.jar.md5
  28. 0 0
      build/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.jar.sha1
  29. 0 0
      build/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.pom
  30. 0 0
      build/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.pom.md5
  31. 0 0
      build/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.pom.sha1
  32. 0 0
      build/local-maven-repo/com/novell/security/nmas/ldap/maven-metadata.xml
  33. 0 0
      build/local-maven-repo/com/novell/security/nmas/ldap/maven-metadata.xml.md5
  34. 0 0
      build/local-maven-repo/com/novell/security/nmas/ldap/maven-metadata.xml.sha1
  35. 0 0
      build/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.jar
  36. 0 0
      build/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.jar.md5
  37. 0 0
      build/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.jar.sha1
  38. 0 0
      build/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.pom
  39. 0 0
      build/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.pom.md5
  40. 0 0
      build/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.pom.sha1
  41. 0 0
      build/local-maven-repo/com/novell/security/nmas/nmasclient/maven-metadata.xml
  42. 0 0
      build/local-maven-repo/com/novell/security/nmas/nmasclient/maven-metadata.xml.md5
  43. 0 0
      build/local-maven-repo/com/novell/security/nmas/nmasclient/maven-metadata.xml.sha1
  44. 0 0
      build/spotbugs-exclude.xml
  45. 0 2
      data-service/README.md
  46. 0 325
      data-service/checkstyle.xml
  47. 9 36
      data-service/pom.xml
  48. 13 9
      data-service/src/main/java/password/pwm/receiver/ContextManager.java
  49. 5 5
      data-service/src/main/java/password/pwm/receiver/CsvDownloadServlet.java
  50. 81 57
      data-service/src/main/java/password/pwm/receiver/FtpDataIngestor.java
  51. 11 8
      data-service/src/main/java/password/pwm/receiver/Logger.java
  52. 37 23
      data-service/src/main/java/password/pwm/receiver/PwmReceiverApp.java
  53. 33 6
      data-service/src/main/java/password/pwm/receiver/PwmReceiverLogger.java
  54. 22 20
      data-service/src/main/java/password/pwm/receiver/Settings.java
  55. 3 3
      data-service/src/main/java/password/pwm/receiver/Status.java
  56. 86 55
      data-service/src/main/java/password/pwm/receiver/Storage.java
  57. 100 82
      data-service/src/main/java/password/pwm/receiver/SummaryBean.java
  58. 39 27
      data-service/src/main/java/password/pwm/receiver/TelemetryRestReceiver.java
  59. 15 14
      data-service/src/main/java/password/pwm/receiver/TelemetryViewerServlet.java
  60. 0 0
      data-service/src/main/resources/password/pwm/receiver/package-info.java
  61. 2 6
      data-service/src/main/webapp/META-INF/context.xml
  62. 22 27
      data-service/src/main/webapp/WEB-INF/jsp/telemetry-viewer.jsp
  63. 3 14
      data-service/src/main/webapp/WEB-INF/web.xml
  64. 20 21
      data-service/src/main/webapp/index.jsp
  65. 1 1
      onejar/onejar-assembly.xml
  66. 3 0
      pom.xml
  67. 283 0
      rest-test-service/pom.xml
  68. 24 0
      rest-test-service/src/main/webapp/META-INF/context.xml
  69. 47 0
      rest-test-service/src/main/webapp/WEB-INF/web.xml
  70. 31 0
      rest-test-service/src/main/webapp/index.jsp
  71. 9 162
      server/pom.xml
  72. 2 2
      server/src/main/resources/password/pwm/i18n/Display_nl-colloquial.properties
  73. 2 2
      server/src/main/resources/password/pwm/i18n/Message_nl-colloquial.properties
  74. 0 0
      server/src/main/resources/password/pwm/i18n/nl-colloquial.readme
  75. 441 0
      webapp/pom.xml
  76. 0 0
      webapp/src/build/assembly/ldif-schema-zip.xml
  77. 0 0
      webapp/src/build/assembly/release-bundle.xml
  78. 0 0
      webapp/src/build/assembly/source-reference.xml
  79. 0 0
      webapp/src/build/ldif/AD-schema.ldif
  80. 0 0
      webapp/src/build/ldif/ApacheDS-schema.ldif
  81. 0 0
      webapp/src/build/ldif/OracleDS-schema.ldif
  82. 0 0
      webapp/src/build/ldif/edirectory-schema-update.ldif
  83. 0 0
      webapp/src/build/ldif/edirectory-schema.ldif
  84. 0 0
      webapp/src/build/ldif/edirectory-schema.sch
  85. 0 0
      webapp/src/build/ldif/openDJ-schema.ldif
  86. 0 0
      webapp/src/build/ldif/openldap.ldif
  87. 0 0
      webapp/src/build/ldif/openldap.schema
  88. 0 0
      webapp/src/main/webapp/META-INF/context.xml
  89. 0 0
      webapp/src/main/webapp/WEB-INF/Command.bat
  90. 0 0
      webapp/src/main/webapp/WEB-INF/command.sh
  91. 0 0
      webapp/src/main/webapp/WEB-INF/jsp/accountinformation.jsp
  92. 0 0
      webapp/src/main/webapp/WEB-INF/jsp/activateuser-agreement.jsp
  93. 0 0
      webapp/src/main/webapp/WEB-INF/jsp/activateuser-entercode.jsp
  94. 0 0
      webapp/src/main/webapp/WEB-INF/jsp/activateuser-tokenchoice.jsp
  95. 0 0
      webapp/src/main/webapp/WEB-INF/jsp/activateuser-tokensuccess.jsp
  96. 0 0
      webapp/src/main/webapp/WEB-INF/jsp/activateuser.jsp
  97. 0 0
      webapp/src/main/webapp/WEB-INF/jsp/admin-activity.jsp
  98. 0 0
      webapp/src/main/webapp/WEB-INF/jsp/admin-analysis.jsp
  99. 0 0
      webapp/src/main/webapp/WEB-INF/jsp/admin-dashboard.jsp
  100. 0 0
      webapp/src/main/webapp/WEB-INF/jsp/admin-logview-window.jsp

+ 2 - 2
.gitignore

@@ -6,8 +6,8 @@
 /.classpath
 
 # IntelliJ Project Files
-.idea/
-*.iml
+**/.idea/
+**/*.iml
 */.idea/
 */*.iml
 

+ 1 - 1
server/src/build/checkstyle-import.xml → build/checkstyle-import.xml

@@ -83,6 +83,7 @@
 
     <allow pkg="edu.umd.cs.findbugs.annotations"/>
     <allow pkg="com.nulabinc.zxcvbn" />
+    <allow pkg="jetbrains.exodus"/>
 
     <subpackage name="password.pwm.util">
         <allow pkg="sun.management"/>
@@ -125,7 +126,6 @@
     </subpackage>
 
     <subpackage name="util.localdb">
-        <allow pkg="jetbrains.exodus"/>
         <allow pkg="java.sql"/>
     </subpackage>
 

+ 5 - 5
server/src/build/checkstyle.xml → build/checkstyle.xml

@@ -32,19 +32,19 @@
 <module name="Checker">
 
     <module name="Header">
-        <property name="headerFile" value="${basedir}/src/build/license-header-jsp.txt"/>
+        <property name="headerFile" value="${basedir}/../build/license-header-jsp.txt"/>
         <property name="fileExtensions" value="jsp"/>
     </module>
     <module name="Header">
-        <property name="headerFile" value="${basedir}/src/build/license-header-java.txt"/>
+        <property name="headerFile" value="${basedir}/../build/license-header-java.txt"/>
         <property name="fileExtensions" value="java,css"/>
     </module>
     <module name="Header">
-        <property name="headerFile" value="${basedir}/src/build/license-header-xml.txt"/>
+        <property name="headerFile" value="${basedir}/../build/license-header-xml.txt"/>
         <property name="fileExtensions" value="xml,svg"/>
     </module>
     <module name="Header">
-        <property name="headerFile" value="${basedir}/src/build/license-header-properties.txt"/>
+        <property name="headerFile" value="${basedir}/../build/license-header-properties.txt"/>
         <property name="fileExtensions" value="properties"/>
     </module>
 
@@ -179,7 +179,7 @@
         <module name="RedundantImport"/>
         <module name="UnusedImports"/>
         <module name="ImportControl">
-            <property name="file" value="${basedir}/src/build/checkstyle-import.xml"/>
+            <property name="file" value="${basedir}/../build/checkstyle-import.xml"/>
         </module>
 
 

+ 0 - 0
server/src/build/license-header-java.txt → build/license-header-java.txt


+ 0 - 0
server/src/build/license-header-jsp.txt → build/license-header-jsp.txt


+ 0 - 0
server/src/build/license-header-properties.txt → build/license-header-properties.txt


+ 0 - 0
server/src/build/license-header-xml.txt → build/license-header-xml.txt


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.jar → build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.jar


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.jar.md5 → build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.jar.md5


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.jar.sha1 → build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.jar.sha1


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.pom → build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.pom


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.pom.md5 → build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.pom.md5


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.pom.sha1 → build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/2013.04.18/ChallengeResponseLCM-2013.04.18.pom.sha1


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/maven-metadata.xml → build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/maven-metadata.xml


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/maven-metadata.xml.md5 → build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/maven-metadata.xml.md5


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/maven-metadata.xml.sha1 → build/local-maven-repo/com/novell/security/nmas/ChallengeResponseLCM/maven-metadata.xml.sha1


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.jar → build/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.jar


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.jar.md5 → build/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.jar.md5


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.jar.sha1 → build/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.jar.sha1


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.pom → build/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.pom


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.pom.md5 → build/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.pom.md5


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.pom.sha1 → build/local-maven-repo/com/novell/security/nmas/NMASToolkit/2013.04.26/NMASToolkit-2013.04.26.pom.sha1


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/NMASToolkit/maven-metadata.xml → build/local-maven-repo/com/novell/security/nmas/NMASToolkit/maven-metadata.xml


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/NMASToolkit/maven-metadata.xml.md5 → build/local-maven-repo/com/novell/security/nmas/NMASToolkit/maven-metadata.xml.md5


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/NMASToolkit/maven-metadata.xml.sha1 → build/local-maven-repo/com/novell/security/nmas/NMASToolkit/maven-metadata.xml.sha1


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.jar → build/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.jar


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.jar.md5 → build/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.jar.md5


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.jar.sha1 → build/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.jar.sha1


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.pom → build/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.pom


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.pom.md5 → build/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.pom.md5


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.pom.sha1 → build/local-maven-repo/com/novell/security/nmas/ldap/2013.04.26/ldap-2013.04.26.pom.sha1


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ldap/maven-metadata.xml → build/local-maven-repo/com/novell/security/nmas/ldap/maven-metadata.xml


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ldap/maven-metadata.xml.md5 → build/local-maven-repo/com/novell/security/nmas/ldap/maven-metadata.xml.md5


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/ldap/maven-metadata.xml.sha1 → build/local-maven-repo/com/novell/security/nmas/ldap/maven-metadata.xml.sha1


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.jar → build/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.jar


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.jar.md5 → build/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.jar.md5


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.jar.sha1 → build/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.jar.sha1


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.pom → build/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.pom


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.pom.md5 → build/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.pom.md5


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.pom.sha1 → build/local-maven-repo/com/novell/security/nmas/nmasclient/2013.04.26/nmasclient-2013.04.26.pom.sha1


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/nmasclient/maven-metadata.xml → build/local-maven-repo/com/novell/security/nmas/nmasclient/maven-metadata.xml


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/nmasclient/maven-metadata.xml.md5 → build/local-maven-repo/com/novell/security/nmas/nmasclient/maven-metadata.xml.md5


+ 0 - 0
server/local-maven-repo/com/novell/security/nmas/nmasclient/maven-metadata.xml.sha1 → build/local-maven-repo/com/novell/security/nmas/nmasclient/maven-metadata.xml.sha1


+ 0 - 0
server/src/build/spotbugs-exclude.xml → build/spotbugs-exclude.xml


+ 0 - 2
data-service/README.md

@@ -1,2 +0,0 @@
-# pwm-data-service
-Cloud service for PWM

+ 0 - 325
data-service/checkstyle.xml

@@ -1,325 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  ~ Password Management Servlets (PWM)
-  ~ http://www.pwm-project.org
-  ~
-  ~ Copyright (c) 2006-2009 Novell, Inc.
-  ~ Copyright (c) 2009-2016 The PWM Project
-  ~
-  ~ This program is free software; you can redistribute it and/or modify
-  ~ it under the terms of the GNU General Public License as published by
-  ~ the Free Software Foundation; either version 2 of the License, or
-  ~ (at your option) any later version.
-  ~
-  ~ This program is distributed in the hope that it will be useful,
-  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
-  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  ~ GNU General Public License for more details.
-  ~
-  ~ You should have received a copy of the GNU General Public License
-  ~ along with this program; if not, write to the Free Software
-  ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-  -->
-
-<!DOCTYPE module PUBLIC
-        "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
-        "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
-
-<!--
-  PWM Checkstyle definition
--->
-
-<module name="Checker">
-
-    <!-- Checks that each Java package has a Javadoc file used for commenting. -->
-    <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage       -->
-    <!--module name="JavadocPackage">
-      <property name="allowLegacy" value="true"/>
-    </module-->
-
-    <module name="FileLength"/>
-
-    <!-- Checks for Headers                              -->
-    <!-- See http://checkstyle.sf.net/config_header.html -->
-    <!--
-    <module name="RegexpHeader">
-        <property name="fileExtensions" value="java"/>
-        <property name="headerFile" value="${checkstyle.header.file}"/>
-    </module>
-    -->
-
-    <module name="FileTabCharacter">
-        <property name="eachLine" value="true"/>
-    </module>
-    <module name="NewlineAtEndOfFile"/>
-
-    <module name="TreeWalker">
-
-        <property name="cacheFile" value="target/checkstyle.cache"/>
-
-        <!-- required for SuppressWarningsFilter (and other Suppress* rules not used here) -->
-        <!-- see http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarningsHolder -->
-        <module name="SuppressWarningsHolder"/>
-
-        <module name="OuterTypeFilename"/>
-        <module name="IllegalTokenText">
-            <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
-            <property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
-            <property name="message" value="Avoid using corresponding octal or Unicode escape."/>
-        </module>
-        <module name="AvoidEscapedUnicodeCharacters">
-            <property name="allowEscapesForControlCharacters" value="true"/>
-            <property name="allowByTailComment" value="true"/>
-            <property name="allowNonPrintableEscapes" value="true"/>
-        </module>
-
-        <!--
-        <module name="LineLength">
-            <property name="max" value="200" />
-            <property name="ignorePattern" value="@version|@see|@todo|TODO"/>
-        </module>
-        -->
-        <!-- required for SuppressionCommentFilter -->
-        <!-- see http://checkstyle.sourceforge.net/config.html#SuppressionCommentFilter -->
-        <!--
-        <module name="FileContentsHolder"/>
-
-
-        -->
-
-        <module name="EmptyBlock">
-            <property name="option" value="TEXT"/>
-            <property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
-        </module>
-        <!--
-        <module name="LeftCurly">
-            <property name="option" value="nl"/>
-            <property name="maxLineLength" value="100"/>
-        </module>
-        -->
-
-        <module name="RightCurly"/>
-        <module name="RightCurly">
-            <property name="option" value="alone"/>
-            <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
-        </module>
-
-        <!--
-        <module name="MemberName" />
-        -->
-
-        <!-- Checks for Javadoc comments.                     -->
-        <!-- See http://checkstyle.sf.net/config_javadoc.html -->
-        <!--
-        <module name="JavadocMethod">
-            <property name="severity" value="warning"/>
-            <property name="scope" value="protected"/>
-        </module>
-        <module name="JavadocType">
-            <property name="scope" value="protected"/>
-            <property name="allowUnknownTags" value="true" />
-        </module>
-        <module name="JavadocVariable">
-            <property name="severity" value="info"/>
-            <property name="scope" value="protected"/>
-        </module>
-        -->
-
-        <module name="AnnotationLocation">
-            <property name="tokens" value="VARIABLE_DEF"/>
-            <property name="allowSamelineMultipleAnnotations" value="true"/>
-        </module>
-
-        <!-- Checks for Naming Conventions.                  -->
-        <!-- See http://checkstyle.sf.net/config_naming.html -->
-        <!--
-        <module name="MemberName">
-            <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
-        </module>
-        <module name="TypeName">
-        -->
-        <module name="ConstantName"/>
-        <module name="PackageName">
-            <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
-        </module>
-        <module name="LocalVariableName">
-            <property name="tokens" value="VARIABLE_DEF"/>
-            <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
-            <property name="allowOneCharVarInForLoop" value="true"/>
-        </module>
-        <!--
-        <module name="ClassTypeParameterName">
-            <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
-        </module>
-        -->
-        <module name="MethodTypeParameterName">
-            <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
-        </module>
-        <module name="InterfaceTypeParameterName">
-            <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
-        </module>
-        <!--
-        <module name="LocalFinalVariableName"/>
-        <module name="LocalVariableName"/>
-        <module name="MethodName"/>
-        <module name="PackageName"/>
-        <module name="ParameterName"/>
-        <module name="StaticVariableName"/>
-        <module name="TypeName"/>
-        -->
-
-        <!-- Checks for imports                              -->
-        <!-- See http://checkstyle.sf.net/config_import.html -->
-        <module name="AvoidStarImport"/>
-        <module name="AvoidStaticImport"/>
-        <module name="IllegalImport"/>
-        <module name="RedundantImport"/>
-        <module name="UnusedImports"/>
-
-
-        <!-- Checks for Size Violations.                    -->
-        <!-- See http://checkstyle.sf.net/config_sizes.html -->
-        <!--
-        <module name="MethodLength"/>
-        <module name="ParameterNumber"/>
-        -->
-
-
-        <!-- Checks for whitespace                               -->
-        <!-- See http://checkstyle.sf.net/config_whitespace.html -->
-        <module name="EmptyForIteratorPad">
-            <property name="option" value="space"/>
-        </module>
-        <module name="EmptyForInitializerPad"/>
-        <module name="NeedBraces"/>
-        <!--
-        -->
-        <!-- module name="NoWhitespaceAfter"/ -->
-        <!-- module name="NoWhitespaceBefore"/ -->
-        <!--
-        <module name="OperatorWrap"/>
-        <module name="ParenPad">
-            <property name="option" value="space" />
-        </module>
-        <module name="WhitespaceAfter"/>
-        <module name="WhitespaceAround"/>
-        -->
-        <!-- module name="MethodParamPad"/ -->
-        <module name="GenericWhitespace"/>
-        <module name="EmptyLineSeparator">
-            <property name="allowNoEmptyLineBetweenFields" value="true"/>
-        </module>
-
-
-
-        <!-- Modifier Checks                                    -->
-        <!-- See http://checkstyle.sf.net/config_modifiers.html -->
-        <module name="ModifierOrder"/>
-        <module name="RedundantModifier"/>
-        <!--
-        -->
-
-
-        <!-- Checks for blocks. You know, those {}'s         -->
-        <!-- See http://checkstyle.sf.net/config_blocks.html -->
-        <!--
-        <module name="AvoidNestedBlocks"/>
-        -->
-
-
-        <!-- Checks for common coding problems               -->
-        <!-- See http://checkstyle.sf.net/config_coding.html -->
-        <!-- module name="AvoidInlineConditionals"/ -->
-        <!--
-        <module name="EmptyStatement"/>
-        <module name="EqualsHashCode"/>
-        <module name="HiddenField">
-            <property name="severity" value="warning"/>
-            <property name="ignoreSetter" value="true"/>
-            <property name="ignoreConstructorParameter" value="true"/>
-        </module>
-        <module name="IllegalInstantiation"/>
-        <module name="InnerAssignment"/>
-        -->
-        <!--
-        <module name="MagicNumber">
-            <property name="ignoreNumbers" value="-4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 31, 32, 37, 64, 100, 128, 256, 512, 1000, 1024"/>
-        </module>
-        -->
-
-        <!-- Checks for class design                         -->
-        <!-- See http://checkstyle.sf.net/config_design.html -->
-        <!-- module name="DesignForExtension"/ -->
-        <!-- module name="FinalClass"/ -->
-        <!-- module name="HideUtilityClassConstructor"/ -->
-        <!--
-        <module name="InterfaceIsType"/>
-        <module name="VisibilityModifier">
-            <property name="protectedAllowed" value="true"/>
-            <property name="packageAllowed" value="true"/>
-        </module>
-        -->
-
-
-        <!-- future enabled checks -->
-        <!--
-        <module name="TrailingComment"/>
-        <module name="NPathComplexity"/>
-        <module name="EnumTrailingCommaCheck"/> //doesnt yet exist as of checkstyle 2.17
-        <module name="MultipleStringLiterals"/>
-        <module name="InnerAssignment"/>
-        <module name="MagicNumber">
-            <property name="ignoreNumbers" value="-4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 31, 32, 37, 64, 100, 128, 256, 512, 1000, 1024"/>
-        </module>
-        <module name="SimplifyBooleanExpression"/>
-        -->
-
-        <!-- coding -->
-        <module name="FallThrough"/>
-        <module name="EqualsHashCode"/>
-        <module name="ArrayTrailingCommaCheck"/>
-        <module name="FinalLocalVariable"/>
-        <module name="MissingSwitchDefault"/>
-        <module name="ModifiedControlVariable"/>
-        <module name="MultipleVariableDeclarations"/>
-        <module name="OneStatementPerLine"/>
-        <module name="FinalParameters"/>
-        <module name="ParameterAssignment"/>
-        <module name="SimplifyBooleanReturn"/>
-        <module name="StringLiteralEquality"/>
-        <module name="CovariantEquals"/>
-        <module name="DefaultComesLast"/>
-        <module name="EmptyStatement"/>
-        <module name="EqualsHashCode"/>
-        <module name="EqualsAvoidNull"/>
-
-        <module name="MutableException"/>
-        <module name="TodoComment"/>
-        <module name="NoLineWrap"/>
-        <module name="OneTopLevelClass"/>
-        <module name="NoFinalizer"/>
-        <module name="ArrayTypeStyle"/>
-        <module name="UpperEll"/>
-        <module name="PackageDeclaration"/>
-        <module name="NoClone"/>
-    </module>
-
-    <!-- Support @SuppressWarnings (added in Checkstyle 5.7) -->
-    <!-- see http://checkstyle.sourceforge.net/config.html#SuppressWarningsFilter -->
-    <module name="SuppressWarningsFilter"/>
-
-    <!-- Checks properties file for a duplicated properties. -->
-    <!-- See http://checkstyle.sourceforge.net/config_misc.html#UniqueProperties -->
-    <module name="UniqueProperties"/>
-
-    <!-- Support CHECKSTYLE_OFF: regexp and CHECKSTYLE_ON: regexp comments to disable/enable some checks -->
-    <!-- see http://checkstyle.sourceforge.net/config.html#SuppressionCommentFilter -->
-    <!--
-    <module name="SuppressionCommentFilter">
-        <property name="offCommentFormat" value="CHECKSTYLE_OFF\: (.+)"/>
-        <property name="onCommentFormat" value="CHECKSTYLE_ON\: (.+)"/>
-        <property name="checkFormat" value="$1"/>
-    </module>
-    -->
-
-</module>

+ 9 - 36
data-service/pom.xml

@@ -40,16 +40,6 @@
     </properties>
 
     <profiles>
-        <profile>
-            <id>skip-all</id>
-            <properties>
-                <maven.javadoc.skip>true</maven.javadoc.skip>
-                <source.skip>true</source.skip>
-                <skipTests>true</skipTests>
-                <checkstyle.skip>true</checkstyle.skip>
-                <skip.npm>true</skip.npm>
-            </properties>
-        </profile>
         <profile>
             <id>skip-tests</id>
             <properties>
@@ -173,7 +163,7 @@
                     <dependency>
                         <groupId>com.puppycrawl.tools</groupId>
                         <artifactId>checkstyle</artifactId>
-                        <version>8.10.1</version>
+                        <version>8.11</version>
                     </dependency>
                 </dependencies>
                 <executions>
@@ -181,11 +171,16 @@
                         <id>validate</id>
                         <phase>validate</phase>
                         <configuration>
+                            <propertyExpansion>basedir=${basedir}</propertyExpansion>
+                            <configLocation>../build/checkstyle.xml</configLocation>
                             <encoding>UTF-8</encoding>
                             <consoleOutput>true</consoleOutput>
                             <includeTestResources>false</includeTestResources>
                             <failsOnError>true</failsOnError>
-                            <configLocation>checkstyle.xml</configLocation>
+                            <includes>**/*.java,**/*.jsp,**/*.properties,**/*.xml,**/*.css,**/*.svg</includes>
+                            <sourceDirectories>
+                                <directory>src/main</directory>
+                            </sourceDirectories>
                         </configuration>
                         <goals>
                             <goal>check</goal>
@@ -226,7 +221,7 @@
     <dependencies>
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>pwm</artifactId>
+            <artifactId>pwm-server</artifactId>
             <version>${project.version}</version>
             <type>jar</type>
         </dependency>
@@ -277,7 +272,7 @@
         <dependency>
             <groupId>org.apache.httpcomponents</groupId>
             <artifactId>httpclient</artifactId>
-            <version>4.5.5</version>
+            <version>4.5.6</version>
         </dependency>
         <dependency>
             <groupId>log4j</groupId>
@@ -309,27 +304,5 @@
             <artifactId>webjars-locator-core</artifactId>
             <version>0.35</version>
         </dependency>
-
-
-
     </dependencies>
-
-    <repositories>
-        <repository>
-            <id>central</id>
-            <url>https://repo1.maven.org/maven2</url>
-            <snapshots>
-                <enabled>false</enabled>
-            </snapshots>
-        </repository>
-    </repositories>
-    <pluginRepositories>
-        <pluginRepository>
-            <id>central</id>
-            <url>https://repo1.maven.org/maven2</url>
-            <snapshots>
-                <enabled>false</enabled>
-            </snapshots>
-        </pluginRepository>
-    </pluginRepositories>
 </project>

+ 13 - 9
data-service/src/main/java/password/pwm/receiver/ContextManager.java

@@ -3,7 +3,7 @@
  * http://www.pwm-project.org
  *
  * Copyright (c) 2006-2009 Novell, Inc.
- * Copyright (c) 2009-2017 The PWM Project
+ * Copyright (c) 2009-2018 The PWM Project
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
  */
 
 package password.pwm.receiver;
@@ -29,27 +28,32 @@ import javax.servlet.ServletContextListener;
 import javax.servlet.annotation.WebListener;
 
 @WebListener
-public class ContextManager implements ServletContextListener {
+public class ContextManager implements ServletContextListener
+{
     private static final String CONTEXT_ATTR = "contextManager";
     private PwmReceiverApp app;
 
     @Override
-    public void contextInitialized(final ServletContextEvent sce) {
+    public void contextInitialized( final ServletContextEvent sce )
+    {
         app = new PwmReceiverApp();
-        sce.getServletContext().setAttribute(CONTEXT_ATTR, this);
+        sce.getServletContext().setAttribute( CONTEXT_ATTR, this );
     }
 
     @Override
-    public void contextDestroyed(final ServletContextEvent sce) {
+    public void contextDestroyed( final ServletContextEvent sce )
+    {
         app.close();
         app = null;
     }
 
-    public PwmReceiverApp getApp() {
+    public PwmReceiverApp getApp( )
+    {
         return app;
     }
 
-    public static ContextManager getContextManager(final ServletContext serverContext) {
-        return (ContextManager)serverContext.getAttribute(CONTEXT_ATTR);
+    public static ContextManager getContextManager( final ServletContext serverContext )
+    {
+        return ( ContextManager ) serverContext.getAttribute( CONTEXT_ATTR );
     }
 }

+ 5 - 5
data-service/src/main/java/password/pwm/receiver/CsvDownloadServlet.java

@@ -3,7 +3,7 @@
  * http://www.pwm-project.org
  *
  * Copyright (c) 2006-2009 Novell, Inc.
- * Copyright (c) 2009-2017 The PWM Project
+ * Copyright (c) 2009-2018 The PWM Project
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
  */
 
 package password.pwm.receiver;
@@ -26,10 +25,11 @@ package password.pwm.receiver;
 import javax.servlet.annotation.WebServlet;
 
 @WebServlet(
-        name="TelemetryViewer",
-        urlPatterns={
+        name = "TelemetryViewer",
+        urlPatterns = {
                 "/csv",
         }
 )
-public class CsvDownloadServlet {
+public class CsvDownloadServlet
+{
 }

+ 81 - 57
data-service/src/main/java/password/pwm/receiver/FtpDataIngestor.java

@@ -3,7 +3,7 @@
  * http://www.pwm-project.org
  *
  * Copyright (c) 2006-2009 Novell, Inc.
- * Copyright (c) 2009-2017 The PWM Project
+ * Copyright (c) 2009-2018 The PWM Project
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
  */
 
 package password.pwm.receiver;
@@ -42,102 +41,126 @@ import java.util.List;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
-class FtpDataIngestor {
+class FtpDataIngestor
+{
 
-    private static final PwmReceiverLogger LOGGER = PwmReceiverLogger.forClass(FtpDataIngestor.class);
+    private static final PwmReceiverLogger LOGGER = PwmReceiverLogger.forClass( FtpDataIngestor.class );
 
     private final Settings settings;
     private final PwmReceiverApp app;
 
-    FtpDataIngestor(final PwmReceiverApp app, final Settings telemetrySettings) {
+    FtpDataIngestor( final PwmReceiverApp app, final Settings telemetrySettings )
+    {
         this.app = app;
         this.settings = telemetrySettings;
     }
 
-    void readData(final Storage storage) {
-        app.getStatus().setLastFtpStatus("beginning ftp ingestion");
+    void readData( final Storage storage )
+    {
+        app.getStatus().setLastFtpStatus( "beginning ftp ingestion" );
         LOGGER.debug( "beginning ftp ingestion" );
-        app.getStatus().setLastFtpIngest(Instant.now());
-        try {
+        app.getStatus().setLastFtpIngest( Instant.now() );
+        try
+        {
             final FTPClient ftpClient = getFtpClient();
-            final List<String> files = getFiles(ftpClient);
+            final List<String> files = getFiles( ftpClient );
             LOGGER.debug( "beginning ftp ingestion, listed " + files.size() + " files from server" );
-            for (final String fileName : files) {
-                if (fileName != null && fileName.endsWith(".zip")) {
-                    app.getStatus().setLastFtpIngest(Instant.now());
-                    app.getStatus().setLastFtpStatus("reading file " + fileName);
+            for ( final String fileName : files )
+            {
+                if ( fileName != null && fileName.endsWith( ".zip" ) )
+                {
+                    app.getStatus().setLastFtpIngest( Instant.now() );
+                    app.getStatus().setLastFtpStatus( "reading file " + fileName );
                     LOGGER.debug( "read file " + fileName );
-                    try {
+                    try
+                    {
                         readFile( ftpClient, fileName, storage );
-                    } catch (Exception e) {
-                        app.getStatus().setLastFtpIngest(Instant.now());
+                    }
+                    catch ( Exception e )
+                    {
+                        app.getStatus().setLastFtpIngest( Instant.now() );
                         final String msg = "error while reading ftp file '" + fileName + "': " + e.getMessage();
-                        app.getStatus().setLastFtpStatus(msg);
+                        app.getStatus().setLastFtpStatus( msg );
                         LOGGER.error( msg );
                     }
-                } else {
-                    LOGGER.info("skipping ftp file " + fileName);
+                }
+                else
+                {
+                    LOGGER.info( "skipping ftp file " + fileName );
                 }
             }
             ftpClient.disconnect();
-            LOGGER.info("completed ftp ingestion");
-            app.getStatus().setLastFtpStatus("completed successfully");
-            app.getStatus().setLastFtpIngest(Instant.now());
+            LOGGER.info( "completed ftp ingestion" );
+            app.getStatus().setLastFtpStatus( "completed successfully" );
+            app.getStatus().setLastFtpIngest( Instant.now() );
             app.getStatus().setLastFtpFilesRead( files.size() );
-        } catch (Exception e) {
-            app.getStatus().setLastFtpIngest(Instant.now());
-            app.getStatus().setLastFtpStatus("error during ftp scan: " + e.getMessage());
+        }
+        catch ( Exception e )
+        {
+            app.getStatus().setLastFtpIngest( Instant.now() );
+            app.getStatus().setLastFtpStatus( "error during ftp scan: " + e.getMessage() );
         }
     }
 
-    private void readFile(final FTPClient ftpClient, final String fileName, final Storage storage) throws Exception {
+    private void readFile( final FTPClient ftpClient, final String fileName, final Storage storage ) throws Exception
+    {
         final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-        ftpClient.retrieveFile(fileName, byteArrayOutputStream);
-        final ByteArrayInputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
-        readZippedByteStream(inputStream, fileName, storage);
+        ftpClient.retrieveFile( fileName, byteArrayOutputStream );
+        final ByteArrayInputStream inputStream = new ByteArrayInputStream( byteArrayOutputStream.toByteArray() );
+        readZippedByteStream( inputStream, fileName, storage );
     }
 
-    private void readZippedByteStream(final InputStream inputStream, final String fileName, final Storage storage) throws Exception {
-        try {
-            final ZipInputStream zipInputStream = new ZipInputStream(inputStream);
+    private void readZippedByteStream( final InputStream inputStream, final String fileName, final Storage storage ) throws Exception
+    {
+        try
+        {
+            final ZipInputStream zipInputStream = new ZipInputStream( inputStream );
             final ZipEntry zipEntry = zipInputStream.getNextEntry();
             final String zipEntryName = zipEntry.getName();
-            if (zipEntryName != null && zipEntryName.endsWith(".json")) {
-                LOGGER.info("reading ftp file " + fileName + ":" + zipEntryName);
+            if ( zipEntryName != null && zipEntryName.endsWith( ".json" ) )
+            {
+                LOGGER.info( "reading ftp file " + fileName + ":" + zipEntryName );
                 final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-                final byte[] buffer = new byte[1024];
+                final byte[] buffer = new byte[ 1024 ];
                 int len;
-                while ((len = zipInputStream.read(buffer)) > 0) {
-                    byteArrayOutputStream.write(buffer, 0, len);
+                while ( ( len = zipInputStream.read( buffer ) ) > 0 )
+                {
+                    byteArrayOutputStream.write( buffer, 0, len );
                 }
-                final String resultsStr = byteArrayOutputStream.toString(PwmConstants.DEFAULT_CHARSET.name());
-                final TelemetryPublishBean bean = JsonUtil.deserialize(resultsStr, TelemetryPublishBean.class);
-                storage.store(bean);
+                final String resultsStr = byteArrayOutputStream.toString( PwmConstants.DEFAULT_CHARSET.name() );
+                final TelemetryPublishBean bean = JsonUtil.deserialize( resultsStr, TelemetryPublishBean.class );
+                storage.store( bean );
             }
-        } catch (Exception e) {
+        }
+        catch ( Exception e )
+        {
             final String msg = "error reading ftp file '" + fileName + "', error: " + e.getMessage();
-            LOGGER.info(msg);
-            throw new Exception(e);
+            LOGGER.info( msg );
+            throw new Exception( e );
         }
     }
 
-    private List<String> getFiles(final FTPClient ftpClient) throws IOException {
+    private List<String> getFiles( final FTPClient ftpClient ) throws IOException
+    {
         final String pathname = settings.getSetting( Settings.Setting.ftpReadPath );
-        final FTPFile[] files = ftpClient.listFiles(pathname);
+        final FTPFile[] files = ftpClient.listFiles( pathname );
         final List<String> returnFiles = new ArrayList<>();
-        for (final FTPFile ftpFile : files) {
+        for ( final FTPFile ftpFile : files )
+        {
             final String name = ftpFile.getName();
             final String fullPath = pathname + "/" + name;
-            returnFiles.add(fullPath);
+            returnFiles.add( fullPath );
         }
 
-        return Collections.unmodifiableList(returnFiles);
+        return Collections.unmodifiableList( returnFiles );
     }
 
-    private FTPClient getFtpClient() throws IOException {
+    private FTPClient getFtpClient( ) throws IOException
+    {
         final FTPClient ftpClient;
         final Settings.FtpMode ftpMode = Settings.FtpMode.valueOf( settings.getSetting( Settings.Setting.ftpMode ) );
-        switch ( ftpMode ) {
+        switch ( ftpMode )
+        {
             case ftp:
                 ftpClient = new FTPClient();
                 break;
@@ -147,14 +170,15 @@ class FtpDataIngestor {
                 break;
 
             default:
-                throw new IllegalArgumentException("unexpected ftp mode");
+                throw new IllegalArgumentException( "unexpected ftp mode" );
         }
 
-        ftpClient.connect( settings.getSetting( Settings.Setting.ftpSite ));
-        LOGGER.info("ftp connect complete");
-        if (!StringUtil.isEmpty(settings.getSetting(Settings.Setting.ftpUser)) && !StringUtil.isEmpty(settings.getSetting( Settings.Setting.ftpPassword ))) {
-            final boolean loggedInSuccess = ftpClient.login( settings.getSetting(Settings.Setting.ftpUser), settings.getSetting( Settings.Setting.ftpPassword ));
-            LOGGER.info("ftp login complete, success=" + loggedInSuccess);
+        ftpClient.connect( settings.getSetting( Settings.Setting.ftpSite ) );
+        LOGGER.info( "ftp connect complete" );
+        if ( !StringUtil.isEmpty( settings.getSetting( Settings.Setting.ftpUser ) ) && !StringUtil.isEmpty( settings.getSetting( Settings.Setting.ftpPassword ) ) )
+        {
+            final boolean loggedInSuccess = ftpClient.login( settings.getSetting( Settings.Setting.ftpUser ), settings.getSetting( Settings.Setting.ftpPassword ) );
+            LOGGER.info( "ftp login complete, success=" + loggedInSuccess );
         }
         ftpClient.enterLocalPassiveMode();
         return ftpClient;

+ 11 - 8
data-service/src/main/java/password/pwm/receiver/Logger.java

@@ -3,7 +3,7 @@
  * http://www.pwm-project.org
  *
  * Copyright (c) 2006-2009 Novell, Inc.
- * Copyright (c) 2009-2017 The PWM Project
+ * Copyright (c) 2009-2018 The PWM Project
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,24 +18,27 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
  */
 
 package password.pwm.receiver;
 
-public class Logger {
+public class Logger
+{
 
     private final String name;
 
-    private Logger(final String name) {
+    private Logger( final String name )
+    {
         this.name = name;
     }
 
-    public static Logger createLogger(final String name) {
-        return new Logger(name);
+    public static Logger createLogger( final String name )
+    {
+        return new Logger( name );
     }
 
-    public void info(final CharSequence input) {
-        System.out.println(input);
+    public void info( final CharSequence input )
+    {
+        System.out.println( input );
     }
 }

+ 37 - 23
data-service/src/main/java/password/pwm/receiver/PwmReceiverApp.java

@@ -3,7 +3,7 @@
  * http://www.pwm-project.org
  *
  * Copyright (c) 2006-2009 Novell, Inc.
- * Copyright (c) 2009-2017 The PWM Project
+ * Copyright (c) 2009-2018 The PWM Project
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
  */
 
 package password.pwm.receiver;
@@ -31,7 +30,8 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
-public class PwmReceiverApp {
+public class PwmReceiverApp
+{
     private static final PwmReceiverLogger LOGGER = PwmReceiverLogger.forClass( PwmReceiverApp.class );
     private static final String ENV_NAME = "DATA_SERVICE_PROPS";
 
@@ -40,56 +40,70 @@ public class PwmReceiverApp {
     private Settings settings;
     private Status status = new Status();
 
-    public PwmReceiverApp() {
-        final String propsFile = System.getenv(ENV_NAME);
-        if (StringUtil.isEmpty(propsFile)) {
+    public PwmReceiverApp( )
+    {
+        final String propsFile = System.getenv( ENV_NAME );
+        if ( StringUtil.isEmpty( propsFile ) )
+        {
             final String errorMsg = "Missing environment variable '" + ENV_NAME + "', can't load configuration";
             status.setErrorState( errorMsg );
             LOGGER.error( errorMsg );
             return;
         }
 
-        try {
-            settings = Settings.readFromFile(propsFile);
-        } catch (IOException e) {
-            final String errorMsg = "can't read configuration: " + JavaHelper.readHostileExceptionMessage(e);
+        try
+        {
+            settings = Settings.readFromFile( propsFile );
+        }
+        catch ( IOException e )
+        {
+            final String errorMsg = "can't read configuration: " + JavaHelper.readHostileExceptionMessage( e );
             status.setErrorState( errorMsg );
             LOGGER.error( errorMsg, e );
             return;
         }
 
-        try {
-            storage = new Storage(settings);
-        } catch (Exception e) {
-            final String errorMsg = "can't start storage system: " + JavaHelper.readHostileExceptionMessage(e);
+        try
+        {
+            storage = new Storage( settings );
+        }
+        catch ( Exception e )
+        {
+            final String errorMsg = "can't start storage system: " + JavaHelper.readHostileExceptionMessage( e );
             status.setErrorState( errorMsg );
             LOGGER.error( errorMsg, e );
             return;
         }
 
-        if (settings.getSetting( Settings.Setting.ftpSite ) != null && !settings.getSetting( Settings.Setting.ftpSite ).isEmpty()) {
-            final Runnable ftpThread = () -> {
-                final FtpDataIngestor ftpDataIngestor = new FtpDataIngestor(this, settings);
-                ftpDataIngestor.readData(storage);
+        if ( settings.getSetting( Settings.Setting.ftpSite ) != null && !settings.getSetting( Settings.Setting.ftpSite ).isEmpty() )
+        {
+            final Runnable ftpThread = ( ) ->
+            {
+                final FtpDataIngestor ftpDataIngestor = new FtpDataIngestor( this, settings );
+                ftpDataIngestor.readData( storage );
             };
-            scheduledExecutorService.scheduleAtFixedRate(ftpThread, 0, 1, TimeUnit.HOURS);
+            scheduledExecutorService.scheduleAtFixedRate( ftpThread, 0, 1, TimeUnit.HOURS );
         }
     }
 
-    public Settings getSettings() {
+    public Settings getSettings( )
+    {
         return settings;
     }
 
-    public Storage getStorage() {
+    public Storage getStorage( )
+    {
         return storage;
     }
 
-    void close() {
+    void close( )
+    {
         storage.close();
         scheduledExecutorService.shutdown();
     }
 
-    public Status getStatus() {
+    public Status getStatus( )
+    {
         return status;
     }
 

+ 33 - 6
data-service/src/main/java/password/pwm/receiver/PwmReceiverLogger.java

@@ -1,3 +1,25 @@
+/*
+ * Password Management Servlets (PWM)
+ * http://www.pwm-project.org
+ *
+ * Copyright (c) 2006-2009 Novell, Inc.
+ * Copyright (c) 2009-2018 The PWM Project
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 package password.pwm.receiver;
 
 import java.util.logging.Level;
@@ -17,24 +39,29 @@ public class PwmReceiverLogger
         return new PwmReceiverLogger( clazz );
     }
 
-    public void debug(final CharSequence logMsg) {
+    public void debug( final CharSequence logMsg )
+    {
         log( Level.FINE, logMsg, null );
     }
 
-    public void info(final CharSequence logMsg) {
+    public void info( final CharSequence logMsg )
+    {
         log( Level.INFO, logMsg, null );
     }
 
-    public void error(final CharSequence logMsg ) {
+    public void error( final CharSequence logMsg )
+    {
         log( Level.SEVERE, logMsg, null );
     }
 
-    public void error(final CharSequence logMsg, final Throwable throwable ) {
+    public void error( final CharSequence logMsg, final Throwable throwable )
+    {
         log( Level.SEVERE, logMsg, throwable );
     }
 
-    private void log( final Level level, final CharSequence logMsg, final Throwable throwable ) {
-        final Logger logger = Logger.getLogger(clazz.getName());
+    private void log( final Level level, final CharSequence logMsg, final Throwable throwable )
+    {
+        final Logger logger = Logger.getLogger( clazz.getName() );
         logger.log( level, logMsg.toString(), throwable );
     }
 }

+ 22 - 20
data-service/src/main/java/password/pwm/receiver/Settings.java

@@ -3,7 +3,7 @@
  * http://www.pwm-project.org
  *
  * Copyright (c) 2006-2009 Novell, Inc.
- * Copyright (c) 2009-2017 The PWM Project
+ * Copyright (c) 2009-2018 The PWM Project
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
  */
 
 package password.pwm.receiver;
@@ -34,17 +33,17 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.concurrent.TimeUnit;
 
-public class Settings {
-    enum Setting {
-        ftpMode(FtpMode.ftp.name()),
-        ftpSite(null),
-        ftpUser(null),
-        ftpPassword(null),
-        ftpReadPath(null),
-        storagePath(null),
-        maxInstanceSeconds(Long.toString( new TimeDuration(14, TimeUnit.DAYS).getTotalSeconds() ) ),
-
-        ;
+public class Settings
+{
+    enum Setting
+    {
+        ftpMode( FtpMode.ftp.name() ),
+        ftpSite( null ),
+        ftpUser( null ),
+        ftpPassword( null ),
+        ftpReadPath( null ),
+        storagePath( null ),
+        maxInstanceSeconds( Long.toString( new TimeDuration( 14, TimeUnit.DAYS ).getTotalSeconds() ) ),;
 
         private final String defaultValue;
 
@@ -59,23 +58,25 @@ public class Settings {
         }
     }
 
-    enum FtpMode {
+    enum FtpMode
+    {
         ftp,
         ftps,
     }
 
-    private final Map<Setting,String> settings;
+    private final Map<Setting, String> settings;
 
     private Settings( final Map<Setting, String> settings )
     {
         this.settings = settings;
     }
 
-    static Settings readFromFile( final String filename) throws IOException {
+    static Settings readFromFile( final String filename ) throws IOException
+    {
         final Properties properties = new Properties();
-        properties.load(new FileReader(filename));
-        final Map<Setting,String> returnMap = new HashMap<>(  );
-        for (final Setting setting : Setting.values() )
+        properties.load( new FileReader( filename ) );
+        final Map<Setting, String> returnMap = new HashMap<>();
+        for ( final Setting setting : Setting.values() )
         {
             final String value = properties.getProperty( setting.name(), setting.getDefaultValue() );
             returnMap.put( setting, value );
@@ -88,7 +89,8 @@ public class Settings {
         return settings.get( setting );
     }
 
-    public boolean isFtpEnabled() {
+    public boolean isFtpEnabled( )
+    {
         final String value = settings.get( Setting.ftpSite );
         return !StringUtil.isEmpty( value );
     }

+ 3 - 3
data-service/src/main/java/password/pwm/receiver/Status.java

@@ -3,7 +3,7 @@
  * http://www.pwm-project.org
  *
  * Copyright (c) 2006-2009 Novell, Inc.
- * Copyright (c) 2009-2017 The PWM Project
+ * Copyright (c) 2009-2018 The PWM Project
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
  */
 
 package password.pwm.receiver;
@@ -30,7 +29,8 @@ import java.time.Instant;
 
 @Getter
 @Setter
-public class Status {
+public class Status
+{
     private String errorState;
     private String lastFtpStatus;
     private Instant lastFtpIngest;

+ 86 - 55
data-service/src/main/java/password/pwm/receiver/Storage.java

@@ -3,7 +3,7 @@
  * http://www.pwm-project.org
  *
  * Copyright (c) 2006-2009 Novell, Inc.
- * Copyright (c) 2009-2017 The PWM Project
+ * Copyright (c) 2009-2018 The PWM Project
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
  */
 
 package password.pwm.receiver;
@@ -42,123 +41,152 @@ import java.io.IOException;
 import java.time.Instant;
 import java.util.Iterator;
 
-public class Storage {
+public class Storage
+{
     private final Environment environment;
     private Store store;
 
-    public Storage(final Settings settings) throws IOException {
+    public Storage( final Settings settings ) throws IOException
+    {
         final String path = settings.getSetting( Settings.Setting.storagePath );
-        if (path == null) {
-            throw new IOException("data path is not specified!");
+        if ( path == null )
+        {
+            throw new IOException( "data path is not specified!" );
         }
 
-        final File dataPath = new File(path);
-        if (!dataPath.exists()) {
-            throw new IOException("data path '" + dataPath + "' does not exist");
+        final File dataPath = new File( path );
+        if ( !dataPath.exists() )
+        {
+            throw new IOException( "data path '" + dataPath + "' does not exist" );
         }
 
-        final File stoagePath = new File(dataPath.getAbsolutePath() + File.separator + "storage");
+        final File stoagePath = new File( dataPath.getAbsolutePath() + File.separator + "storage" );
         stoagePath.mkdir();
 
         final EnvironmentConfig environmentConfig = new EnvironmentConfig();
-        environment = Environments.newInstance(stoagePath.getAbsolutePath(), environmentConfig);
+        environment = Environments.newInstance( stoagePath.getAbsolutePath(), environmentConfig );
 
-        environment.executeInTransaction(txn -> store
-                = environment.openStore("store1", StoreConfig.WITHOUT_DUPLICATES, txn));
+        environment.executeInTransaction( txn -> store
+                = environment.openStore( "store1", StoreConfig.WITHOUT_DUPLICATES, txn ) );
     }
 
-    public void store(final TelemetryPublishBean bean) {
-        if (bean == null) {
+    public void store( final TelemetryPublishBean bean )
+    {
+        if ( bean == null )
+        {
             return;
         }
 
         final String instanceHash = bean.getInstanceHash();
-        if (instanceHash != null) {
-            final TelemetryPublishBean existingBean = get(instanceHash);
+        if ( instanceHash != null )
+        {
+            final TelemetryPublishBean existingBean = get( instanceHash );
             Instant existingTimestamp = null;
-            if (existingBean != null) {
+            if ( existingBean != null )
+            {
                 existingTimestamp = existingBean.getTimestamp();
             }
-            if (existingTimestamp == null || existingTimestamp.isBefore(bean.getTimestamp())) {
-                put(bean);
+            if ( existingTimestamp == null || existingTimestamp.isBefore( bean.getTimestamp() ) )
+            {
+                put( bean );
             }
         }
     }
 
-    public Iterator<TelemetryPublishBean> iterator() {
+    public Iterator<TelemetryPublishBean> iterator( )
+    {
         return new InnerIterator();
     }
 
-    private boolean put(final TelemetryPublishBean value) {
-        return environment.computeInTransaction(transaction -> {
-            final ByteIterable k = StringBinding.stringToEntry(value.getInstanceHash());
-            final ByteIterable v = StringBinding.stringToEntry(JsonUtil.serialize(value));
-            return store.put(transaction,k,v);
-        });
+    private boolean put( final TelemetryPublishBean value )
+    {
+        return environment.computeInTransaction( transaction ->
+        {
+            final ByteIterable k = StringBinding.stringToEntry( value.getInstanceHash() );
+            final ByteIterable v = StringBinding.stringToEntry( JsonUtil.serialize( value ) );
+            return store.put( transaction, k, v );
+        } );
     }
 
-    private TelemetryPublishBean get(final String hash) {
-        return environment.computeInTransaction(transaction -> {
-            final ByteIterable k = StringBinding.stringToEntry(hash);
-            final ByteIterable v = store.get(transaction,k);
-            if (v != null) {
-                final String string = StringBinding.entryToString(new ArrayByteIterable(v));
-                if (!StringUtil.isEmpty(string)) {
-                    return JsonUtil.deserialize(string, TelemetryPublishBean.class);
+    private TelemetryPublishBean get( final String hash )
+    {
+        return environment.computeInTransaction( transaction ->
+        {
+            final ByteIterable k = StringBinding.stringToEntry( hash );
+            final ByteIterable v = store.get( transaction, k );
+            if ( v != null )
+            {
+                final String string = StringBinding.entryToString( new ArrayByteIterable( v ) );
+                if ( !StringUtil.isEmpty( string ) )
+                {
+                    return JsonUtil.deserialize( string, TelemetryPublishBean.class );
                 }
             }
             return null;
-        });
+        } );
     }
 
-    public void close() {
+    public void close( )
+    {
         store.getEnvironment().close();
     }
 
-    public long count() {
+    public long count( )
+    {
         return environment.computeInTransaction( transaction -> store.count( transaction ) );
     }
 
-    private class InnerIterator implements AutoCloseable,Iterator {
+    private class InnerIterator implements AutoCloseable, Iterator
+    {
         private final Transaction transaction;
         private final Cursor cursor;
 
         private boolean closed;
         private String nextValue = "";
 
-        InnerIterator() {
+        InnerIterator( )
+        {
             this.transaction = environment.beginReadonlyTransaction();
-            this.cursor = store.openCursor(transaction);
+            this.cursor = store.openCursor( transaction );
             doNext();
         }
 
-        private void doNext() {
-            try {
-                if (closed) {
+        private void doNext( )
+        {
+            try
+            {
+                if ( closed )
+                {
                     return;
                 }
 
-                if (!cursor.getNext()) {
+                if ( !cursor.getNext() )
+                {
                     close();
                     return;
                 }
                 final ByteIterable nextKey = cursor.getKey();
-                final String string = StringBinding.entryToString(new ArrayByteIterable(nextKey));
+                final String string = StringBinding.entryToString( new ArrayByteIterable( nextKey ) );
 
-                if (string == null || string.isEmpty()) {
+                if ( string == null || string.isEmpty() )
+                {
                     close();
                     return;
                 }
                 nextValue = string;
-            } catch (Exception e) {
+            }
+            catch ( Exception e )
+            {
                 e.printStackTrace();
                 throw e;
             }
         }
 
         @Override
-        public void close() {
-            if (closed) {
+        public void close( )
+        {
+            if ( closed )
+            {
                 return;
             }
             cursor.close();
@@ -168,20 +196,23 @@ public class Storage {
         }
 
         @Override
-        public boolean hasNext() {
+        public boolean hasNext( )
+        {
             return !closed && nextValue != null;
         }
 
         @Override
-        public TelemetryPublishBean next() {
+        public TelemetryPublishBean next( )
+        {
             final String value = nextValue;
             doNext();
-            return get(value);
+            return get( value );
         }
 
         @Override
-        public void remove() {
-            throw new UnsupportedOperationException("remove not supported");
+        public void remove( )
+        {
+            throw new UnsupportedOperationException( "remove not supported" );
         }
     }
 

+ 100 - 82
data-service/src/main/java/password/pwm/receiver/SummaryBean.java

@@ -3,7 +3,7 @@
  * http://www.pwm-project.org
  *
  * Copyright (c) 2006-2009 Novell, Inc.
- * Copyright (c) 2009-2017 The PWM Project
+ * Copyright (c) 2009-2018 The PWM Project
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
  */
 
 package password.pwm.receiver;
@@ -39,88 +38,97 @@ import java.util.TreeMap;
 
 @Getter
 @Builder
-public class SummaryBean {
+public class SummaryBean
+{
     private int serverCount;
-    private Map<String,SiteSummary> siteSummary;
-    private Map<String,Integer> ldapVendorCount;
-    private Map<String,Integer> appServerCount;
-    private Map<String,Integer> settingCount;
-    private Map<String,Integer> statCount;
-    private Map<String,Integer> osCount;
-    private Map<String,Integer> dbCount;
-    private Map<String,Integer> javaCount;
-    private Map<String,Integer> ssprVersionCount;
-
-    static SummaryBean fromStorage(final Storage storage, final TimeDuration maxAge ) {
+    private Map<String, SiteSummary> siteSummary;
+    private Map<String, Integer> ldapVendorCount;
+    private Map<String, Integer> appServerCount;
+    private Map<String, Integer> settingCount;
+    private Map<String, Integer> statCount;
+    private Map<String, Integer> osCount;
+    private Map<String, Integer> dbCount;
+    private Map<String, Integer> javaCount;
+    private Map<String, Integer> ssprVersionCount;
+
+    static SummaryBean fromStorage( final Storage storage, final TimeDuration maxAge )
+    {
 
         final String naText = "n/a";
 
         int serverCount = 0;
-        final Map<String,SiteSummary> siteSummaryMap = new TreeMap<>();
-        final Map<String,Integer> ldapVendorCount = new TreeMap<>();
-        final Map<String,Integer> appServerCount = new TreeMap<>();
-        final Map<String,Integer> settingCount = new TreeMap<>();
-        final Map<String,Integer> statCount = new TreeMap<>();
-        final Map<String,Integer> osCount = new TreeMap<>();
-        final Map<String,Integer> dbCount = new TreeMap<>();
-        final Map<String,Integer> javaCount = new TreeMap<>();
-        final Map<String,Integer> ssprVersionCount = new TreeMap<>();
-
-        for (Iterator<TelemetryPublishBean> iterator = storage.iterator(); iterator.hasNext(); ) {
+        final Map<String, SiteSummary> siteSummaryMap = new TreeMap<>();
+        final Map<String, Integer> ldapVendorCount = new TreeMap<>();
+        final Map<String, Integer> appServerCount = new TreeMap<>();
+        final Map<String, Integer> settingCount = new TreeMap<>();
+        final Map<String, Integer> statCount = new TreeMap<>();
+        final Map<String, Integer> osCount = new TreeMap<>();
+        final Map<String, Integer> dbCount = new TreeMap<>();
+        final Map<String, Integer> javaCount = new TreeMap<>();
+        final Map<String, Integer> ssprVersionCount = new TreeMap<>();
+
+        for ( Iterator<TelemetryPublishBean> iterator = storage.iterator(); iterator.hasNext(); )
+        {
             final TelemetryPublishBean bean = iterator.next();
             final TimeDuration age = TimeDuration.fromCurrent( bean.getTimestamp() );
 
-            if (bean.getAbout() != null && age.isShorterThan( maxAge ) ) {
+            if ( bean.getAbout() != null && age.isShorterThan( maxAge ) )
+            {
                 serverCount++;
                 final String hashID = bean.getInstanceHash();
                 final String ldapVendor = bean.getLdapVendorName() == null
                         ? naText
                         : bean.getLdapVendorName();
 
-                final String dbVendor = dbVendorName(bean);
+                final String dbVendor = dbVendorName( bean );
 
                 final SiteSummary siteSummary = SiteSummary.builder()
-                        .description(bean.getSiteDescription())
-                        .version(bean.getVersionVersion())
-                        .installAge(TimeDuration.fromCurrent(bean.getInstallTime()).asDuration())
-                        .updateAge(TimeDuration.fromCurrent(bean.getTimestamp()).asDuration())
-                        .ldapVendor(ldapVendor)
-                        .osName(bean.getAbout().get(PwmAboutProperty.java_osName.name()))
-                        .osVersion(bean.getAbout().get(PwmAboutProperty.java_osVersion.name()))
-                        .servletName(bean.getAbout().get(PwmAboutProperty.java_appServerInfo.name()))
-                        .dbVendor(dbVendor)
-                        .appliance(Boolean.parseBoolean(bean.getAbout().get(PwmAboutProperty.app_mode_appliance.name())))
-                        .javaVm(javaVmInfo( bean, "n/a" ))
+                        .description( bean.getSiteDescription() )
+                        .version( bean.getVersionVersion() )
+                        .installAge( TimeDuration.fromCurrent( bean.getInstallTime() ).asDuration() )
+                        .updateAge( TimeDuration.fromCurrent( bean.getTimestamp() ).asDuration() )
+                        .ldapVendor( ldapVendor )
+                        .osName( bean.getAbout().get( PwmAboutProperty.java_osName.name() ) )
+                        .osVersion( bean.getAbout().get( PwmAboutProperty.java_osVersion.name() ) )
+                        .servletName( bean.getAbout().get( PwmAboutProperty.java_appServerInfo.name() ) )
+                        .dbVendor( dbVendor )
+                        .appliance( Boolean.parseBoolean( bean.getAbout().get( PwmAboutProperty.app_mode_appliance.name() ) ) )
+                        .javaVm( javaVmInfo( bean, "n/a" ) )
                         .build();
 
-                siteSummaryMap.put(hashID, siteSummary);
+                siteSummaryMap.put( hashID, siteSummary );
 
-                incrementCounterMap(dbCount, dbVendor);
+                incrementCounterMap( dbCount, dbVendor );
 
-                incrementCounterMap(ldapVendorCount, ldapVendor);
+                incrementCounterMap( ldapVendorCount, ldapVendor );
 
-                incrementCounterMap(appServerCount, siteSummary.getServletName());
+                incrementCounterMap( appServerCount, siteSummary.getServletName() );
 
-                incrementCounterMap(osCount, bean.getAbout().get(PwmAboutProperty.java_osName.name()));
+                incrementCounterMap( osCount, bean.getAbout().get( PwmAboutProperty.java_osName.name() ) );
 
-                incrementCounterMap(javaCount, siteSummary.getJavaVm());
+                incrementCounterMap( javaCount, siteSummary.getJavaVm() );
 
-                incrementCounterMap(ssprVersionCount, siteSummary.getVersion());
+                incrementCounterMap( ssprVersionCount, siteSummary.getVersion() );
 
-                for (final String settingKey : bean.getConfiguredSettings()) {
-                    final PwmSetting setting = PwmSetting.forKey(settingKey);
-                    if (setting != null) {
-                        final String description = setting.toMenuLocationDebug(null, null);
-                        incrementCounterMap(settingCount, description);
+                for ( final String settingKey : bean.getConfiguredSettings() )
+                {
+                    final PwmSetting setting = PwmSetting.forKey( settingKey );
+                    if ( setting != null )
+                    {
+                        final String description = setting.toMenuLocationDebug( null, null );
+                        incrementCounterMap( settingCount, description );
                     }
                 }
 
-                for (final String statKey : bean.getStatistics().keySet()) {
-                    final Statistic statistic = Statistic.forKey(statKey);
-                    if (statistic != null) {
-                        if (statistic.getType() == Statistic.Type.INCREMENTOR) {
-                            final int count = Integer.parseInt(bean.getStatistics().get(statKey));
-                            incrementCounterMap(statCount, statistic.getLabel(null), count);
+                for ( final String statKey : bean.getStatistics().keySet() )
+                {
+                    final Statistic statistic = Statistic.forKey( statKey );
+                    if ( statistic != null )
+                    {
+                        if ( statistic.getType() == Statistic.Type.INCREMENTER )
+                        {
+                            final int count = Integer.parseInt( bean.getStatistics().get( statKey ) );
+                            incrementCounterMap( statCount, statistic.getLabel( null ), count );
                         }
                     }
                 }
@@ -129,46 +137,55 @@ public class SummaryBean {
 
 
         return SummaryBean.builder()
-                .serverCount(serverCount)
-                .siteSummary(siteSummaryMap)
-                .ldapVendorCount(ldapVendorCount)
-                .settingCount(settingCount)
-                .statCount(statCount)
-                .appServerCount(appServerCount)
-                .osCount(osCount)
-                .dbCount(dbCount)
-                .javaCount(javaCount)
-                .ssprVersionCount(ssprVersionCount)
+                .serverCount( serverCount )
+                .siteSummary( siteSummaryMap )
+                .ldapVendorCount( ldapVendorCount )
+                .settingCount( settingCount )
+                .statCount( statCount )
+                .appServerCount( appServerCount )
+                .osCount( osCount )
+                .dbCount( dbCount )
+                .javaCount( javaCount )
+                .ssprVersionCount( ssprVersionCount )
                 .build();
 
     }
 
-    private static void incrementCounterMap(final Map<String,Integer> map, final String key) {
-        incrementCounterMap(map, key, 1);
+    private static void incrementCounterMap( final Map<String, Integer> map, final String key )
+    {
+        incrementCounterMap( map, key, 1 );
     }
 
-    private static void incrementCounterMap(final Map<String,Integer> map, final String key, final int count) {
-        if (map.containsKey(key)) {
-            map.put(key, map.get(key) + count);
-        } else {
-            map.put(key, count);
+    private static void incrementCounterMap( final Map<String, Integer> map, final String key, final int count )
+    {
+        if ( map.containsKey( key ) )
+        {
+            map.put( key, map.get( key ) + count );
+        }
+        else
+        {
+            map.put( key, count );
         }
     }
 
-    private static String dbVendorName(final TelemetryPublishBean bean) {
+    private static String dbVendorName( final TelemetryPublishBean bean )
+    {
         String dbVendor = "n/a";
-        final Map<String,String> aboutMap = bean.getAbout();
-        if (aboutMap.get(PwmAboutProperty.database_databaseProductName.name()) != null) {
-            dbVendor = aboutMap.get(PwmAboutProperty.database_databaseProductName.name());
-
-            if (aboutMap.get(PwmAboutProperty.database_databaseProductVersion.name()) != null) {
-                dbVendor += "/" + aboutMap.get(PwmAboutProperty.database_databaseProductVersion.name());
+        final Map<String, String> aboutMap = bean.getAbout();
+        if ( aboutMap.get( PwmAboutProperty.database_databaseProductName.name() ) != null )
+        {
+            dbVendor = aboutMap.get( PwmAboutProperty.database_databaseProductName.name() );
+
+            if ( aboutMap.get( PwmAboutProperty.database_databaseProductVersion.name() ) != null )
+            {
+                dbVendor += "/" + aboutMap.get( PwmAboutProperty.database_databaseProductVersion.name() );
             }
         }
         return dbVendor;
     }
 
-    private static String javaVmInfo(final TelemetryPublishBean bean, final String naText ) {
+    private static String javaVmInfo( final TelemetryPublishBean bean, final String naText )
+    {
         return bean.getAbout().getOrDefault( PwmAboutProperty.java_vmName.name(), naText )
                 + " ("
                 + bean.getAbout().getOrDefault( PwmAboutProperty.java_vmVendor.name(), naText )
@@ -178,7 +195,8 @@ public class SummaryBean {
 
     @Value
     @Builder
-    public static class SiteSummary {
+    public static class SiteSummary
+    {
         private String description;
         private String version;
         private Duration installAge;

+ 39 - 27
data-service/src/main/java/password/pwm/receiver/TelemetryRestReceiver.java

@@ -3,7 +3,7 @@
  * http://www.pwm-project.org
  *
  * Copyright (c) 2006-2009 Novell, Inc.
- * Copyright (c) 2009-2017 The PWM Project
+ * Copyright (c) 2009-2018 The PWM Project
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
  */
 
 package password.pwm.receiver;
@@ -44,33 +43,39 @@ import java.io.Reader;
 import java.io.StringWriter;
 
 @WebServlet(
-        name="TelemetryRestReceiver",
-        urlPatterns={
+        name = "TelemetryRestReceiver",
+        urlPatterns = {
                 "/telemetry",
         }
 )
 
-public class TelemetryRestReceiver extends HttpServlet {
+public class TelemetryRestReceiver extends HttpServlet
+{
     @Override
-    protected void doPost(final HttpServletRequest req, final HttpServletResponse resp)
+    protected void doPost( final HttpServletRequest req, final HttpServletResponse resp )
             throws ServletException, IOException
     {
-        try {
-            resp.setHeader("Content","application/json");
-            final String input = readRequestBodyAsString(req, 1024 * 1024);
-            final TelemetryPublishBean telemetryPublishBean = JsonUtil.deserialize(input, TelemetryPublishBean.class);
-            final Storage stoage = ContextManager.getContextManager(this.getServletContext()).getApp().getStorage();
-            stoage.store(telemetryPublishBean);
-            resp.getWriter().print(RestResultBean.forSuccessMessage(null, null, null, Message.Success_Unknown).toJson());
-        } catch (PwmUnrecoverableException e) {
-            resp.getWriter().print(RestResultBean.fromError(e.getErrorInformation()).toJson());
-        } catch (Exception e) {
-            final RestResultBean restResultBean = RestResultBean.fromError(new ErrorInformation(PwmError.ERROR_UNKNOWN, e.getMessage()));
-            resp.getWriter().print(restResultBean.toJson());
+        try
+        {
+            resp.setHeader( "Content", "application/json" );
+            final String input = readRequestBodyAsString( req, 1024 * 1024 );
+            final TelemetryPublishBean telemetryPublishBean = JsonUtil.deserialize( input, TelemetryPublishBean.class );
+            final Storage stoage = ContextManager.getContextManager( this.getServletContext() ).getApp().getStorage();
+            stoage.store( telemetryPublishBean );
+            resp.getWriter().print( RestResultBean.forSuccessMessage( null, null, null, Message.Success_Unknown ).toJson() );
+        }
+        catch ( PwmUnrecoverableException e )
+        {
+            resp.getWriter().print( RestResultBean.fromError( e.getErrorInformation() ).toJson() );
+        }
+        catch ( Exception e )
+        {
+            final RestResultBean restResultBean = RestResultBean.fromError( new ErrorInformation( PwmError.ERROR_UNKNOWN, e.getMessage() ) );
+            resp.getWriter().print( restResultBean.toJson() );
         }
     }
 
-    private static String readRequestBodyAsString(final HttpServletRequest req, final int maxChars)
+    private static String readRequestBodyAsString( final HttpServletRequest req, final int maxChars )
             throws IOException, PwmUnrecoverableException
     {
         final StringWriter stringWriter = new StringWriter();
@@ -79,18 +84,25 @@ public class TelemetryRestReceiver extends HttpServlet {
                 PwmConstants.DEFAULT_CHARSET
         );
 
-        try {
-            IOUtils.copy(readerStream, stringWriter);
-        } catch (Exception e) {
+        try
+        {
+            IOUtils.copy( readerStream, stringWriter );
+        }
+        catch ( Exception e )
+        {
             final String errorMsg = "error reading request body stream: " + e.getMessage();
-            throw new PwmUnrecoverableException(new ErrorInformation(PwmError.ERROR_UNKNOWN,errorMsg));
-        } finally {
-            IOUtils.closeQuietly(readerStream);
+            throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_UNKNOWN, errorMsg ) );
+        }
+        finally
+        {
+            IOUtils.closeQuietly( readerStream );
         }
 
         final String stringValue = stringWriter.toString();
-        if (stringValue.length() > maxChars) {
-            throw new PwmUnrecoverableException(new ErrorInformation(PwmError.ERROR_UNKNOWN,"input request body is to big, size=" + stringValue.length() + ", max=" + maxChars));
+        if ( stringValue.length() > maxChars )
+        {
+            final String msg = "input request body is to big, size=" + stringValue.length() + ", max=" + maxChars;
+            throw new PwmUnrecoverableException( new ErrorInformation( PwmError.ERROR_UNKNOWN, msg ) );
         }
         return stringValue;
     }

+ 15 - 14
data-service/src/main/java/password/pwm/receiver/TelemetryViewerServlet.java

@@ -3,7 +3,7 @@
  * http://www.pwm-project.org
  *
  * Copyright (c) 2006-2009 Novell, Inc.
- * Copyright (c) 2009-2017 The PWM Project
+ * Copyright (c) 2009-2018 The PWM Project
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
  */
 
 package password.pwm.receiver;
@@ -35,37 +34,39 @@ import java.io.IOException;
 import java.util.concurrent.TimeUnit;
 
 @WebServlet(
-        name="TelemetryViewer",
-        urlPatterns={
+        name = "TelemetryViewer",
+        urlPatterns = {
                 "/viewer",
         }
 )
-public class TelemetryViewerServlet extends HttpServlet {
+public class TelemetryViewerServlet extends HttpServlet
+{
     private static final String PARAM_DAYS = "days";
 
-    public static String SUMMARY_ATTR = "SummaryBean";
+    public static final String SUMMARY_ATTR = "SummaryBean";
 
     @Override
-    protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException
+    protected void doGet( final HttpServletRequest req, final HttpServletResponse resp ) throws ServletException, IOException
     {
         final String daysString = req.getParameter( PARAM_DAYS );
         final int days = StringUtil.isEmpty( daysString ) ? 30 : Integer.parseInt( daysString );
-        final ContextManager contextManager = ContextManager.getContextManager(req.getServletContext());
+        final ContextManager contextManager = ContextManager.getContextManager( req.getServletContext() );
         final PwmReceiverApp app = contextManager.getApp();
 
         {
             final String errorState = app.getStatus().getErrorState();
-            if (!StringUtil.isEmpty(errorState)) {
-                resp.sendError(500, errorState);
+            if ( !StringUtil.isEmpty( errorState ) )
+            {
+                resp.sendError( 500, errorState );
                 final String htmlBody = "<html>Error: " + errorState + "</html>";
-                resp.getWriter().print(htmlBody);
+                resp.getWriter().print( htmlBody );
                 return;
             }
         }
 
         final Storage storage = app.getStorage();
-        final SummaryBean summaryBean = SummaryBean.fromStorage(storage, new TimeDuration(days, TimeUnit.DAYS ) );
-        req.setAttribute(SUMMARY_ATTR, summaryBean);
-        req.getServletContext().getRequestDispatcher("/WEB-INF/jsp/telemetry-viewer.jsp").forward(req,resp);
+        final SummaryBean summaryBean = SummaryBean.fromStorage( storage, new TimeDuration( days, TimeUnit.DAYS ) );
+        req.setAttribute( SUMMARY_ATTR, summaryBean );
+        req.getServletContext().getRequestDispatcher( "/WEB-INF/jsp/telemetry-viewer.jsp" ).forward( req, resp );
     }
 }

+ 0 - 0
data-service/src/main/resources/password/pwm/receiver/package-info.java


+ 2 - 6
data-service/src/main/webapp/META-INF/context.xml

@@ -1,11 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!--
   ~ Password Management Servlets (PWM)
-  ~ http://www.pwm-project.org
-  ~
-  ~ Copyright (c) 2006-2009 Novell, Inc.
-  ~ Copyright (c) 2009-2017 The PWM Project
+  ~ Copyright (c) 2006-2018 Novell, Inc.
   ~
   ~ This program is free software; you can redistribute it and/or modify
   ~ it under the terms of the GNU General Public License as published by
@@ -20,9 +16,9 @@
   ~ You should have received a copy of the GNU General Public License
   ~ along with this program; if not, write to the Free Software
   ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-  ~
   -->
 
+
 <Context tldValidation="false" unloadDelay="30000" useHttpOnly="true">
 
 </Context>

+ 22 - 27
data-service/src/main/webapp/WEB-INF/jsp/telemetry-viewer.jsp

@@ -1,35 +1,30 @@
-<%@ page import="password.pwm.config.PwmSetting" %>
+<%--
+ ~ Password Management Servlets (PWM)
+ ~ http://www.pwm-project.org
+ ~
+ ~ Copyright (c) 2006-2009 Novell, Inc.
+ ~ Copyright (c) 2009-2018 The PWM Project
+ ~
+ ~ This program is free software; you can redistribute it and/or modify
+ ~ it under the terms of the GNU General Public License as published by
+ ~ the Free Software Foundation; either version 2 of the License, or
+ ~ (at your option) any later version.
+ ~
+ ~ This program is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ ~ GNU General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License
+ ~ along with this program; if not, write to the Free Software
+ ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+--%>
+
 <%@ page import="password.pwm.receiver.SummaryBean" %>
 <%@ page import="password.pwm.receiver.TelemetryViewerServlet" %>
-<%@ page import="org.joda.time.DateTime" %>
-<%@ page import="java.time.format.DateTimeFormatter" %>
 <%@ page import="java.time.Instant" %>
-<%@ page import="java.time.LocalDateTime" %>
-<%@ page import="java.time.format.FormatStyle" %>
 <%@ page import="password.pwm.receiver.PwmReceiverApp" %>
 <%@ page import="password.pwm.receiver.ContextManager" %>
-<%--
-  ~ Password Management Servlets (PWM)
-  ~ http://www.pwm-project.org
-  ~
-  ~ Copyright (c) 2006-2009 Novell, Inc.
-  ~ Copyright (c) 2009-2017 The PWM Project
-  ~
-  ~ This program is free software; you can redistribute it and/or modify
-  ~ it under the terms of the GNU General Public License as published by
-  ~ the Free Software Foundation; either version 2 of the License, or
-  ~ (at your option) any later version.
-  ~
-  ~ This program is distributed in the hope that it will be useful,
-  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
-  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  ~ GNU General Public License for more details.
-  ~
-  ~ You should have received a copy of the GNU General Public License
-  ~ along with this program; if not, write to the Free Software
-  ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-  ~
-  --%>
 
 <!DOCTYPE html>
 <%@ page contentType="text/html" %>

+ 3 - 14
data-service/src/main/webapp/WEB-INF/web.xml

@@ -1,10 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
   ~ Password Management Servlets (PWM)
-  ~ http://www.pwm-project.org
-  ~
-  ~ Copyright (c) 2006-2009 Novell, Inc.
-  ~ Copyright (c) 2009-2017 The PWM Project
+  ~ Copyright (c) 2006-2018 Novell, Inc.
   ~
   ~ This program is free software; you can redistribute it and/or modify
   ~ it under the terms of the GNU General Public License as published by
@@ -19,23 +16,15 @@
   ~ You should have received a copy of the GNU General Public License
   ~ along with this program; if not, write to the Free Software
   ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-  ~
   -->
 
 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns="http://java.sun.com/xml/ns/javaee"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
          id="PWM" version="3.0">
-    <display-name>PWM Receiver</display-name>
+    <display-name>PWM Data Service</display-name>
     <!-- <distributable/> Clustering/Session replication is not supported -->
-    <description>Password Management Servlet</description>
-    <context-param>
-        <description>
-            Explicit location of application path working directory or the literal value "unspecified".  See the environment documentation at /public/reference/environment.jsp for more information.
-        </description>
-        <param-name>applicationPath</param-name>
-        <param-value>unspecified</param-value>
-    </context-param>
+    <description>Password Management Servlet - Data Service</description>
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
     </welcome-file-list>

+ 20 - 21
data-service/src/main/webapp/index.jsp

@@ -1,25 +1,24 @@
 <%--
-  ~ Password Management Servlets (PWM)
-  ~ http://www.pwm-project.org
-  ~
-  ~ Copyright (c) 2006-2009 Novell, Inc.
-  ~ Copyright (c) 2009-2017 The PWM Project
-  ~
-  ~ This program is free software; you can redistribute it and/or modify
-  ~ it under the terms of the GNU General Public License as published by
-  ~ the Free Software Foundation; either version 2 of the License, or
-  ~ (at your option) any later version.
-  ~
-  ~ This program is distributed in the hope that it will be useful,
-  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
-  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  ~ GNU General Public License for more details.
-  ~
-  ~ You should have received a copy of the GNU General Public License
-  ~ along with this program; if not, write to the Free Software
-  ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-  ~
-  --%>
+ ~ Password Management Servlets (PWM)
+ ~ http://www.pwm-project.org
+ ~
+ ~ Copyright (c) 2006-2009 Novell, Inc.
+ ~ Copyright (c) 2009-2018 The PWM Project
+ ~
+ ~ This program is free software; you can redistribute it and/or modify
+ ~ it under the terms of the GNU General Public License as published by
+ ~ the Free Software Foundation; either version 2 of the License, or
+ ~ (at your option) any later version.
+ ~
+ ~ This program is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ ~ GNU General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License
+ ~ along with this program; if not, write to the Free Software
+ ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+--%>
 
 <!DOCTYPE html>
 <%@ page language="java" session="true" isThreadSafe="true"

+ 1 - 1
onejar/onejar-assembly.xml

@@ -38,7 +38,7 @@
     </dependencySets>
     <files>
         <file>
-            <source>${project.basedir}${file.separator}..${file.separator}server${file.separator}target${file.separator}${warArtifactID}</source>
+            <source>${project.basedir}${file.separator}..${file.separator}webapp${file.separator}target${file.separator}${warArtifactID}</source>
             <outputDirectory>/</outputDirectory>
             <destName>embed.war</destName>
         </file>

+ 3 - 0
pom.xml

@@ -34,7 +34,10 @@
     <modules>
         <module>client</module>
         <module>server</module>
+        <module>webapp</module>
         <module>onejar</module>
+        <module>data-service</module>
+        <module>rest-test-service</module>
         <module>docker</module>
     </modules>
 

+ 283 - 0
rest-test-service/pom.xml

@@ -0,0 +1,283 @@
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <parent>
+        <groupId>org.pwm-project</groupId>
+        <artifactId>pwm-parent</artifactId>
+        <version>1.8.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>rest-test-server</artifactId>
+    <packaging>war</packaging>
+
+    <name>PWM Password Self Service: Web Service Test Server</name>
+
+    <properties>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+    </properties>
+
+    <profiles>
+        <profile>
+            <id>skip-tests</id>
+            <properties>
+                <skipTests>true</skipTests>
+            </properties>
+        </profile>
+        <profile>
+            <id>skip-javadoc</id>
+            <properties>
+                <maven.javadoc.skip>true</maven.javadoc.skip>
+            </properties>
+        </profile>
+        <profile>
+            <id>skip-checkstyle</id>
+            <properties>
+                <checkstyle.skip>true</checkstyle.skip>
+            </properties>
+        </profile>
+        <profile>
+            <id>skip-spotbugs</id>
+            <properties>
+                <skipSpotbugs>true</skipSpotbugs>
+            </properties>
+        </profile>
+    </profiles>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>com.github.spotbugs</groupId>
+                <artifactId>spotbugs-maven-plugin</artifactId>
+                <version>3.1.3.1</version>
+                <dependencies>
+                    <dependency>
+                        <groupId>com.github.spotbugs</groupId>
+                        <artifactId>spotbugs</artifactId>
+                        <version>3.1.6</version>
+                    </dependency>
+                </dependencies>
+                <configuration>
+                    <fork>false</fork>
+                    <excludeFilterFile>../build/spotbugs-exclude.xml</excludeFilterFile>
+                    <includeTests>false</includeTests>
+                    <skip>${skipSpotbugs}</skip>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>test</phase>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-enforcer-plugin</artifactId>
+                <version>3.0.0-M1</version>
+                <executions>
+                    <execution>
+                        <id>enforce-maven</id>
+                        <goals>
+                            <goal>enforce</goal>
+                        </goals>
+                        <configuration>
+                            <rules>
+                                <requireMavenVersion>
+                                    <version>${pwm.minimum.maven.version}</version>
+                                </requireMavenVersion>
+                            </rules>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.7.0</version>
+                <configuration>
+                    <source>${maven.compiler.source}</source>
+                    <target>${maven.compiler.target}</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.19.1</version>
+                <configuration>
+                    <skipTests>${skipTests}</skipTests>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <version>3.0.1</version>
+                <configuration>
+                    <includePom>true</includePom>
+                    <archive>
+                        <manifestEntries>
+                            <Implementation-Archive-Name>pwm.source</Implementation-Archive-Name>
+                            <Implementation-Title>${project.name}</Implementation-Title>
+                            <Implementation-Version>${project.version}</Implementation-Version>
+                            <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
+                            <Implementation-URL>${project.organization.url}</Implementation-URL>
+                            <Implementation-Build-Java-Vendor>${java.vendor}</Implementation-Build-Java-Vendor>
+                            <Implementation-Build-Java-Version>${java.version}</Implementation-Build-Java-Version>
+                            <Implementation-Build>${build.number}</Implementation-Build>
+                            <Implementation-Build-Timestamp>${timestamp.iso}</Implementation-Build-Timestamp>
+                            <Implementation-Revision>${build.revision}</Implementation-Revision>
+                            <Implementation-Version-Display>v${project.version} b${build.number} r${build.revision}</Implementation-Version-Display>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <version>3.0.0</version>
+                <configuration>
+                    <archive>
+                        <manifestEntries>
+                            <Implementation-Archive-Name>pwm.javadoc</Implementation-Archive-Name>
+                            <Implementation-Title>${project.name}</Implementation-Title>
+                            <Implementation-Version>${project.version}</Implementation-Version>
+                            <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
+                            <Implementation-URL>${project.organization.url}</Implementation-URL>
+                            <Implementation-Build-Java-Vendor>${java.vendor}</Implementation-Build-Java-Vendor>
+                            <Implementation-Build-Java-Version>${java.version}</Implementation-Build-Java-Version>
+                            <Implementation-Build>${build.number}</Implementation-Build>
+                            <Implementation-Build-Timestamp>${timestamp.iso}</Implementation-Build-Timestamp>
+                            <Implementation-Revision>${build.revision}</Implementation-Revision>
+                            <Implementation-Version-Display>v${project.version} b${build.number} r${build.revision}</Implementation-Version-Display>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <version>2.6</version>
+                <configuration>
+                    <archiveClasses>true</archiveClasses>
+                    <packagingExcludes>WEB-INF/classes</packagingExcludes>
+                    <archive>
+                        <manifestEntries>
+                            <Implementation-Archive-Name>pwm.war</Implementation-Archive-Name>
+                            <Implementation-Title>${project.name}</Implementation-Title>
+                            <Implementation-Version>${project.version}</Implementation-Version>
+                            <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
+                            <Implementation-URL>${project.organization.url}</Implementation-URL>
+                            <Implementation-Build-Java-Vendor>${java.vendor}</Implementation-Build-Java-Vendor>
+                            <Implementation-Build-Java-Version>${java.version}</Implementation-Build-Java-Version>
+                            <Implementation-Build>${build.number}</Implementation-Build>
+                            <Implementation-Build-Timestamp>${timestamp.iso}</Implementation-Build-Timestamp>
+                            <Implementation-Revision>${build.revision}</Implementation-Revision>
+                            <Implementation-Version-Display>v${project.version} b${build.number} r${build.revision}</Implementation-Version-Display>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <version>3.0.0</version>
+                <dependencies>
+                    <dependency>
+                        <groupId>com.puppycrawl.tools</groupId>
+                        <artifactId>checkstyle</artifactId>
+                        <version>8.11</version>
+                    </dependency>
+                </dependencies>
+                <executions>
+                    <execution>
+                        <id>validate</id>
+                        <phase>validate</phase>
+                        <configuration>
+                            <propertyExpansion>basedir=${basedir}</propertyExpansion>
+                            <configLocation>../build/checkstyle.xml</configLocation>
+                            <encoding>UTF-8</encoding>
+                            <consoleOutput>true</consoleOutput>
+                            <includeTestResources>false</includeTestResources>
+                            <failsOnError>true</failsOnError>
+                            <includes>**/*.java,**/*.jsp,**/*.properties,**/*.xml,**/*.css,**/*.svg</includes>
+                            <sourceDirectories>
+                                <directory>src/main</directory>
+                            </sourceDirectories>
+                        </configuration>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <!-- dev tool -->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.18.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.github.spotbugs</groupId>
+            <artifactId>spotbugs-annotations</artifactId>
+            <version>3.1.6</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <!-- Test dependencies -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.12</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <version>2.13.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <version>3.9.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.github.tomakehurst</groupId>
+            <artifactId>wiremock</artifactId>
+            <version>2.18.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.reflections</groupId>
+            <artifactId>reflections</artifactId>
+            <version>0.9.11</version>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- container dependencies -->
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>javax.servlet-api</artifactId>
+            <version>4.0.1</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet.jsp</groupId>
+            <artifactId>jsp-api</artifactId>
+            <version>2.2.1-b03</version>
+            <scope>provided</scope>
+        </dependency>
+        <!-- / container dependencies -->
+
+    </dependencies>
+
+</project>

+ 24 - 0
rest-test-service/src/main/webapp/META-INF/context.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Password Management Servlets (PWM)
+  ~ Copyright (c) 2006-2018 Novell, Inc.
+  ~
+  ~ This program is free software; you can redistribute it and/or modify
+  ~ it under the terms of the GNU General Public License as published by
+  ~ the Free Software Foundation; either version 2 of the License, or
+  ~ (at your option) any later version.
+  ~
+  ~ This program is distributed in the hope that it will be useful,
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  ~ GNU General Public License for more details.
+  ~
+  ~ You should have received a copy of the GNU General Public License
+  ~ along with this program; if not, write to the Free Software
+  ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+  -->
+
+
+<Context tldValidation="false" unloadDelay="30000" useHttpOnly="true">
+
+</Context>

+ 47 - 0
rest-test-service/src/main/webapp/WEB-INF/web.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Password Management Servlets (PWM)
+  ~ Copyright (c) 2006-2018 Novell, Inc.
+  ~
+  ~ This program is free software; you can redistribute it and/or modify
+  ~ it under the terms of the GNU General Public License as published by
+  ~ the Free Software Foundation; either version 2 of the License, or
+  ~ (at your option) any later version.
+  ~
+  ~ This program is distributed in the hope that it will be useful,
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  ~ GNU General Public License for more details.
+  ~
+  ~ You should have received a copy of the GNU General Public License
+  ~ along with this program; if not, write to the Free Software
+  ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+  -->
+
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://java.sun.com/xml/ns/javaee"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+         id="PWM-rest-test-servlet" version="3.0">
+    <display-name>PWM REST Test Server</display-name>
+    <!-- <distributable/> Clustering/Session replication is not supported -->
+    <description>PWM REST Test Server</description>
+    <welcome-file-list>
+        <welcome-file>index.jsp</welcome-file>
+    </welcome-file-list>
+    <session-config>
+        <session-timeout>5</session-timeout>
+        <cookie-config>
+            <http-only>true</http-only>
+        </cookie-config>
+    </session-config>
+    <jsp-config>
+        <jsp-property-group>
+            <url-pattern>*.jsp</url-pattern>
+            <trim-directive-whitespaces>true</trim-directive-whitespaces>
+        </jsp-property-group>
+        <jsp-property-group>
+            <url-pattern>*.jsp</url-pattern>
+            <page-encoding>UTF-8</page-encoding>
+        </jsp-property-group>
+    </jsp-config>
+</web-app>

+ 31 - 0
rest-test-service/src/main/webapp/index.jsp

@@ -0,0 +1,31 @@
+<%--
+ ~ Password Management Servlets (PWM)
+ ~ http://www.pwm-project.org
+ ~
+ ~ Copyright (c) 2006-2009 Novell, Inc.
+ ~ Copyright (c) 2009-2018 The PWM Project
+ ~
+ ~ This program is free software; you can redistribute it and/or modify
+ ~ it under the terms of the GNU General Public License as published by
+ ~ the Free Software Foundation; either version 2 of the License, or
+ ~ (at your option) any later version.
+ ~
+ ~ This program is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ ~ GNU General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License
+ ~ along with this program; if not, write to the Free Software
+ ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+--%>
+
+<!DOCTYPE html>
+<%@ page language="java" session="true" isThreadSafe="true"
+         contentType="text/html" %>
+<html>
+<body>
+<div>html-pwm-receiver
+</div>
+</body>
+</html>

+ 9 - 162
server/pom.xml

@@ -9,10 +9,10 @@
 
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>pwm</artifactId>
-    <packaging>war</packaging>
+    <artifactId>pwm-server</artifactId>
+    <packaging>jar</packaging>
 
-    <name>PWM Password Self Service: Server</name>
+    <name>PWM Password Self Service: Server JAR</name>
 
     <properties>
         <maven.compiler.source>1.8</maven.compiler.source>
@@ -57,7 +57,7 @@
                         <version>2.6</version>
                         <configuration>
                             <descriptors>
-                                <descriptor>src/build/assembly/release-bundle.xml</descriptor>
+                                <descriptor>../webapp/src/build/assembly/release-bundle.xml</descriptor>
                             </descriptors>
                             <finalName>${project.build.finalName}-${timestamp.iso}</finalName>
                         </configuration>
@@ -120,12 +120,12 @@
                     <dependency>
                         <groupId>com.github.spotbugs</groupId>
                         <artifactId>spotbugs</artifactId>
-                        <version>3.1.5</version>
+                        <version>3.1.6</version>
                     </dependency>
                 </dependencies>
                 <configuration>
                     <fork>false</fork>
-                    <excludeFilterFile>src/build/spotbugs-exclude.xml</excludeFilterFile>
+                    <excludeFilterFile>../build/spotbugs-exclude.xml</excludeFilterFile>
                     <includeTests>false</includeTests>
                     <skip>${skipSpotbugs}</skip>
                 </configuration>
@@ -158,41 +158,6 @@
                     </execution>
                 </executions>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <version>2.6</version>
-                <executions>
-                    <execution>
-                        <id>make-ldif-schema-zip</id>
-                        <phase>prepare-package</phase>
-                        <configuration>
-                            <finalName>${project.build.finalName}/public/reference/ldif-schema</finalName>
-                            <appendAssemblyId>false</appendAssemblyId>
-                            <descriptors>
-                                <descriptor>src/build/assembly/ldif-schema-zip.xml</descriptor>
-                            </descriptors>
-                        </configuration>
-                        <goals>
-                            <goal>single</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>make-source-reference-zip</id>
-                        <phase>prepare-package</phase>
-                        <configuration>
-                            <finalName>${project.build.finalName}/public/reference/source</finalName>
-                            <appendAssemblyId>false</appendAssemblyId>
-                            <descriptors>
-                                <descriptor>src/build/assembly/source-reference.xml</descriptor>
-                            </descriptors>
-                        </configuration>
-                        <goals>
-                            <goal>single</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
@@ -258,30 +223,6 @@
                     </archive>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-war-plugin</artifactId>
-                <version>2.6</version>
-                <configuration>
-                    <archiveClasses>true</archiveClasses>
-                    <packagingExcludes>WEB-INF/classes</packagingExcludes>
-                    <archive>
-                        <manifestEntries>
-                            <Implementation-Archive-Name>pwm.war</Implementation-Archive-Name>
-                            <Implementation-Title>${project.name}</Implementation-Title>
-                            <Implementation-Version>${project.version}</Implementation-Version>
-                            <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
-                            <Implementation-URL>${project.organization.url}</Implementation-URL>
-                            <Implementation-Build-Java-Vendor>${java.vendor}</Implementation-Build-Java-Vendor>
-                            <Implementation-Build-Java-Version>${java.version}</Implementation-Build-Java-Version>
-                            <Implementation-Build>${build.number}</Implementation-Build>
-                            <Implementation-Build-Timestamp>${timestamp.iso}</Implementation-Build-Timestamp>
-                            <Implementation-Revision>${build.revision}</Implementation-Revision>
-                            <Implementation-Version-Display>v${project.version} b${build.number} r${build.revision}</Implementation-Version-Display>
-                        </manifestEntries>
-                    </archive>
-                </configuration>
-            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-checkstyle-plugin</artifactId>
@@ -299,7 +240,7 @@
                         <phase>validate</phase>
                         <configuration>
                             <propertyExpansion>basedir=${basedir}</propertyExpansion>
-                            <configLocation>src/build/checkstyle.xml</configLocation>
+                            <configLocation>../build/checkstyle.xml</configLocation>
                             <encoding>UTF-8</encoding>
                             <consoleOutput>true</consoleOutput>
                             <includeTestResources>false</includeTestResources>
@@ -342,24 +283,6 @@
                     </execution>
                 </executions>
             </plugin>
-            <plugin>
-                <!-- verifies jsp pages compile, but does not include the compiled versions in the WAR -->
-                <groupId>io.leonard.maven.plugins</groupId>
-                <artifactId>jspc-maven-plugin</artifactId>
-                <version>2.4.2</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>compile</goal>
-                        </goals>
-                        <phase>compile</phase>
-                        <configuration>
-                            <compilerVersion>${maven.compiler.source}</compilerVersion>
-                            <keepSources>false</keepSources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
             <plugin>
                 <!-- creates the classes directory early in the build so the attribution plugin doesn't fail -->
                 <artifactId>maven-antrun-plugin</artifactId>
@@ -497,37 +420,6 @@
                         </manifestEntries>
                     </archive>
                 </configuration>
-                <executions>
-                    <execution>
-                        <id>make-a-jar</id>
-                        <phase>compile</phase>
-                        <goals>
-                            <goal>jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-install-plugin</artifactId>
-                <version>2.5.2</version>
-                <executions>
-                    <execution>
-                        <phase>install</phase>
-                        <goals>
-                            <goal>install-file</goal>
-                        </goals>
-                        <configuration>
-                            <packaging>jar</packaging>
-                            <artifactId>${project.artifactId}</artifactId>
-                            <groupId>${project.groupId}</groupId>
-                            <version>${project.version}</version>
-                            <file>
-                                ${project.build.directory}/${project.artifactId}-${project.version}.jar
-                            </file>
-                        </configuration>
-                    </execution>
-                </executions>
             </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -583,7 +475,7 @@
         <dependency>
             <groupId>com.github.spotbugs</groupId>
             <artifactId>spotbugs-annotations</artifactId>
-            <version>3.1.5</version>
+            <version>3.1.6</version>
             <scope>provided</scope>
         </dependency>
 
@@ -808,51 +700,6 @@
                 </exclusion>
             </exclusions>
         </dependency>
-
-
-
-        <!-- client webjar dependencies -->
-        <!-- changes in client dependencies require updating AppProperty.properties:http.resources.webjarMappings -->
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>pwm-client</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.webjars.bower</groupId>
-            <artifactId>dojo</artifactId>
-            <version>1.13.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.webjars.bower</groupId>
-            <artifactId>dijit</artifactId>
-            <version>1.13.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.webjars.bower</groupId>
-            <artifactId>dojox</artifactId>
-            <version>1.13.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.webjars.bower</groupId>
-            <artifactId>dgrid</artifactId>
-            <version>1.2.1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.webjars.bower</groupId>
-            <artifactId>dstore</artifactId>
-            <version>1.1.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.webjars.bower</groupId>
-            <artifactId>font-awesome</artifactId>
-            <version>4.7.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.webjars.bower</groupId>
-            <artifactId>famfamfam-flags</artifactId>
-            <version>1.0.0</version>
-        </dependency>
     </dependencies>
 
     <repositories>
@@ -867,7 +714,7 @@
         <repository>
             <id>project.local</id>
             <name>project</name>
-            <url>file:///${project.basedir}/local-maven-repo</url>
+            <url>file:///${project.basedir}/../build/local-maven-repo</url>
         </repository>
     </repositories>
     <pluginRepositories>

+ 2 - 2
server/supplemental/i18n/Display_nl-colloquial.properties → server/src/main/resources/password/pwm/i18n/Display_nl-colloquial.properties

@@ -1,9 +1,9 @@
 #
 # Password Management Servlets (PWM)
-# http://code.google.com/p/pwm/
+# http://www.pwm-project.org
 #
 # Copyright (c) 2006-2009 Novell, Inc.
-# Copyright (c) 2009-2012 The PWM Project
+# Copyright (c) 2009-2018 The PWM Project
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by

+ 2 - 2
server/supplemental/i18n/Message_nl-colloquial.properties → server/src/main/resources/password/pwm/i18n/Message_nl-colloquial.properties

@@ -1,9 +1,9 @@
 #
 # Password Management Servlets (PWM)
-# http://code.google.com/p/pwm/
+# http://www.pwm-project.org
 #
 # Copyright (c) 2006-2009 Novell, Inc.
-# Copyright (c) 2009-2012 The PWM Project
+# Copyright (c) 2009-2018 The PWM Project
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by

+ 0 - 0
server/supplemental/i18n/nl-colloquial.readme → server/src/main/resources/password/pwm/i18n/nl-colloquial.readme


+ 441 - 0
webapp/pom.xml

@@ -0,0 +1,441 @@
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <parent>
+        <groupId>org.pwm-project</groupId>
+        <artifactId>pwm-parent</artifactId>
+        <version>1.8.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>pwm</artifactId>
+    <packaging>war</packaging>
+
+    <name>PWM Password Self Service: Server WAR</name>
+
+    <properties>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+        <skipTests>false</skipTests>
+        <skipSpotbugs>false</skipSpotbugs>
+    </properties>
+
+    <profiles>
+        <profile>
+            <id>skip-tests</id>
+            <properties>
+                <skipTests>true</skipTests>
+            </properties>
+        </profile>
+        <profile>
+            <id>skip-javadoc</id>
+            <properties>
+                <maven.javadoc.skip>true</maven.javadoc.skip>
+            </properties>
+        </profile>
+        <profile>
+            <id>skip-checkstyle</id>
+            <properties>
+                <checkstyle.skip>true</checkstyle.skip>
+            </properties>
+        </profile>
+        <profile>
+            <id>skip-spotbugs</id>
+            <properties>
+                <skipSpotbugs>true</skipSpotbugs>
+            </properties>
+        </profile>
+        <profile>
+            <!-- Builds a zip file containing the built war file, along with the supplemental directory -->
+            <id>release</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-assembly-plugin</artifactId>
+                        <version>2.6</version>
+                        <configuration>
+                            <descriptors>
+                                <descriptor>src/build/assembly/release-bundle.xml</descriptor>
+                            </descriptors>
+                            <finalName>${project.build.finalName}-${timestamp.iso}</finalName>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>make-release-bundle</id>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>single</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-enforcer-plugin</artifactId>
+                <version>3.0.0-M1</version>
+                <executions>
+                    <execution>
+                        <id>enforce-maven</id>
+                        <goals>
+                            <goal>enforce</goal>
+                        </goals>
+                        <configuration>
+                            <rules>
+                                <requireMavenVersion>
+                                    <version>${pwm.minimum.maven.version}</version>
+                                </requireMavenVersion>
+                            </rules>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>2.6</version>
+                <executions>
+                    <execution>
+                        <id>make-ldif-schema-zip</id>
+                        <phase>prepare-package</phase>
+                        <configuration>
+                            <finalName>${project.build.finalName}/public/reference/ldif-schema</finalName>
+                            <appendAssemblyId>false</appendAssemblyId>
+                            <descriptors>
+                                <descriptor>src/build/assembly/ldif-schema-zip.xml</descriptor>
+                            </descriptors>
+                        </configuration>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>make-source-reference-zip</id>
+                        <phase>prepare-package</phase>
+                        <configuration>
+                            <finalName>${project.build.finalName}/public/reference/source</finalName>
+                            <appendAssemblyId>false</appendAssemblyId>
+                            <descriptors>
+                                <descriptor>src/build/assembly/source-reference.xml</descriptor>
+                            </descriptors>
+                        </configuration>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.7.0</version>
+                <configuration>
+                    <source>${maven.compiler.source}</source>
+                    <target>${maven.compiler.target}</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.19.1</version>
+                <configuration>
+                    <skipTests>${skipTests}</skipTests>
+                    <excludes>
+                        <exclude>password.pwm.manual.*</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <version>3.0.1</version>
+                <configuration>
+                    <includePom>true</includePom>
+                    <archive>
+                        <manifestEntries>
+                            <Implementation-Archive-Name>pwm.source</Implementation-Archive-Name>
+                            <Implementation-Title>${project.name}</Implementation-Title>
+                            <Implementation-Version>${project.version}</Implementation-Version>
+                            <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
+                            <Implementation-URL>${project.organization.url}</Implementation-URL>
+                            <Implementation-Build-Java-Vendor>${java.vendor}</Implementation-Build-Java-Vendor>
+                            <Implementation-Build-Java-Version>${java.version}</Implementation-Build-Java-Version>
+                            <Implementation-Build>${build.number}</Implementation-Build>
+                            <Implementation-Build-Timestamp>${timestamp.iso}</Implementation-Build-Timestamp>
+                            <Implementation-Revision>${build.revision}</Implementation-Revision>
+                            <Implementation-Version-Display>v${project.version} b${build.number} r${build.revision}</Implementation-Version-Display>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <version>3.0.0</version>
+                <configuration>
+                    <archive>
+                        <manifestEntries>
+                            <Implementation-Archive-Name>pwm.javadoc</Implementation-Archive-Name>
+                            <Implementation-Title>${project.name}</Implementation-Title>
+                            <Implementation-Version>${project.version}</Implementation-Version>
+                            <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
+                            <Implementation-URL>${project.organization.url}</Implementation-URL>
+                            <Implementation-Build-Java-Vendor>${java.vendor}</Implementation-Build-Java-Vendor>
+                            <Implementation-Build-Java-Version>${java.version}</Implementation-Build-Java-Version>
+                            <Implementation-Build>${build.number}</Implementation-Build>
+                            <Implementation-Build-Timestamp>${timestamp.iso}</Implementation-Build-Timestamp>
+                            <Implementation-Revision>${build.revision}</Implementation-Revision>
+                            <Implementation-Version-Display>v${project.version} b${build.number} r${build.revision}</Implementation-Version-Display>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <version>2.6</version>
+                <configuration>
+                    <archiveClasses>true</archiveClasses>
+                    <packagingExcludes>WEB-INF/classes</packagingExcludes>
+                    <archive>
+                        <manifestEntries>
+                            <Implementation-Archive-Name>${warArtifactID}</Implementation-Archive-Name>
+                            <Implementation-Title>${project.name}</Implementation-Title>
+                            <Implementation-Version>${project.version}</Implementation-Version>
+                            <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
+                            <Implementation-URL>${project.organization.url}</Implementation-URL>
+                            <Implementation-Build-Java-Vendor>${java.vendor}</Implementation-Build-Java-Vendor>
+                            <Implementation-Build-Java-Version>${java.version}</Implementation-Build-Java-Version>
+                            <Implementation-Build>${build.number}</Implementation-Build>
+                            <Implementation-Build-Timestamp>${timestamp.iso}</Implementation-Build-Timestamp>
+                            <Implementation-Revision>${build.revision}</Implementation-Revision>
+                            <Implementation-Version-Display>v${project.version} b${build.number} r${build.revision}</Implementation-Version-Display>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <version>3.0.0</version>
+                <dependencies>
+                    <dependency>
+                        <groupId>com.puppycrawl.tools</groupId>
+                        <artifactId>checkstyle</artifactId>
+                        <version>8.11</version>
+                    </dependency>
+                </dependencies>
+                <executions>
+                    <execution>
+                        <id>validate</id>
+                        <phase>validate</phase>
+                        <configuration>
+                            <propertyExpansion>basedir=${basedir}</propertyExpansion>
+                            <configLocation>../build/checkstyle.xml</configLocation>
+                            <encoding>UTF-8</encoding>
+                            <consoleOutput>true</consoleOutput>
+                            <includeTestResources>false</includeTestResources>
+                            <failsOnError>true</failsOnError>
+                            <includes>**/*.java,**/*.jsp,**/*.properties,**/*.xml,**/*.css,**/*.svg</includes>
+                            <sourceDirectories>
+                                <directory>src/main</directory>
+                            </sourceDirectories>
+                        </configuration>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>io.leonard.maven.plugins</groupId>
+                <artifactId>jspc-maven-plugin</artifactId>
+                <version>2.4.2</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>
+                        <phase>compile</phase>
+                        <configuration>
+                            <compilerVersion>${maven.compiler.source}</compilerVersion>
+                            <keepSources>false</keepSources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-deploy-plugin</artifactId>
+                <version>2.8.2</version>
+                <executions>
+                    <execution>
+                        <phase>deploy</phase>
+                        <goals>
+                            <goal>deploy-file</goal>
+                        </goals>
+                        <configuration>
+                            <packaging>jar</packaging>
+                            <generatePom>true</generatePom>
+                            <url>${project.distributionManagement.repository.url}</url>
+                            <artifactId>${project.artifactId}</artifactId>
+                            <groupId>${project.groupId}</groupId>
+                            <version>${project.version}</version>
+                            <file>${project.build.directory}/${project.artifactId}-${project.version}.jar</file>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <reporting>
+        <plugins>
+            <plugin> <!-- checks owsp vulnerability database -->
+                <groupId>org.owasp</groupId>
+                <artifactId>dependency-check-maven</artifactId>
+                <version>3.1.2</version>
+                <reportSets>
+                    <reportSet>
+                        <reports>
+                            <report>aggregate</report>
+                        </reports>
+                    </reportSet>
+                </reportSets>
+            </plugin>
+        </plugins>
+    </reporting>
+
+    <dependencies>
+        <!-- Test dependencies -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.12</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <version>2.13.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <version>3.9.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.github.tomakehurst</groupId>
+            <artifactId>wiremock</artifactId>
+            <version>2.18.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.reflections</groupId>
+            <artifactId>reflections</artifactId>
+            <version>0.9.11</version>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- main jar -->
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>pwm-server</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <!-- container dependencies -->
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>javax.servlet-api</artifactId>
+            <version>4.0.1</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet.jsp</groupId>
+            <artifactId>jsp-api</artifactId>
+            <version>2.2.1-b03</version>
+            <scope>provided</scope>
+        </dependency>
+        <!-- / container dependencies -->
+
+
+        <!-- client webjar dependencies -->
+        <!-- changes in client dependencies require updating AppProperty.properties:http.resources.webjarMappings -->
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>pwm-client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.webjars.bower</groupId>
+            <artifactId>dojo</artifactId>
+            <version>1.13.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.webjars.bower</groupId>
+            <artifactId>dijit</artifactId>
+            <version>1.13.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.webjars.bower</groupId>
+            <artifactId>dojox</artifactId>
+            <version>1.13.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.webjars.bower</groupId>
+            <artifactId>dgrid</artifactId>
+            <version>1.2.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.webjars.bower</groupId>
+            <artifactId>dstore</artifactId>
+            <version>1.1.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.webjars.bower</groupId>
+            <artifactId>font-awesome</artifactId>
+            <version>4.7.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.webjars.bower</groupId>
+            <artifactId>famfamfam-flags</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+    </dependencies>
+
+    <repositories>
+        <repository>
+            <id>central</id>
+            <url>https://repo1.maven.org/maven2</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>
+        <!-- Include our own local maven repository, for artifacts that aren't available elsewhere -->
+        <repository>
+            <id>project.local</id>
+            <name>project</name>
+            <url>file:///${project.basedir}/../build/local-maven-repo</url>
+        </repository>
+    </repositories>
+    <pluginRepositories>
+        <pluginRepository>
+            <id>central</id>
+            <url>https://repo1.maven.org/maven2</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </pluginRepository>
+    </pluginRepositories>
+</project>

+ 0 - 0
server/src/build/assembly/ldif-schema-zip.xml → webapp/src/build/assembly/ldif-schema-zip.xml


+ 0 - 0
server/src/build/assembly/release-bundle.xml → webapp/src/build/assembly/release-bundle.xml


+ 0 - 0
server/src/build/assembly/source-reference.xml → webapp/src/build/assembly/source-reference.xml


+ 0 - 0
server/src/build/ldif/AD-schema.ldif → webapp/src/build/ldif/AD-schema.ldif


+ 0 - 0
server/src/build/ldif/ApacheDS-schema.ldif → webapp/src/build/ldif/ApacheDS-schema.ldif


+ 0 - 0
server/src/build/ldif/OracleDS-schema.ldif → webapp/src/build/ldif/OracleDS-schema.ldif


+ 0 - 0
server/src/build/ldif/edirectory-schema-update.ldif → webapp/src/build/ldif/edirectory-schema-update.ldif


+ 0 - 0
server/src/build/ldif/edirectory-schema.ldif → webapp/src/build/ldif/edirectory-schema.ldif


+ 0 - 0
server/src/build/ldif/edirectory-schema.sch → webapp/src/build/ldif/edirectory-schema.sch


+ 0 - 0
server/src/build/ldif/openDJ-schema.ldif → webapp/src/build/ldif/openDJ-schema.ldif


+ 0 - 0
server/src/build/ldif/openldap.ldif → webapp/src/build/ldif/openldap.ldif


+ 0 - 0
server/src/build/ldif/openldap.schema → webapp/src/build/ldif/openldap.schema


+ 0 - 0
server/src/main/webapp/META-INF/context.xml → webapp/src/main/webapp/META-INF/context.xml


+ 0 - 0
server/src/main/webapp/WEB-INF/Command.bat → webapp/src/main/webapp/WEB-INF/Command.bat


+ 0 - 0
server/src/main/webapp/WEB-INF/command.sh → webapp/src/main/webapp/WEB-INF/command.sh


+ 0 - 0
server/src/main/webapp/WEB-INF/jsp/accountinformation.jsp → webapp/src/main/webapp/WEB-INF/jsp/accountinformation.jsp


+ 0 - 0
server/src/main/webapp/WEB-INF/jsp/activateuser-agreement.jsp → webapp/src/main/webapp/WEB-INF/jsp/activateuser-agreement.jsp


+ 0 - 0
server/src/main/webapp/WEB-INF/jsp/activateuser-entercode.jsp → webapp/src/main/webapp/WEB-INF/jsp/activateuser-entercode.jsp


+ 0 - 0
server/src/main/webapp/WEB-INF/jsp/activateuser-tokenchoice.jsp → webapp/src/main/webapp/WEB-INF/jsp/activateuser-tokenchoice.jsp


+ 0 - 0
server/src/main/webapp/WEB-INF/jsp/activateuser-tokensuccess.jsp → webapp/src/main/webapp/WEB-INF/jsp/activateuser-tokensuccess.jsp


+ 0 - 0
server/src/main/webapp/WEB-INF/jsp/activateuser.jsp → webapp/src/main/webapp/WEB-INF/jsp/activateuser.jsp


+ 0 - 0
server/src/main/webapp/WEB-INF/jsp/admin-activity.jsp → webapp/src/main/webapp/WEB-INF/jsp/admin-activity.jsp


+ 0 - 0
server/src/main/webapp/WEB-INF/jsp/admin-analysis.jsp → webapp/src/main/webapp/WEB-INF/jsp/admin-analysis.jsp


+ 0 - 0
server/src/main/webapp/WEB-INF/jsp/admin-dashboard.jsp → webapp/src/main/webapp/WEB-INF/jsp/admin-dashboard.jsp


+ 0 - 0
server/src/main/webapp/WEB-INF/jsp/admin-logview-window.jsp → webapp/src/main/webapp/WEB-INF/jsp/admin-logview-window.jsp


Неке датотеке нису приказане због велике количине промена