From 66077b15af7befbaca70389ec24b328bbb99fa6c Mon Sep 17 00:00:00 2001 From: Joerg Hohwiller Date: Mon, 1 Dec 2014 14:08:03 +0100 Subject: [PATCH] oasp/oasp4j#81: wiped repository history before making public --- .editorconfig | 4 + .gitignore | 16 + LICENSE.txt | 202 + README.md | 4 + oasp4j-beanmapping/.checkstyle | 7 + oasp4j-beanmapping/pom.xml | 27 + .../beanmapping/common/api/BeanMapper.java | 48 + .../common/base/AbstractBeanMapper.java | 56 + .../common/impl/DozerBeanMapper.java | 50 + .../common/impl/IdentityConverter.java | 29 + oasp4j-configuration/.checkstyle | 7 + oasp4j-configuration/pom.xml | 19 + .../ApplicationConfigurationConstants.java | 41 + oasp4j-jpa/pom.xml | 36 + .../api/AbstractPersistenceEntity.java | 155 + .../oasp/module/jpa/dataaccess/api/Dao.java | 18 + .../module/jpa/dataaccess/api/GenericDao.java | 117 + .../jpa/dataaccess/api/MasterDataDao.java | 28 + .../jpa/dataaccess/base/AbstractDao.java | 27 + .../dataaccess/base/AbstractGenericDao.java | 265 ++ .../base/AbstractMasterDataDao.java | 38 + oasp4j-logging/.checkstyle | 7 + oasp4j-logging/pom.xml | 41 + .../common/api/DiagnosticContextFacade.java | 33 + .../logging/common/api/LoggingConstants.java | 27 + .../impl/DiagnosticContextFacadeImpl.java | 50 + .../common/impl/DiagnosticContextFilter.java | 165 + .../common/impl/SingleLinePatternLayout.java | 91 + oasp4j-monitoring/.checkstyle | 7 + oasp4j-monitoring/pom.xml | 60 + .../impl/jmx/ServiceStatisticsMBean.java | 118 + .../service/impl/jmx/StatusMonitorMBean.java | 55 + .../loadbalancer/LoadbalancerServlet.java | 71 + .../jmx/test/ServiceStatisticsMBeanTest.java | 64 + oasp4j-parent/pom.xml | 531 +++ oasp4j-rest/pom.xml | 59 + .../rest/service/api/RequestParameters.java | 192 + .../impl/RestServiceExceptionFacade.java | 423 ++ .../impl/json/AbstractJsonDeserializer.java | 76 + .../impl/json/MixInAnnotationsModule.java | 49 + .../impl/json/ObjectMapperFactory.java | 115 + .../impl/RestServiceExceptionFacadeTest.java | 256 + oasp4j-security/.checkstyle | 7 + oasp4j-security/pom.xml | 78 + .../api/accesscontrol/AccessControl.java | 109 + .../api/accesscontrol/AccessControlGroup.java | 164 + .../AccessControlPermission.java | 43 + .../accesscontrol/AccessControlProvider.java | 55 + .../accesscontrol/AccessControlSchema.java | 87 + .../PrincipalAccessControlProvider.java | 22 + .../InvalidConfigurationException.java | 36 + ...essControlBasedAuthenticationProvider.java | 163 + .../AbstractAccessControlProvider.java | 206 + .../AccessControlGrantedAuthority.java | 59 + .../AccessControlSchemaMapper.java | 34 + .../AccessControlSchemaProvider.java | 19 + .../PrincipalGroupProviderGroupImpl.java | 58 + ...essControlBasedAuthenticationProvider.java | 45 + .../AccessControlProviderImpl.java | 55 + .../AccessControlSchemaProviderImpl.java | 111 + .../AccessControlSchemaXmlMapper.java | 165 + .../AccessControlSchemaXsdWriter.java | 32 + ...SuccessHandlerSendingOkHttpStatusCode.java | 36 + ...nUsernamePasswordAuthenticationFilter.java | 191 + ...ccessHandlerReturningOkHttpStatusCode.java | 25 + .../common/impl/web/RetainAnchorFilter.java | 193 + .../module/security/access-control-schema.xsd | 53 + .../AccessControlSchemaTest.java | 247 + .../app/security/access-control-schema.xml | 45 + .../access-control-schema_corrupted.xml | 20 + .../security/access-control-schema_cyclic.xml | 29 + .../access-control-schema_groupTypes.xml | 24 + .../access-control-schema_illegal.xml | 8 + .../src/test/resources/logback.xml | 19 + oasp4j-web/pom.xml | 32 + ...rtiesWebApplicationContextInitializer.java | 60 + .../web/common/base/ToggleFilterWrapper.java | 126 + pom.xml | 253 + settings/checkstyle/checkstyle.xml | 144 + settings/clientpe-properties.bat | 6 + settings/eclipse/codetemplates.xml | 30 + settings/eclipse/formatter.xml | 251 + settings/eclipse/project.dictionary | 17 + .../eclipse/project.dictionary.readme.txt | 6 + .../workspace/replacement-patterns.properties | 0 .../.metadata/.mylyn/repositories.xml.zip | Bin 0 -> 576 bytes .../.indexes/properties.index | Bin 0 -> 80 bytes .../GitProjectData.properties | 3 + .../Servers/.indexes/properties.index | Bin 0 -> 80 bytes .../.projects/Servers/.syncinfo | Bin 0 -> 3776 bytes .../GitProjectData.properties | 3 + .../.root/.indexes/history.version | 1 + .../.root/.indexes/properties.index | Bin 0 -> 151 bytes .../.root/.indexes/properties.version | 1 + .../org.eclipse.core.resources/.root/1.tree | Bin 0 -> 1008 bytes .../.safetable/org.eclipse.core.resources | Bin 0 -> 1146 bytes .../org.eclipse.e4.ui.css.swt.theme.prefs | 2 + .../.settings/org.eclipse.ui.ide.prefs | 6 + .../.settings/org.eclipse.ui.workbench.prefs | 6 + .../org.sonar.ide.eclipse.core.prefs | 3 + ....springsource.ide.eclipse.commons.ui.prefs | 2 + ...pringsource.ide.eclipse.dashboard.ui.prefs | 2 + ...ris.subversion.subclipse.tools.usage.prefs | 2 + .../org.tigris.subversion.subclipse.ui.prefs | 4 + .../ServerProfiles.dat | Bin 0 -> 1976 bytes .../org.eclipse.mylyn.builds.ui/builds.xmi | 10 + .../org.eclipse.ui.ide/dialog_settings.xml | 8 + .../org.eclipse.wst.server.core/servers.xml | 4 + .../eclipse/workspace/setup/Servers/.project | 11 + .../Servers/Tomcat7-config/catalina.policy | 242 + .../Tomcat7-config/catalina.properties | 119 + .../setup/Servers/Tomcat7-config/context.xml | 33 + .../setup/Servers/Tomcat7-config/server.xml | 32 + .../Servers/Tomcat7-config/tomcat-users.xml | 27 + .../setup/Servers/Tomcat7-config/web.xml | 4192 +++++++++++++++++ .../checkstyle-config.xml | 6 + .../.settings/org.eclipse.ant.core.prefs | 3 + .../.settings/org.eclipse.compare.prefs | 3 + .../org.eclipse.core.resources.prefs | 3 + .../.settings/org.eclipse.debug.core.prefs | 3 + .../.settings/org.eclipse.jdt.core.prefs | 336 ++ .../.settings/org.eclipse.jdt.debug.ui.prefs | 5 + .../.settings/org.eclipse.jdt.ui.prefs | 152 + .../.settings/org.eclipse.jst.jsp.core.prefs | 2 + .../org.eclipse.jst.server.tomcat.core.prefs | 3 + .../.settings/org.eclipse.m2e.core.prefs | 7 + .../.settings/org.eclipse.mylyn.team.ui.prefs | 3 + .../.settings/org.eclipse.team.core.prefs | 2 + .../.settings/org.eclipse.ui.editors.prefs | 12 + .../.settings/org.eclipse.ui.prefs | 3 + .../.settings/org.eclipse.wst.css.core.prefs | 2 + .../.settings/org.eclipse.wst.html.core.prefs | 2 + .../org.eclipse.wst.server.core.prefs | 2 + .../org.eclipse.wst.validation.prefs | 27 + .../.settings/org.eclipse.wst.xml.core.prefs | 7 + .../.settings/org.eclipse.wst.xml.ui.prefs | 3 + .../driverStorage.xml | 1 + settings/findbugs/findbugs-exclude.xml | 334 ++ settings/findbugs/findbugs-include.xml | 770 +++ settings/ide-properties.bat | 6 + settings/maven/settings.xml | 129 + settings/pmd/pmd-ruleset.xml | 93 + settings/sonarqube/sonarqube_oasp_java.xml | 1 + .../sonarqube/sonarqube_oasp_javascript.xml | 1 + src/main/javadoc/stylesheet.css | 478 ++ src/site/resources/favicon.ico | Bin 0 -> 1150 bytes src/site/site.xml | 31 + src/site/xdoc/index.xml | 13 + 148 files changed, 14203 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 oasp4j-beanmapping/.checkstyle create mode 100644 oasp4j-beanmapping/pom.xml create mode 100644 oasp4j-beanmapping/src/main/java/io/oasp/module/beanmapping/common/api/BeanMapper.java create mode 100644 oasp4j-beanmapping/src/main/java/io/oasp/module/beanmapping/common/base/AbstractBeanMapper.java create mode 100644 oasp4j-beanmapping/src/main/java/io/oasp/module/beanmapping/common/impl/DozerBeanMapper.java create mode 100644 oasp4j-beanmapping/src/main/java/io/oasp/module/beanmapping/common/impl/IdentityConverter.java create mode 100644 oasp4j-configuration/.checkstyle create mode 100644 oasp4j-configuration/pom.xml create mode 100644 oasp4j-configuration/src/main/java/io/oasp/module/configuration/common/api/ApplicationConfigurationConstants.java create mode 100644 oasp4j-jpa/pom.xml create mode 100644 oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/api/AbstractPersistenceEntity.java create mode 100644 oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/api/Dao.java create mode 100644 oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/api/GenericDao.java create mode 100644 oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/api/MasterDataDao.java create mode 100644 oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/base/AbstractDao.java create mode 100644 oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/base/AbstractGenericDao.java create mode 100644 oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/base/AbstractMasterDataDao.java create mode 100644 oasp4j-logging/.checkstyle create mode 100644 oasp4j-logging/pom.xml create mode 100644 oasp4j-logging/src/main/java/io/oasp/module/logging/common/api/DiagnosticContextFacade.java create mode 100644 oasp4j-logging/src/main/java/io/oasp/module/logging/common/api/LoggingConstants.java create mode 100644 oasp4j-logging/src/main/java/io/oasp/module/logging/common/impl/DiagnosticContextFacadeImpl.java create mode 100644 oasp4j-logging/src/main/java/io/oasp/module/logging/common/impl/DiagnosticContextFilter.java create mode 100644 oasp4j-logging/src/main/java/io/oasp/module/logging/common/impl/SingleLinePatternLayout.java create mode 100644 oasp4j-monitoring/.checkstyle create mode 100644 oasp4j-monitoring/pom.xml create mode 100644 oasp4j-monitoring/src/main/java/io/oasp/module/monitoring/service/impl/jmx/ServiceStatisticsMBean.java create mode 100644 oasp4j-monitoring/src/main/java/io/oasp/module/monitoring/service/impl/jmx/StatusMonitorMBean.java create mode 100644 oasp4j-monitoring/src/main/java/io/oasp/module/monitoring/service/impl/loadbalancer/LoadbalancerServlet.java create mode 100644 oasp4j-monitoring/src/test/java/io/oasp/module/monitoring/jmx/test/ServiceStatisticsMBeanTest.java create mode 100644 oasp4j-parent/pom.xml create mode 100644 oasp4j-rest/pom.xml create mode 100644 oasp4j-rest/src/main/java/io/oasp/module/rest/service/api/RequestParameters.java create mode 100644 oasp4j-rest/src/main/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacade.java create mode 100644 oasp4j-rest/src/main/java/io/oasp/module/rest/service/impl/json/AbstractJsonDeserializer.java create mode 100644 oasp4j-rest/src/main/java/io/oasp/module/rest/service/impl/json/MixInAnnotationsModule.java create mode 100644 oasp4j-rest/src/main/java/io/oasp/module/rest/service/impl/json/ObjectMapperFactory.java create mode 100644 oasp4j-rest/src/test/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacadeTest.java create mode 100644 oasp4j-security/.checkstyle create mode 100644 oasp4j-security/pom.xml create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControl.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControlGroup.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControlPermission.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControlProvider.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControlSchema.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/PrincipalAccessControlProvider.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/api/exception/InvalidConfigurationException.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AbstractAccessControlBasedAuthenticationProvider.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AbstractAccessControlProvider.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AccessControlGrantedAuthority.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AccessControlSchemaMapper.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AccessControlSchemaProvider.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/PrincipalGroupProviderGroupImpl.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/SimpleAccessControlBasedAuthenticationProvider.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlProviderImpl.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaProviderImpl.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaXmlMapper.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaXsdWriter.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/impl/rest/AuthenticationSuccessHandlerSendingOkHttpStatusCode.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/impl/rest/JsonUsernamePasswordAuthenticationFilter.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/impl/rest/LogoutSuccessHandlerReturningOkHttpStatusCode.java create mode 100644 oasp4j-security/src/main/java/io/oasp/module/security/common/impl/web/RetainAnchorFilter.java create mode 100644 oasp4j-security/src/main/resources/io/oasp/module/security/access-control-schema.xsd create mode 100644 oasp4j-security/src/test/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaTest.java create mode 100644 oasp4j-security/src/test/resources/config/app/security/access-control-schema.xml create mode 100644 oasp4j-security/src/test/resources/config/app/security/access-control-schema_corrupted.xml create mode 100644 oasp4j-security/src/test/resources/config/app/security/access-control-schema_cyclic.xml create mode 100644 oasp4j-security/src/test/resources/config/app/security/access-control-schema_groupTypes.xml create mode 100644 oasp4j-security/src/test/resources/config/app/security/access-control-schema_illegal.xml create mode 100644 oasp4j-security/src/test/resources/logback.xml create mode 100644 oasp4j-web/pom.xml create mode 100644 oasp4j-web/src/main/java/io/oasp/module/web/common/base/PropertiesWebApplicationContextInitializer.java create mode 100644 oasp4j-web/src/main/java/io/oasp/module/web/common/base/ToggleFilterWrapper.java create mode 100644 pom.xml create mode 100644 settings/checkstyle/checkstyle.xml create mode 100644 settings/clientpe-properties.bat create mode 100644 settings/eclipse/codetemplates.xml create mode 100644 settings/eclipse/formatter.xml create mode 100644 settings/eclipse/project.dictionary create mode 100644 settings/eclipse/project.dictionary.readme.txt create mode 100644 settings/eclipse/workspace/replacement-patterns.properties create mode 100644 settings/eclipse/workspace/setup/.metadata/.mylyn/repositories.xml.zip create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.indexes/properties.index create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/org.eclipse.egit.core/GitProjectData.properties create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/Servers/.indexes/properties.index create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/Servers/.syncinfo create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/Servers/org.eclipse.egit.core/GitProjectData.properties create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.root/1.tree create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.e4.ui.css.swt.theme.prefs create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.sonar.ide.eclipse.core.prefs create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.springsource.ide.eclipse.commons.ui.prefs create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.springsource.ide.eclipse.dashboard.ui.prefs create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.tigris.subversion.subclipse.tools.usage.prefs create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.tigris.subversion.subclipse.ui.prefs create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.datatools.connectivity/ServerProfiles.dat create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.mylyn.builds.ui/builds.xmi create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml create mode 100644 settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.wst.server.core/servers.xml create mode 100644 settings/eclipse/workspace/setup/Servers/.project create mode 100644 settings/eclipse/workspace/setup/Servers/Tomcat7-config/catalina.policy create mode 100644 settings/eclipse/workspace/setup/Servers/Tomcat7-config/catalina.properties create mode 100644 settings/eclipse/workspace/setup/Servers/Tomcat7-config/context.xml create mode 100644 settings/eclipse/workspace/setup/Servers/Tomcat7-config/server.xml create mode 100644 settings/eclipse/workspace/setup/Servers/Tomcat7-config/tomcat-users.xml create mode 100644 settings/eclipse/workspace/setup/Servers/Tomcat7-config/web.xml create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/net.sf.eclipsecs.core/checkstyle-config.xml create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ant.core.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.compare.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.core.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.debug.ui.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jst.jsp.core.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jst.server.tomcat.core.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.core.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.team.ui.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.core.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.css.core.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.html.core.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.server.core.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.validation.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.xml.core.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.xml.ui.prefs create mode 100644 settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.datatools.connectivity/driverStorage.xml create mode 100644 settings/findbugs/findbugs-exclude.xml create mode 100644 settings/findbugs/findbugs-include.xml create mode 100644 settings/ide-properties.bat create mode 100644 settings/maven/settings.xml create mode 100644 settings/pmd/pmd-ruleset.xml create mode 100644 settings/sonarqube/sonarqube_oasp_java.xml create mode 100644 settings/sonarqube/sonarqube_oasp_javascript.xml create mode 100644 src/main/javadoc/stylesheet.css create mode 100644 src/site/resources/favicon.ico create mode 100644 src/site/site.xml create mode 100644 src/site/xdoc/index.xml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..7ff4f3a62 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +[*] +insert_final_newline = true +indent_style = space +indent_size = 2 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..1815ac8d9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +*.class +*.classpath +*.project +*.iml +.* +target/ +eclipse-target/ +**/src/generated/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 000000000..491da3def --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +oasp-java +========= + +The Open Application Standard Platform for Java diff --git a/oasp4j-beanmapping/.checkstyle b/oasp4j-beanmapping/.checkstyle new file mode 100644 index 000000000..b6203b021 --- /dev/null +++ b/oasp4j-beanmapping/.checkstyle @@ -0,0 +1,7 @@ + + + + + + + diff --git a/oasp4j-beanmapping/pom.xml b/oasp4j-beanmapping/pom.xml new file mode 100644 index 000000000..bd288255c --- /dev/null +++ b/oasp4j-beanmapping/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + io.oasp.java + oasp4j-parent + dev-SNAPSHOT + ../oasp4j-parent/pom.xml + + oasp4j-beanmapping + ${oasp4j.version} + ${project.artifactId} + Minimal shim for bean mapping to convert between compatible Java beans (e.g. JPA entity to transfer-object and vice versa). + + + + net.sf.dozer + dozer + + + javax.inject + javax.inject + + + + \ No newline at end of file diff --git a/oasp4j-beanmapping/src/main/java/io/oasp/module/beanmapping/common/api/BeanMapper.java b/oasp4j-beanmapping/src/main/java/io/oasp/module/beanmapping/common/api/BeanMapper.java new file mode 100644 index 000000000..90b7e7651 --- /dev/null +++ b/oasp4j-beanmapping/src/main/java/io/oasp/module/beanmapping/common/api/BeanMapper.java @@ -0,0 +1,48 @@ +package io.oasp.module.beanmapping.common.api; + +import java.util.List; +import java.util.Set; + +/** + * This is the interface used to convert from one Java bean to another compatible bean (e.g. from a JPA entity to a + * corresponding transfer-object). + * + * @author hohwille + */ +public interface BeanMapper { + + /** + * Recursively converts the given source {@link Object} to the given target {@link Class}. + * + * @param is the generic type to convert to. + * @param source is the object to convert. + * @param targetClass is the {@link Class} reflecting the type to convert to. + * @return the converted object. Will be null if source is null. + */ + T map(Object source, Class targetClass); + + /** + * Creates a new {@link List} with the {@link #map(Object, Class) mapped bean} for each {@link List#get(int) entry} of + * the given {@link List}. + * + * @param is the generic type to convert the {@link List} entries to. + * @param source is the {@link List} with the source objects. + * @param targetClass is the {@link Class} reflecting the type to convert each {@link List} entry to. + * @return the {@link List} with the converted objects. Will be {@link List#isEmpty() empty} is source is + * empty or null. + */ + List mapList(List source, Class targetClass); + + /** + * Creates a new {@link Set} with the {@link #map(Object, Class) mapped bean} for each {@link Set#contains(Object) + * entry} of the given {@link Set}. + * + * @param is the generic type to convert the {@link Set} entries to. + * @param source is the {@link Set} with the source objects. + * @param targetClass is the {@link Class} reflecting the type to convert each {@link Set} entry to. + * @return the {@link Set} with the converted objects. Will be {@link Set#isEmpty() empty} is source is + * empty or null. + */ + Set mapSet(Set source, Class targetClass); + +} diff --git a/oasp4j-beanmapping/src/main/java/io/oasp/module/beanmapping/common/base/AbstractBeanMapper.java b/oasp4j-beanmapping/src/main/java/io/oasp/module/beanmapping/common/base/AbstractBeanMapper.java new file mode 100644 index 000000000..1b6a34e26 --- /dev/null +++ b/oasp4j-beanmapping/src/main/java/io/oasp/module/beanmapping/common/base/AbstractBeanMapper.java @@ -0,0 +1,56 @@ +package io.oasp.module.beanmapping.common.base; + +import io.oasp.module.beanmapping.common.api.BeanMapper; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * The abstract base implementation of {@link BeanMapper}. + * + * @author hohwille + */ +public abstract class AbstractBeanMapper implements BeanMapper { + + /** + * The constructor. + */ + public AbstractBeanMapper() { + + super(); + } + + /** + * {@inheritDoc} + */ + @Override + public List mapList(List source, Class targetClass) { + + if ((source == null) || (source.isEmpty())) { + return new ArrayList<>(); + } + List result = new ArrayList<>(source.size()); + for (Object sourceObject : source) { + result.add(map(sourceObject, targetClass)); + } + return result; + } + + /** + * {@inheritDoc} + */ + @Override + public Set mapSet(Set source, Class targetClass) { + + if ((source == null) || (source.isEmpty())) { + return new HashSet<>(); + } + Set result = new HashSet<>(source.size()); + for (Object sourceObject : source) { + result.add(map(sourceObject, targetClass)); + } + return result; + } +} diff --git a/oasp4j-beanmapping/src/main/java/io/oasp/module/beanmapping/common/impl/DozerBeanMapper.java b/oasp4j-beanmapping/src/main/java/io/oasp/module/beanmapping/common/impl/DozerBeanMapper.java new file mode 100644 index 000000000..a015f24d5 --- /dev/null +++ b/oasp4j-beanmapping/src/main/java/io/oasp/module/beanmapping/common/impl/DozerBeanMapper.java @@ -0,0 +1,50 @@ +package io.oasp.module.beanmapping.common.impl; + +import io.oasp.module.beanmapping.common.base.AbstractBeanMapper; + +import javax.inject.Inject; +import javax.inject.Named; + +import org.dozer.Mapper; + +/** + * This is the implementation of {@link io.oasp.module.beanmapping.common.api.BeanMapper} using dozer {@link Mapper}. + * + * @author hohwille + */ +@Named +public class DozerBeanMapper extends AbstractBeanMapper { + + /** The dozer instance to use. */ + private Mapper dozer; + + /** + * The constructor. + */ + public DozerBeanMapper() { + + super(); + } + + /** + * @param dozer is the {@link Mapper} to {@link Inject}. + */ + @Inject + public void setDozer(Mapper dozer) { + + this.dozer = dozer; + } + + /** + * {@inheritDoc} + */ + @Override + public T map(Object source, Class targetType) { + + if (source == null) { + return null; + } + return this.dozer.map(source, targetType); + } + +} diff --git a/oasp4j-beanmapping/src/main/java/io/oasp/module/beanmapping/common/impl/IdentityConverter.java b/oasp4j-beanmapping/src/main/java/io/oasp/module/beanmapping/common/impl/IdentityConverter.java new file mode 100644 index 000000000..05a0cc5d0 --- /dev/null +++ b/oasp4j-beanmapping/src/main/java/io/oasp/module/beanmapping/common/impl/IdentityConverter.java @@ -0,0 +1,29 @@ +package io.oasp.module.beanmapping.common.impl; + +import org.dozer.CustomConverter; + +/** + * Dozer {@link CustomConverter} that returns the original source object reference (identity conversion). + * + * @author hohwille + */ +public class IdentityConverter implements CustomConverter { + + /** + * The constructor. + */ + public IdentityConverter() { + + super(); + } + + /** + * {@inheritDoc} + */ + @Override + public Object convert(Object destination, Object source, Class destinationClass, Class sourceClass) { + + return source; + } + +} diff --git a/oasp4j-configuration/.checkstyle b/oasp4j-configuration/.checkstyle new file mode 100644 index 000000000..b6203b021 --- /dev/null +++ b/oasp4j-configuration/.checkstyle @@ -0,0 +1,7 @@ + + + + + + + diff --git a/oasp4j-configuration/pom.xml b/oasp4j-configuration/pom.xml new file mode 100644 index 000000000..c9900b0e4 --- /dev/null +++ b/oasp4j-configuration/pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + + io.oasp.java + oasp4j-parent + dev-SNAPSHOT + ../oasp4j-parent/pom.xml + + oasp4j-configuration + ${oasp4j.version} + ${project.artifactId} + Configuration Module of the Open Application Standard Platform for Java (OASP4J). + + + + + \ No newline at end of file diff --git a/oasp4j-configuration/src/main/java/io/oasp/module/configuration/common/api/ApplicationConfigurationConstants.java b/oasp4j-configuration/src/main/java/io/oasp/module/configuration/common/api/ApplicationConfigurationConstants.java new file mode 100644 index 000000000..e8e3db805 --- /dev/null +++ b/oasp4j-configuration/src/main/java/io/oasp/module/configuration/common/api/ApplicationConfigurationConstants.java @@ -0,0 +1,41 @@ +package io.oasp.module.configuration.common.api; + +/** + * Central constants for spring configuration files. Mainly for testing but may also be used for productive usage. + * + * @author hohwille + */ +public final class ApplicationConfigurationConstants { + + /** Path to the spring XML configuration file for the entire application. */ + public static final String BEANS_APPLICATION = "classpath:/config/app/beans-application.xml"; + + /** Path to the spring XML configuration file for the service layer. */ + public static final String BEANS_SERVICE = "classpath:/config/app/service/beans-service.xml"; + + /** Path to the spring XML configuration file for the logic layer. */ + public static final String BEANS_LOGIC = "classpath:/config/app/logic/beans-logic.xml"; + + /** Path to the spring XML configuration file for the data-acccess layer. */ + public static final String BEANS_DATA_ACCESS = "classpath:/config/app/dataaccess/beans-dataaccess.xml"; + + /** + * Path to the spring XML configuration file for the common and cross-cutting code that is not assigned to any layer. + */ + public static final String BEANS_COMMON = "classpath:/config/app/common/beans-common.xml"; + + /** Path to the spring XML configuration file for the security. */ + public static final String BEANS_SECURITY = "classpath:/config/app/security/beans-security.xml"; + + /** Path to the XML configuration of the access control schema. */ + public static final String SECURITY_ACCESS_CONTROL_SCHEMA = "config/app/security/access-control-schema.xml"; + + /** + * Construction prohibited. + */ + private ApplicationConfigurationConstants() { + + super(); + } + +} diff --git a/oasp4j-jpa/pom.xml b/oasp4j-jpa/pom.xml new file mode 100644 index 000000000..949830079 --- /dev/null +++ b/oasp4j-jpa/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + + io.oasp.java + oasp4j-parent + dev-SNAPSHOT + ../oasp4j-parent/pom.xml + + oasp4j-jpa + ${oasp4j.version} + ${project.artifactId} + JPA-based persistence infrastructure of the Open Application Standard Platform for Java (OASP4J). + + + + net.sf.m-m-m + mmm-util-core + + + org.hibernate.javax.persistence + hibernate-jpa-2.1-api + + + com.mysema.querydsl + querydsl-jpa + + + org.hibernate + hibernate-entitymanager + true + + + + \ No newline at end of file diff --git a/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/api/AbstractPersistenceEntity.java b/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/api/AbstractPersistenceEntity.java new file mode 100644 index 000000000..ddf03b4ea --- /dev/null +++ b/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/api/AbstractPersistenceEntity.java @@ -0,0 +1,155 @@ +package io.oasp.module.jpa.dataaccess.api; + +import java.util.Objects; + +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.MappedSuperclass; +import javax.persistence.Transient; +import javax.persistence.Version; + +import net.sf.mmm.util.entity.api.MutableGenericEntity; +import net.sf.mmm.util.entity.api.PersistenceEntity; + +/** + * Abstract base implementation of {@link PersistenceEntity} with a {@link GeneratedValue generated} {@link #getId() + * primary key}. In case you need a different type of key add it as extra column and make it + * {@link javax.persistence.Column#unique() unique}. + * + * @author hohwille + * @author rjoeris + */ +@MappedSuperclass +public abstract class AbstractPersistenceEntity implements PersistenceEntity, MutableGenericEntity { + + private static final long serialVersionUID = 1L; + + /** @see #getId() */ + private Long id; + + /** @see #getModificationCounter() */ + private int modificationCounter; + + /** + * The constructor. + */ + public AbstractPersistenceEntity() { + + super(); + } + + /** + * {@inheritDoc} + */ + @Override + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE) + public Long getId() { + + return this.id; + } + + /** + * {@inheritDoc} + */ + public void setId(Long id) { + + this.id = id; + } + + /** + * {@inheritDoc} + */ + @Override + @Version + public int getModificationCounter() { + + return this.modificationCounter; + } + + /** + * {@inheritDoc} + */ + @Override + public void setModificationCounter(int version) { + + this.modificationCounter = version; + } + + /** + * {@inheritDoc} + */ + @Override + @Transient + public Number getRevision() { + + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + result = prime * result + this.modificationCounter; + return result; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) { + + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + AbstractPersistenceEntity other = (AbstractPersistenceEntity) obj; + if (!Objects.equals(this.id, other.id)) { + return false; + } + if (this.modificationCounter != other.modificationCounter) { + return false; + } + return true; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + + StringBuilder buffer = new StringBuilder(); + toString(buffer); + return buffer.toString(); + } + + /** + * Method to extend {@link #toString()} logic. + * + * @param buffer is the {@link StringBuilder} where to {@link StringBuilder#append(Object) append} the string + * representation. + */ + protected void toString(StringBuilder buffer) { + + buffer.append(getClass().getSimpleName()); + if (this.id != null) { + buffer.append("[id="); + buffer.append(this.id); + buffer.append("]"); + } + } + +} diff --git a/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/api/Dao.java b/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/api/Dao.java new file mode 100644 index 000000000..6945305dd --- /dev/null +++ b/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/api/Dao.java @@ -0,0 +1,18 @@ +package io.oasp.module.jpa.dataaccess.api; + +import net.sf.mmm.util.entity.api.PersistenceEntity; + +/** + * This is a simplified variant of {@link GenericDao} for the suggested and common case that you have a {@link Long} as + * {@link PersistenceEntity#getId() primary key}. + * + * @see GenericDao + * @see AbstractPersistenceEntity + * + * @param is the generic type of the {@link PersistenceEntity}. + * + * @author hohwille + */ +public interface Dao> extends GenericDao { + +} diff --git a/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/api/GenericDao.java b/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/api/GenericDao.java new file mode 100644 index 000000000..6f503d63a --- /dev/null +++ b/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/api/GenericDao.java @@ -0,0 +1,117 @@ +package io.oasp.module.jpa.dataaccess.api; + +import java.util.List; + +import net.sf.mmm.util.entity.api.PersistenceEntity; +import net.sf.mmm.util.exception.api.ObjectNotFoundUserException; + +/** + * This is the interface for a Data Access Object (DAO). It acts as a manager responsible for the persistence + * operations on a specific {@link PersistenceEntity entity} {@literal }.
+ * This is base interface contains the CRUD operations: + *
    + *
  • Create: call {@link #save(PersistenceEntity)} on a new entity.
  • + *
  • Retrieve: use find* methods such as {@link #findOne(Object)}. More specific queries will be added in + * dedicated DAO interfaces.
  • + *
  • Update: done automatically by JPA vendor (hibernate) on commit or call {@link #save(PersistenceEntity)} to + * {@link javax.persistence.EntityManager#merge(Object) merge} an entity.
  • + *
  • Delete: call {@link #delete(PersistenceEntity)} or {@link #delete(Object)}.
  • + *
+ * For each (non-abstract) implementation of {@link PersistenceEntity entity} MyEntity you should create an + * interface interface MyEntityDao that inherits from this {@link GenericDao} interface. Also you create an + * implementation of that interface MyEntityDaoImpl that you derive from + * {@link io.oasp.module.jpa.dataaccess.base.AbstractGenericDao}. + * + * @param is the generic type if the {@link PersistenceEntity#getId() primary key}. + * @param is the generic type of the {@link PersistenceEntity}. + * + * @author hohwille + */ +public interface GenericDao> { + + /** + * Saves a given entity. Use the returned instance for further operations as the save operation might have changed the + * entity instance completely. + * + * @param entity + * @return the saved entity + */ + E save(E entity); + + /** + * Saves all given entities. + * + * @param entities + * @throws IllegalArgumentException in case the given entity is (@literal null}. + */ + void save(Iterable entities); + + /** + * Retrieves an entity by its id. + * + * @param id must not be {@literal null}. + * @return the entity with the given id or {@literal null} if none found + * @throws IllegalArgumentException if {@code id} is {@literal null}. + * @throws ObjectNotFoundUserException if the requested entity does not exists (use {@link #findOne(Object)} to + * prevent). + */ + E find(ID id) throws ObjectNotFoundUserException; + + /** + * Retrieves an entity by its id. + * + * @param id must not be {@literal null}. + * @return the entity with the given id or {@literal null} if none found + * @throws IllegalArgumentException if {@code id} is {@literal null} + */ + E findOne(ID id); + + /** + * Returns whether an entity with the given id exists. + * + * @param id must not be {@literal null}. + * @return true if an entity with the given id exists, {@literal false} otherwise + * @throws IllegalArgumentException if {@code id} is {@literal null} + */ + boolean exists(ID id); + + /** + * Returns all instances of the type with the given IDs. + * + * @param ids are the IDs of all entities to retrieve e.g. as {@link java.util.List}. + * @return an {@link Iterable} with all {@link PersistenceEntity entites} for the given ids. + */ + List findAll(Iterable ids); + + // /** + // * Returns the number of entities available. + // * + // * @return the number of entities + // */ + // long count(); + + /** + * Deletes the entity with the given id. + * + * @param id must not be {@literal null}. + * @throws IllegalArgumentException in case the given {@code id} is {@literal null} + */ + void delete(ID id); + + /** + * Deletes a given entity. + * + * @param entity + * @throws IllegalArgumentException in case the given entity is (@literal null}. + */ + void delete(E entity); + + /** + * Deletes the given entities. + * + * @param entities + * @throws IllegalArgumentException in case the given {@link Iterable} is (@literal null}. + */ + void delete(Iterable entities); + +} diff --git a/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/api/MasterDataDao.java b/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/api/MasterDataDao.java new file mode 100644 index 000000000..2e742955f --- /dev/null +++ b/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/api/MasterDataDao.java @@ -0,0 +1,28 @@ +package io.oasp.module.jpa.dataaccess.api; + +import java.util.List; + +import net.sf.mmm.util.entity.api.PersistenceEntity; + +/** + * This is the interface for a {@link Dao} responsible for a {@link PersistenceEntity} that represents master-data. In + * that case you typically have a limited number of entities in your persistent store and need operations like + * {@link #findAll()}.
+ * ATTENTION:
+ * Such operations are not part of {@link GenericDao} or {@link Dao} as invoking them (accidently) could cause that an + * extraordinary large number of entities are loaded into main memory and could cause serious performance and stability + * disasters. So only extend this interface in case you are aware of what you are doing. + * + * @param is the generic type of the {@link PersistenceEntity}. + * + * @author hohwille + */ +public interface MasterDataDao> extends Dao { + + /** + * @return an {@link Iterable} with ALL managed entities from the persistent store. Not exposed to API by default as + * this might not make sense for all kind of entities. + */ + List findAll(); + +} diff --git a/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/base/AbstractDao.java b/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/base/AbstractDao.java new file mode 100644 index 000000000..967d7c46b --- /dev/null +++ b/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/base/AbstractDao.java @@ -0,0 +1,27 @@ +package io.oasp.module.jpa.dataaccess.base; + +import io.oasp.module.jpa.dataaccess.api.AbstractPersistenceEntity; +import io.oasp.module.jpa.dataaccess.api.Dao; + +import net.sf.mmm.util.entity.api.PersistenceEntity; + +/** + * Abstract base implementation of {@link Dao} interface. + * + * @param is the generic type of the {@link PersistenceEntity}. Should be derived from + * {@link AbstractPersistenceEntity}. + * + * @author hohwille + */ +public abstract class AbstractDao> extends AbstractGenericDao implements + Dao { + + /** + * The constructor. + */ + public AbstractDao() { + + super(); + } + +} \ No newline at end of file diff --git a/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/base/AbstractGenericDao.java b/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/base/AbstractGenericDao.java new file mode 100644 index 000000000..3258ebfb5 --- /dev/null +++ b/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/base/AbstractGenericDao.java @@ -0,0 +1,265 @@ +package io.oasp.module.jpa.dataaccess.base; + +import io.oasp.module.jpa.dataaccess.api.GenericDao; + +import java.util.List; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.persistence.Query; +import javax.persistence.TypedQuery; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Root; + +import net.sf.mmm.util.entity.api.PersistenceEntity; +import net.sf.mmm.util.exception.api.ObjectNotFoundUserException; +import net.sf.mmm.util.search.base.AbstractSearchCriteria; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.mysema.query.jpa.impl.JPAQuery; + +/** + * This is the abstract base-implementation of the {@link GenericDao} interface. + * + * @param is the generic type if the {@link PersistenceEntity#getId() primary key}. + * @param is the generic type of the managed {@link PersistenceEntity}. + * + * @author hohwille + */ +// @Repository +public abstract class AbstractGenericDao> implements GenericDao { + + /** Logger instance. */ + private static final Logger LOG = LoggerFactory.getLogger(AbstractGenericDao.class); + + private EntityManager entityManager; + + /** + * The constructor. + */ + public AbstractGenericDao() { + + super(); + } + + /** + * @return the {@link Class} reflecting the managed entity. + */ + protected abstract Class getEntityClass(); + + /** + * @return the {@link EntityManager} instance. + */ + protected EntityManager getEntityManager() { + + return this.entityManager; + } + + /** + * @param entityManager the {@link EntityManager} to inject. + */ + @PersistenceContext + public void setEntityManager(EntityManager entityManager) { + + this.entityManager = entityManager; + } + + /** + * @return the name of the managed entity. + */ + protected String getEntityName() { + + return getEntityClass().getSimpleName(); + } + + /** + * {@inheritDoc} + */ + @Override + public E save(E entity) { + + if (isNew(entity)) { + this.entityManager.persist(entity); + LOG.debug("Saved new {} with id {}.", getEntityName(), entity.getId()); + return entity; + } else { + E update = this.entityManager.merge(entity); + LOG.debug("Updated {} with id {}.", getEntityName(), entity.getId()); + return update; + } + } + + /** + * Determines if the given {@link PersistenceEntity} is {@link PersistenceEntity#STATE_NEW new}. + * + * @param entity is the {@link PersistenceEntity} to check. + * @return true if {@link PersistenceEntity#STATE_NEW new}, false otherwise (e.g. + * {@link PersistenceEntity#STATE_DETACHED detached} or {@link PersistenceEntity#STATE_MANAGED managed}. + */ + protected boolean isNew(E entity) { + + return entity.getId() == null; + } + + /** + * {@inheritDoc} + */ + @Override + public void save(Iterable entities) { + + for (E entity : entities) { + save(entity); + } + } + + /** + * {@inheritDoc} + */ + @Override + public E findOne(ID id) { + + E entity = this.entityManager.find(getEntityClass(), id); + return entity; + } + + /** + * {@inheritDoc} + */ + @Override + public E find(ID id) throws ObjectNotFoundUserException { + + E entity = findOne(id); + if (entity == null) { + throw new ObjectNotFoundUserException(getEntityClass().getSimpleName(), id); + } + return entity; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean exists(ID id) { + + // pointless... + return findOne(id) != null; + } + + /** + * @return an {@link Iterable} to find ALL {@link #getEntityClass() managed entities} from the persistent store. Not + * exposed to API by default as this might not make sense for all kind of entities. + */ + protected List findAll() { + + CriteriaQuery query = this.entityManager.getCriteriaBuilder().createQuery(getEntityClass()); + Root root = query.from(getEntityClass()); + query.select(root); + TypedQuery typedQuery = this.entityManager.createQuery(query); + List resultList = typedQuery.getResultList(); + LOG.debug("Query for all {} objects returned {} hit(s).", getEntityName(), resultList.size()); + return resultList; + } + + /** + * {@inheritDoc} + */ + @Override + public List findAll(Iterable ids) { + + CriteriaBuilder builder = this.entityManager.getCriteriaBuilder(); + CriteriaQuery query = builder.createQuery(getEntityClass()); + Root root = query.from(getEntityClass()); + query.select(root); + query.where(root.get("id").in(ids)); + TypedQuery typedQuery = this.entityManager.createQuery(query); + List resultList = typedQuery.getResultList(); + LOG.debug("Query for selection of {} objects returned {} hit(s).", getEntityName(), resultList.size()); + return resultList; + } + + /** + * {@inheritDoc} + */ + @Override + public void delete(ID id) { + + E entity = this.entityManager.getReference(getEntityClass(), id); + this.entityManager.remove(entity); + LOG.debug("Deleted {} with ID {}.", getEntityName(), id); + } + + /** + * {@inheritDoc} + */ + @Override + public void delete(E entity) { + + // entity might be detached and could cause trouble in entityManager on remove + if (this.entityManager.contains(entity)) { + this.entityManager.remove(entity); + LOG.debug("Deleted {} with ID {}.", getEntityName(), entity.getId()); + } else { + delete(entity.getId()); + } + + } + + /** + * {@inheritDoc} + */ + @Override + public void delete(Iterable entities) { + + for (E entity : entities) { + delete(entity); + } + } + + /** + * Applies the meta-data of the given {@link AbstractSearchCriteria search criteria} to the given {@link JPAQuery}. + * + * @param criteria is the {@link AbstractSearchCriteria search criteria} to apply. + * @param query is the {@link JPAQuery} to apply to. + */ + protected void applyCriteria(AbstractSearchCriteria criteria, JPAQuery query) { + + Integer limit = criteria.getMaximumHitCount(); + if (limit != null) { + query.limit(limit); + } + int offset = criteria.getHitOffset(); + if (offset > 0) { + query.offset(offset); + } + Long timeout = criteria.getSearchTimeout(); + if (timeout != null) { + query.setHint("javax.persistence.query.timeout", timeout); + } + } + + /** + * Applies the meta-data of the given {@link AbstractSearchCriteria search criteria} to the given {@link Query}. + * + * @param criteria is the {@link AbstractSearchCriteria search criteria} to apply. + * @param query is the {@link Query} to apply to. + */ + protected void applyCriteria(AbstractSearchCriteria criteria, Query query) { + + Integer limit = criteria.getMaximumHitCount(); + if (limit != null) { + query.setMaxResults(limit); + } + int offset = criteria.getHitOffset(); + if (offset > 0) { + query.setFirstResult(offset); + } + Long timeout = criteria.getSearchTimeout(); + if (timeout != null) { + query.setHint("javax.persistence.query.timeout", timeout); + } + } + +} diff --git a/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/base/AbstractMasterDataDao.java b/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/base/AbstractMasterDataDao.java new file mode 100644 index 000000000..75bee460a --- /dev/null +++ b/oasp4j-jpa/src/main/java/io/oasp/module/jpa/dataaccess/base/AbstractMasterDataDao.java @@ -0,0 +1,38 @@ +package io.oasp.module.jpa.dataaccess.base; + +import io.oasp.module.jpa.dataaccess.api.AbstractPersistenceEntity; +import io.oasp.module.jpa.dataaccess.api.MasterDataDao; + +import java.util.List; + +import net.sf.mmm.util.entity.api.PersistenceEntity; + +/** + * This is the abstract base implementation of {@link MasterDataDao}. + * + * @param is the generic type of the {@link PersistenceEntity}. Should be derived from + * {@link AbstractPersistenceEntity}. + * + * @author hohwille + */ +public abstract class AbstractMasterDataDao> extends AbstractDao implements + MasterDataDao { + + /** + * The constructor. + */ + public AbstractMasterDataDao() { + + super(); + } + + /** + * {@inheritDoc} + */ + @Override + public List findAll() { + + return super.findAll(); + } + +} diff --git a/oasp4j-logging/.checkstyle b/oasp4j-logging/.checkstyle new file mode 100644 index 000000000..b6203b021 --- /dev/null +++ b/oasp4j-logging/.checkstyle @@ -0,0 +1,7 @@ + + + + + + + diff --git a/oasp4j-logging/pom.xml b/oasp4j-logging/pom.xml new file mode 100644 index 000000000..2728677a3 --- /dev/null +++ b/oasp4j-logging/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + + io.oasp.java + oasp4j-parent + dev-SNAPSHOT + ../oasp4j-parent/pom.xml + + oasp4j-logging + ${oasp4j.version} + ${project.artifactId} + Logging Module of the Open Application Standard Platform for Java (OASP4J). + + + + ch.qos.logback + logback-classic + + + org.slf4j + jcl-over-slf4j + + + javax.servlet + javax.servlet-api + provided + + + org.springframework + spring-web + true + + + javax.inject + javax.inject + + + + \ No newline at end of file diff --git a/oasp4j-logging/src/main/java/io/oasp/module/logging/common/api/DiagnosticContextFacade.java b/oasp4j-logging/src/main/java/io/oasp/module/logging/common/api/DiagnosticContextFacade.java new file mode 100644 index 000000000..fc81346ef --- /dev/null +++ b/oasp4j-logging/src/main/java/io/oasp/module/logging/common/api/DiagnosticContextFacade.java @@ -0,0 +1,33 @@ +package io.oasp.module.logging.common.api; + +/** + * This is the interface for a simple facade to write data into the {@link org.slf4j.MDC mapped diagnostic context}. As + * additional value you can easily hook in custom extensions without interfering the logger implementation. A use case + * may be to provide diagnostic informations also to additional components such as a performance monitoring module. + * Therefore setting diagnostic information from OASP code is always indirected via this interface so the implementation + * can be extended or replaced (what is not as easy for {@link org.slf4j.MDC#put(String, String) static methods}). + * + * @author hohwille + */ +public interface DiagnosticContextFacade { + + /** + * @return the current {@link LoggingConstants#CORRELATION_ID correlation ID} or null if not + * {@link #setCorrelationId(String) set}. + */ + String getCorrelationId(); + + /** + * Sets the {@link LoggingConstants#CORRELATION_ID correlation ID} for the current processing and thread. + * + * @param correlationId is the {@link LoggingConstants#CORRELATION_ID correlation ID} as unique identifier for the + * current processing task. + */ + void setCorrelationId(String correlationId); + + /** + * Removes the {@link #setCorrelationId(String) correlation ID} from the diagnostic context. + */ + void removeCorrelationId(); + +} diff --git a/oasp4j-logging/src/main/java/io/oasp/module/logging/common/api/LoggingConstants.java b/oasp4j-logging/src/main/java/io/oasp/module/logging/common/api/LoggingConstants.java new file mode 100644 index 000000000..0e558619a --- /dev/null +++ b/oasp4j-logging/src/main/java/io/oasp/module/logging/common/api/LoggingConstants.java @@ -0,0 +1,27 @@ +package io.oasp.module.logging.common.api; + +/** + * Central constants for logging. + * + * @author rstroh + */ +public final class LoggingConstants { + + /** + * The key for the correlation id used as unique identifier to correlate log entries of a processing task. It allows + * to track down all related log messages for that task across the entire application landscape (e.g. in case of a + * problem). + * + * @see DiagnosticContextFacade#setCorrelationId(String) + */ + public static final String CORRELATION_ID = "correlationId"; + + /** + * Construction prohibited. + */ + private LoggingConstants() { + + super(); + } + +} diff --git a/oasp4j-logging/src/main/java/io/oasp/module/logging/common/impl/DiagnosticContextFacadeImpl.java b/oasp4j-logging/src/main/java/io/oasp/module/logging/common/impl/DiagnosticContextFacadeImpl.java new file mode 100644 index 000000000..aa2db9d67 --- /dev/null +++ b/oasp4j-logging/src/main/java/io/oasp/module/logging/common/impl/DiagnosticContextFacadeImpl.java @@ -0,0 +1,50 @@ +package io.oasp.module.logging.common.impl; + +import io.oasp.module.logging.common.api.DiagnosticContextFacade; +import io.oasp.module.logging.common.api.LoggingConstants; + +import org.slf4j.MDC; + +/** + * This is the simple and straight forward implementation of {@link DiagnosticContextFacade}. + * + * @author hohwille + */ +public class DiagnosticContextFacadeImpl implements DiagnosticContextFacade { + + /** + * The constructor. + */ + public DiagnosticContextFacadeImpl() { + + super(); + } + + /** + * {@inheritDoc} + */ + @Override + public String getCorrelationId() { + + return MDC.get(LoggingConstants.CORRELATION_ID); + } + + /** + * {@inheritDoc} + */ + @Override + public void setCorrelationId(String correlationId) { + + MDC.put(LoggingConstants.CORRELATION_ID, correlationId); + } + + /** + * {@inheritDoc} + */ + @Override + public void removeCorrelationId() { + + MDC.remove(LoggingConstants.CORRELATION_ID); + } + +} diff --git a/oasp4j-logging/src/main/java/io/oasp/module/logging/common/impl/DiagnosticContextFilter.java b/oasp4j-logging/src/main/java/io/oasp/module/logging/common/impl/DiagnosticContextFilter.java new file mode 100644 index 000000000..e85e4f4e0 --- /dev/null +++ b/oasp4j-logging/src/main/java/io/oasp/module/logging/common/impl/DiagnosticContextFilter.java @@ -0,0 +1,165 @@ +package io.oasp.module.logging.common.impl; + +import io.oasp.module.logging.common.api.DiagnosticContextFacade; + +import java.io.IOException; +import java.util.UUID; + +import javax.inject.Inject; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Request logging filter that adds the request log message to the SLF4j mapped diagnostic context (MDC) before the + * request is processed, removing it again after the request is processed. + * + * @author Malte Brunnlieb + * @author hohwille + */ +// @WebFilter("/services/*") +public class DiagnosticContextFilter implements Filter { + + private static final Logger LOG = LoggerFactory.getLogger(DiagnosticContextFilter.class); + + /** + * The name of the {@link FilterConfig#getInitParameter(String) init parameter} for + * {@link #setCorrelationIdHttpHeaderName(String)}. + */ + private static final String CORRELATION_ID_HEADER_NAME_PARAM = "correlationIdHeaderName"; + + /** The default value for {@link #setCorrelationIdHttpHeaderName(String)}. */ + private static final String CORRELATION_ID_HEADER_NAME_DEFAULT = "CorrelationId"; + + /** @see #setCorrelationIdHttpHeaderName(String) */ + private String correlationIdHttpHeaderName; + + private DiagnosticContextFacade diagnosticContextFacade; + + /** + * The constructor. + */ + public DiagnosticContextFilter() { + + super(); + } + + /** + * @param correlationIdHttpHeaderName is the name of the {@link HttpServletRequest#getHeader(String) HTTP header} for + * the {@link io.oasp.module.logging.common.api.LoggingConstants#CORRELATION_ID correlation ID}. + */ + public void setCorrelationIdHttpHeaderName(String correlationIdHttpHeaderName) { + + this.correlationIdHttpHeaderName = correlationIdHttpHeaderName; + } + + /** + * {@inheritDoc} + */ + @Override + public void destroy() { + + } + + private static String normalizeValue(String value) { + + if (value != null) { + String result = value.trim(); + if (!result.isEmpty()) { + return result; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, + ServletException { + + setCorrelationId(request); + try { + chain.doFilter(request, response); + } finally { + this.diagnosticContextFacade.removeCorrelationId(); + } + } + + private void setCorrelationId(ServletRequest request) { + + String correlationId = null; + if (request instanceof HttpServletRequest && this.correlationIdHttpHeaderName != null) { + correlationId = normalizeValue(((HttpServletRequest) request).getHeader(this.correlationIdHttpHeaderName)); + if (correlationId == null) { + LOG.debug("No correlation ID found for HTTP header {}.", this.correlationIdHttpHeaderName); + } else { + this.diagnosticContextFacade.setCorrelationId(correlationId); + LOG.debug("Using correlation ID {} from HTTP header {}.", correlationId, this.correlationIdHttpHeaderName); + return; + } + } + if (correlationId == null) { + // potential fallback if initialized before this filter... + correlationId = normalizeValue(this.diagnosticContextFacade.getCorrelationId()); + if (correlationId != null) { + LOG.debug("Correlation ID was already set to {} before DiagnosticContextFilter has been invoked.", + correlationId); + } else { + // no correlation ID present, create a unique ID + correlationId = UUID.randomUUID().toString(); + this.diagnosticContextFacade.setCorrelationId(correlationId); + LOG.debug("Created unique correlation ID {}.", correlationId); + } + } + } + + /** + * @param diagnosticContextFacade the diagnosticContextFacade to set + */ + @Inject + public void setDiagnosticContextFacade(DiagnosticContextFacade diagnosticContextFacade) { + + this.diagnosticContextFacade = diagnosticContextFacade; + } + + /** + * {@inheritDoc} + */ + @Override + public void init(FilterConfig config) throws ServletException { + + String headerName = config.getInitParameter(CORRELATION_ID_HEADER_NAME_PARAM); + if (headerName == null) { + headerName = CORRELATION_ID_HEADER_NAME_DEFAULT; + LOG.info("Parameter {} not configured using default.", CORRELATION_ID_HEADER_NAME_PARAM); + } + this.correlationIdHttpHeaderName = headerName; + LOG.info("Correlation ID header initialized to: {}", this.correlationIdHttpHeaderName); + if (this.diagnosticContextFacade == null) { + try { + // ATTENTION: We do not import these classes as we keep spring as an optional dependency. + // If spring is not available in your classpath (e.g. some real JEE context) then this will produce a + // ClassNotFoundException and use the fallback in the catch statement. + ServletContext servletContext = config.getServletContext(); + org.springframework.web.context.WebApplicationContext springContext; + springContext = + org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(servletContext); + this.diagnosticContextFacade = springContext.getBean(DiagnosticContextFacade.class); + } catch (Throwable e) { + LOG.warn("DiagnosticContextFacade not defined in spring. Falling back to default", e); + this.diagnosticContextFacade = new DiagnosticContextFacadeImpl(); + } + } + } + +} diff --git a/oasp4j-logging/src/main/java/io/oasp/module/logging/common/impl/SingleLinePatternLayout.java b/oasp4j-logging/src/main/java/io/oasp/module/logging/common/impl/SingleLinePatternLayout.java new file mode 100644 index 000000000..ff466fd5a --- /dev/null +++ b/oasp4j-logging/src/main/java/io/oasp/module/logging/common/impl/SingleLinePatternLayout.java @@ -0,0 +1,91 @@ +package io.oasp.module.logging.common.impl; + +import java.util.regex.Pattern; + +import ch.qos.logback.classic.PatternLayout; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.classic.spi.IThrowableProxy; +import ch.qos.logback.classic.spi.StackTraceElementProxy; +import ch.qos.logback.core.CoreConstants; + +/** + * Custom {@link PatternLayout} for logging entries. + * + * @author rstroh + */ +public class SingleLinePatternLayout extends PatternLayout { + + // --------------- FIELDS --------------- + + /** The separator used as replacement for newlines. */ + private static final String LINE_SEP = " | "; + + /** OS specific line separator. */ + private static final String NEWLINE = CoreConstants.LINE_SEPARATOR; + + /** Regular expression for line breaks. */ + private static final Pattern LINEBREAK_PATTERN = Pattern.compile("[\\r\\n|\\n]"); + + /** Average buffer size per line of stack trace. */ + private static final int BUFFER_PER_LINE = 50; + + // --------------- CONSTRUCTORS --------------- + + /** + * Default constructor. + */ + public SingleLinePatternLayout() { + + super(); + } + + // --------------- METHODS --------------- + + /** + * Creates formatted String, using conversion pattern. + * + * @param event ILoggingEvent + * @return String Formatted event as string in one line + */ + @Override + public String doLayout(ILoggingEvent event) { + + // Format message + String msg = super.doLayout(event).trim(); + // prevent log forging + msg = preventLogForging(msg); + + // Formatting of exception, remove line breaks + IThrowableProxy throwableProxy = event.getThrowableProxy(); + if (throwableProxy != null) { + StackTraceElementProxy[] s = throwableProxy.getStackTraceElementProxyArray(); + if (s != null && s.length > 0) { + // Performance: Initialize StringBuilder with (number of StackTrace-Elements + 1)*50 (+1 for Message) + StringBuilder sb = new StringBuilder(s.length * BUFFER_PER_LINE); + sb.append(msg); + + int len = s.length; + for (int i = 0; i < len; i++) { + sb.append(LINE_SEP).append(s[i]); + } + msg = sb.toString(); + } + } + return msg + NEWLINE; + } + + /** + * Method to prevent log forging. + * + * @param logMsg + * @return Encoded message + */ + private String preventLogForging(String logMsg) { + + String result = logMsg; + // use precompiled pattern for performance reasons + result = LINEBREAK_PATTERN.matcher(logMsg).replaceAll(SingleLinePatternLayout.LINE_SEP); + return result; + } + +} diff --git a/oasp4j-monitoring/.checkstyle b/oasp4j-monitoring/.checkstyle new file mode 100644 index 000000000..b6203b021 --- /dev/null +++ b/oasp4j-monitoring/.checkstyle @@ -0,0 +1,7 @@ + + + + + + + diff --git a/oasp4j-monitoring/pom.xml b/oasp4j-monitoring/pom.xml new file mode 100644 index 000000000..029288190 --- /dev/null +++ b/oasp4j-monitoring/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + + io.oasp.java + oasp4j-parent + dev-SNAPSHOT + ../oasp4j-parent/pom.xml + + oasp4j-monitoring + ${oasp4j.version} + ${project.artifactId} + Monitoring Module of the Open Application Standard Platform for Java (OASP4J). + + + + + org.springframework + spring-context + + + + + org.springframework + spring-aop + + + + + + + org.apache.commons + commons-collections4 + + + javax.servlet + javax.servlet-api + provided + + + + + \ No newline at end of file diff --git a/oasp4j-monitoring/src/main/java/io/oasp/module/monitoring/service/impl/jmx/ServiceStatisticsMBean.java b/oasp4j-monitoring/src/main/java/io/oasp/module/monitoring/service/impl/jmx/ServiceStatisticsMBean.java new file mode 100644 index 000000000..88e13f4a2 --- /dev/null +++ b/oasp4j-monitoring/src/main/java/io/oasp/module/monitoring/service/impl/jmx/ServiceStatisticsMBean.java @@ -0,0 +1,118 @@ +package io.oasp.module.monitoring.service.impl.jmx; + +import org.aopalliance.intercept.MethodInterceptor; +import org.aopalliance.intercept.MethodInvocation; +import org.apache.commons.collections4.queue.CircularFifoQueue; +import org.springframework.jmx.export.annotation.ManagedAttribute; +import org.springframework.jmx.export.annotation.ManagedResource; + +/** + * MBean for service statistics. + * + * @author mvielsac + */ +@ManagedResource(description = "Returns information about the service.") +public class ServiceStatisticsMBean implements MethodInterceptor { + + private static final int MILLIS_PER_MINUTE = 60000; + + private static final int NUM_OF_EXECS_FOR_AVARAGE = 10; + + private volatile int numOfCallsLastMinute; + + private volatile int numOfErrorsLastMinute; + + private volatile int numOfCallsThisMinute; + + private volatile int numOfErrorsThisMinute; + + private volatile int lastMinute; + + private volatile CircularFifoQueue execTimes = new CircularFifoQueue<>(NUM_OF_EXECS_FOR_AVARAGE); + + /** + * {@inheritDoc} + */ + public Object invoke(MethodInvocation invocation) throws Throwable { + + long startTime = System.currentTimeMillis(); + boolean success = false; + + try { + Object result = invocation.proceed(); + success = true; + return result; + } catch (Exception e) { + // TODO check which exceptions are no errors and set success = true; + throw e; + } finally { + long execTime = System.currentTimeMillis() - startTime; + countExecution(execTime, success); + // TODO add log statement "Method X executed un/successfully in xyz ms. + } + + } + + public synchronized void countExecution(Long duration, Boolean success) { + + updateTimeWindow(); + ++this.numOfCallsThisMinute; + if (!success) { + ++this.numOfErrorsThisMinute; + } + + this.execTimes.add(duration); + + } + + private synchronized void updateTimeWindow() { + + // get current minute + int currentMinute = (int) (System.currentTimeMillis() / MILLIS_PER_MINUTE); + + if (currentMinute != this.lastMinute) { + this.lastMinute = currentMinute; + this.numOfCallsLastMinute = this.numOfCallsThisMinute; + this.numOfErrorsLastMinute = this.numOfErrorsThisMinute; + + this.numOfCallsThisMinute = 0; + this.numOfErrorsThisMinute = 0; + } + } + + @ManagedAttribute(description = "Returns the avarage execution time of the last 10 calls in millis.") + public Long getAvarageExecTime() { + + long result = 0; + + if (this.execTimes.size() > 0) { + // copy to array to avoid concurrent changes + Long[] execTimesArray = this.execTimes.toArray(new Long[this.execTimes.size()]); + + long sum = 0; + + for (Long execTime : execTimesArray) { + sum += execTime.longValue(); + } + + result = sum / execTimesArray.length; + } + + return Long.valueOf(result); + + } + + @ManagedAttribute(description = "Returns the number of calls without error in the last minute") + public int getNumOfCallsLastMinute() { + + updateTimeWindow(); + return this.numOfCallsLastMinute; + } + + @ManagedAttribute(description = "Returns the number of errors occured in the last minute") + public int getNumOfErrosLastMinute() { + + updateTimeWindow(); + return this.numOfErrorsLastMinute; + } +} diff --git a/oasp4j-monitoring/src/main/java/io/oasp/module/monitoring/service/impl/jmx/StatusMonitorMBean.java b/oasp4j-monitoring/src/main/java/io/oasp/module/monitoring/service/impl/jmx/StatusMonitorMBean.java new file mode 100644 index 000000000..dc49aeea8 --- /dev/null +++ b/oasp4j-monitoring/src/main/java/io/oasp/module/monitoring/service/impl/jmx/StatusMonitorMBean.java @@ -0,0 +1,55 @@ +package io.oasp.module.monitoring.service.impl.jmx; + +import java.util.Calendar; +import java.util.Date; + +import org.springframework.jmx.export.annotation.ManagedAttribute; +import org.springframework.jmx.export.annotation.ManagedResource; + +/** + * MBean for monitoring the application status. + * + * @author mvielsac + */ +@ManagedResource(description = "Returns the status of the application.") +public class StatusMonitorMBean { + + private boolean lastCheckSuccessful; + + private Date timeOfLastCheck; + + /** + * Registers a check with the result of the check and updates the {@link #getTimeOfLastCheck() timeOfLastCheck} + * attribute. + * + * @param success result of system check + */ + public void registerCheck(boolean success) { + + this.lastCheckSuccessful = success; + this.timeOfLastCheck = Calendar.getInstance().getTime(); + } + + /** + * Returns the field 'lastCheckSuccessful'. + * + * @return value of lastCheckSuccessful + */ + @ManagedAttribute(description = "Returns true if the last check was successful or false if the last check failed.") + public boolean isLastCheckSuccessful() { + + return this.lastCheckSuccessful; + } + + /** + * Returns the field 'timeOfLastCheck'. + * + * @return value of timeOfLastCheck + */ + @ManagedAttribute(description = "Time of the last check.") + public Date getTimeOfLastCheck() { + + return this.timeOfLastCheck; + } + +} diff --git a/oasp4j-monitoring/src/main/java/io/oasp/module/monitoring/service/impl/loadbalancer/LoadbalancerServlet.java b/oasp4j-monitoring/src/main/java/io/oasp/module/monitoring/service/impl/loadbalancer/LoadbalancerServlet.java new file mode 100644 index 000000000..8fd7b5169 --- /dev/null +++ b/oasp4j-monitoring/src/main/java/io/oasp/module/monitoring/service/impl/loadbalancer/LoadbalancerServlet.java @@ -0,0 +1,71 @@ +package io.oasp.module.monitoring.service.impl.loadbalancer; + +import java.io.File; +import java.io.IOException; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * This servlet is used to check whether this application is alive and can be used by the load-balancer or if it is + * currently unavailable (or under maintenance). It returns HTTP OK if the "isAlive file" is present, if not HTTP + * FORBIDDEN will be returned. + * + * The location of the "isAlive - file" can be configured via the init parameter {@link #PARAM_IS_ALIVE_FILE_LOCATION}. + * If no parameter is given {@value #DEFAULT_IS_ALIVE_FILE_LOCATION} is used. + * + * @author mvielsac + */ +public class LoadbalancerServlet extends HttpServlet { + + private static final long serialVersionUID = 1L; + + private static final Logger LOG = LoggerFactory.getLogger(LoadbalancerServlet.class); + + protected static final String PARAM_IS_ALIVE_FILE_LOCATION = "isAliveFileLocation"; + + protected static final String DEFAULT_IS_ALIVE_FILE_LOCATION = "/WEB-INF/classes/config/isAlive"; + + private File isAliveFile; + + /** + * + * Inits the servlet. + */ + @Override + public void init() { + + LOG.info("Initializing the loadbalancer servlet"); + String isAliveFileLocation = getInitParameter(PARAM_IS_ALIVE_FILE_LOCATION); + if (isAliveFileLocation == null) { + LOG.debug("No isAlive param given. Using default: " + DEFAULT_IS_ALIVE_FILE_LOCATION); + isAliveFileLocation = DEFAULT_IS_ALIVE_FILE_LOCATION; + } + + String realPathToIsAliveFile = getServletContext().getRealPath(isAliveFileLocation); + + this.isAliveFile = new File(realPathToIsAliveFile); + LOG.info("Using " + this.isAliveFile.getAbsolutePath() + " as isAlive path"); + } + + /** + * + * {@inheritDoc} + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { + + if (this.isAliveFile.exists()) { + LOG.debug("IsAlive-file is present, sending HTTP OK."); + response.setStatus(HttpServletResponse.SC_OK); + response.getWriter().write("

Is Alive!

"); + } else { + LOG.info("IsAlive-file " + this.isAliveFile.getAbsolutePath() + " does not exist, sending HTTP FORBIDDEN."); + response.setStatus(HttpServletResponse.SC_FORBIDDEN); + } + } +} diff --git a/oasp4j-monitoring/src/test/java/io/oasp/module/monitoring/jmx/test/ServiceStatisticsMBeanTest.java b/oasp4j-monitoring/src/test/java/io/oasp/module/monitoring/jmx/test/ServiceStatisticsMBeanTest.java new file mode 100644 index 000000000..7c165af27 --- /dev/null +++ b/oasp4j-monitoring/src/test/java/io/oasp/module/monitoring/jmx/test/ServiceStatisticsMBeanTest.java @@ -0,0 +1,64 @@ +package io.oasp.module.monitoring.jmx.test; + +import io.oasp.module.monitoring.service.impl.jmx.ServiceStatisticsMBean; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Test case for {@link ServiceStatisticsMBean}. + * + * @author mvielsac + */ +public class ServiceStatisticsMBeanTest extends Assert { + + private ServiceStatisticsMBean serviceStatistics = new ServiceStatisticsMBean(); + + /** + * Tests the average calculation for a full buffer. + */ + @Test + public void avarageCalculationTest() { + + int buffersize = 10; + long[] execTimes = { 100, 150, 200, 250, 111, 222, 333, 123, 231, 321 }; + long sum = 0; + + for (int i = 0; i < execTimes.length; i++) { + sum += execTimes[i]; + this.serviceStatistics.countExecution(execTimes[i], true); + } + + assertEquals(new Long(sum / buffersize), this.serviceStatistics.getAvarageExecTime()); + + } + + /** + * Tests the average calculation for a buffer which is not full. + */ + @Test + public void avarageCalculationUnderfullBufferTest() { + + int buffersize = 4; + long[] execTimes = { 100, 150, 200, 250 }; + long sum = 0; + + for (int i = 0; i < execTimes.length; i++) { + sum += execTimes[i]; + this.serviceStatistics.countExecution(execTimes[i], true); + } + + assertEquals(new Long(sum / buffersize), this.serviceStatistics.getAvarageExecTime()); + + } + + /** + * Test the average calculation for a empty buffer. + */ + @Test + public void avargeCalculationEmptyBuffer() { + + assertEquals(new Long(0), this.serviceStatistics.getAvarageExecTime()); + + } +} diff --git a/oasp4j-parent/pom.xml b/oasp4j-parent/pom.xml new file mode 100644 index 000000000..c4246a395 --- /dev/null +++ b/oasp4j-parent/pom.xml @@ -0,0 +1,531 @@ + + + 4.0.0 + + io.oasp.java + oasp4j-dependencies + 1.0.0-SNAPSHOT + + oasp4j-parent + dev-SNAPSHOT + pom + ${project.artifactId} + Modules of the Open Application Standard Platform for Java (OASP4J). + http://oasp.io/oasp4j/maven/oasp4j + 2014 + + + ../oasp4j-logging + ../oasp4j-configuration + ../oasp4j-monitoring + ../oasp4j-beanmapping + ../oasp4j-rest + ../oasp4j-security + ../oasp4j-jpa + ../oasp4j-web + + + + UTF-8 + UTF-8 + + + + + junit + junit + test + + + org.slf4j + slf4j-api + + + + + + + org.apache.maven.plugins + maven-resources-plugin + + ${project.build.sourceEncoding} + true + + + + + + org.codehaus.mojo + flatten-maven-plugin + 1.0.0-beta-3 + + oss + + + + flatten + process-test-resources + + flatten + + + + flatten.clean + clean + + clean + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${project.build.sourceEncoding} + 1.7 + 1.7 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + + + org.apache.maven.plugins + maven-war-plugin + + WEB-INF/lib/*-sources.jar + ${project.artifactId} + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + ${basedir} + + + + + + org.apache.maven.plugins + maven-site-plugin + + + + org.apache.maven.plugins + maven-eclipse-plugin + 2.9 + + + net.sf.eclipsecs.core.CheckstyleNature + + + net.sf.eclipsecs.core.CheckstyleBuilder + + true + true + + + .checkstyle + + + + + +]]> + + + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + 2.7 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.2 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + org.apache.maven.plugins + maven-clean-plugin + 2.6 + + + org.apache.maven.plugins + maven-jar-plugin + 2.5 + + + org.apache.maven.plugins + maven-source-plugin + 2.4 + + + org.apache.maven.plugins + maven-site-plugin + 3.4 + + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.9.1 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 2.7 + + + org.apache.maven.plugins + maven-jxr-plugin + 2.4 + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + + + true + private + ${project.reporting.outputEncoding} + ${project.build.sourceEncoding} + true + + + http://docs.oracle.com/javase/7/docs/api/ + http://m-m-m.sourceforge.net/apidocs/ + + JavaDocs for ${project.name} + JavaDocs for ${project.name} + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.17 + + + ${basedir} + + + + org.apache.maven.plugins + maven-surefire-report-plugin + 2.9 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.2 + + ${java.version} + + + + org.apache.maven.plugins + maven-war-plugin + 2.5 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + org.apache.maven.plugins + maven-help-plugin + 2.2 + + + org.codehaus.mojo + cobertura-maven-plugin + 2.6 + + + org.codehaus.mojo + sonar-maven-plugin + 2.4 + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.0 + + + org.codehaus.mojo + taglist-maven-plugin + 2.4 + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.codehaus.mojo + flatten-maven-plugin + [0.0,) + + flatten + clean + + + + + + + + + org.codehaus.cargo + cargo-maven2-plugin + [0.0,) + + start + stop + + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + [0.0,) + + jar + + + + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + + false + + + + org.apache.maven.plugins + maven-jxr-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + + + private + ${project.reporting.outputEncoding} + ${project.build.sourceEncoding} + true + ${user.dir}/src/main/javadoc/stylesheet.css + + + http://docs.oracle.com/javase/7/docs/api/ + http://oasp.github.io/oasp4j/maven/apidocs/ + + JavaDocs for ${project.name} + JavaDocs for ${project.name} + + + + oasp.javadoc + + javadoc + + + + oasp.javadoc.aggregate + + aggregate + + + + + + org.codehaus.mojo + taglist-maven-plugin + + + TODO + @todo + FIXME + @deprecated + REVIEW + + + + + + + + + deploy + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + + org.apache.maven.plugins + maven-gpg-plugin + + + + + + sign-artifacts + verify + + sign + + + + + + + + + + eclipse + + + eclipse.application + + + + eclipse-target + + + + + + GitHub + https://github.com/oasp/oasp4j/issues + + + + https://github.com/oasp/oasp4j/tree/master/develop/src + + + + + OASP-Team + http://oasp.io/oasp4j/maven/team-list.html + + + + + hohwille + Jörg Hohwiller + hohwille@users.sourceforge.net + + + + admin + designer + developer + + +1 + + + + + + + Apache Software Licenese + http://www.apache.org/licenses/LICENSE-2.0.txt + repro + + + + + diff --git a/oasp4j-rest/pom.xml b/oasp4j-rest/pom.xml new file mode 100644 index 000000000..a9cdae149 --- /dev/null +++ b/oasp4j-rest/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + + io.oasp.java + oasp4j-parent + dev-SNAPSHOT + ../oasp4j-parent/pom.xml + + oasp4j-rest + ${oasp4j.version} + ${project.artifactId} + REST-Service Support Module of the Open Application Standard Platform for Java (OASP4J). + + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + + + javax.ws.rs + javax.ws.rs-api + + + org.slf4j + slf4j-api + + + javax.inject + javax.inject + + + javax.validation + validation-api + + + org.springframework + spring-context + + + net.sf.m-m-m + mmm-util-core + + + org.springframework.security + spring-security-core + test + + + + org.glassfish.jersey.core + jersey-common + 2.4.1 + test + + + + diff --git a/oasp4j-rest/src/main/java/io/oasp/module/rest/service/api/RequestParameters.java b/oasp4j-rest/src/main/java/io/oasp/module/rest/service/api/RequestParameters.java new file mode 100644 index 000000000..cb0457332 --- /dev/null +++ b/oasp4j-rest/src/main/java/io/oasp/module/rest/service/api/RequestParameters.java @@ -0,0 +1,192 @@ +package io.oasp.module.rest.service.api; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +import javax.ws.rs.BadRequestException; +import javax.ws.rs.InternalServerErrorException; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.UriInfo; + +/** + * This class helps to deal with {@link UriInfo} and {@link MultivaluedMap} from the JAX-RS API. E.g. if you have a REST + * query operation for a collection URI you can use {@link UriInfo} in case you want to support a mixture of optional + * and required parameters. The methods provided here throw according exceptions such as {@link BadRequestException} and + * already support conversion of values. + * + * @author hohwille + */ +public class RequestParameters { + + private final MultivaluedMap parameters; + + /** + * The constructor. + * + * @param parameters is the {@link MultivaluedMap} containing the parameters to wrap. + */ + public RequestParameters(MultivaluedMap parameters) { + + super(); + this.parameters = parameters; + } + + /** + * Gets the single parameter in a generic and flexible way. + * + * @param is the generic type of targetType. + * @param key is the {@link java.util.Map#get(Object) key} of the parameter to get. + * @param targetType is the {@link Class} reflecting the type to convert the value to. Supports common Java standard + * types such as {@link String}, {@link Long}, {@link Double}, {@link BigDecimal}, etc. + * @param required - true if the value is required and a {@link BadRequestException} is thrown if it is + * not present, false otherwise (if optional). + * @return the value for the given key converted to the given targetType. May be + * null if required is false . + * @throws WebApplicationException if an error occurred. E.g. {@link BadRequestException} if a required parameter is + * missing or {@link InternalServerErrorException} if the given targetType is not supported. + */ + public T get(String key, Class targetType, boolean required) throws WebApplicationException { + + String value = get(key); + if (value == null) { + if (required) { + throw new BadRequestException("Missing parameter: " + key); + } + return null; + } + try { + return convertValue(value, targetType); + } catch (WebApplicationException e) { + throw e; + } catch (Exception e) { + throw new BadRequestException("Failed to convert '" + value + "' to type " + targetType); + } + } + + /** + * Converts the given value to the given targetType. + * + * @param is the generic type of targetType. + * @param value is the value to convert. + * @param targetType is the {@link Class} reflecting the type to convert the value to. + * @return the converted value. + * @throws ParseException if parsing of the given value failed while converting. + */ + @SuppressWarnings("unchecked") + protected T convertValue(String value, Class targetType) throws ParseException { + + if (value == null) { + return null; + } + Object result; + if (targetType == String.class) { + result = value; + } else if (targetType.isEnum()) { + for (T instance : targetType.getEnumConstants()) { + Enum e = (Enum) instance; + if (e.name().equalsIgnoreCase(value)) { + return instance; + } + } + throw new IllegalArgumentException("Enum constant not found!"); + } else if ((targetType == boolean.class) || (targetType == Boolean.class)) { + result = Boolean.parseBoolean(value); + } else if ((targetType == int.class) || (targetType == Integer.class)) { + result = Integer.valueOf(value); + } else if ((targetType == long.class) || (targetType == Long.class)) { + result = Long.valueOf(value); + } else if ((targetType == double.class) || (targetType == Double.class)) { + result = Double.valueOf(value); + } else if ((targetType == float.class) || (targetType == Float.class)) { + result = Float.valueOf(value); + } else if ((targetType == short.class) || (targetType == Short.class)) { + result = Short.valueOf(value); + } else if ((targetType == byte.class) || (targetType == Byte.class)) { + result = Byte.valueOf(value); + } else if (targetType == BigDecimal.class) { + result = new BigDecimal(value); + } else if (targetType == BigInteger.class) { + result = new BigInteger(value); + } else if (targetType == Date.class) { + result = new SimpleDateFormat("YYYY-MM-dd'T'HH:mm:ss").parseObject(value); + } else { + throw new InternalServerErrorException("Unsupported type " + targetType); + } + // do not use type.cast() as not working for primitive types. + return (T) result; + } + + /** + * Gets the parameter as single value with the given key as {@link String}. + * + * @param key is the {@link java.util.Map#get(Object) key} of the parameter to get. + * @return the requested parameter. Will be null if the parameter is not present. + * @throws BadRequestException if the parameter is defined multiple times (see {@link #getList(String)}). + */ + public String get(String key) throws BadRequestException { + + List list = this.parameters.get(key); + if ((list == null) || (list.isEmpty())) { + return null; + } + if (list.size() > 1) { + throw new BadRequestException("Duplicate parameter: " + key); + } + return list.get(0); + } + + /** + * Gets the parameter with the given key as {@link String}. Unlike {@link #get(String)} this method will + * not throw an exception if the parameter is multi-valued but just return the first value. + * + * @param key is the {@link java.util.Map#get(Object) key} of the parameter to get. + * @return the first value of the requested parameter. Will be null if the parameter is not present. + */ + public String getFirst(String key) { + + return this.parameters.getFirst(key); + } + + /** + * Gets the {@link List} of all value for the parameter with with the given key. In general you should + * avoid multi-valued parameters (e.g. http://host/path?query=a&query=b). The JAX-RS API supports this exotic case as + * first citizen so we expose it here but only use it if you know exactly what you are doing. + * + * @param key is the {@link java.util.Map#get(Object) key} of the parameter to get. + * @return the {@link List} with all values of the requested parameter. Will be an {@link Collections#emptyList() + * empty list} if the parameter is not present. + */ + public List getList(String key) { + + List list = this.parameters.get(key); + if (list == null) { + list = Collections.emptyList(); + } + return list; + } + + /** + * @param uriInfo is the {@link UriInfo}. + * @return a new instance of {@link RequestParameters} for {@link UriInfo#getQueryParameters()}. + */ + public static RequestParameters fromQuery(UriInfo uriInfo) { + + return new RequestParameters(uriInfo.getQueryParameters()); + } + + /** + * @param uriInfo is the {@link UriInfo}. + * @return a new instance of {@link RequestParameters} for {@link UriInfo#getPathParameters()}. + */ + public static RequestParameters fromPath(UriInfo uriInfo) { + + return new RequestParameters(uriInfo.getPathParameters()); + } + +} diff --git a/oasp4j-rest/src/main/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacade.java b/oasp4j-rest/src/main/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacade.java new file mode 100644 index 000000000..039d774eb --- /dev/null +++ b/oasp4j-rest/src/main/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacade.java @@ -0,0 +1,423 @@ +package io.oasp.module.rest.service.impl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +import javax.inject.Inject; +import javax.validation.ConstraintViolation; +import javax.validation.ConstraintViolationException; +import javax.validation.ValidationException; +import javax.ws.rs.ClientErrorException; +import javax.ws.rs.ServerErrorException; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; +import javax.ws.rs.ext.ExceptionMapper; +import javax.ws.rs.ext.Provider; + +import net.sf.mmm.util.exception.api.NlsRuntimeException; +import net.sf.mmm.util.exception.api.TechnicalErrorUserException; +import net.sf.mmm.util.lang.api.StringUtil; +import net.sf.mmm.util.security.api.SecurityErrorUserException; +import net.sf.mmm.util.validation.api.ValidationErrorUserException; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +/** + * This is an implementation of {@link ExceptionMapper} that acts as generic exception facade for REST services. + * + * the exception handling class for all upcoming exceptions thrown at REST requests. Each type of possible thrown + * exception will be fetched within the method "toResponse". + * + * @author agreul + */ +@Provider +public class RestServiceExceptionFacade implements ExceptionMapper { + + /** JSON key for {@link Throwable#getMessage() error message}. */ + public static final String KEY_MESSAGE = "message"; + + /** JSON key for {@link NlsRuntimeException#getUuid() error ID}. */ + public static final String KEY_UUID = "uuid"; + + /** JSON key for {@link NlsRuntimeException#getCode() error code}. */ + public static final String KEY_CODE = "code"; + + /** Logger instance. */ + private static final Logger LOG = LoggerFactory.getLogger(RestServiceExceptionFacade.class); + + private final List> securityExceptions; + + private ObjectMapper mapper; + + private boolean exposeInternalErrorDetails; + + /** + * The constructor. + */ + public RestServiceExceptionFacade() { + + super(); + this.securityExceptions = new ArrayList<>(); + registerToplevelSecurityExceptions(); + } + + /** + * Registers a {@link Class} as a top-level security {@link Throwable exception}. Instances of this class and all its + * subclasses will be handled as security errors. Therefore an according HTTP error code is used and no further + * details about the exception is send to the client to prevent sensitive data exposure. + * + * @param securityException is the {@link Class} reflecting the security error. + */ + protected void registerToplevelSecurityException(Class securityException) { + + this.securityExceptions.add(securityException); + } + + /** + * This method registers the {@link #registerToplevelSecurityException(Class) top-level security exceptions}. You may + * override it to add additional or other classes. + */ + protected void registerToplevelSecurityExceptions() { + + this.securityExceptions.add(SecurityException.class); + this.securityExceptions.add(SecurityErrorUserException.class); + registerToplevelSecurityExceptions("org.springframework.security.access.AccessDeniedException"); + registerToplevelSecurityExceptions("org.springframework.security.authentication.AuthenticationServiceException"); + registerToplevelSecurityExceptions("org.springframework.security.authentication.AuthenticationCredentialsNotFoundException"); + registerToplevelSecurityExceptions("org.springframework.security.authentication.BadCredentialsException"); + registerToplevelSecurityExceptions("org.springframework.security.authentication.AccountExpiredException"); + } + + /** + * @param className the className to be registered + */ + protected void registerToplevelSecurityExceptions(String className) { + + try { + @SuppressWarnings("unchecked") + Class securityException = (Class) Class.forName(className); + registerToplevelSecurityException(securityException); + } catch (ClassNotFoundException e) { + LOG.info( + "Spring security was not found on classpath. Spring security exceptions will not be handled as such by {}", + getClass().getSimpleName()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public Response toResponse(Throwable exception) { + + // business exceptions + if (exception instanceof WebApplicationException) { + return createResponse((WebApplicationException) exception); + } else if (exception instanceof ValidationException) { + Throwable t = exception; + if (exception instanceof ConstraintViolationException) { + ConstraintViolationException constraintViolationException = (ConstraintViolationException) exception; + Set> violations = constraintViolationException.getConstraintViolations(); + StringBuilder buffer = new StringBuilder(); + boolean first = true; + for (ConstraintViolation violation : violations) { + if (first) { + first = false; + } else { + buffer.append(StringUtil.LINE_SEPARATOR); + } + buffer.append(violation.getMessage()); + buffer.append(" ("); + buffer.append(violation.getPropertyPath()); + buffer.append(")"); + } + t = new ValidationException(buffer.toString()); + } + ValidationErrorUserException error = new ValidationErrorUserException(t); + return createResponse(t, error); + } else if (exception instanceof ValidationErrorUserException) { + return createResponse(exception, (ValidationErrorUserException) exception); + } else { + Class exceptionClass = exception.getClass(); + for (Class securityError : this.securityExceptions) { + if (securityError.isAssignableFrom(exceptionClass)) { + return handleSecurityError(exception); + } + } + return handleGenericError(exception); + } + } + + /** + * Creates the {@link Response} for the given validation exception. + * + * @param exception is the original validation exception. + * @param error is the wrapped exception or the same as exception. + * @return the requested {@link Response}. + */ + protected Response createResponse(Throwable exception, ValidationErrorUserException error) { + + LOG.warn("Service failed due to validation failure.", error); + if (exception == error) { + return createResponse(Status.BAD_REQUEST, error); + } else { + return createResponse(Status.BAD_REQUEST, error, exception.getMessage()); + } + } + + /** + * Exception handling depending on technical Exception or not. + * + * @param exception the exception thrown + * @return the response build from error status + */ + protected Response handleGenericError(Throwable exception) { + + NlsRuntimeException userError = TechnicalErrorUserException.getOrCreateUserException(exception); + if (userError.isTechnical()) { + LOG.error("Service failed on server", exception); + } else { + LOG.warn("Service failed due to business error: {}", exception.getMessage()); + } + return createResponse(userError); + } + + /** + * Exception handling for security exceptions. + * + * @param exception the exception thrown + * @return the response build from error status + */ + protected Response handleSecurityError(Throwable exception) { + + // *** security error *** + NlsRuntimeException error; + if (exception instanceof NlsRuntimeException) { + error = (NlsRuntimeException) exception; + } else { + error = new SecurityErrorUserException(exception); + } + LOG.error("Service failed due to security error", error); + // NOTE: for security reasons we do not send any details about the error + // to the client! + String message; + String code = null; + if (this.exposeInternalErrorDetails) { + message = getExposedErrorDetails(error); + } else { + message = "forbidden"; + } + return createResponse(Status.FORBIDDEN, message, code, error.getUuid()); + } + + /** + * @param error is the {@link Throwable} to extract message details from. + * @return the exposed message(s). + */ + protected String getExposedErrorDetails(Throwable error) { + + StringBuilder buffer = new StringBuilder(); + Throwable e = error; + while (e != null) { + if (buffer.length() > 0) { + buffer.append(StringUtil.LINE_SEPARATOR); + } + buffer.append(e.getClass().getSimpleName()); + buffer.append(": "); + buffer.append(e.getLocalizedMessage()); + e = e.getCause(); + } + return buffer.toString(); + } + + /** + * Create the {@link Response} for the given {@link NlsRuntimeException}. + * + * @param error the generic {@link NlsRuntimeException}. + * @return the corresponding {@link Response}. + */ + protected Response createResponse(NlsRuntimeException error) { + + Status status; + if (error.isTechnical()) { + status = Status.INTERNAL_SERVER_ERROR; + } else { + status = Status.BAD_REQUEST; + } + return createResponse(status, error); + } + + /** + * Create a response message as a JSON-String from the given parts. + * + * @param status is the HTTP {@link Status}. + * @param error is the catched or wrapped {@link NlsRuntimeException}. + * @return the corresponding {@link Response}. + */ + protected Response createResponse(Status status, NlsRuntimeException error) { + + String message; + if (this.exposeInternalErrorDetails) { + message = getExposedErrorDetails(error); + } else { + message = error.getLocalizedMessage(); + } + return createResponse(status, error, message); + } + + /** + * Create a response message as a JSON-String from the given parts. + * + * @param status is the HTTP {@link Status}. + * @param error is the catched or wrapped {@link NlsRuntimeException}. + * @param message is the JSON message attribute. + * @return the corresponding {@link Response}. + */ + protected Response createResponse(Status status, NlsRuntimeException error, String message) { + + return createResponse(status, error, message, error.getCode()); + } + + /** + * Create a response message as a JSON-String from the given parts. + * + * @param status is the HTTP {@link Status}. + * @param error is the catched or wrapped {@link NlsRuntimeException}. + * @param message is the JSON message attribute. + * @param code is the {@link NlsRuntimeException#getCode() error code}. + * @return the corresponding {@link Response}. + */ + protected Response createResponse(Status status, NlsRuntimeException error, String message, String code) { + + return createResponse(status, message, code, error.getUuid()); + } + + /** + * Create a response message as a JSON-String from the given parts. + * + * @param status is the HTTP {@link Status}. + * @param message is the JSON message attribute. + * @param code is the {@link NlsRuntimeException#getCode() error code}. + * @param uuid the {@link UUID} of the response message. + * @return the corresponding {@link Response}. + */ + protected Response createResponse(Status status, String message, String code, UUID uuid) { + + String json = createJsonErrorResponseMessage(message, code, uuid); + return Response.status(status).entity(json).build(); + } + + /** + * Create a response message as a JSON-String from the given parts. + * + * @param message the message of the response message + * @param code the code of the response message + * @param uuid the uuid of the response message + * @return the response message as a JSON-String + */ + protected String createJsonErrorResponseMessage(String message, String code, UUID uuid) { + + Map jsonMap = new HashMap<>(); + if (message != null) { + jsonMap.put(KEY_MESSAGE, message); + } + if (code != null) { + jsonMap.put(KEY_CODE, code); + } + if (uuid != null) { + jsonMap.put(KEY_UUID, uuid.toString()); + } + + String responseMessage = ""; + try { + responseMessage = this.mapper.writeValueAsString(jsonMap); + } catch (JsonProcessingException e) { + LOG.error("Exception facade failed to create JSON.", e); + responseMessage = "{}"; + } + return responseMessage; + } + + /** + * Add a response message to an existing response. + * + * @param exception the {@link WebApplicationException}. + * @return the response with the response message added + */ + protected Response createResponse(WebApplicationException exception) { + + Response response = exception.getResponse(); + int statusCode = response.getStatus(); + Status status = Status.fromStatusCode(statusCode); + NlsRuntimeException error; + if (exception instanceof ServerErrorException) { + error = new TechnicalErrorUserException(exception); + LOG.error("Service failed on server", error); + return createResponse(status, error); + } else { + UUID uuid = UUID.randomUUID(); + if (exception instanceof ClientErrorException) { + LOG.warn("Service failed due to unexpected request. UUDI: {}, reason: {} ", uuid, exception.getMessage()); + } else { + LOG.warn("Service caused redirect or other error. UUID: {}, reason: {}", uuid, exception.getMessage()); + } + return createResponse(status, exception.getMessage(), String.valueOf(statusCode), uuid); + } + + } + + /** + * @return the {@link ObjectMapper} for JSON mapping. + */ + public ObjectMapper getMapper() { + + return this.mapper; + } + + /** + * @param mapper the mapper to set + */ + @Inject + public void setMapper(ObjectMapper mapper) { + + this.mapper = mapper; + } + + /** + * @param exposeInternalErrorDetails - true if internal exception details shall be exposed to clients + * (useful for debugging and testing), false if such details are hidden to prevent Sensitive Data Exposure + * (default, has to be used in production environment). + */ + public void setExposeInternalErrorDetails(boolean exposeInternalErrorDetails) { + + this.exposeInternalErrorDetails = exposeInternalErrorDetails; + if (exposeInternalErrorDetails) { + String message = + "****** Exposing of internal error details is enabled! This violates OWASP A6 (Sensitive Data Exposure) and shall only be used for testing/debugging and never in production. ******"; + LOG.warn(message); + // CHECKSTYLE:OFF (for development only) + System.err.println(message); + // CHECKSTYLE:ON + } + } + + /** + * @return exposeInternalErrorDetails the value set by {@link #setExposeInternalErrorDetails(boolean)}. + */ + public boolean isExposeInternalErrorDetails() { + + return this.exposeInternalErrorDetails; + } + +} diff --git a/oasp4j-rest/src/main/java/io/oasp/module/rest/service/impl/json/AbstractJsonDeserializer.java b/oasp4j-rest/src/main/java/io/oasp/module/rest/service/impl/json/AbstractJsonDeserializer.java new file mode 100644 index 000000000..9339472fe --- /dev/null +++ b/oasp4j-rest/src/main/java/io/oasp/module/rest/service/impl/json/AbstractJsonDeserializer.java @@ -0,0 +1,76 @@ +package io.oasp.module.rest.service.impl.json; + +import java.io.IOException; +import java.math.BigDecimal; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; + +/** + * Helper class to simplify implementation of {@link JsonDeserializer}. + * + * @author agreul, hohwiller + * @param the class to be deserialized + */ +public abstract class AbstractJsonDeserializer extends JsonDeserializer { + + /** + * @param type of value from node to get + * @param node parent node to deserialize + * @param fieldName the required key whose value is looked up + * @param type the same type as the expected value + * @return value from node to get + */ + @SuppressWarnings("unchecked") + protected V getRequiredValue(JsonNode node, String fieldName, Class type) { + + JsonNode childNode = node.get(fieldName); + if (childNode != null) { + + V value = null; + if (!childNode.isNull()) { + try { + if (type == String.class) { + value = type.cast(childNode.asText()); + } else if (type == BigDecimal.class) { + value = type.cast(new BigDecimal(childNode.asText())); + } else if (type == Boolean.class) { + value = (V) Boolean.valueOf(childNode.booleanValue()); + } else if (type == Integer.class) { + value = (V) Integer.valueOf(childNode.asText()); + } else if (type == Double.class) { + value = (V) Double.valueOf(childNode.asText()); + } else { + throw new IllegalArgumentException("Unsupported value type " + type.getName()); + } + } catch (NumberFormatException e) { + throw new IllegalArgumentException("Failed to convert value to type " + type.getName(), e); + } + } + if (value != null) { + return value; + } + } + throw new IllegalStateException("Deserialization failed due to missing " + type.getSimpleName() + " field " + + fieldName + "!"); + } + + /** + * {@inheritDoc} + */ + @Override + public T deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + + JsonNode node = jp.getCodec().readTree(jp); + return deserializeNode(node); + } + + /** + * @param node is the {@link JsonNode} with the value content to be deserialized + * @return the deserialized java object + */ + protected abstract T deserializeNode(JsonNode node); +} diff --git a/oasp4j-rest/src/main/java/io/oasp/module/rest/service/impl/json/MixInAnnotationsModule.java b/oasp4j-rest/src/main/java/io/oasp/module/rest/service/impl/json/MixInAnnotationsModule.java new file mode 100644 index 000000000..ee8de2af6 --- /dev/null +++ b/oasp4j-rest/src/main/java/io/oasp/module/rest/service/impl/json/MixInAnnotationsModule.java @@ -0,0 +1,49 @@ +package io.oasp.module.rest.service.impl.json; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.As; +import com.fasterxml.jackson.core.Version; +import com.fasterxml.jackson.databind.module.SimpleModule; + +/** + * A {@link SimpleModule} to extend Jackson to mixin annotations for polymorphic types. + * + * @author hohwille + * @author agreul + */ +public class MixInAnnotationsModule extends SimpleModule { + + private final Class[] polymorphicClasses; + + /** + * @param polymorphicClasses the classes reflecting JSON transfer-objects that are polymorphic. + */ + public MixInAnnotationsModule(Class... polymorphicClasses) { + + super("oasp.PolymorphyModule", new Version(1, 0, 0, null, ObjectMapperFactory.GROUP_ID, + ObjectMapperFactory.ARTIFACT_ID)); + this.polymorphicClasses = polymorphicClasses; + } + + /** + * {@inheritDoc} + */ + @Override + public void setupModule(SetupContext context) { + + for (Class type : this.polymorphicClasses) { + context.setMixInAnnotations(type, JacksonPolymorphicAnnotation.class); + } + } + + /** + * The blueprint class for the following JSON-annotation allowing to convert from JSON to POJO and vice versa + * + * @author agreul + */ + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = As.PROPERTY, property = "@type") + public static class JacksonPolymorphicAnnotation { + + } + +} diff --git a/oasp4j-rest/src/main/java/io/oasp/module/rest/service/impl/json/ObjectMapperFactory.java b/oasp4j-rest/src/main/java/io/oasp/module/rest/service/impl/json/ObjectMapperFactory.java new file mode 100644 index 000000000..308fcefb3 --- /dev/null +++ b/oasp4j-rest/src/main/java/io/oasp/module/rest/service/impl/json/ObjectMapperFactory.java @@ -0,0 +1,115 @@ +package io.oasp.module.rest.service.impl.json; + +import java.util.Arrays; +import java.util.List; + +import com.fasterxml.jackson.core.Version; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.jsontype.NamedType; +import com.fasterxml.jackson.databind.jsontype.SubtypeResolver; +import com.fasterxml.jackson.databind.module.SimpleModule; + +/** + * A generic factory to {@link #createInstance() create} instances of a Jackson {@link ObjectMapper}. It allows to + * configure the {@link ObjectMapper} for polymorphic transfer-objects. + * + * @see #setBaseClasses(Class...) + * @see #setSubtypes(NamedType...) + * + * @author hohwille + * @author agreul + */ +public class ObjectMapperFactory { + + static final String GROUP_ID = "io.oasp.java"; + + static final String ARTIFACT_ID = "oasp4j-rest"; + + private Class[] baseClasses; + + private List subtypeList; + + private SimpleModule extensionModule; + + /** + * The constructor. + */ + public ObjectMapperFactory() { + + super(); + } + + /** + * Gets access to a generic extension {@link SimpleModule module} for customizations to Jackson JSON mapping. + * + * @see SimpleModule#addSerializer(Class, com.fasterxml.jackson.databind.JsonSerializer) + * @see SimpleModule#addDeserializer(Class, com.fasterxml.jackson.databind.JsonDeserializer) + * + * @return extensionModule + */ + public SimpleModule getExtensionModule() { + + if (this.extensionModule == null) { + this.extensionModule = + new SimpleModule("oasp.ExtensionModule", new Version(1, 0, 0, null, GROUP_ID, ARTIFACT_ID)); + } + return this.extensionModule; + } + + /** + * @param baseClasses are the base classes that are polymorphic (e.g. abstract transfer-object classes that have + * sub-types). You also need to register all sub-types of these polymorphic classes via + * {@link #setSubtypes(NamedType...)}. + */ + public void setBaseClasses(Class... baseClasses) { + + this.baseClasses = baseClasses; + } + + /** + * @see #setSubtypes(NamedType...) + * + * @param subtypeList the {@link List} of {@link NamedType}s to register the subtypes. + */ + public void setSubtypeList(List subtypeList) { + + this.subtypeList = subtypeList; + } + + /** + * @param subtypeList the {@link NamedType}s as pair of {@link Class} reflecting a polymorphic sub-type together with + * its unique name in JSON format. + */ + public void setSubtypes(NamedType... subtypeList) { + + setSubtypeList(Arrays.asList(subtypeList)); + } + + /** + * @return an instance of {@link ObjectMapper} configured for polymorphic resolution. + */ + public ObjectMapper createInstance() { + + ObjectMapper mapper = new ObjectMapper(); + + if ((this.baseClasses != null) && (this.baseClasses.length > 0)) { + SimpleModule polymorphyModule = new MixInAnnotationsModule(this.baseClasses); + mapper.registerModule(polymorphyModule); + } + + if (this.extensionModule != null) { + mapper.registerModule(this.extensionModule); + } + + if (this.subtypeList != null) { + SubtypeResolver subtypeResolver = mapper.getSubtypeResolver(); + for (NamedType subtype : this.subtypeList) { + subtypeResolver.registerSubtypes(subtype); + } + mapper.setSubtypeResolver(subtypeResolver); + } + + return mapper; + } + +} diff --git a/oasp4j-rest/src/test/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacadeTest.java b/oasp4j-rest/src/test/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacadeTest.java new file mode 100644 index 000000000..03fa41d32 --- /dev/null +++ b/oasp4j-rest/src/test/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacadeTest.java @@ -0,0 +1,256 @@ +package io.oasp.module.rest.service.impl; + +import java.util.Map; + +import javax.validation.ValidationException; +import javax.ws.rs.BadRequestException; +import javax.ws.rs.InternalServerErrorException; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.core.Response; + +import net.sf.mmm.util.exception.api.IllegalCaseException; +import net.sf.mmm.util.exception.api.NlsRuntimeException; +import net.sf.mmm.util.exception.api.ObjectNotFoundUserException; +import net.sf.mmm.util.exception.api.TechnicalErrorUserException; +import net.sf.mmm.util.lang.api.StringUtil; +import net.sf.mmm.util.security.api.SecurityErrorUserException; +import net.sf.mmm.util.validation.api.ValidationErrorUserException; + +import org.junit.Assert; +import org.junit.Test; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.authentication.AccountExpiredException; +import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.security.authentication.InternalAuthenticationServiceException; + +import com.fasterxml.jackson.databind.ObjectMapper; + +/** + * Test-case for {@link RestServiceExceptionFacade}. + * + * @author hohwille + */ +public class RestServiceExceptionFacadeTest extends Assert { + + /** Value of {@link TechnicalErrorUserException#getCode()}. */ + private static final String CODE_TECHNICAL_ERROR = "TechnicalError"; + + /** Placeholder for any UUID. */ + private static final String UUID_ANY = ""; + + /** + * @return the {@link RestServiceExceptionFacade} instance to test. + */ + protected RestServiceExceptionFacade getExceptionFacade() { + + RestServiceExceptionFacade facade = new RestServiceExceptionFacade(); + facade.setMapper(new ObjectMapper()); + return facade; + } + + /** + * Tests {@link RestServiceExceptionFacade#toResponse(Throwable)} with forbidden security exception including + * subclasses. + */ + @Test + public void testSecurityExceptions() { + + RestServiceExceptionFacade exceptionFacade = getExceptionFacade(); + + String secretMessage = "Secret information not to be revealed on client - only to be logged on server!"; + + int statusCode = 403; + String message = "forbidden"; + String code = null; + + checkFacade(exceptionFacade, new AccessDeniedException(secretMessage), statusCode, message, UUID_ANY, code); + checkFacade(exceptionFacade, new AuthenticationCredentialsNotFoundException(secretMessage), statusCode, message, + UUID_ANY, code); + checkFacade(exceptionFacade, new BadCredentialsException(secretMessage), statusCode, message, UUID_ANY, code); + checkFacade(exceptionFacade, new AccountExpiredException(secretMessage), statusCode, message, UUID_ANY, code); + checkFacade(exceptionFacade, new InternalAuthenticationServiceException(secretMessage), statusCode, message, + UUID_ANY, code); + SecurityErrorUserException error = new SecurityErrorUserException(); + checkFacade(exceptionFacade, error, statusCode, message, error.getUuid().toString(), code); + } + + /** + * Tests {@link RestServiceExceptionFacade#toResponse(Throwable)} with forbidden security exception including + * subclasses. + */ + @Test + public void testSecurityExceptionExposed() { + + RestServiceExceptionFacade exceptionFacade = getExceptionFacade(); + exceptionFacade.setExposeInternalErrorDetails(true); + + String secretMessage = "Secret information not to be revealed on client - only to be logged on server!"; + + int statusCode = 403; + String message = + "The operation failed due to security restrictions. Please contact the support in case of a permission problem."; + String code = null; + + checkFacade(exceptionFacade, new AccessDeniedException(secretMessage), statusCode, "SecurityErrorUserException: " + + message + StringUtil.LINE_SEPARATOR + "AccessDeniedException: " + secretMessage, UUID_ANY, code); + } + + /** + * Checks that the specified {@link RestServiceExceptionFacade} provides the expected results for the given + * {@link Throwable}. + * + * @param exceptionFacade is the {@link RestServiceExceptionFacade} to test. + * @param error is the {@link Throwable} to convert. + * @param statusCode is the expected {@link Response#getStatus() status} code. + * @param message is the expected {@link Throwable#getMessage() error message} from the JSON result. + * @param uuid is the expected {@link NlsRuntimeException#getUuid() UUID} from the JSON result. May be + * null. + * @param code is the expected {@link NlsRuntimeException#getCode() error code} from the JSON result. May be + * null. + * @return the JSON result for potential further asserts. + */ + protected String checkFacade(RestServiceExceptionFacade exceptionFacade, Throwable error, int statusCode, + String message, String uuid, String code) { + + Response response = exceptionFacade.toResponse(error); + assertNotNull(response); + assertEquals(statusCode, response.getStatus()); + + Object entity = response.getEntity(); + assertTrue(entity instanceof String); + String result = (String) entity; + + try { + Map valueMap = exceptionFacade.getMapper().readValue(result, Map.class); + String msg = message; + if (msg == null) { + msg = error.getLocalizedMessage(); + } + assertEquals(msg, valueMap.get(RestServiceExceptionFacade.KEY_MESSAGE)); + if ((statusCode == 403) && (!exceptionFacade.isExposeInternalErrorDetails())) { + assertFalse(result.contains(error.getMessage())); + } + assertEquals(code, valueMap.get(RestServiceExceptionFacade.KEY_CODE)); + String actualUuid = valueMap.get(RestServiceExceptionFacade.KEY_UUID); + if (UUID_ANY.equals(uuid)) { + if (actualUuid == null) { + fail("UUID expected but not found in response: " + result); + } + } else { + assertEquals(uuid, actualUuid); + } + } catch (Exception e) { + throw new IllegalStateException(e.getMessage(), e); + } + return result; + } + + /** + * Tests {@link RestServiceExceptionFacade#toResponse(Throwable)} with bad request technical exception including + * subclasses. + */ + @Test + public void testJaxrsInternalServerException() { + + RestServiceExceptionFacade exceptionFacade = getExceptionFacade(); + String internalMessage = "The HTTP request is invalid"; + int statusCode = 500; + InternalServerErrorException error = new InternalServerErrorException(internalMessage); + String expectedMessage = new TechnicalErrorUserException(error).getLocalizedMessage(); + checkFacade(exceptionFacade, error, statusCode, expectedMessage, UUID_ANY, CODE_TECHNICAL_ERROR); + } + + /** + * Tests {@link RestServiceExceptionFacade#toResponse(Throwable)} with bad request technical exception. + */ + @Test + public void testJaxrsBadRequestException() { + + RestServiceExceptionFacade exceptionFacade = getExceptionFacade(); + String message = "The HTTP request is invalid"; + Throwable error = new BadRequestException(message); + checkFacade(exceptionFacade, error, 400, message, UUID_ANY, "400"); + } + + /** + * Tests {@link RestServiceExceptionFacade#toResponse(Throwable)} with a {@link ValidationException}. + */ + @Test + public void testValidationException() { + + RestServiceExceptionFacade exceptionFacade = getExceptionFacade(); + String message = "Validation failed!"; + Throwable error = new ValidationException(message); + checkFacade(exceptionFacade, error, 400, message, UUID_ANY, ValidationErrorUserException.CODE); + } + + /** + * Tests {@link RestServiceExceptionFacade#toResponse(Throwable)} with bad request technical exception including + * subclasses. + */ + @Test + public void testJaxrsNotFoundException() { + + RestServiceExceptionFacade exceptionFacade = getExceptionFacade(); + String internalMessage = "Either the service URL is wrong or the requested resource does not exist"; + checkFacade(exceptionFacade, new NotFoundException(internalMessage), 404, internalMessage, UUID_ANY, "404"); + } + + /** + * Tests {@link RestServiceExceptionFacade#toResponse(Throwable)} with bad request technical exception including + * subclasses. + */ + @Test + public void testTechnicalJavaRuntimeServerException() { + + RestServiceExceptionFacade exceptionFacade = getExceptionFacade(); + String secretMessage = "Internal server error occurred"; + IllegalArgumentException error = new IllegalArgumentException(secretMessage); + String expectedMessage = new TechnicalErrorUserException(error).getLocalizedMessage(); + checkFacade(exceptionFacade, error, 500, expectedMessage, UUID_ANY, CODE_TECHNICAL_ERROR); + } + + /** + * Tests {@link RestServiceExceptionFacade#toResponse(Throwable)} with bad request technical exception including + * subclasses. + */ + @Test + public void testTechnicalCustomRuntimeServerException() { + + RestServiceExceptionFacade exceptionFacade = getExceptionFacade(); + String message = "Internal server error occurred"; + IllegalCaseException error = new IllegalCaseException(message); + String expectedMessage = new TechnicalErrorUserException(error).getLocalizedMessage(); + checkFacade(exceptionFacade, error, 500, expectedMessage, error.getUuid().toString(), CODE_TECHNICAL_ERROR); + } + + /** + * Tests {@link RestServiceExceptionFacade#toResponse(Throwable)} with bad request technical exception including + * subclasses. + */ + @Test + public void testTechnicalCustomRuntimeServerExceptionExposed() { + + RestServiceExceptionFacade exceptionFacade = getExceptionFacade(); + exceptionFacade.setExposeInternalErrorDetails(true); + String message = "Internal server error occurred"; + IllegalCaseException error = new IllegalCaseException(message); + String expectedMessage = + "TechnicalErrorUserException: An unexpected error has occurred! We apologize any inconvenience. Please try again later." + + StringUtil.LINE_SEPARATOR + error.getClass().getSimpleName() + ": " + error.getLocalizedMessage(); + checkFacade(exceptionFacade, error, 500, expectedMessage, error.getUuid().toString(), CODE_TECHNICAL_ERROR); + } + + /** + * Tests {@link RestServiceExceptionFacade#toResponse(Throwable)} with bad request technical exception including + * subclasses. + */ + @Test + public void testBusinessException() { + + RestServiceExceptionFacade exceptionFacade = getExceptionFacade(); + ObjectNotFoundUserException error = new ObjectNotFoundUserException(4711L); + checkFacade(exceptionFacade, error, 400, null, error.getUuid().toString(), "NotFound"); + } +} diff --git a/oasp4j-security/.checkstyle b/oasp4j-security/.checkstyle new file mode 100644 index 000000000..b6203b021 --- /dev/null +++ b/oasp4j-security/.checkstyle @@ -0,0 +1,7 @@ + + + + + + + diff --git a/oasp4j-security/pom.xml b/oasp4j-security/pom.xml new file mode 100644 index 000000000..54fb70d0f --- /dev/null +++ b/oasp4j-security/pom.xml @@ -0,0 +1,78 @@ + + + 4.0.0 + + io.oasp.java + oasp4j-parent + dev-SNAPSHOT + ../oasp4j-parent/pom.xml + + oasp4j-security + ${oasp4j.version} + ${project.artifactId} + Security Module of the Open Application Standard Platform for Java (OASP4J). + + + + + + org.springframework + spring-web + + + javax.servlet + javax.servlet-api + provided + + + + + org.springframework.security + spring-security-config + + + org.springframework.security + spring-security-web + + + + + javax.inject + javax.inject + + + javax.annotation + javax.annotation-api + + + + + com.fasterxml.jackson.core + jackson-databind + + + + + + org.springframework + spring-test + test + + + io.oasp.java + oasp4j-logging + test + + + com.google.guava + guava + test + + + org.mockito + mockito-core + test + + + \ No newline at end of file diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControl.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControl.java new file mode 100644 index 000000000..46724783d --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControl.java @@ -0,0 +1,109 @@ +package io.oasp.module.security.common.api.accesscontrol; + +import java.util.Objects; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +/** + * This is the abstract base class for a node of the {@link AccessControlSchema} that represents a tree of + * {@link AccessControlGroup}s and {@link AccessControlPermission}s. If a {@link java.security.Principal} "has" a + * {@link AccessControl} he also "has" all {@link AccessControl}s with according permissions in the spanned sub-tree. + * + * @author hohwille + */ +@XmlAccessorType(XmlAccessType.FIELD) +public abstract class AccessControl { + + /** @see #getName() */ + @XmlID + @XmlAttribute(name = "id", required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + private String id; + + /** + * The constructor. + */ + public AccessControl() { + + super(); + } + + /** + * The constructor. + * + * @param id the {@link #getId() ID}. + */ + public AccessControl(String id) { + + super(); + this.id = id; + } + + /** + * @return the unique identifier of this {@link AccessControl}. Has to be unique for all {@link AccessControl} in a + * {@link AccessControlSchema}. + */ + public String getId() { + + return this.id; + } + + /** + * @param id the new {@link #getId() id}. + */ + public void setId(String id) { + + this.id = id; + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + return result; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) { + + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + AccessControl other = (AccessControl) obj; + if (!Objects.equals(this.id, other.id)) { + return false; + } + return true; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + + return this.id; + } + +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControlGroup.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControlGroup.java new file mode 100644 index 000000000..684ee0db5 --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControlGroup.java @@ -0,0 +1,164 @@ +package io.oasp.module.security.common.api.accesscontrol; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; + +/** + * A {@link AccessControlGroup} represents a collection of {@link AccessControlPermission permissions}. A security + * administrator assigns a {@link java.security.Principal user} to a {@link AccessControlGroup group} to grant him the + * {@link AccessControlPermission permissions} of that {@link AccessControlGroup group}.
+ * Please note that a role is a special form of a {@link AccessControlGroup group} that also represents a + * strategic function. Therefore not every {@link AccessControlGroup group} is a role. Often a user can only have one + * role or can only act under one role at a time. Unfortunately these terms are often mixed up what is causing + * confusion. + * + * @author hohwille + */ +@XmlRootElement(name = "group") +public class AccessControlGroup extends AccessControl { // implements java.security.acl.Group { + + /** @see #getInherits() */ + @XmlIDREF + @XmlElementWrapper(name = "inherits") + @XmlElement(name = "group-ref") + private List inherits; + + /** @see #getPermissions() */ + @XmlElementWrapper(name = "permissions") + @XmlElement(name = "permission") + private List permissions; + + /** @see #getType() */ + @XmlAttribute(name = "type", required = false) + @XmlSchemaType(name = "string") + private String type; + + /** + * The constructor. + */ + public AccessControlGroup() { + + super(); + } + + /** + * The constructor. + * + * @param id the {@link #getId() ID}. + */ + public AccessControlGroup(String id) { + + super(id); + } + + /** + * @return the type of this group. E.g. "role", "department", "use-case-group", etc. You can use this for your own + * purpose. + */ + public String getType() { + + if (this.type == null) { + return ""; + } + return this.type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + + this.type = type; + } + + /** + * @return inherits + */ + public List getInherits() { + + if (this.inherits == null) { + this.inherits = new ArrayList<>(); + } + return this.inherits; + } + + /** + * @param inherits the inherits to set + */ + public void setInherits(List inherits) { + + this.inherits = inherits; + } + + /** + * @return the {@link List} of {@link AccessControlPermission}s. + */ + public List getPermissions() { + + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + return this.permissions; + } + + /** + * @param permissions the new {@link #getPermissions() permissions}. + */ + public void setPermissions(List permissions) { + + this.permissions = permissions; + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + + final int prime = 31; + int result = super.hashCode(); + // prevent infinity loops or other sick effects + // result = prime * result + ((this.inherits == null) ? 0 : this.inherits.hashCode()); + result = prime * result + ((this.permissions == null) ? 0 : this.permissions.hashCode()); + result = prime * result + ((this.type == null) ? 0 : this.type.hashCode()); + return result; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) { + + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + AccessControlGroup other = (AccessControlGroup) obj; + // prevent infinity loops or other sick effects... + // if (!Objects.equal(this.inherits, other.inherits)) { + // return false; + // } + if (!Objects.equals(this.permissions, other.permissions)) { + return false; + } + if (!Objects.equals(this.type, other.type)) { + return false; + } + return true; + } + +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControlPermission.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControlPermission.java new file mode 100644 index 000000000..5fa5aff4d --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControlPermission.java @@ -0,0 +1,43 @@ +package io.oasp.module.security.common.api.accesscontrol; + +import javax.xml.bind.annotation.XmlRootElement; + +/** + * A {@link AccessControlPermission} represents an atomic permission of the application. Each operation (use-case) + * should have its own {@link AccessControlPermission permission}. These operations are secured referencing the + * {@link #getId() ID} of the {@link AccessControlPermission permission}. We do this by annotating the operation method + * with {@link javax.annotation.security.RolesAllowed} (from JSR 250). Please do not get confused by the name + * {@link javax.annotation.security.RolesAllowed} as we are not assigning roles (see also {@link AccessControlGroup}) + * but {@link AccessControlPermission permissions} instead. We want to use Java standards (such as + * {@link javax.annotation.security.RolesAllowed}) where suitable but assigning the allowed roles to a method would end + * up in unmaintainable system configurations if your application reaches a certain complexity.
+ *
+ * If a user is logged in and wants to invoke the operation he needs to own the required permission. Therefore his + * {@link AccessControlGroup}s (resp. roles) have to contain the {@link AccessControlPermission permission} + * {@link AccessControlGroup#getPermissions() directly} or {@link AccessControlGroup#getInherits() indirectly}.
+ * In order to avoid naming clashes you should use the name of the application component as prefix of the permission. + * + * @author hohwille + */ +@XmlRootElement(name = "permission") +public class AccessControlPermission extends AccessControl { + + /** + * The constructor. + */ + public AccessControlPermission() { + + super(); + } + + /** + * The constructor. + * + * @param id the {@link #getId() ID}. + */ + public AccessControlPermission(String id) { + + super(id); + } + +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControlProvider.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControlProvider.java new file mode 100644 index 000000000..3074bf345 --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControlProvider.java @@ -0,0 +1,55 @@ +package io.oasp.module.security.common.api.accesscontrol; + +import java.util.Set; + +/** + * This is the interface for a provider of {@link AccessControl}s. It allows to + * {@link #collectAccessControlIds(String, Set) collect} all {@link AccessControl}s for an ID of a {@link AccessControl} + * (typically a {@link AccessControlGroup} or role). This is used to expand the groups provided by the access-manager + * (authentication and identity-management) to the full set of {@link AccessControlPermission permissions} of the + * {@link java.security.Principal user}.
+ * The actual authorization can then check individual permissions of the user by simply checking for + * {@link Set#contains(Object) contains} in the collected {@link Set}, what is very fast as security checks happen + * frequently. + * + * @see PrincipalAccessControlProvider + * + * @author hohwille + */ +public interface AccessControlProvider { + + /** + * @param id is the {@link AccessControl#getId() ID} of the requested {@link AccessControl}. + * @return the requested {@link AccessControl} or null if not found. + */ + AccessControl getAccessControl(String id); + + /** + * This method collects the {@link AccessControl#getId() IDs} of all {@link AccessControlPermission}s (or more + * precisely of all {@link AccessControl}s) contained in the {@link AccessControl} {@link AccessControl#getId() + * identified} by the given groupId. + * + * @see #collectAccessControls(String, Set) + * + * @param id is the {@link AccessControl#getId() ID} of the {@link AccessControl} (typically an + * {@link AccessControlGroup}) to collect. + * @param permissions is the {@link Set} where to {@link Set#add(Object) add} the collected + * {@link AccessControl#getId() IDs}. This will include the given groupId. + * @return true if the given groupId has been found, false otherwise. + */ + boolean collectAccessControlIds(String id, Set permissions); + + /** + * This method collects the {@link AccessControl}s contained in the {@link AccessControl} + * {@link AccessControl#getId() identified} by the given groupId. + * + * @param id is the {@link AccessControl#getId() ID} of the {@link AccessControl} (typically an + * {@link AccessControlGroup}) to collect. + * @param permissions is the {@link Set} where to {@link Set#add(Object) add} the collected {@link AccessControl}s. + * This will include the {@link AccessControl} {@link AccessControl#getId() identified} by the given + * groupId. + * @return true if the given groupId has been found, false otherwise. + */ + boolean collectAccessControls(String id, Set permissions); + +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControlSchema.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControlSchema.java new file mode 100644 index 000000000..f6f93a88e --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/AccessControlSchema.java @@ -0,0 +1,87 @@ +package io.oasp.module.security.common.api.accesscontrol; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * This class represents the security configuration for the mapping of {@link AccessControlGroup}s to + * {@link AccessControlPermission}s. Everything is properly annotated for JAXB (de)serialization from/to XML. + * + * @author hohwille + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlRootElement(name = "access-control-schema") +public class AccessControlSchema { + + /** @see #getGroups() */ + @XmlElement(name = "group") + private List groups; + + /** + * The constructor. + */ + public AccessControlSchema() { + + super(); + } + + /** + * @return the {@link List} of {@link AccessControlGroup}s contained in this {@link AccessControlSchema}. + */ + public List getGroups() { + + if (this.groups == null) { + this.groups = new ArrayList<>(); + } + return this.groups; + } + + /** + * @param groups the new {@link #getGroups() groups}. + */ + public void setGroups(List groups) { + + this.groups = groups; + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + + final int prime = 31; + int result = 1; + result = prime * result + ((this.groups == null) ? 0 : this.groups.hashCode()); + return result; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) { + + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + AccessControlSchema other = (AccessControlSchema) obj; + if (!Objects.equals(this.groups, other.groups)) { + return false; + } + return true; + } + +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/PrincipalAccessControlProvider.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/PrincipalAccessControlProvider.java new file mode 100644 index 000000000..2f4b0b403 --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/api/accesscontrol/PrincipalAccessControlProvider.java @@ -0,0 +1,22 @@ +package io.oasp.module.security.common.api.accesscontrol; + +import java.security.Principal; +import java.util.Collection; + +/** + * This is the interface for a provide that allows to {@link #getAccessControlIds(Principal) get the permission groups} for a + * {@link Principal}. + * + * @param

is the generic type of the {@link Principal} representing the user or subject. + * + * @author hohwille + */ +public interface PrincipalAccessControlProvider

{ + + /** + * @param principal is the {@link Principal} (user). + * @return the {@link Collection} of {@link AccessControl#getId() IDs} with the groups of the given {@link Principal}. + */ + Collection getAccessControlIds(P principal); + +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/api/exception/InvalidConfigurationException.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/api/exception/InvalidConfigurationException.java new file mode 100644 index 000000000..0e6a07f8d --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/api/exception/InvalidConfigurationException.java @@ -0,0 +1,36 @@ +package io.oasp.module.security.common.api.exception; + +/** + * Signals an exception during reading the security configuration + * + * @author mbrunnli + */ +public class InvalidConfigurationException extends RuntimeException { + + /** + * Default serial version UID + */ + private static final long serialVersionUID = 1L; + + /** + * Creates a new {@link InvalidConfigurationException} with the given message + * + * @param message error message + */ + public InvalidConfigurationException(String message) { + + super(message); + } + + /** + * Creates a new {@link InvalidConfigurationException} with the given message and the given cause + * + * @param message error message + * @param ex cause of the created exception + */ + public InvalidConfigurationException(String message, Throwable ex) { + + super(message, ex); + } + +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AbstractAccessControlBasedAuthenticationProvider.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AbstractAccessControlBasedAuthenticationProvider.java new file mode 100644 index 000000000..c86009305 --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AbstractAccessControlBasedAuthenticationProvider.java @@ -0,0 +1,163 @@ +package io.oasp.module.security.common.base.accesscontrol; + +import io.oasp.module.security.common.api.accesscontrol.AccessControl; +import io.oasp.module.security.common.api.accesscontrol.AccessControlProvider; +import io.oasp.module.security.common.api.accesscontrol.PrincipalAccessControlProvider; + +import java.security.Principal; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +import javax.inject.Inject; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +/** + * This is an implementation of {@link AbstractUserDetailsAuthenticationProvider} based on + * {@link PrincipalAccessControlProvider} and {@link AccessControlProvider}. + * + * @param is the generic type of the {@link UserDetails} implementation used to bridge with spring-security. + * @param

is the generic type of the {@link Principal} for internal user representation to bridge with + * {@link PrincipalAccessControlProvider}. + * + * @author hohwille + */ +public abstract class AbstractAccessControlBasedAuthenticationProvider + extends AbstractUserDetailsAuthenticationProvider { + + /** The {@link Logger} instance. */ + private static final Logger LOG = LoggerFactory.getLogger(AbstractAccessControlBasedAuthenticationProvider.class); + + private PrincipalAccessControlProvider

principalAccessControlProvider; + + private AccessControlProvider accessControlProvider; + + /** + * The constructor. + */ + public AbstractAccessControlBasedAuthenticationProvider() { + + } + + /** + * @param principalAccessControlProvider the {@link PrincipalAccessControlProvider} to {@link Inject}. + */ + @Inject + public void setPrincipalAccessControlProvider(PrincipalAccessControlProvider

principalAccessControlProvider) { + + this.principalAccessControlProvider = principalAccessControlProvider; + } + + /** + * @param accessControlProvider the {@link AccessControlProvider} to {@link Inject}. + */ + @Inject + public void setAccessControlProvider(AccessControlProvider accessControlProvider) { + + this.accessControlProvider = accessControlProvider; + } + + /** + * Here the actual authentication has to be implemented.
+ *
+ * + * {@inheritDoc} + */ + @Override + protected void additionalAuthenticationChecks(UserDetails userDetails, + UsernamePasswordAuthenticationToken authentication) throws AuthenticationException { + + // default implementation authentications via servlet API (container managed) + ServletRequestAttributes currentRequestAttributes = + (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes(); + + HttpServletRequest request = currentRequestAttributes.getRequest(); + String login = authentication.getName(); + String password = null; + Object credentials = authentication.getCredentials(); + if (credentials != null) { + password = credentials.toString(); + } + try { + request.login(login, password); + } catch (ServletException e) { + LOG.warn("Authentication failed: {}", e.toString()); + throw new BadCredentialsException("Authentication failed.", e); + } + authentication.setDetails(userDetails); + } + + /** + * Creates an instance of {@link UserDetails} that represent the user with the given username. + * + * @param username is the login of the user to create. + * @param password the password of the user. + * @param principal is the internal {@link Principal} that has been provided by + * {@link #retrievePrincipal(String, UsernamePasswordAuthenticationToken)}. + * @param authorities are the {@link GrantedAuthority granted authorities} or in other words the permissions of the + * user. + * @return the new user object. + */ + protected abstract U createUser(String username, String password, P principal, Set authorities); + + /** + * Retrieves the internal {@link Principal} object representing the user. This can be any object implementing + * {@link Principal} and can contain additional user details such as profile data. This object is used to + * {@link PrincipalAccessControlProvider#getAccessControlIds(Principal) retrieve} the (top-level) + * {@link AccessControl}s that have been granted to the user. + * + * @param username is the login of the user. + * @param authentication is the {@link UsernamePasswordAuthenticationToken}. + * @return the {@link Principal}. + */ + protected abstract P retrievePrincipal(String username, UsernamePasswordAuthenticationToken authentication); + + /** + * {@inheritDoc} + */ + @Override + protected UserDetails retrieveUser(String username, UsernamePasswordAuthenticationToken authentication) + throws AuthenticationException { + + P principal = retrievePrincipal(username, authentication); + if (principal == null) { + LOG.warn("Failed to retrieve user for login {}.", username); + throw new UsernameNotFoundException(username); + } + + // determine granted authorities for spring-security... + Set authorities = new HashSet<>(); + Collection accessControlIds = this.principalAccessControlProvider.getAccessControlIds(principal); + Set accessControlSet = new HashSet<>(); + for (String id : accessControlIds) { + boolean success = this.accessControlProvider.collectAccessControls(id, accessControlSet); + if (!success) { + LOG.warn("Undefined access control {}.", id); + // authorities.add(new SimpleGrantedAuthority(id)); + } + } + for (AccessControl accessControl : accessControlSet) { + authorities.add(new AccessControlGrantedAuthority(accessControl)); + } + + String password = null; + Object credentials = authentication.getCredentials(); + if (credentials != null) { + password = credentials.toString(); + } + return createUser(username, password, principal, authorities); + } +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AbstractAccessControlProvider.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AbstractAccessControlProvider.java new file mode 100644 index 000000000..79bb036f2 --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AbstractAccessControlProvider.java @@ -0,0 +1,206 @@ +package io.oasp.module.security.common.base.accesscontrol; + +import io.oasp.module.security.common.api.accesscontrol.AccessControl; +import io.oasp.module.security.common.api.accesscontrol.AccessControlGroup; +import io.oasp.module.security.common.api.accesscontrol.AccessControlPermission; +import io.oasp.module.security.common.api.accesscontrol.AccessControlProvider; +import io.oasp.module.security.common.api.accesscontrol.AccessControlSchema; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * This is the abstract base implementation of {@link AccessControlProvider}.
+ * ATTENTION:
+ * You need to call {@link #initialize(AccessControlSchema)} from the derived implementation. + * + * @author hohwille + */ +public abstract class AbstractAccessControlProvider implements AccessControlProvider { + + /** Logger instance. */ + private static final Logger LOG = LoggerFactory.getLogger(AbstractAccessControlProvider.class); + + /** @see #getAccessControl(String) */ + private final Map id2nodeMap; + + /** + * The constructor. + */ + public AbstractAccessControlProvider() { + + super(); + this.id2nodeMap = new HashMap<>(); + } + + /** + * Performs the required initialization of this class. + * + * @param config is the {@link AccessControlSchema}. + */ + protected void initialize(AccessControlSchema config) { + + LOG.debug("Initializing."); + List groups = config.getGroups(); + if (groups.size() == 0) { + throw new IllegalStateException("AccessControlSchema is empty - please configure at least one group!"); + } + Set toplevelGroups = new HashSet<>(groups); + for (AccessControlGroup group : groups) { + collectAccessControls(group, toplevelGroups); + checkForCyclicDependencies(group, new HashSet()); + } + } + + /** + * Checks that the given {@link AccessControlGroup} has no cyclic {@link AccessControlGroup#getInherits() inheritance + * graph}. + * + * @param group is the {@link AccessControlGroup} to check. + * @param visitedGroups is where the {@link AccessControlGroup} are collected to detect cycles. + */ + protected void checkForCyclicDependencies(AccessControlGroup group, Set visitedGroups) { + + boolean added = visitedGroups.add(group); + if (!added) { + // mmm NodeCycleException would be very helpful here... + throw new IllegalStateException("Cyclic inheritance of access control groups detected for " + group); + } + for (AccessControlGroup inheritedGroup : group.getInherits()) { + checkForCyclicDependencies(inheritedGroup, visitedGroups); + } + } + + /** + * Called from {@link #initialize(AccessControlSchema)} to collect all {@link AccessControl}s recursively. + * + * @param group the {@link AccessControlGroup} to traverse. + * @param toplevelGroups is the {@link Set} of all {@link AccessControlGroup}s from + * {@link AccessControlSchema#getGroups()}. + */ + protected void collectAccessControls(AccessControlGroup group, Set toplevelGroups) { + + // TODO hohwille Java HashMap buggy??? + // if (!toplevelGroups.contains(group)) { + // throw new IllegalStateException("Invalid group not declared as top-level group in schema: " + group); + // } + AccessControl old = this.id2nodeMap.put(group.getId(), group); + if (old != null) { + LOG.debug("Already visited access control group {}", group); + if (old != group) { + throw new IllegalStateException("Invalid security configuration: duplicate groups with id " + group.getId() + + "!"); + } + // group has already been visited, stop recursion... + return; + } else { + LOG.debug("Registered access control group {}", group); + } + for (AccessControlPermission permission : group.getPermissions()) { + old = this.id2nodeMap.put(permission.getId(), permission); + if (old != null) { + // throw new IllegalStateException("Invalid security configuration: duplicate permission with id " + // + permission.getId() + "!"); + LOG.warn("Security configuration contains duplicate permission with id {}.", permission.getId()); + } else { + LOG.debug("Registered access control permission {}", permission); + } + } + for (AccessControlGroup inheritedGroup : group.getInherits()) { + collectAccessControls(inheritedGroup, toplevelGroups); + } + } + + /** + * {@inheritDoc} + */ + @Override + public AccessControl getAccessControl(String nodeId) { + + return this.id2nodeMap.get(nodeId); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean collectAccessControlIds(String groupId, Set permissions) { + + AccessControl node = getAccessControl(groupId); + if (node instanceof AccessControlGroup) { + collectPermissionIds((AccessControlGroup) node, permissions); + } else { + // node does not exist or is a flat AccessControlPermission + permissions.add(groupId); + } + return (node != null); + } + + /** + * Recursive implementation of {@link #collectAccessControlIds(String, Set)} for {@link AccessControlGroup}s. + * + * @param group is the {@link AccessControlGroup} to traverse. + * @param permissions is the {@link Set} used to collect. + */ + public void collectPermissionIds(AccessControlGroup group, Set permissions) { + + boolean added = permissions.add(group.getId()); + if (!added) { + // we have already visited this node, stop recursion... + return; + } + for (AccessControlPermission permission : group.getPermissions()) { + permissions.add(permission.getId()); + } + for (AccessControlGroup inheritedGroup : group.getInherits()) { + collectPermissionIds(inheritedGroup, permissions); + } + } + + /** + * {@inheritDoc} + */ + @Override + public boolean collectAccessControls(String groupId, Set permissions) { + + AccessControl node = getAccessControl(groupId); + if (node == null) { + return false; + } + if (node instanceof AccessControlGroup) { + collectPermissionNodes((AccessControlGroup) node, permissions); + } else { + // node is a flat AccessControlPermission + permissions.add(node); + } + return true; + } + + /** + * Recursive implementation of {@link #collectAccessControls(String, Set)} for {@link AccessControlGroup}s. + * + * @param group is the {@link AccessControlGroup} to traverse. + * @param permissions is the {@link Set} used to collect. + */ + public void collectPermissionNodes(AccessControlGroup group, Set permissions) { + + boolean added = permissions.add(group); + if (!added) { + // we have already visited this node, stop recursion... + return; + } + for (AccessControlPermission permission : group.getPermissions()) { + permissions.add(permission); + } + for (AccessControlGroup inheritedGroup : group.getInherits()) { + collectPermissionNodes(inheritedGroup, permissions); + } + } + +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AccessControlGrantedAuthority.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AccessControlGrantedAuthority.java new file mode 100644 index 000000000..a39e89f3a --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AccessControlGrantedAuthority.java @@ -0,0 +1,59 @@ +package io.oasp.module.security.common.base.accesscontrol; + +import io.oasp.module.security.common.api.accesscontrol.AccessControl; + +import java.util.Objects; + +import org.springframework.security.core.GrantedAuthority; + +/** + * Implementation of {@link GrantedAuthority} for a {@link AccessControl}. + * + * @author hohwille + */ +public class AccessControlGrantedAuthority implements GrantedAuthority { + + /** UID for serialization. */ + private static final long serialVersionUID = 1L; + + private final AccessControl accessControl; + + /** + * The constructor. + * + * @param accessControl the {@link #getAccessControl() access control}. + */ + public AccessControlGrantedAuthority(AccessControl accessControl) { + + super(); + Objects.requireNonNull(accessControl, AccessControl.class.getSimpleName()); + this.accessControl = accessControl; + } + + /** + * @return the contained {@link AccessControl}. + */ + public AccessControl getAccessControl() { + + return this.accessControl; + } + + /** + * {@inheritDoc} + */ + @Override + public String getAuthority() { + + return this.accessControl.getId(); + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + + return getAuthority(); + } + +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AccessControlSchemaMapper.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AccessControlSchemaMapper.java new file mode 100644 index 000000000..5b545d199 --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AccessControlSchemaMapper.java @@ -0,0 +1,34 @@ +package io.oasp.module.security.common.base.accesscontrol; + +import io.oasp.module.security.common.api.accesscontrol.AccessControlSchema; + +import java.io.InputStream; +import java.io.OutputStream; + +/** + * This is the interface to {@link #read(InputStream)} and {@link #write(AccessControlSchema, OutputStream)} the + * {@link AccessControlSchema}. + * + * @author hohwille + */ +public interface AccessControlSchemaMapper { + + /** + * Reads the {@link AccessControlSchema} from the given {@link InputStream}. + * + * @param in is the {@link InputStream} with {@link AccessControlSchema} to read. Has to be + * {@link InputStream#close() closed} by the caller of this method who created the stream. + * @return the {@link AccessControlSchema} represented by the given input. + */ + AccessControlSchema read(InputStream in); + + /** + * Writes the given {@link AccessControlSchema} to the given {@link OutputStream}. + * + * @param conf is the {@link AccessControlSchema} to write. + * @param out is the {@link OutputStream} where to write the {@link AccessControlSchema} to. Has to be + * {@link OutputStream#close() closed} by the caller of this method who created the stream. + */ + void write(AccessControlSchema conf, OutputStream out); + +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AccessControlSchemaProvider.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AccessControlSchemaProvider.java new file mode 100644 index 000000000..f4f276a1b --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/AccessControlSchemaProvider.java @@ -0,0 +1,19 @@ +package io.oasp.module.security.common.base.accesscontrol; + +import io.oasp.module.security.common.api.accesscontrol.AccessControlSchema; + +/** + * This is the interface to {@link #loadSchema() load} the {@link AccessControlSchema} from an arbitrary source. The + * default implementation will load it from an XML file. You could create your own implementation to read from database + * or wherever if default is not suitable. + * + * @author hohwille + */ +public interface AccessControlSchemaProvider { + + /** + * @return the loaded {@link AccessControlSchema}. May not be null. + */ + AccessControlSchema loadSchema(); + +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/PrincipalGroupProviderGroupImpl.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/PrincipalGroupProviderGroupImpl.java new file mode 100644 index 000000000..4bdeb9f1a --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/PrincipalGroupProviderGroupImpl.java @@ -0,0 +1,58 @@ +package io.oasp.module.security.common.base.accesscontrol; + +import io.oasp.module.security.common.api.accesscontrol.PrincipalAccessControlProvider; + +import java.security.Principal; +import java.security.acl.Group; +import java.util.Collection; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.Set; + +/** + * This is an implementation of {@link PrincipalAccessControlProvider} based on {@link Group}. Due to the confusing API of + * {@link Group} that mixes a {@link Principal} with permissions and permission groups it is not commonly used even + * though it is available in the Java standard edition. + * + * @author hohwille + */ +public class PrincipalGroupProviderGroupImpl implements PrincipalAccessControlProvider { + + /** + * The constructor. + */ + public PrincipalGroupProviderGroupImpl() { + + super(); + } + + /** + * {@inheritDoc} + */ + @Override + public Collection getAccessControlIds(Group principal) { + + Set groupSet = new HashSet<>(); + collectGroups(principal, groupSet); + return groupSet; + } + + /** + * Called from {@link #getAccessControlIds(Group)} to recursively collect the groups. + * + * @param group is the {@link Group} to traverse. + * @param groupSet is the {@link Set} where to add the principal names. + */ + protected void collectGroups(Group group, Set groupSet) { + + Enumeration members = group.members(); + while (members.hasMoreElements()) { + Principal member = members.nextElement(); + String name = member.getName(); + boolean added = groupSet.add(name); + if (added && (member instanceof Group)) { + collectGroups((Group) member, groupSet); + } + } + } +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/SimpleAccessControlBasedAuthenticationProvider.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/SimpleAccessControlBasedAuthenticationProvider.java new file mode 100644 index 000000000..389ec3a79 --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/base/accesscontrol/SimpleAccessControlBasedAuthenticationProvider.java @@ -0,0 +1,45 @@ +package io.oasp.module.security.common.base.accesscontrol; + +import java.security.Principal; +import java.util.Set; + +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.userdetails.User; + +/** + * This is a simple implementation of {@link AbstractAccessControlBasedAuthenticationProvider}. + * + * @author hohwille + */ +public class SimpleAccessControlBasedAuthenticationProvider extends + AbstractAccessControlBasedAuthenticationProvider { + + /** + * The constructor. + */ + public SimpleAccessControlBasedAuthenticationProvider() { + + super(); + } + + /** + * {@inheritDoc} + */ + @Override + protected User createUser(String username, String password, Principal principal, Set authorities) { + + User user = new User(username, password, authorities); + return user; + } + + /** + * {@inheritDoc} + */ + @Override + protected Principal retrievePrincipal(String username, UsernamePasswordAuthenticationToken authentication) { + + return authentication; + } + +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlProviderImpl.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlProviderImpl.java new file mode 100644 index 000000000..119184dd6 --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlProviderImpl.java @@ -0,0 +1,55 @@ +package io.oasp.module.security.common.impl.accesscontrol; + +import io.oasp.module.security.common.base.accesscontrol.AbstractAccessControlProvider; +import io.oasp.module.security.common.base.accesscontrol.AccessControlSchemaProvider; + +import javax.annotation.PostConstruct; +import javax.inject.Inject; + +/** + * This is the default implementation of {@link io.oasp.module.security.common.api.accesscontrol.AccessControlProvider}. + * + * @author hohwille + */ +public class AccessControlProviderImpl extends AbstractAccessControlProvider { + + private AccessControlSchemaProvider accessControlSchemaProvider; + + /** + * The constructor. + */ + public AccessControlProviderImpl() { + + super(); + } + + /** + * Initializes this class. + */ + @PostConstruct + public void initialize() { + + if (this.accessControlSchemaProvider == null) { + this.accessControlSchemaProvider = new AccessControlSchemaProviderImpl(); + } + initialize(this.accessControlSchemaProvider.loadSchema()); + } + + /** + * @return accessControlSchemaProvider + */ + public AccessControlSchemaProvider getAccessControlSchemaProvider() { + + return this.accessControlSchemaProvider; + } + + /** + * @param accessControlSchemaProvider the {@link AccessControlSchemaProvider} to {@link Inject}. + */ + @Inject + public void setAccessControlSchemaProvider(AccessControlSchemaProvider accessControlSchemaProvider) { + + this.accessControlSchemaProvider = accessControlSchemaProvider; + } + +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaProviderImpl.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaProviderImpl.java new file mode 100644 index 000000000..8d518ef7e --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaProviderImpl.java @@ -0,0 +1,111 @@ +package io.oasp.module.security.common.impl.accesscontrol; + +import io.oasp.module.security.common.api.accesscontrol.AccessControlSchema; +import io.oasp.module.security.common.base.accesscontrol.AccessControlSchemaMapper; +import io.oasp.module.security.common.base.accesscontrol.AccessControlSchemaProvider; + +import java.io.InputStream; + +import javax.annotation.PostConstruct; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.Resource; + +/** + * This is the default implementation of {@link AccessControlSchemaProvider}. + * + * @author hohwille + */ +public class AccessControlSchemaProviderImpl implements AccessControlSchemaProvider { + + /** Logger instance. */ + private static final Logger LOG = LoggerFactory.getLogger(AccessControlSchemaProviderImpl.class); + + private Resource accessControlSchema; + + private AccessControlSchemaMapper accessControlSchemaMapper; + + private boolean initialized; + + /** + * The constructor. + */ + public AccessControlSchemaProviderImpl() { + + super(); + this.initialized = false; + } + + /** + * Initializes this class. + */ + @PostConstruct + public void initialize() { + + if (this.initialized) { + return; + } + LOG.debug("Initializing."); + if (this.accessControlSchemaMapper == null) { + this.accessControlSchemaMapper = new AccessControlSchemaXmlMapper(); + } + if (this.accessControlSchema == null) { + // this.accessControlSchema = new + // ClassPathResource(ApplicationConfigurationConstants.SECURITY_ACCESS_CONTROL_SCHEMA); + this.accessControlSchema = new ClassPathResource("config/app/security/access-control-schema.xml"); + } + this.initialized = true; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessControlSchema loadSchema() { + + initialize(); + LOG.debug("Reading access control schema from {}", this.accessControlSchema); + try (InputStream inputStream = this.accessControlSchema.getInputStream()) { + AccessControlSchema schema = this.accessControlSchemaMapper.read(inputStream); + LOG.debug("Reading access control schema completed successfully."); + return schema; + } catch (Exception e) { + throw new IllegalStateException("Failed to load access control schema from " + this.accessControlSchema, e); + } + } + + /** + * @return the {@link AccessControlSchemaMapper}. + */ + public AccessControlSchemaMapper getAccessControlSchemaMapper() { + + return this.accessControlSchemaMapper; + } + + /** + * @param accessControlSchemaMapper the {@link AccessControlSchemaMapper} to use. + */ + public void setAccessControlSchemaMapper(AccessControlSchemaMapper accessControlSchemaMapper) { + + this.accessControlSchemaMapper = accessControlSchemaMapper; + } + + /** + * @return accessControlSchema + */ + public Resource getAccessControlSchema() { + + return this.accessControlSchema; + } + + /** + * @param accessControlSchema the {@link Resource} pointing to the XML configuration of the access control schema. + */ + public void setAccessControlSchema(Resource accessControlSchema) { + + this.accessControlSchema = accessControlSchema; + } + +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaXmlMapper.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaXmlMapper.java new file mode 100644 index 000000000..47b99a489 --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaXmlMapper.java @@ -0,0 +1,165 @@ +package io.oasp.module.security.common.impl.accesscontrol; + +import io.oasp.module.security.common.api.accesscontrol.AccessControlSchema; +import io.oasp.module.security.common.base.accesscontrol.AccessControlSchemaMapper; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.bind.SchemaOutputResolver; +import javax.xml.bind.Unmarshaller; +import javax.xml.bind.ValidationEvent; +import javax.xml.bind.ValidationEventHandler; +import javax.xml.transform.Result; +import javax.xml.transform.stream.StreamResult; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * This class is a simple wrapper for {@link #read(InputStream) reading} and + * {@link #write(AccessControlSchema, OutputStream) writing} the {@link AccessControlSchema} from/to XML. + * + * @author hohwille + */ +public class AccessControlSchemaXmlMapper implements AccessControlSchemaMapper { + + /** Logger instance. */ + private static final Logger LOG = LoggerFactory.getLogger(AccessControlSchemaXmlMapper.class); + + private JAXBContext jaxbContext; + + /** + * The constructor. + */ + public AccessControlSchemaXmlMapper() { + + super(); + try { + this.jaxbContext = JAXBContext.newInstance(AccessControlSchema.class); + } catch (JAXBException e) { + throw new IllegalStateException(e); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void write(AccessControlSchema conf, OutputStream out) { + + try { + Marshaller marshaller = this.jaxbContext.createMarshaller(); + marshaller.marshal(conf, out); + } catch (JAXBException e) { + throw new IllegalStateException("Marshalling XML failed!", e); + } + } + + /** + * {@inheritDoc} + */ + @Override + public AccessControlSchema read(InputStream in) { + + try { + Unmarshaller unmarshaller = this.jaxbContext.createUnmarshaller(); + ValidationEventHandler handler = new ValidationEventHandlerImpl(); + unmarshaller.setEventHandler(handler); + return (AccessControlSchema) unmarshaller.unmarshal(in); + } catch (JAXBException e) { + throw new IllegalStateException("Unmarshalling XML failed!", e); + } + } + + /** + * Generates the XSD (XML Schema Definition) to the given {@link File}. + * + * @param outFile is the {@link File} to write to. + */ + public void writeXsd(File outFile) { + + File folder = outFile.getParentFile(); + if (!folder.isDirectory()) { + boolean success = folder.mkdirs(); + if (!success) { + throw new IllegalStateException("Failed to create folder " + folder); + } + } + try (FileOutputStream fos = new FileOutputStream(outFile)) { + writeXsd(fos); + } catch (Exception e) { + throw new IllegalStateException("Failed to generate and write the XSD schema to " + outFile + "!", e); + } + } + + /** + * Generates the XSD (XML Schema Definition) to the given {@link OutputStream}. + * + * @param out is the {@link OutputStream} to write to. + */ + public void writeXsd(final OutputStream out) { + + SchemaOutputResolver sor = new SchemaOutputResolver() { + + /** + * {@inheritDoc} + */ + @Override + public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException { + + StreamResult streamResult = new StreamResult(out); + streamResult.setSystemId(suggestedFileName); + return streamResult; + } + + }; + try { + this.jaxbContext.generateSchema(sor); + } catch (IOException e) { + throw new IllegalStateException("Failed to generate and write the XSD schema!", e); + } + } + + /** + * Custom implementation of {@link ValidationEventHandler}. + */ + protected static class ValidationEventHandlerImpl implements ValidationEventHandler { + + /** + * The constructor. + */ + public ValidationEventHandlerImpl() { + + super(); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean handleEvent(ValidationEvent event) { + + if (event != null) { + switch (event.getSeverity()) { + case ValidationEvent.ERROR: + case ValidationEvent.FATAL_ERROR: + throw new IllegalArgumentException(event.toString()); + case ValidationEvent.WARNING: + LOG.warn(event.toString()); + break; + default: + LOG.debug(event.toString()); + } + } + return true; + } + } + +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaXsdWriter.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaXsdWriter.java new file mode 100644 index 000000000..a2079d335 --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaXsdWriter.java @@ -0,0 +1,32 @@ +package io.oasp.module.security.common.impl.accesscontrol; + +import java.io.File; + +/** + * This is a simple programm to generate (create or update) the XSD for the + * {@link io.oasp.module.security.common.api.accesscontrol.AccessControlSchema}. + * + * @author hohwille + */ +public class AccessControlSchemaXsdWriter extends AccessControlSchemaXmlMapper { + + /** + * The constructor. + */ + public AccessControlSchemaXsdWriter() { + + super(); + } + + /** + * The main method to launch this program. + * + * @param args the command-line arguments (will be ignored). + */ + public static void main(String[] args) { + + AccessControlSchemaXmlMapper mapper = new AccessControlSchemaXmlMapper(); + mapper.writeXsd(new File("src/main/resources/io/oasp/module/security/access-control-schema.xsd")); + } + +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/rest/AuthenticationSuccessHandlerSendingOkHttpStatusCode.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/rest/AuthenticationSuccessHandlerSendingOkHttpStatusCode.java new file mode 100644 index 000000000..a6c9a626a --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/rest/AuthenticationSuccessHandlerSendingOkHttpStatusCode.java @@ -0,0 +1,36 @@ +package io.oasp.module.security.common.impl.rest; + +import org.springframework.security.core.Authentication; +import org.springframework.security.web.WebAttributes; +import org.springframework.security.web.authentication.AuthenticationSuccessHandler; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import java.io.IOException; + +/** + * Sends the OK status code upon successful authentication. + * + * @see JsonUsernamePasswordAuthenticationFilter + * @author Marek Matczak + */ +public class AuthenticationSuccessHandlerSendingOkHttpStatusCode implements AuthenticationSuccessHandler { + @Override + public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { + if (response.isCommitted()) { + return; + } + clearAuthenticationAttributes(request); + response.setStatus(HttpServletResponse.SC_OK); + } + + private void clearAuthenticationAttributes(HttpServletRequest request) { + HttpSession session = request.getSession(false); + if (session == null) { + return; + } + session.removeAttribute(WebAttributes.AUTHENTICATION_EXCEPTION); + } +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/rest/JsonUsernamePasswordAuthenticationFilter.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/rest/JsonUsernamePasswordAuthenticationFilter.java new file mode 100644 index 000000000..86346ae71 --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/rest/JsonUsernamePasswordAuthenticationFilter.java @@ -0,0 +1,191 @@ +package io.oasp.module.security.common.impl.rest; + +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.http.server.ServletServerHttpRequest; +import org.springframework.security.authentication.AuthenticationServiceException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; +import org.springframework.security.web.util.matcher.RequestMatcher; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +/** + *

+ * Processes authentication where credentials are sent as a JSON object. + *

+ *

+ * The JSON object must contain two properties: a username and a password. The default properties' names to use are + * contained in the static fields {@link UsernamePasswordAuthenticationFilter#SPRING_SECURITY_FORM_USERNAME_KEY} and + * {@link UsernamePasswordAuthenticationFilter#SPRING_SECURITY_FORM_PASSWORD_KEY}. The JSON object properties' names can + * also be changed by setting the {@code usernameParameter} and {@code passwordParameter} properties. Assuming the + * default properties' names were not changed, if the credentials user/pass are to be sent, the + * following JSON object is expected: + *


+ *     {
+ *        "j_username": "user",
+ *        "j_password": "pass",
+ *    }
+ * 
+ *

+ *

+ * The URL this filter responds to is passed as a constructor parameter. + *

+ *

+ * This authentication filter is intended for One Page Applications which handle a login page/dialog/pop-up on their + * own. This filter combined with: + *

    + *
  • {@link AuthenticationSuccessHandlerSendingOkHttpStatusCode}
  • + *
  • {@link org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler} created using + * the default constructor (thus leaving the {@code defaultFailureUrl} unset)
  • + *
  • {@link LogoutSuccessHandlerReturningOkHttpStatusCode}
  • + *
+ * makes the login/logout API fully RESTful. + *

+ * + * @author Marek Matczak + */ +public class JsonUsernamePasswordAuthenticationFilter extends AbstractAuthenticationProcessingFilter { + private String usernameParameter = UsernamePasswordAuthenticationFilter.SPRING_SECURITY_FORM_USERNAME_KEY; + + private String passwordParameter = UsernamePasswordAuthenticationFilter.SPRING_SECURITY_FORM_PASSWORD_KEY; + + private boolean postOnly = true; + + // REVIEW may-bee (hohwille) We have a centralized and custom-configured object mapper as spring bean. IMHO we should + // inject that instance here. + private ObjectMapper objectMapper = new ObjectMapper(); + + public JsonUsernamePasswordAuthenticationFilter(RequestMatcher requiresAuthenticationRequestMatcher) { + + super(requiresAuthenticationRequestMatcher); + } + + @Override + public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) + throws AuthenticationException, IOException, ServletException { + + if (this.postOnly && !request.getMethod().equals("POST")) { + throw new AuthenticationServiceException("Authentication method not supported: " + request.getMethod()); + } + + final UsernameAndPasswordParser usernameAndPasswordParser = new UsernameAndPasswordParser(request); + usernameAndPasswordParser.parse(); + UsernamePasswordAuthenticationToken authRequest = + new UsernamePasswordAuthenticationToken(usernameAndPasswordParser.getTrimmedUsername(), + usernameAndPasswordParser.getPassword()); + // authRequest.setDetails(this.authenticationDetailsSource.buildDetails(request)); + return getAuthenticationManager().authenticate(authRequest); + } + + public String getUsernameParameter() { + + return this.usernameParameter; + } + + public void setUsernameParameter(String usernameParameter) { + + this.usernameParameter = usernameParameter; + } + + public String getPasswordParameter() { + + return this.passwordParameter; + } + + public void setPasswordParameter(String passwordParameter) { + + this.passwordParameter = passwordParameter; + } + + public boolean isPostOnly() { + + return this.postOnly; + } + + public void setPostOnly(boolean postOnly) { + + this.postOnly = postOnly; + } + + private class UsernameAndPasswordParser { + private String username; + + private String password; + + private final HttpServletRequest request; + + private JsonNode credentialsNode; + + private UsernameAndPasswordParser(HttpServletRequest request) { + + this.request = request; + } + + public void parse() { + + parseJsonFromRequestBody(); + if (jsonParsedSuccessfully()) { + extractUsername(); + extractPassword(); + } + } + + private void extractPassword() { + + this.password = extractValueByName(JsonUsernamePasswordAuthenticationFilter.this.passwordParameter); + } + + private void extractUsername() { + + this.username = extractValueByName(JsonUsernamePasswordAuthenticationFilter.this.usernameParameter); + } + + private String extractValueByName(String name) { + + String value = null; + if (this.credentialsNode.has(name)) { + JsonNode node = this.credentialsNode.get(name); + if (node != null) { + value = node.asText(); + } + } + return value; + } + + private boolean jsonParsedSuccessfully() { + + return this.credentialsNode != null; + } + + private void parseJsonFromRequestBody() { + + try { + final ServletServerHttpRequest servletServerHttpRequest = new ServletServerHttpRequest(this.request); + this.credentialsNode = + JsonUsernamePasswordAuthenticationFilter.this.objectMapper.readTree(servletServerHttpRequest.getBody()); + } catch (IOException e) { + // ignoring + } + } + + private String getTrimmedUsername() { + + return this.username == null ? "" : this.username.trim(); + } + + private String getPassword() { + + return this.password == null ? "" : this.password; + } + + } +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/rest/LogoutSuccessHandlerReturningOkHttpStatusCode.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/rest/LogoutSuccessHandlerReturningOkHttpStatusCode.java new file mode 100644 index 000000000..e43077e3f --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/rest/LogoutSuccessHandlerReturningOkHttpStatusCode.java @@ -0,0 +1,25 @@ +package io.oasp.module.security.common.impl.rest; + +import org.springframework.security.core.Authentication; +import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * Sends the OK status code upon successful logout. + * + * @see JsonUsernamePasswordAuthenticationFilter + * @author Marek Matczak + */ +public class LogoutSuccessHandlerReturningOkHttpStatusCode implements LogoutSuccessHandler { + @Override + public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { + if (response.isCommitted()) { + return; + } + response.setStatus(HttpServletResponse.SC_OK); + } +} diff --git a/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/web/RetainAnchorFilter.java b/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/web/RetainAnchorFilter.java new file mode 100644 index 000000000..f1dd8ab52 --- /dev/null +++ b/oasp4j-security/src/main/java/io/oasp/module/security/common/impl/web/RetainAnchorFilter.java @@ -0,0 +1,193 @@ +package io.oasp.module.security.common.impl.web; + +import java.io.IOException; + +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletResponseWrapper; + +import org.springframework.web.filter.GenericFilterBean; + +/** + * Spring Security filter that preserves the URL anchor if the authentication process contains redirects (e.g. if the + * login is performed via CAS or form login). + * + * With standard redirects (default Spring Security behavior), Internet Explorer (6.0 and 8.0) discard the anchor part + * of the URL such that e.g. bookmarking does not work properly. Firefox re-appends the anchor part. + * + * This filter replaces redirects to URLs that match a certain pattern (storeUrlPattern) with a Javascript + * page that stores the URL anchor in a cookie, and replaces redirects to URLs that match another pattern ( + * restoreUrlPattern) with a Javascript page that restores the URL anchor from that cookie. The cookie name + * can be set via the attribute cookieName. + * + * @author mbrunnli (contributed by guidow08 & mpickell) + * @see Forum post of guidow08 + * @see Forum post of mpickell + */ +public class RetainAnchorFilter extends GenericFilterBean { + + private String storeUrlPattern; + + private String restoreUrlPattern; + + private String cookieName; + + /** + * Sets the url pattern for storing anchors. + * + * @param storeUrlPattern url regular expression + */ + public void setStoreUrlPattern(String storeUrlPattern) { + + this.storeUrlPattern = storeUrlPattern; + } + + /** + * Sets the url pattern for restoring anchors. + * + * @param restoreUrlPattern url regular expression + */ + public void setRestoreUrlPattern(String restoreUrlPattern) { + + this.restoreUrlPattern = restoreUrlPattern; + } + + /** + * Sets the cookie name in which the anchor data should be saved. + * + * @param cookieName name of the cookie + */ + public void setCookieName(String cookieName) { + + this.cookieName = cookieName; + } + + /** + * {@inheritDoc} + */ + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, + ServletException { + + ServletResponse wrappedResponse = response; + if (response instanceof HttpServletResponse) { + wrappedResponse = new RedirectResponseWrapper((HttpServletResponse) response); + } + + chain.doFilter(request, wrappedResponse); + } + + /** + * HttpServletResponseWrapper that replaces the redirect by appropriate Javascript code. + */ + private class RedirectResponseWrapper extends HttpServletResponseWrapper { + + public RedirectResponseWrapper(HttpServletResponse response) { + + super(response); + } + + @Override + public void sendRedirect(String location) throws IOException { + + HttpServletResponse response = (HttpServletResponse) getResponse(); + String redirectPageHtml = ""; + if (location.matches(RetainAnchorFilter.this.storeUrlPattern)) { + redirectPageHtml = generateStoreAnchorRedirectPageHtml(location); + } else if (location.matches(RetainAnchorFilter.this.restoreUrlPattern)) { + redirectPageHtml = generateRestoreAnchorRedirectPageHtml(location); + } else { + super.sendRedirect(location); + return; + } + response.setContentType("text/html;charset=UTF-8"); + response.setContentLength(redirectPageHtml.length()); + response.getWriter().write(redirectPageHtml); + } + + private String generateStoreAnchorRedirectPageHtml(String location) { + + StringBuilder sb = new StringBuilder(); + + sb.append("Redirect Page\n"); + sb.append("\n\n"); + sb.append("

Redirect Page (Store Anchor)

\n"); + sb.append("Should redirect to " + location + "\n"); + sb.append("\n"); + + return sb.toString(); + } + + /** + * @author mbrunnli (Bugfix of mpickell) + * @see Forum + * post + */ + private String generateRestoreAnchorRedirectPageHtml(String location) { + + StringBuilder sb = new StringBuilder(); + + // open html + sb.append("Redirect Page"); + sb.append(""); + sb.append(""); + sb.append(""); + sb.append("

Redirect Page (Restore Anchor)

"); + sb.append("

Should redirect to " + location + "

"); + sb.append(""); + sb.append(""); + + return sb.toString(); + } + + } +} diff --git a/oasp4j-security/src/main/resources/io/oasp/module/security/access-control-schema.xsd b/oasp4j-security/src/main/resources/io/oasp/module/security/access-control-schema.xsd new file mode 100644 index 000000000..4b256afbf --- /dev/null +++ b/oasp4j-security/src/main/resources/io/oasp/module/security/access-control-schema.xsd @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/oasp4j-security/src/test/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaTest.java b/oasp4j-security/src/test/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaTest.java new file mode 100644 index 000000000..b1d8cd5c2 --- /dev/null +++ b/oasp4j-security/src/test/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaTest.java @@ -0,0 +1,247 @@ +package io.oasp.module.security.common.impl.accesscontrol; + +import io.oasp.module.security.common.api.accesscontrol.AccessControl; +import io.oasp.module.security.common.api.accesscontrol.AccessControlGroup; +import io.oasp.module.security.common.api.accesscontrol.AccessControlPermission; +import io.oasp.module.security.common.api.accesscontrol.AccessControlProvider; +import io.oasp.module.security.common.api.accesscontrol.AccessControlSchema; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.junit.Assert; +import org.junit.Test; +import org.springframework.core.io.ClassPathResource; + +/** + * This is the test-case for {@link AccessControlSchema} and {@link AccessControlSchemaXmlMapper}. + * + * @author hohwille + */ +public class AccessControlSchemaTest extends Assert { + + /** The location of the reference configuration for regression tests. */ + private static final String SCHEMA_XML = "config/app/security/access-control-schema.xml"; + + /** The location of the reference configuration with group type declaration */ + private static final String SCHEMA_XML_GROUP_TYPES = "config/app/security/access-control-schema_groupTypes.xml"; + + /** The location of the configuration with a cyclic dependency. */ + private static final String SCHEMA_XML_CYCLIC = "config/app/security/access-control-schema_cyclic.xml"; + + /** The location of the configuration that is syntactically corrupted (invalid group reference). */ + private static final String SCHEMA_XML_CORRUPTED = "config/app/security/access-control-schema_corrupted.xml"; + + /** The location of the configuration that is syntactically corrupted (invalid group reference). */ + private static final String SCHEMA_XML_ILLEGAL = "config/app/security/access-control-schema_illegal.xml"; + + /** + * The constructor. + */ + public AccessControlSchemaTest() { + + super(); + } + + /** + * Regression test for {@link AccessControlSchemaXmlMapper#write(AccessControlSchema, java.io.OutputStream)}. + * + * @throws Exception if something goes wrong. + */ + @Test + public void testWriteXml() throws Exception { + + // given + AccessControlSchema conf = createSecurityConfiguration(); + String expectedXml = readSecurityConfigurationXmlFile(); + // when + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + new AccessControlSchemaXmlMapper().write(conf, baos); + String actualXml = baos.toString(); + // then + assertEquals(expectedXml.replaceAll("\\r *|\\n *", ""), actualXml); + } + + /** + * Regression test for {@link AccessControlSchemaXmlMapper#read(InputStream)}. + * + * @throws Exception if something goes wrong. + */ + @Test + public void testReadXml() throws Exception { + + // given + AccessControlSchema expectedConf = createSecurityConfiguration(); + // when + ClassPathResource resource = new ClassPathResource(SCHEMA_XML); + AccessControlSchema actualConf; + try (InputStream in = resource.getInputStream()) { + actualConf = new AccessControlSchemaXmlMapper().read(in); + } + // then + assertEquals(expectedConf, actualConf); + } + + /** + * Tests that {@link AccessControlProviderImpl} properly detects cyclic inheritance of {@link AccessControlGroup}s. + */ + @Test + public void testProviderCyclic() { + + try { + createProvider(SCHEMA_XML_CYCLIC); + fail("Exception expected!"); + } catch (IllegalStateException e) { + assertTrue(e.getMessage().startsWith("Cyclic inheritance ")); + } + } + + /** + * Tests that {@link AccessControlProviderImpl} with corrupted XML (not well-formed). + */ + @Test + public void testProviderCorrupted() { + + try { + createProvider(SCHEMA_XML_CORRUPTED); + fail("Exception expected!"); + } catch (IllegalStateException e) { + String message = e.getMessage(); + assertTrue(message, message.contains(SCHEMA_XML_CORRUPTED.toString())); + String causeMessage = e.getCause().getMessage(); + assertEquals("Unmarshalling XML failed!", causeMessage); + } + } + + /** + * Tests that {@link AccessControlProviderImpl} with illegal XML (undefined group reference). + */ + @Test + public void testProviderIllegal() { + + try { + createProvider(SCHEMA_XML_ILLEGAL); + fail("Exception expected!"); + } catch (IllegalStateException e) { + String message = e.getMessage(); + assertTrue(message, message.contains(SCHEMA_XML_ILLEGAL.toString())); + String causeMessage = e.getCause().getMessage(); + assertTrue(causeMessage, causeMessage.contains("Undefined ID \"Waiter\"")); + } + } + + /** + * Tests that {@link AccessControlProviderImpl} properly detects cyclic inheritance of {@link AccessControlGroup}s. + */ + public void testProvider() { + + AccessControlProvider provider = createProvider(SCHEMA_XML); + Set permissions = new HashSet<>(); + boolean success; + success = provider.collectAccessControls("", permissions); + assertFalse(success); + assertEquals(0, permissions.size()); + success = provider.collectAccessControls("Admin", permissions); + assertTrue(success); + assertTrue(permissions.contains(provider.getAccessControl("Customer_ReadCustomer"))); + assertTrue(permissions.contains(provider.getAccessControl("Customer_CreateCustomer"))); + assertTrue(permissions.contains(provider.getAccessControl("Customer_DeleteCustomer"))); + assertEquals(24, permissions.size()); + success = provider.collectAccessControls("ReadOnly", permissions); + assertTrue(success); + assertTrue(permissions.contains(provider.getAccessControl("Contract_ReadContractAsset"))); + assertTrue(permissions.contains(provider.getAccessControl("Contract_UpdateContractAsset"))); + assertFalse(permissions.contains(provider.getAccessControl("System_DeleteUser"))); + assertEquals(5, permissions.size()); + + } + + /** + * Tests the correct extraction of group types + */ + @Test + public void testGroupTypes() { + + ClassPathResource resource = new ClassPathResource(SCHEMA_XML_GROUP_TYPES); + AccessControlSchemaProviderImpl accessControlSchemaProvider = new AccessControlSchemaProviderImpl(); + accessControlSchemaProvider.setAccessControlSchema(resource); + AccessControlSchema accessControlSchema = accessControlSchemaProvider.loadSchema(); + List groups = accessControlSchema.getGroups(); + + Assert.assertNotNull(groups); + Assert.assertEquals(3, groups.size()); + + for (AccessControlGroup group : groups) { + if (group.getId().equals("Admin")) { + Assert.assertEquals("role", group.getType()); + } else if (group.getId().equals("ReadOnly") || group.getId().equals("ReadWrite")) { + Assert.assertEquals("group", group.getType()); + } + } + } + + private AccessControlProvider createProvider(String location) { + + ClassPathResource resource = new ClassPathResource(location); + AccessControlProviderImpl accessControlProvider = new AccessControlProviderImpl(); + AccessControlSchemaProviderImpl accessControlSchemaProvider = new AccessControlSchemaProviderImpl(); + accessControlSchemaProvider.setAccessControlSchema(resource); + accessControlProvider.setAccessControlSchemaProvider(accessControlSchemaProvider); + accessControlProvider.initialize(); + return accessControlProvider; + } + + private String readSecurityConfigurationXmlFile() throws IOException, UnsupportedEncodingException { + + ClassPathResource resource = new ClassPathResource(SCHEMA_XML); + byte[] data = Files.readAllBytes(Paths.get(resource.getURI())); + String expectedXml = new String(data, "UTF-8"); + return expectedXml; + } + + private AccessControlSchema createSecurityConfiguration() { + + AccessControlSchema conf = new AccessControlSchema(); + AccessControlGroup readOnly = new AccessControlGroup("ReadOnly"); + readOnly.getPermissions().add(new AccessControlPermission("Customer_ReadCustomer")); + readOnly.getPermissions().add(new AccessControlPermission("Customer_ReadProfile")); + readOnly.getPermissions().add(new AccessControlPermission("Customer_ReadAddress")); + readOnly.getPermissions().add(new AccessControlPermission("Contract_ReadContract")); + readOnly.getPermissions().add(new AccessControlPermission("Contract_ReadContractAsset")); + AccessControlGroup readWrite = new AccessControlGroup("ReadWrite"); + readWrite.getInherits().add(readOnly); + readWrite.getPermissions().add(new AccessControlPermission("Customer_CreateCustomer")); + readWrite.getPermissions().add(new AccessControlPermission("Customer_CreateProfile")); + readWrite.getPermissions().add(new AccessControlPermission("Customer_CreateAddress")); + readWrite.getPermissions().add(new AccessControlPermission("Contract_CreateContract")); + readWrite.getPermissions().add(new AccessControlPermission("Contract_CreateContractAsset")); + readWrite.getPermissions().add(new AccessControlPermission("Customer_UpdateCustomer")); + readWrite.getPermissions().add(new AccessControlPermission("Customer_UpdateProfile")); + readWrite.getPermissions().add(new AccessControlPermission("Customer_UpdateAddress")); + readWrite.getPermissions().add(new AccessControlPermission("Contract_UpdateContract")); + readWrite.getPermissions().add(new AccessControlPermission("Contract_UpdateContractAsset")); + AccessControlGroup admin = new AccessControlGroup("Admin"); + admin.getInherits().add(readWrite); + admin.getPermissions().add(new AccessControlPermission("Customer_DeleteCustomer")); + admin.getPermissions().add(new AccessControlPermission("Customer_DeleteProfile")); + admin.getPermissions().add(new AccessControlPermission("Customer_DeleteAddress")); + admin.getPermissions().add(new AccessControlPermission("Contract_DeleteContract")); + admin.getPermissions().add(new AccessControlPermission("Contract_DeleteContractAsset")); + admin.getPermissions().add(new AccessControlPermission("System_ReadUser")); + admin.getPermissions().add(new AccessControlPermission("System_CreateUser")); + admin.getPermissions().add(new AccessControlPermission("System_UpdateUser")); + admin.getPermissions().add(new AccessControlPermission("System_DeleteUser")); + conf.getGroups().add(readOnly); + conf.getGroups().add(readWrite); + conf.getGroups().add(admin); + return conf; + } + +} diff --git a/oasp4j-security/src/test/resources/config/app/security/access-control-schema.xml b/oasp4j-security/src/test/resources/config/app/security/access-control-schema.xml new file mode 100644 index 000000000..6c2cdec6e --- /dev/null +++ b/oasp4j-security/src/test/resources/config/app/security/access-control-schema.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + ReadOnly + + + + + + + + + + + + + + + + + ReadWrite + + + + + + + + + + + + + + \ No newline at end of file diff --git a/oasp4j-security/src/test/resources/config/app/security/access-control-schema_corrupted.xml b/oasp4j-security/src/test/resources/config/app/security/access-control-schema_corrupted.xml new file mode 100644 index 000000000..63b25fe56 --- /dev/null +++ b/oasp4j-security/src/test/resources/config/app/security/access-control-schema_corrupted.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/oasp4j-security/src/test/resources/config/app/security/access-control-schema_cyclic.xml b/oasp4j-security/src/test/resources/config/app/security/access-control-schema_cyclic.xml new file mode 100644 index 000000000..562287fb4 --- /dev/null +++ b/oasp4j-security/src/test/resources/config/app/security/access-control-schema_cyclic.xml @@ -0,0 +1,29 @@ + + + + + + + + + + Chief + + + + + Barkeeper + + + + + Waiter + Barkeeper + Cook + + + + + + + diff --git a/oasp4j-security/src/test/resources/config/app/security/access-control-schema_groupTypes.xml b/oasp4j-security/src/test/resources/config/app/security/access-control-schema_groupTypes.xml new file mode 100644 index 000000000..7dfd6f707 --- /dev/null +++ b/oasp4j-security/src/test/resources/config/app/security/access-control-schema_groupTypes.xml @@ -0,0 +1,24 @@ + + + + + + + + + + ReadOnly + + + + + + + + ReadWrite + + + + + + \ No newline at end of file diff --git a/oasp4j-security/src/test/resources/config/app/security/access-control-schema_illegal.xml b/oasp4j-security/src/test/resources/config/app/security/access-control-schema_illegal.xml new file mode 100644 index 000000000..fd4a6a9fe --- /dev/null +++ b/oasp4j-security/src/test/resources/config/app/security/access-control-schema_illegal.xml @@ -0,0 +1,8 @@ + + + + + Waiter + + + diff --git a/oasp4j-security/src/test/resources/logback.xml b/oasp4j-security/src/test/resources/logback.xml new file mode 100644 index 000000000..bebe76302 --- /dev/null +++ b/oasp4j-security/src/test/resources/logback.xml @@ -0,0 +1,19 @@ + + + + + + + + + ${logPattern} + + + DEBUG + + + + + + + diff --git a/oasp4j-web/pom.xml b/oasp4j-web/pom.xml new file mode 100644 index 000000000..e98e5efed --- /dev/null +++ b/oasp4j-web/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + io.oasp.java + oasp4j-parent + dev-SNAPSHOT + ../oasp4j-parent/pom.xml + + oasp4j-web + ${oasp4j.version} + ${project.artifactId} + Module for reusable web and servlet related code of the Open Application Standard Platform for Java (OASP4J). + + + + javax.servlet + javax.servlet-api + provided + + + org.springframework + spring-web + + + net.sf.m-m-m + mmm-util-core + + + + \ No newline at end of file diff --git a/oasp4j-web/src/main/java/io/oasp/module/web/common/base/PropertiesWebApplicationContextInitializer.java b/oasp4j-web/src/main/java/io/oasp/module/web/common/base/PropertiesWebApplicationContextInitializer.java new file mode 100644 index 000000000..2f6b1fcd4 --- /dev/null +++ b/oasp4j-web/src/main/java/io/oasp/module/web/common/base/PropertiesWebApplicationContextInitializer.java @@ -0,0 +1,60 @@ +package io.oasp.module.web.common.base; + +import java.io.IOException; +import java.util.Arrays; + +import net.sf.mmm.util.io.api.RuntimeIoException; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.ApplicationContextInitializer; +import org.springframework.core.env.CompositePropertySource; +import org.springframework.core.io.support.ResourcePropertySource; +import org.springframework.web.WebApplicationInitializer; +import org.springframework.web.context.ConfigurableWebApplicationContext; + +/** + * Registers new {@link WebApplicationInitializer} which allows setting spring profiles in application properties. + * + * @author sspielma + */ +public class PropertiesWebApplicationContextInitializer implements + ApplicationContextInitializer { + + /** Logger instance. */ + private static final Logger LOG = LoggerFactory.getLogger(PropertiesWebApplicationContextInitializer.class); + + /** + * List of application property resource names. + */ + private String[] applicationPropertyResources = { "classpath:/config/app/application-default.properties", + "classpath:/config/env/application.properties" }; + + /** + * {@inheritDoc} + */ + @Override + public void initialize(ConfigurableWebApplicationContext applicationContext) { + + CompositePropertySource compositePropertySource = new CompositePropertySource("application properties"); + for (String propertyName : Arrays.asList(this.applicationPropertyResources)) { + try { + LOG.debug("Registering " + propertyName + " as property source."); + compositePropertySource.addPropertySource(new ResourcePropertySource(propertyName)); + applicationContext.getEnvironment().getPropertySources().addFirst(compositePropertySource); + } catch (IOException e) { + throw new RuntimeIoException(e); + } + } + } + + /** + * Overwrites default application property resources. + * + * @param applicationPropertyResources the applicationPropertyResources to set + */ + public void setApplicationPropertyResources(String... applicationPropertyResources) { + + this.applicationPropertyResources = applicationPropertyResources; + } +} diff --git a/oasp4j-web/src/main/java/io/oasp/module/web/common/base/ToggleFilterWrapper.java b/oasp4j-web/src/main/java/io/oasp/module/web/common/base/ToggleFilterWrapper.java new file mode 100644 index 000000000..0cc9668c3 --- /dev/null +++ b/oasp4j-web/src/main/java/io/oasp/module/web/common/base/ToggleFilterWrapper.java @@ -0,0 +1,126 @@ +package io.oasp.module.web.common.base; + +import java.io.IOException; + +import javax.annotation.PostConstruct; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * This class is responsible for wrapping a {@link Filter} and allows to be {@link #setDisabled(Boolean) disabled} e.g. + * for development tests (e.g. via some {@link System#getProperty(String) system property}. In case the filter gets + * {@link #setDisabled(Boolean) disabled} a WARNING log message is produced and also written to {@link System#err}.
+ * + * Here is an example spring XML config from our sample application that allows to disable the CsrfFilter + * via a {@link System#getProperties() system property} (-DCsrfDisabled=true): + * + *
+ * <bean id="CsrfFilterWrapper" class="io.oasp.gastronomy.restaurant.general.service.impl.rest.ToggleFilterWrapper">
+ *   <property name="delegateFilter" ref="CsrfFilter"/>
+ *   <property name="disabledString" value="#{systemProperties['CsrfDisabled']}"/>
+ * </bean>
+ * 
+ * + * @author hohwille + */ +public class ToggleFilterWrapper implements Filter { + + /** Logger instance. */ + private static final Logger LOG = LoggerFactory.getLogger(ToggleFilterWrapper.class); + + /** + * The delegated Filter. + */ + private Filter delegateFilter; + + /** + * Is set if this filter is disabled. + */ + private Boolean disabled; + + /** + * {@inheritDoc} + */ + @Override + public void init(FilterConfig filterConfig) throws ServletException { + + } + + /** + * + */ + @PostConstruct + public void initialize() { + + if (this.disabled) { + String message = + "****** FILTER " + this.delegateFilter + + " HAS BEEN DISABLED! THIS FEATURE SHOULD ONLY BE USED IN DEVELOPMENT MODE ******"; + LOG.warn(message); + // CHECKSTYLE:OFF (for development only) + System.err.println(message); + // CHECKSTYLE:ON + } + } + + /** + * {@inheritDoc} + */ + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, + ServletException { + + if (!this.disabled) { + this.delegateFilter.doFilter(request, response, chain); + } else { + chain.doFilter(request, response); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void destroy() { + + } + + /** + * @param delegateFilter the filter to delegate to + */ + public void setDelegateFilter(Filter delegateFilter) { + + this.delegateFilter = delegateFilter; + } + + /** + * @param disabled indicates if this filter is disabled + */ + public void setDisabled(Boolean disabled) { + + this.disabled = disabled; + } + + /** + * @param disabledString the String to be parsed to a boolean + */ + public void setDisabledString(String disabledString) { + + setDisabled(Boolean.parseBoolean(disabledString)); + } + + /** + * @return disabled + */ + public Boolean isDisabled() { + + return this.disabled; + } +} diff --git a/pom.xml b/pom.xml new file mode 100644 index 000000000..a1369ac96 --- /dev/null +++ b/pom.xml @@ -0,0 +1,253 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-dependencies + 1.1.9.RELEASE + + io.oasp.java + oasp4j-dependencies + 1.0.0-SNAPSHOT + pom + ${project.artifactId} + Dependencies of the Open Application Standard Platform for Java (OASP4J) based on spring boot. + http://oasp.io/oasp4j/ + 2014 + + + UTF-8 + UTF-8 + + 1.7 + 3.0.2 + 1.0.0-SNAPSHOT + + + + oasp4j-parent + + + + + + + + org.springframework + spring-context + ${spring.version} + + + + javax.annotation + jsr250-api + 1.0 + + + + javax.inject + javax.inject + 1 + + + + javax.annotation + javax.annotation-api + 1.2 + + + + com.google.guava + guava + 17.0 + + + + net.sf.m-m-m + mmm-util-core + 6.0.0 + + + + org.apache.commons + commons-collections4 + 4.0 + + + + org.javamoney + moneta + 0.8 + + + + org.hibernate.javax.persistence + hibernate-jpa-2.1-api + 1.0.0.Final + + + cglib + cglib + 3.1 + + + + com.mysema.querydsl + querydsl-jpa + 3.4.3 + + + + org.apache.commons + commons-dbcp2 + 2.0.1 + + + + org.slf4j + slf4j-api + 1.7.7 + + + + javax.servlet + javax.servlet-api + 3.1.0 + + + + + javax.servlet + jstl + 1.2 + + + + javax.ws.rs + javax.ws.rs-api + 2.0 + + + + org.apache.cxf + cxf-rt-frontend-jaxws + ${cxf.version} + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf.version} + + + org.apache.cxf + cxf-rt-transports-http + ${cxf.version} + + + org.apache.cxf + cxf-rt-transports-local + ${cxf.version} + + + org.apache.cxf + cxf-rt-rs-client + ${cxf.version} + + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + 2.4.2 + + + com.fasterxml.jackson.core + jackson-databind + 2.3.3 + + + com.fasterxml.jackson.core + jackson-core + 2.3.3 + + + + net.sf.dozer + dozer + 5.5.1 + + + + javax.validation + validation-api + 1.1.0.Final + + + + org.mockito + mockito-core + 1.9.5 + + + + + io.oasp.java + oasp4j-monitoring + ${oasp4j.version} + + + io.oasp.java + oasp4j-logging + ${oasp4j.version} + + + io.oasp.java + oasp4j-beanmapping + ${oasp4j.version} + + + io.oasp.java + oasp4j-configuration + ${oasp4j.version} + + + io.oasp.java + oasp4j-security + ${oasp4j.version} + + + io.oasp.java + oasp4j-rest + ${oasp4j.version} + + + io.oasp.java + oasp4j-jpa + ${oasp4j.version} + + + io.oasp.java + oasp4j-web + ${oasp4j.version} + + + + + + + oasp.releases + OASP Releases + http://oasp-ci.cloudapp.net/nexus/content/repositories/releases/ + + + oasp.snapshots + OASP Snapshots + http://oasp-ci.cloudapp.net/nexus/content/repositories/snapshots/ + + + oasp-site + file://${user.dir}/target/oasp4j/maven + + + + diff --git a/settings/checkstyle/checkstyle.xml b/settings/checkstyle/checkstyle.xml new file mode 100644 index 000000000..ac244a1b3 --- /dev/null +++ b/settings/checkstyle/checkstyle.xml @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/settings/clientpe-properties.bat b/settings/clientpe-properties.bat new file mode 100644 index 000000000..a690a2ca4 --- /dev/null +++ b/settings/clientpe-properties.bat @@ -0,0 +1,6 @@ +@echo off +rem **************************************** +rem Architect + +rem Variable replacement config +set REPLACEMENT_PATTERNS_PATH=%SETTINGS_PATH%\eclipse\workspace\replacement-patterns.properties \ No newline at end of file diff --git a/settings/eclipse/codetemplates.xml b/settings/eclipse/codetemplates.xml new file mode 100644 index 000000000..6ec5534cb --- /dev/null +++ b/settings/eclipse/codetemplates.xml @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/settings/eclipse/formatter.xml b/settings/eclipse/formatter.xml new file mode 100644 index 000000000..8a8c716c1 --- /dev/null +++ b/settings/eclipse/formatter.xml @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/settings/eclipse/project.dictionary b/settings/eclipse/project.dictionary new file mode 100644 index 000000000..71dcae451 --- /dev/null +++ b/settings/eclipse/project.dictionary @@ -0,0 +1,17 @@ +plugins +plugin +seamlessly +polymorphic +deserialize +deserialized +iterable +hibernate +barkeeper +deserializer +servlet +multi +salesmanagement +offermanagement +staffmanagement +tablemanagement +usecsae diff --git a/settings/eclipse/project.dictionary.readme.txt b/settings/eclipse/project.dictionary.readme.txt new file mode 100644 index 000000000..626fc6a30 --- /dev/null +++ b/settings/eclipse/project.dictionary.readme.txt @@ -0,0 +1,6 @@ +In Eclipse ist ein Spell-Checker eingebaut: +Preferences > Editors > Text Editors > Spelling +Dort aktivieren und ein ASCII Dictionary einbinden. +Korrekturvorschläge mit [Ctrl.][1] +Für weitere Details siehe hier: +http://sww.sdm.de/app/snuggets/bin/view/Technik/Eclipse#Rechtschreibpr%FCfung diff --git a/settings/eclipse/workspace/replacement-patterns.properties b/settings/eclipse/workspace/replacement-patterns.properties new file mode 100644 index 000000000..e69de29bb diff --git a/settings/eclipse/workspace/setup/.metadata/.mylyn/repositories.xml.zip b/settings/eclipse/workspace/setup/.metadata/.mylyn/repositories.xml.zip new file mode 100644 index 0000000000000000000000000000000000000000..e749daa61c73e57be1040bc493dcfa13ef378ebe GIT binary patch literal 576 zcmWIWW@Zs#;Nak3Sl8<7%76p}fb62wg8bsllKi5~)MCAg+?=;zvDwmw0)Mof-e28n zG9{>pQ)JF^C+}I`V)sSQ4}HDGX?Ic0&#zOJ>l4-2PF*6<70;)b>ArZbWa0Da-S@gI zS&Uv}{q);Al_{oqZDFi#{hgS-KQ;9A&*ht(U3XAf@>oK{k?SYyKArcSd*`-s$IQZ9 z-Qyc~8(+)POxmz@j#2fmkkHIoA|}@=m|7R^oEYKW zEOy5MR>_KnHD^O7d(@9cHw+-B1xC%W9&ruXsQisznJ6XF-D z)&IBr9V)qqW4B>{-m?$a_SW%oH-9|u67x}mBkH4cfSZx2g~eU+r2bG zd;8l8hc&hV*IG4&o+o>0fBqd5_4P>JgOo`=T+(wF#IEZR~*8honfA9u)vvVYA2VGsq$iTqJ&A<@g&B!FefQW5mIZ$k) Y0`#~K@MdKLsbB;`J0SfAXet8(0N;=5X8-^I literal 0 HcmV?d00001 diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.indexes/properties.index b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.indexes/properties.index new file mode 100644 index 0000000000000000000000000000000000000000..1e099f3bff508a47e7cce4c8ace123e0c07a5306 GIT binary patch literal 80 zcmZQ%U|?VbVI~IA{GxQd)a0DZg5p%YlGMapz2y9&R0gi1)Pnrt%#!?~N(Mz_C8_C| TC153b?wKV4Mfqi!DXB#OWmFkc literal 0 HcmV?d00001 diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/org.eclipse.egit.core/GitProjectData.properties b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/org.eclipse.egit.core/GitProjectData.properties new file mode 100644 index 000000000..a964be4b9 --- /dev/null +++ b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/org.eclipse.egit.core/GitProjectData.properties @@ -0,0 +1,3 @@ +#GitProjectData +#Wed Apr 23 14:32:47 CEST 2014 +.gitdir=../.git diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/Servers/.indexes/properties.index b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/Servers/.indexes/properties.index new file mode 100644 index 0000000000000000000000000000000000000000..1e099f3bff508a47e7cce4c8ace123e0c07a5306 GIT binary patch literal 80 zcmZQ%U|?VbVI~IA{GxQd)a0DZg5p%YlGMapz2y9&R0gi1)Pnrt%#!?~N(Mz_C8_C| TC153b?wKV4Mfqi!DXB#OWmFkc literal 0 HcmV?d00001 diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/Servers/.syncinfo b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/Servers/.syncinfo new file mode 100644 index 0000000000000000000000000000000000000000..5de15984cebdff14e4ed939be3d07f060c97599f GIT binary patch literal 3776 zcmd6qO^?$s5Qb-2A#p=+;fMrCAfdPy&`KQO0OEwiYPU!na&gTx^0tj5+x`0W@Qy=R zw%cfdO-knAI&thY&v@P$6VWl<8=bRXu@6LabcdcfU#MscZ-WZUi40g*O4rP76<8VP zneK;GnN3U);v+0#T;w&NbA#J zXvr>RnvkLmh{|X0vlnf&V%lQaG9W;Av3axSx!(X0Jfn&5~aV0$Dk8~@=?+)q&m2zH05J&(N|FGF#T?aIh z!k>Q@`RfotE~PQ4_aQSpy@Ig&eXRd8!aSWB3aAOAsugXi5@v-uO->Cp^yb8%QswLM nY^^?w8n}DSd2s0_2>k_{h@IPGb^P|gKB#qDPIhv7`)m6F)B^8| literal 0 HcmV?d00001 diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/Servers/org.eclipse.egit.core/GitProjectData.properties b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/Servers/org.eclipse.egit.core/GitProjectData.properties new file mode 100644 index 000000000..22485feb2 --- /dev/null +++ b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.projects/Servers/org.eclipse.egit.core/GitProjectData.properties @@ -0,0 +1,3 @@ +#GitProjectData +#Wed Apr 23 14:33:15 CEST 2014 +.gitdir=../.git diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version new file mode 100644 index 000000000..25cb955ba --- /dev/null +++ b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index new file mode 100644 index 0000000000000000000000000000000000000000..af32e4316112c631f6c776284c2095a7a5e2a552 GIT binary patch literal 151 zcmYj~u?_+u5CtDtTWGZLBM|W-THD)b>=8GL5x6XS|L?`>>Nhh_0Z>p|%rrKYUxwm0 z^^HudOopk|fg?36Vl6^N&LO_(DnSU!sZj>j)9IEnH3_-Le7E<om%WETZce>HaPHyO!p`f9lreG-I z7vQ<_3|YxKaSlwrLefaT{q~OrS(?ILld$)9JB~X^CAruyiO2{nr!vT9`%3EIrJXh`YW9fOlMn9#P)=Q5|ZmiZ@apGtOWko3k# z^z>8YIF#jF;pP9zhpE9zbG6aaB?m|kZEwhmH7)GE+XJU{cgs;pmL`z6Lkh3nd*fM4 z7Av~Os(GhMB=Fb2zQ|42LQtv8aGtOUU}p1 zKkn{>8NYKYdnMVS@ufHJ!AAjf+cCg1L1?Y2SKj({NB;^G6H&tiF8kAU<04;{9~ifT zOXqSPbN&voqv*j20nV;!=fe>E9Tm8#Gq=kBQ~&W`SllY78*uvMk!l{=WEK>s>ZPP6m8R<@=NF~gmK2o& z&C%B@DN0SXHN>eSw=$4gIJ;P{G!v=|hv``6pDCMrDf)%5)Qe76cqCgMEw2?j{LySJ=MF*k2%mfF{CBt6qAt}pxSVF zA0DRom6fC>=ISMv6+;3Pzgo1kgI_VoenjGds>PQG=$?A;yC0Ou;K>KSQh55ouME|L JP_^iZ4FHaOnnnNs literal 0 HcmV?d00001 diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.e4.ui.css.swt.theme.prefs b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.e4.ui.css.swt.theme.prefs new file mode 100644 index 000000000..ef52540a5 --- /dev/null +++ b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.e4.ui.css.swt.theme.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +themeid=org.eclipse.e4.ui.css.theme.e4_classic diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs new file mode 100644 index 000000000..603daaa9a --- /dev/null +++ b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs @@ -0,0 +1,6 @@ +PROBLEMS_FILTERS_MIGRATE=true +eclipse.preferences.version=1 +org.eclipse.ui.internal.views.markers.CachedMarkerBuilderorg.eclipse.ui.views.ProblemView=\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n +platformState=1360165333794 +quickStart=false +tipsAndTricks=true diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs new file mode 100644 index 000000000..9a2179c64 --- /dev/null +++ b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs @@ -0,0 +1,6 @@ +#Thu Mar 15 15:24:24 CET 2012 +PLUGINS_NOT_ACTIVATED_ON_STARTUP=org.eclipse.m2e.discovery; +eclipse.preferences.version=1 +//org.eclipse.ui.commands/state/org.eclipse.wst.xml.views.XPathView.processor.xpathprocessor/org.eclipse.ui.commands.radioState=xpath10 +ENABLED_DECORATORS=org.eclipse.jst.ws.jaxws.dom.integration.navigator.WebServiceDecorator\:true,org.eclipse.wst.server.ui.decorator\:false,org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.DependencyDecoration\:true,org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.ColumnDecoration\:true,org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.ForeignKeyDecoration\:true,org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.IndexTriggerDecoration\:true,org.eclipse.datatools.connectivity.internal.core.ui.bookmarkDecoration\:true,org.eclipse.datatools.connectivity.internal.core.ui.FilterNodeDecoration\:true,org.eclipse.datatools.connectivity.ui.decorator.contentextension\:false,org.eclipse.datatools.enablement.ingres.ui.providers.decorators.SynonymDecorationService\:true,org.eclipse.datatools.enablement.ingres.internal.ui.providers.decorators.ParameterDecorationService\:true,org.eclipse.datatools.enablement.sybase.asa.proxytabledecorator\:true,org.eclipse.datatools.enablement.sybase.ase.webservicetabledecorator\:true,org.eclipse.datatools.enablement.sybase.systemtabledecorator\:true,org.eclipse.jdt.ui.override.decorator\:true,org.eclipse.jdt.ui.interface.decorator\:true,org.eclipse.jdt.ui.buildpath.decorator\:true,org.eclipse.jst.j2ee.internal.ui.util.AnnotationIconDecorator_ejb\:true,org.eclipse.jst.j2ee.navigator.internal.J2EEProjectDecorator\:true,org.eclipse.jst.jee.ui.internal.navigator.ejb.BeanDecorator\:true,org.eclipse.jst.jee.navigator.internal.JEEProjectDecorator\:true,org.eclipse.jst.j2ee.internal.ui.util.AnnotationIconDecorator_servlet\:true,org.eclipse.jst.servlet.ui.Decorator\:true,org.eclipse.mylyn.context.ui.decorator.interest\:true,org.eclipse.mylyn.tasks.ui.decorators.task\:true,org.eclipse.mylyn.team.ui.changeset.decorator\:true,org.eclipse.pde.ui.binaryProjectDecorator\:false,org.eclipse.rse.core.virtualobject.decorator\:true,org.eclipse.rse.core.binary.executable.decorator\:true,org.eclipse.rse.core.script.executable.decorator\:true,org.eclipse.rse.core.java.executable.decorator\:true,org.eclipse.rse.core.library.decorator\:true,org.eclipse.rse.core.link.decorator\:true,org.eclipse.rse.subsystems.error.decorator\:true,org.eclipse.team.cvs.ui.decorator\:true,org.eclipse.ui.LinkedResourceDecorator\:true,org.eclipse.ui.VirtualResourceDecorator\:true,org.eclipse.ui.ContentTypeDecorator\:true,org.eclipse.ui.ResourceFilterDecorator\:false,org.eclipse.wst.jsdt.ui.override.decorator\:true,org.eclipse.wst.server.ui.navigatorDecorator\:true, +org.eclipse.ui.commands=\r\n\r\n\r\n\r\n\r\n\r\n \ No newline at end of file diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.sonar.ide.eclipse.core.prefs b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.sonar.ide.eclipse.core.prefs new file mode 100644 index 000000000..6cb2801b0 --- /dev/null +++ b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.sonar.ide.eclipse.core.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +servers/http\:\\2f\\2foasp-ci.cloudapp.net\\2fsonarqube/auth=false +servers/initialized=true diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.springsource.ide.eclipse.commons.ui.prefs b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.springsource.ide.eclipse.commons.ui.prefs new file mode 100644 index 000000000..3545b9225 --- /dev/null +++ b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.springsource.ide.eclipse.commons.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +show.tip=false diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.springsource.ide.eclipse.dashboard.ui.prefs b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.springsource.ide.eclipse.dashboard.ui.prefs new file mode 100644 index 000000000..13fae2580 --- /dev/null +++ b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.springsource.ide.eclipse.dashboard.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.springsource.ide.eclipse.dashboard.uidashboard.startup=false diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.tigris.subversion.subclipse.tools.usage.prefs b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.tigris.subversion.subclipse.tools.usage.prefs new file mode 100644 index 000000000..110bc6950 --- /dev/null +++ b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.tigris.subversion.subclipse.tools.usage.prefs @@ -0,0 +1,2 @@ +ask_user_for_usage_report_preference=false +eclipse.preferences.version=1 diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.tigris.subversion.subclipse.ui.prefs b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.tigris.subversion.subclipse.ui.prefs new file mode 100644 index 000000000..6b0a71e3f --- /dev/null +++ b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.tigris.subversion.subclipse.ui.prefs @@ -0,0 +1,4 @@ +#Sat Mar 17 00:14:33 CET 2012 +eclipse.preferences.version=1 +pref_use_quickdiffannotate=always +pref_merge_provider=CollabNet Desktop diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.datatools.connectivity/ServerProfiles.dat b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.datatools.connectivity/ServerProfiles.dat new file mode 100644 index 0000000000000000000000000000000000000000..a32c83c57dd6d9e6654cca0e8e1b43bb44e116da GIT binary patch literal 1976 zcmbtUYd8}M7{(GIw^Z)YMjCd=7&b;iIcSVc{&EkThmyNq-} zt>NQlnB!QD+ec~2PXw#S$DVjSfgBO*;RxT9c0ibzniBXzoS1n#ePuq0Rp+y@IoD&)^gF_)^X1xW1*Wb*M z3&xzN_jss!F4~FY+_i^aR&nQJ9C39$TTV2jGFf3R7x&JCP``3?WA+EPTS6YYUYH>1 z8YQ6?9cKXTzm($oe5E#4wZsW{^#HvIv&eX`_ZF5qw4r`kDQvYxT}{nTI%*Fj zgdwJEnL=aXzYfKH4v|iakvFEt8w`~k1EiM#Gb$j9T8mT(;dB-XU1gbYZ!AWNj0o~6 z@Cxr0zM&^^zdCpL-9TC4pVSP|HsJ~l2e2(^GRq7(=Ug*moqB^{kTT~Xc=q)3Xw`E{ zAXu(Q0eLg6yDZ4fCIo(U^}IZWYnv{vr}vnc zC(wFPKn<7~jK1fOCmpRe&i{;<65@sU?3T+A5me=^1-Gy% zJ{fRwI!B}N-Z6${pD%ZSX0NW9ud1&%=E}?g0#|<5pS?*kBI2g?AQZiuFW+o=<5zKN zVEO`BVHM874Yesx@Rq?DW^F+M4Ds_^dy_kOe;_zPwfpsdN{PHb9EFWe`a-8Ot&^mR zt2*vlF+a1}gV{}hb82f3xq`!Oyzwh2DN5s(qhIZ%Cx&wQ^BL*YX=j(o3r`o;;rl?p ztLNH1k^Z$VyIU@rZ;oob%vGSqJGL@a;BSy5y^%aieELqjm35o#*j}9#BKE_Kdxthp z6{|GIM}TtQqM=HT)^$)l3?Q>*WXtc^A&>EBfK}2}gDJGsF8-pcr>UpUoLYUIlh6EoV`E8eo1Rq@^FGFD?vJ?=AN{k1k--^Uaw zXMMx)c;*Mc=?0(LG*^~IsLMa*^VUQqYq_2|PTr``{oVG^r%mampUSL#W3?2%gj7at z_m`+zQT%){+D47{Q`;SdPYz7hI1XI8``S$Yr{AM%RB96qUM~ICY5G5ozI_eEU-pW6tABhiP)_l zuOaL?{aWf7a$>L*MNC?7L3SY`Xng{-M8$)|%;*_Ph$)}1(C#LVk}jk~T-YV~Tzkb6A0=XdkrxNP@+XrC>cTrPL$qvzL{ zO{-GxkY2yhB{-OC!PJ_A#P@Q6SPN>TK|N2eCq5uE@ literal 0 HcmV?d00001 diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.mylyn.builds.ui/builds.xmi b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.mylyn.builds.ui/builds.xmi new file mode 100644 index 000000000..0a22f4ca9 --- /dev/null +++ b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.mylyn.builds.ui/builds.xmi @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml new file mode 100644 index 000000000..4950215db --- /dev/null +++ b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml @@ -0,0 +1,8 @@ + +
+
+ + + +
+
diff --git a/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.wst.server.core/servers.xml b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.wst.server.core/servers.xml new file mode 100644 index 000000000..1d3030ecd --- /dev/null +++ b/settings/eclipse/workspace/setup/.metadata/.plugins/org.eclipse.wst.server.core/servers.xml @@ -0,0 +1,4 @@ + + + + diff --git a/settings/eclipse/workspace/setup/Servers/.project b/settings/eclipse/workspace/setup/Servers/.project new file mode 100644 index 000000000..0fa764d92 --- /dev/null +++ b/settings/eclipse/workspace/setup/Servers/.project @@ -0,0 +1,11 @@ + + + Servers + + + + + + + + diff --git a/settings/eclipse/workspace/setup/Servers/Tomcat7-config/catalina.policy b/settings/eclipse/workspace/setup/Servers/Tomcat7-config/catalina.policy new file mode 100644 index 000000000..96b387afa --- /dev/null +++ b/settings/eclipse/workspace/setup/Servers/Tomcat7-config/catalina.policy @@ -0,0 +1,242 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// ============================================================================ +// catalina.policy - Security Policy Permissions for Tomcat 7 +// +// This file contains a default set of security policies to be enforced (by the +// JVM) when Catalina is executed with the "-security" option. In addition +// to the permissions granted here, the following additional permissions are +// granted to each web application: +// +// * Read access to the web application's document root directory +// * Read, write and delete access to the web application's working directory +// +// $Id: catalina.policy 1189147 2011-10-26 11:57:37Z kkolinko $ +// ============================================================================ + + +// ========== SYSTEM CODE PERMISSIONS ========================================= + + +// These permissions apply to javac +grant codeBase "file:${java.home}/lib/-" { + permission java.security.AllPermission; +}; + +// These permissions apply to all shared system extensions +grant codeBase "file:${java.home}/jre/lib/ext/-" { + permission java.security.AllPermission; +}; + +// These permissions apply to javac when ${java.home] points at $JAVA_HOME/jre +grant codeBase "file:${java.home}/../lib/-" { + permission java.security.AllPermission; +}; + +// These permissions apply to all shared system extensions when +// ${java.home} points at $JAVA_HOME/jre +grant codeBase "file:${java.home}/lib/ext/-" { + permission java.security.AllPermission; +}; + + +// ========== CATALINA CODE PERMISSIONS ======================================= + + +// These permissions apply to the daemon code +grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" { + permission java.security.AllPermission; +}; + +// These permissions apply to the logging API +// Note: If tomcat-juli.jar is in ${catalina.base} and not in ${catalina.home}, +// update this section accordingly. +// grant codeBase "file:${catalina.base}/bin/tomcat-juli.jar" {..} +grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" { + permission java.io.FilePermission + "${java.home}${file.separator}lib${file.separator}logging.properties", "read"; + + permission java.io.FilePermission + "${catalina.base}${file.separator}conf${file.separator}logging.properties", "read"; + permission java.io.FilePermission + "${catalina.base}${file.separator}logs", "read, write"; + permission java.io.FilePermission + "${catalina.base}${file.separator}logs${file.separator}*", "read, write"; + + permission java.lang.RuntimePermission "shutdownHooks"; + permission java.lang.RuntimePermission "getClassLoader"; + permission java.lang.RuntimePermission "setContextClassLoader"; + + permission java.util.logging.LoggingPermission "control"; + + permission java.util.PropertyPermission "java.util.logging.config.class", "read"; + permission java.util.PropertyPermission "java.util.logging.config.file", "read"; + permission java.util.PropertyPermission "catalina.base", "read"; + + // Note: To enable per context logging configuration, permit read access to + // the appropriate file. Be sure that the logging configuration is + // secure before enabling such access. + // E.g. for the examples web application (uncomment and unwrap + // the following to be on a single line): + // permission java.io.FilePermission "${catalina.base}${file.separator} + // webapps${file.separator}examples${file.separator}WEB-INF + // ${file.separator}classes${file.separator}logging.properties", "read"; +}; + +// These permissions apply to the server startup code +grant codeBase "file:${catalina.home}/bin/bootstrap.jar" { + permission java.security.AllPermission; +}; + +// These permissions apply to the servlet API classes +// and those that are shared across all class loaders +// located in the "lib" directory +grant codeBase "file:${catalina.home}/lib/-" { + permission java.security.AllPermission; +}; + + +// If using a per instance lib directory, i.e. ${catalina.base}/lib, +// then the following permission will need to be uncommented +// grant codeBase "file:${catalina.base}/lib/-" { +// permission java.security.AllPermission; +// }; + + +// ========== WEB APPLICATION PERMISSIONS ===================================== + + +// These permissions are granted by default to all web applications +// In addition, a web application will be given a read FilePermission +// and JndiPermission for all files and directories in its document root. +grant { + // Required for JNDI lookup of named JDBC DataSource's and + // javamail named MimePart DataSource used to send mail + permission java.util.PropertyPermission "java.home", "read"; + permission java.util.PropertyPermission "java.naming.*", "read"; + permission java.util.PropertyPermission "javax.sql.*", "read"; + + // OS Specific properties to allow read access + permission java.util.PropertyPermission "os.name", "read"; + permission java.util.PropertyPermission "os.version", "read"; + permission java.util.PropertyPermission "os.arch", "read"; + permission java.util.PropertyPermission "file.separator", "read"; + permission java.util.PropertyPermission "path.separator", "read"; + permission java.util.PropertyPermission "line.separator", "read"; + + // JVM properties to allow read access + permission java.util.PropertyPermission "java.version", "read"; + permission java.util.PropertyPermission "java.vendor", "read"; + permission java.util.PropertyPermission "java.vendor.url", "read"; + permission java.util.PropertyPermission "java.class.version", "read"; + permission java.util.PropertyPermission "java.specification.version", "read"; + permission java.util.PropertyPermission "java.specification.vendor", "read"; + permission java.util.PropertyPermission "java.specification.name", "read"; + + permission java.util.PropertyPermission "java.vm.specification.version", "read"; + permission java.util.PropertyPermission "java.vm.specification.vendor", "read"; + permission java.util.PropertyPermission "java.vm.specification.name", "read"; + permission java.util.PropertyPermission "java.vm.version", "read"; + permission java.util.PropertyPermission "java.vm.vendor", "read"; + permission java.util.PropertyPermission "java.vm.name", "read"; + + // Required for OpenJMX + permission java.lang.RuntimePermission "getAttribute"; + + // Allow read of JAXP compliant XML parser debug + permission java.util.PropertyPermission "jaxp.debug", "read"; + + // All JSPs need to be able to read this package + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat"; + + // Precompiled JSPs need access to these packages. + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.el"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime"; + permission java.lang.RuntimePermission + "accessClassInPackage.org.apache.jasper.runtime.*"; + + // Precompiled JSPs need access to these system properties. + permission java.util.PropertyPermission + "org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "read"; + permission java.util.PropertyPermission + "org.apache.el.parser.COERCE_TO_ZERO", "read"; + + // The cookie code needs these. + permission java.util.PropertyPermission + "org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "read"; + permission java.util.PropertyPermission + "org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING", "read"; + permission java.util.PropertyPermission + "org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR", "read"; + + // Applications using Comet need to be able to access this package + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.comet"; +}; + + +// The Manager application needs access to the following packages to support the +// session display functionality. These settings support the following +// configurations: +// - default CATALINA_HOME == CATALINA_BASE +// - CATALINA_HOME != CATALINA_BASE, per instance Manager in CATALINA_BASE +// - CATALINA_HOME != CATALINA_BASE, shared Manager in CATALINA_HOME +grant codeBase "file:${catalina.base}/webapps/manager/-" { + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util"; +}; +grant codeBase "file:${catalina.home}/webapps/manager/-" { + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util"; +}; + +// You can assign additional permissions to particular web applications by +// adding additional "grant" entries here, based on the code base for that +// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files. +// +// Different permissions can be granted to JSP pages, classes loaded from +// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/ +// directory, or even to individual jar files in the /WEB-INF/lib/ directory. +// +// For instance, assume that the standard "examples" application +// included a JDBC driver that needed to establish a network connection to the +// corresponding database and used the scrape taglib to get the weather from +// the NOAA web server. You might create a "grant" entries like this: +// +// The permissions granted to the context root directory apply to JSP pages. +// grant codeBase "file:${catalina.base}/webapps/examples/-" { +// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect"; +// permission java.net.SocketPermission "*.noaa.gov:80", "connect"; +// }; +// +// The permissions granted to the context WEB-INF/classes directory +// grant codeBase "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" { +// }; +// +// The permission granted to your JDBC driver +// grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" { +// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect"; +// }; +// The permission granted to the scrape taglib +// grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/scrape.jar!/-" { +// permission java.net.SocketPermission "*.noaa.gov:80", "connect"; +// }; + diff --git a/settings/eclipse/workspace/setup/Servers/Tomcat7-config/catalina.properties b/settings/eclipse/workspace/setup/Servers/Tomcat7-config/catalina.properties new file mode 100644 index 000000000..652a57c32 --- /dev/null +++ b/settings/eclipse/workspace/setup/Servers/Tomcat7-config/catalina.properties @@ -0,0 +1,119 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageAccess unless the +# corresponding RuntimePermission ("accessClassInPackage."+package) has +# been granted. +package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper. +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageDefinition unless the +# corresponding RuntimePermission ("defineClassInPackage."+package) has +# been granted. +# +# by default, no packages are restricted for definition, and none of +# the class loaders supplied with the JDK call checkPackageDefinition. +# +package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper. + +# +# +# List of comma-separated paths defining the contents of the "common" +# classloader. Prefixes should be used to define what is the repository type. +# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute. +# If left as blank,the JVM system loader will be used as Catalina's "common" +# loader. +# Examples: +# "foo": Add this folder as a class repository +# "foo/*.jar": Add all the JARs of the specified folder as class +# repositories +# "foo/bar.jar": Add bar.jar as a class repository +common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar + +# +# List of comma-separated paths defining the contents of the "server" +# classloader. Prefixes should be used to define what is the repository type. +# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute. +# If left as blank, the "common" loader will be used as Catalina's "server" +# loader. +# Examples: +# "foo": Add this folder as a class repository +# "foo/*.jar": Add all the JARs of the specified folder as class +# repositories +# "foo/bar.jar": Add bar.jar as a class repository +server.loader= + +# +# List of comma-separated paths defining the contents of the "shared" +# classloader. Prefixes should be used to define what is the repository type. +# Path may be relative to the CATALINA_BASE path or absolute. If left as blank, +# the "common" loader will be used as Catalina's "shared" loader. +# Examples: +# "foo": Add this folder as a class repository +# "foo/*.jar": Add all the JARs of the specified folder as class +# repositories +# "foo/bar.jar": Add bar.jar as a class repository +# Please note that for single jars, e.g. bar.jar, you need the URL form +# starting with file:. +shared.loader= + +# List of JAR files that should not be scanned for configuration information +# such as web fragments, TLD files etc. It must be a comma separated list of +# JAR file names. +# The JARs listed below include: +# - Tomcat Bootstrap JARs +# - Tomcat API JARs +# - Catalina JARs +# - Jasper JARs +# - Tomcat JARs +# - Common non-Tomcat JARs +# - Sun JDK JARs +# - Apple JDK JARs +tomcat.util.scan.DefaultJarScanner.jarsToSkip=\ +bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,\ +annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,\ +catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-tribes.jar,\ +jasper.jar,jasper-el.jar,ecj-*.jar,\ +tomcat-api.jar,tomcat-util.jar,tomcat-coyote.jar,tomcat-dbcp.jar,\ +tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,\ +tomcat-juli-adapters.jar,catalina-jmx-remote.jar,catalina-ws.jar,\ +tomcat-jdbc.jar,\ +commons-beanutils*.jar,commons-codec*.jar,commons-collections*.jar,\ +commons-dbcp*.jar,commons-digester*.jar,commons-fileupload*.jar,\ +commons-httpclient*.jar,commons-io*.jar,commons-lang*.jar,commons-logging*.jar,\ +commons-math*.jar,commons-pool*.jar,\ +jstl.jar,\ +geronimo-spec-jaxrpc*.jar,wsdl4j*.jar,\ +ant.jar,ant-junit*.jar,aspectj*.jar,jmx.jar,h2*.jar,hibernate*.jar,httpclient*.jar,\ +jmx-tools.jar,jta*.jar,log4j*.jar,mail*.jar,slf4j*.jar,\ +xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,\ +dnsns.jar,ldapsec.jar,localedata.jar,sunjce_provider.jar,sunmscapi.jar,\ +sunpkcs11.jar,jhall.jar,tools.jar,\ +sunec.jar,zipfs.jar,\ +apple_provider.jar,AppleScriptEngine.jar,CoreAudio.jar,dns_sd.jar,\ +j3daudio.jar,j3dcore.jar,j3dutils.jar,jai_core.jar,jai_codec.jar,\ +mlibwrapper_jai.jar,MRJToolkit.jar,vecmath.jar,\ +junit.jar,junit-*.jar,ant-launcher.jar + +# +# String cache configuration. +tomcat.util.buf.StringCache.byte.enabled=true +#tomcat.util.buf.StringCache.char.enabled=true +#tomcat.util.buf.StringCache.trainThreshold=500000 +#tomcat.util.buf.StringCache.cacheSize=5000 diff --git a/settings/eclipse/workspace/setup/Servers/Tomcat7-config/context.xml b/settings/eclipse/workspace/setup/Servers/Tomcat7-config/context.xml new file mode 100644 index 000000000..b8f4ff945 --- /dev/null +++ b/settings/eclipse/workspace/setup/Servers/Tomcat7-config/context.xml @@ -0,0 +1,33 @@ + + + + + WEB-INF/web.xml + + + + + + + + \ No newline at end of file diff --git a/settings/eclipse/workspace/setup/Servers/Tomcat7-config/server.xml b/settings/eclipse/workspace/setup/Servers/Tomcat7-config/server.xml new file mode 100644 index 000000000..30e116360 --- /dev/null +++ b/settings/eclipse/workspace/setup/Servers/Tomcat7-config/server.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/settings/eclipse/workspace/setup/Servers/Tomcat7-config/tomcat-users.xml b/settings/eclipse/workspace/setup/Servers/Tomcat7-config/tomcat-users.xml new file mode 100644 index 000000000..bdc239568 --- /dev/null +++ b/settings/eclipse/workspace/setup/Servers/Tomcat7-config/tomcat-users.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/settings/eclipse/workspace/setup/Servers/Tomcat7-config/web.xml b/settings/eclipse/workspace/setup/Servers/Tomcat7-config/web.xml new file mode 100644 index 000000000..ca2d153f7 --- /dev/null +++ b/settings/eclipse/workspace/setup/Servers/Tomcat7-config/web.xml @@ -0,0 +1,4192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + default + org.apache.catalina.servlets.DefaultServlet + + debug + 0 + + + listings + false + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jsp + org.apache.jasper.servlet.JspServlet + + fork + false + + + xpoweredBy + false + + 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + default + / + + + + + jsp + *.jsp + *.jspx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 30 + + + + + + + + + + + + 123 + application/vnd.lotus-1-2-3 + + + 3dml + text/vnd.in3d.3dml + + + 3g2 + video/3gpp2 + + + 3gp + video/3gpp + + + 7z + application/x-7z-compressed + + + aab + application/x-authorware-bin + + + aac + audio/x-aac + + + aam + application/x-authorware-map + + + aas + application/x-authorware-seg + + + abs + audio/x-mpeg + + + abw + application/x-abiword + + + ac + application/pkix-attr-cert + + + acc + application/vnd.americandynamics.acc + + + ace + application/x-ace-compressed + + + acu + application/vnd.acucobol + + + acutc + application/vnd.acucorp + + + adp + audio/adpcm + + + aep + application/vnd.audiograph + + + afm + application/x-font-type1 + + + afp + application/vnd.ibm.modcap + + + ahead + application/vnd.ahead.space + + + ai + application/postscript + + + aif + audio/x-aiff + + + aifc + audio/x-aiff + + + aiff + audio/x-aiff + + + aim + application/x-aim + + + air + application/vnd.adobe.air-application-installer-package+zip + + + ait + application/vnd.dvb.ait + + + ami + application/vnd.amiga.ami + + + anx + application/annodex + + + apk + application/vnd.android.package-archive + + + application + application/x-ms-application + + + apr + application/vnd.lotus-approach + + + art + image/x-jg + + + asc + application/pgp-signature + + + asf + video/x-ms-asf + + + asm + text/x-asm + + + aso + application/vnd.accpac.simply.aso + + + asx + video/x-ms-asf + + + atc + application/vnd.acucorp + + + atom + application/atom+xml + + + atomcat + application/atomcat+xml + + + atomsvc + application/atomsvc+xml + + + atx + application/vnd.antix.game-component + + + au + audio/basic + + + avi + video/x-msvideo + + + avx + video/x-rad-screenplay + + + aw + application/applixware + + + axa + audio/annodex + + + axv + video/annodex + + + azf + application/vnd.airzip.filesecure.azf + + + azs + application/vnd.airzip.filesecure.azs + + + azw + application/vnd.amazon.ebook + + + bat + application/x-msdownload + + + bcpio + application/x-bcpio + + + bdf + application/x-font-bdf + + + bdm + application/vnd.syncml.dm+wbxml + + + bed + application/vnd.realvnc.bed + + + bh2 + application/vnd.fujitsu.oasysprs + + + bin + application/octet-stream + + + bmi + application/vnd.bmi + + + bmp + image/bmp + + + body + text/html + + + book + application/vnd.framemaker + + + box + application/vnd.previewsystems.box + + + boz + application/x-bzip2 + + + bpk + application/octet-stream + + + btif + image/prs.btif + + + bz + application/x-bzip + + + bz2 + application/x-bzip2 + + + c + text/x-c + + + c11amc + application/vnd.cluetrust.cartomobile-config + + + c11amz + application/vnd.cluetrust.cartomobile-config-pkg + + + c4d + application/vnd.clonk.c4group + + + c4f + application/vnd.clonk.c4group + + + c4g + application/vnd.clonk.c4group + + + c4p + application/vnd.clonk.c4group + + + c4u + application/vnd.clonk.c4group + + + cab + application/vnd.ms-cab-compressed + + + car + application/vnd.curl.car + + + cat + application/vnd.ms-pki.seccat + + + cc + text/x-c + + + cct + application/x-director + + + ccxml + application/ccxml+xml + + + cdbcmsg + application/vnd.contact.cmsg + + + cdf + application/x-cdf + + + cdkey + application/vnd.mediastation.cdkey + + + cdmia + application/cdmi-capability + + + cdmic + application/cdmi-container + + + cdmid + application/cdmi-domain + + + cdmio + application/cdmi-object + + + cdmiq + application/cdmi-queue + + + cdx + chemical/x-cdx + + + cdxml + application/vnd.chemdraw+xml + + + cdy + application/vnd.cinderella + + + cer + application/pkix-cert + + + cgm + image/cgm + + + chat + application/x-chat + + + chm + application/vnd.ms-htmlhelp + + + chrt + application/vnd.kde.kchart + + + cif + chemical/x-cif + + + cii + application/vnd.anser-web-certificate-issue-initiation + + + cil + application/vnd.ms-artgalry + + + cla + application/vnd.claymore + + + class + application/java + + + clkk + application/vnd.crick.clicker.keyboard + + + clkp + application/vnd.crick.clicker.palette + + + clkt + application/vnd.crick.clicker.template + + + clkw + application/vnd.crick.clicker.wordbank + + + clkx + application/vnd.crick.clicker + + + clp + application/x-msclip + + + cmc + application/vnd.cosmocaller + + + cmdf + chemical/x-cmdf + + + cml + chemical/x-cml + + + cmp + application/vnd.yellowriver-custom-menu + + + cmx + image/x-cmx + + + cod + application/vnd.rim.cod + + + com + application/x-msdownload + + + conf + text/plain + + + cpio + application/x-cpio + + + cpp + text/x-c + + + cpt + application/mac-compactpro + + + crd + application/x-mscardfile + + + crl + application/pkix-crl + + + crt + application/x-x509-ca-cert + + + cryptonote + application/vnd.rig.cryptonote + + + csh + application/x-csh + + + csml + chemical/x-csml + + + csp + application/vnd.commonspace + + + css + text/css + + + cst + application/x-director + + + csv + text/csv + + + cu + application/cu-seeme + + + curl + text/vnd.curl + + + cww + application/prs.cww + + + cxt + application/x-director + + + cxx + text/x-c + + + dae + model/vnd.collada+xml + + + daf + application/vnd.mobius.daf + + + dataless + application/vnd.fdsn.seed + + + davmount + application/davmount+xml + + + dcr + application/x-director + + + dcurl + text/vnd.curl.dcurl + + + dd2 + application/vnd.oma.dd2+xml + + + ddd + application/vnd.fujixerox.ddd + + + deb + application/x-debian-package + + + def + text/plain + + + deploy + application/octet-stream + + + der + application/x-x509-ca-cert + + + dfac + application/vnd.dreamfactory + + + dib + image/bmp + + + dic + text/x-c + + + dir + application/x-director + + + dis + application/vnd.mobius.dis + + + dist + application/octet-stream + + + distz + application/octet-stream + + + djv + image/vnd.djvu + + + djvu + image/vnd.djvu + + + dll + application/x-msdownload + + + dmg + application/octet-stream + + + dms + application/octet-stream + + + dna + application/vnd.dna + + + doc + application/msword + + + docm + application/vnd.ms-word.document.macroenabled.12 + + + docx + application/vnd.openxmlformats-officedocument.wordprocessingml.document + + + dot + application/msword + + + dotm + application/vnd.ms-word.template.macroenabled.12 + + + dotx + application/vnd.openxmlformats-officedocument.wordprocessingml.template + + + dp + application/vnd.osgi.dp + + + dpg + application/vnd.dpgraph + + + dra + audio/vnd.dra + + + dsc + text/prs.lines.tag + + + dssc + application/dssc+der + + + dtb + application/x-dtbook+xml + + + dtd + application/xml-dtd + + + dts + audio/vnd.dts + + + dtshd + audio/vnd.dts.hd + + + dump + application/octet-stream + + + dv + video/x-dv + + + dvi + application/x-dvi + + + dwf + model/vnd.dwf + + + dwg + image/vnd.dwg + + + dxf + image/vnd.dxf + + + dxp + application/vnd.spotfire.dxp + + + dxr + application/x-director + + + ecelp4800 + audio/vnd.nuera.ecelp4800 + + + ecelp7470 + audio/vnd.nuera.ecelp7470 + + + ecelp9600 + audio/vnd.nuera.ecelp9600 + + + ecma + application/ecmascript + + + edm + application/vnd.novadigm.edm + + + edx + application/vnd.novadigm.edx + + + efif + application/vnd.picsel + + + ei6 + application/vnd.pg.osasli + + + elc + application/octet-stream + + + eml + message/rfc822 + + + emma + application/emma+xml + + + eol + audio/vnd.digital-winds + + + eot + application/vnd.ms-fontobject + + + eps + application/postscript + + + epub + application/epub+zip + + + es3 + application/vnd.eszigno3+xml + + + esf + application/vnd.epson.esf + + + et3 + application/vnd.eszigno3+xml + + + etx + text/x-setext + + + exe + application/octet-stream + + + exi + application/exi + + + ext + application/vnd.novadigm.ext + + + ez + application/andrew-inset + + + ez2 + application/vnd.ezpix-album + + + ez3 + application/vnd.ezpix-package + + + f + text/x-fortran + + + f4v + video/x-f4v + + + f77 + text/x-fortran + + + f90 + text/x-fortran + + + fbs + image/vnd.fastbidsheet + + + fcs + application/vnd.isac.fcs + + + fdf + application/vnd.fdf + + + fe_launch + application/vnd.denovo.fcselayout-link + + + fg5 + application/vnd.fujitsu.oasysgp + + + fgd + application/x-director + + + fh + image/x-freehand + + + fh4 + image/x-freehand + + + fh5 + image/x-freehand + + + fh7 + image/x-freehand + + + fhc + image/x-freehand + + + fig + application/x-xfig + + + flac + audio/flac + + + fli + video/x-fli + + + flo + application/vnd.micrografx.flo + + + flv + video/x-flv + + + flw + application/vnd.kde.kivio + + + flx + text/vnd.fmi.flexstor + + + fly + text/vnd.fly + + + fm + application/vnd.framemaker + + + fnc + application/vnd.frogans.fnc + + + for + text/x-fortran + + + fpx + image/vnd.fpx + + + frame + application/vnd.framemaker + + + fsc + application/vnd.fsc.weblaunch + + + fst + image/vnd.fst + + + ftc + application/vnd.fluxtime.clip + + + fti + application/vnd.anser-web-funds-transfer-initiation + + + fvt + video/vnd.fvt + + + fxp + application/vnd.adobe.fxp + + + fxpl + application/vnd.adobe.fxp + + + fzs + application/vnd.fuzzysheet + + + g2w + application/vnd.geoplan + + + g3 + image/g3fax + + + g3w + application/vnd.geospace + + + gac + application/vnd.groove-account + + + gdl + model/vnd.gdl + + + geo + application/vnd.dynageo + + + gex + application/vnd.geometry-explorer + + + ggb + application/vnd.geogebra.file + + + ggt + application/vnd.geogebra.tool + + + ghf + application/vnd.groove-help + + + gif + image/gif + + + gim + application/vnd.groove-identity-message + + + gmx + application/vnd.gmx + + + gnumeric + application/x-gnumeric + + + gph + application/vnd.flographit + + + gqf + application/vnd.grafeq + + + gqs + application/vnd.grafeq + + + gram + application/srgs + + + gre + application/vnd.geometry-explorer + + + grv + application/vnd.groove-injector + + + grxml + application/srgs+xml + + + gsf + application/x-font-ghostscript + + + gtar + application/x-gtar + + + gtm + application/vnd.groove-tool-message + + + gtw + model/vnd.gtw + + + gv + text/vnd.graphviz + + + gxt + application/vnd.geonext + + + gz + application/x-gzip + + + h + text/x-c + + + h261 + video/h261 + + + h263 + video/h263 + + + h264 + video/h264 + + + hal + application/vnd.hal+xml + + + hbci + application/vnd.hbci + + + hdf + application/x-hdf + + + hh + text/x-c + + + hlp + application/winhlp + + + hpgl + application/vnd.hp-hpgl + + + hpid + application/vnd.hp-hpid + + + hps + application/vnd.hp-hps + + + hqx + application/mac-binhex40 + + + htc + text/x-component + + + htke + application/vnd.kenameaapp + + + htm + text/html + + + html + text/html + + + hvd + application/vnd.yamaha.hv-dic + + + hvp + application/vnd.yamaha.hv-voice + + + hvs + application/vnd.yamaha.hv-script + + + i2g + application/vnd.intergeo + + + icc + application/vnd.iccprofile + + + ice + x-conference/x-cooltalk + + + icm + application/vnd.iccprofile + + + ico + image/x-icon + + + ics + text/calendar + + + ief + image/ief + + + ifb + text/calendar + + + ifm + application/vnd.shana.informed.formdata + + + iges + model/iges + + + igl + application/vnd.igloader + + + igm + application/vnd.insors.igm + + + igs + model/iges + + + igx + application/vnd.micrografx.igx + + + iif + application/vnd.shana.informed.interchange + + + imp + application/vnd.accpac.simply.imp + + + ims + application/vnd.ms-ims + + + in + text/plain + + + ipfix + application/ipfix + + + ipk + application/vnd.shana.informed.package + + + irm + application/vnd.ibm.rights-management + + + irp + application/vnd.irepository.package+xml + + + iso + application/octet-stream + + + itp + application/vnd.shana.informed.formtemplate + + + ivp + application/vnd.immervision-ivp + + + ivu + application/vnd.immervision-ivu + + + jad + text/vnd.sun.j2me.app-descriptor + + + jam + application/vnd.jam + + + jar + application/java-archive + + + java + text/x-java-source + + + jisp + application/vnd.jisp + + + jlt + application/vnd.hp-jlyt + + + jnlp + application/x-java-jnlp-file + + + joda + application/vnd.joost.joda-archive + + + jpe + image/jpeg + + + jpeg + image/jpeg + + + jpg + image/jpeg + + + jpgm + video/jpm + + + jpgv + video/jpeg + + + jpm + video/jpm + + + js + application/javascript + + + jsf + text/plain + + + json + application/json + + + jspf + text/plain + + + kar + audio/midi + + + karbon + application/vnd.kde.karbon + + + kfo + application/vnd.kde.kformula + + + kia + application/vnd.kidspiration + + + kml + application/vnd.google-earth.kml+xml + + + kmz + application/vnd.google-earth.kmz + + + kne + application/vnd.kinar + + + knp + application/vnd.kinar + + + kon + application/vnd.kde.kontour + + + kpr + application/vnd.kde.kpresenter + + + kpt + application/vnd.kde.kpresenter + + + ksp + application/vnd.kde.kspread + + + ktr + application/vnd.kahootz + + + ktx + image/ktx + + + ktz + application/vnd.kahootz + + + kwd + application/vnd.kde.kword + + + kwt + application/vnd.kde.kword + + + lasxml + application/vnd.las.las+xml + + + latex + application/x-latex + + + lbd + application/vnd.llamagraphics.life-balance.desktop + + + lbe + application/vnd.llamagraphics.life-balance.exchange+xml + + + les + application/vnd.hhe.lesson-player + + + lha + application/octet-stream + + + link66 + application/vnd.route66.link66+xml + + + list + text/plain + + + list3820 + application/vnd.ibm.modcap + + + listafp + application/vnd.ibm.modcap + + + log + text/plain + + + lostxml + application/lost+xml + + + lrf + application/octet-stream + + + lrm + application/vnd.ms-lrm + + + ltf + application/vnd.frogans.ltf + + + lvp + audio/vnd.lucent.voice + + + lwp + application/vnd.lotus-wordpro + + + lzh + application/octet-stream + + + m13 + application/x-msmediaview + + + m14 + application/x-msmediaview + + + m1v + video/mpeg + + + m21 + application/mp21 + + + m2a + audio/mpeg + + + m2v + video/mpeg + + + m3a + audio/mpeg + + + m3u + audio/x-mpegurl + + + m3u8 + application/vnd.apple.mpegurl + + + m4a + audio/mp4 + + + m4b + audio/mp4 + + + m4r + audio/mp4 + + + m4u + video/vnd.mpegurl + + + m4v + video/mp4 + + + ma + application/mathematica + + + mac + image/x-macpaint + + + mads + application/mads+xml + + + mag + application/vnd.ecowin.chart + + + maker + application/vnd.framemaker + + + man + text/troff + + + mathml + application/mathml+xml + + + mb + application/mathematica + + + mbk + application/vnd.mobius.mbk + + + mbox + application/mbox + + + mc1 + application/vnd.medcalcdata + + + mcd + application/vnd.mcd + + + mcurl + text/vnd.curl.mcurl + + + mdb + application/x-msaccess + + + mdi + image/vnd.ms-modi + + + me + text/troff + + + mesh + model/mesh + + + meta4 + application/metalink4+xml + + + mets + application/mets+xml + + + mfm + application/vnd.mfmp + + + mgp + application/vnd.osgeo.mapguide.package + + + mgz + application/vnd.proteus.magazine + + + mid + audio/midi + + + midi + audio/midi + + + mif + application/x-mif + + + mime + message/rfc822 + + + mj2 + video/mj2 + + + mjp2 + video/mj2 + + + mlp + application/vnd.dolby.mlp + + + mmd + application/vnd.chipnuts.karaoke-mmd + + + mmf + application/vnd.smaf + + + mmr + image/vnd.fujixerox.edmics-mmr + + + mny + application/x-msmoney + + + mobi + application/x-mobipocket-ebook + + + mods + application/mods+xml + + + mov + video/quicktime + + + movie + video/x-sgi-movie + + + mp1 + audio/mpeg + + + mp2 + audio/mpeg + + + mp21 + application/mp21 + + + mp2a + audio/mpeg + + + mp3 + audio/mpeg + + + mp4 + video/mp4 + + + mp4a + audio/mp4 + + + mp4s + application/mp4 + + + mp4v + video/mp4 + + + mpa + audio/mpeg + + + mpc + application/vnd.mophun.certificate + + + mpe + video/mpeg + + + mpeg + video/mpeg + + + mpega + audio/x-mpeg + + + mpg + video/mpeg + + + mpg4 + video/mp4 + + + mpga + audio/mpeg + + + mpkg + application/vnd.apple.installer+xml + + + mpm + application/vnd.blueice.multipass + + + mpn + application/vnd.mophun.application + + + mpp + application/vnd.ms-project + + + mpt + application/vnd.ms-project + + + mpv2 + video/mpeg2 + + + mpy + application/vnd.ibm.minipay + + + mqy + application/vnd.mobius.mqy + + + mrc + application/marc + + + mrcx + application/marcxml+xml + + + ms + text/troff + + + mscml + application/mediaservercontrol+xml + + + mseed + application/vnd.fdsn.mseed + + + mseq + application/vnd.mseq + + + msf + application/vnd.epson.msf + + + msh + model/mesh + + + msi + application/x-msdownload + + + msl + application/vnd.mobius.msl + + + msty + application/vnd.muvee.style + + + mts + model/vnd.mts + + + mus + application/vnd.musician + + + musicxml + application/vnd.recordare.musicxml+xml + + + mvb + application/x-msmediaview + + + mwf + application/vnd.mfer + + + mxf + application/mxf + + + mxl + application/vnd.recordare.musicxml + + + mxml + application/xv+xml + + + mxs + application/vnd.triscape.mxs + + + mxu + video/vnd.mpegurl + + + n-gage + application/vnd.nokia.n-gage.symbian.install + + + n3 + text/n3 + + + nb + application/mathematica + + + nbp + application/vnd.wolfram.player + + + nc + application/x-netcdf + + + ncx + application/x-dtbncx+xml + + + ngdat + application/vnd.nokia.n-gage.data + + + nlu + application/vnd.neurolanguage.nlu + + + nml + application/vnd.enliven + + + nnd + application/vnd.noblenet-directory + + + nns + application/vnd.noblenet-sealer + + + nnw + application/vnd.noblenet-web + + + npx + image/vnd.net-fpx + + + nsf + application/vnd.lotus-notes + + + oa2 + application/vnd.fujitsu.oasys2 + + + oa3 + application/vnd.fujitsu.oasys3 + + + oas + application/vnd.fujitsu.oasys + + + obd + application/x-msbinder + + + oda + application/oda + + + + odb + application/vnd.oasis.opendocument.database + + + + odc + application/vnd.oasis.opendocument.chart + + + + odf + application/vnd.oasis.opendocument.formula + + + odft + application/vnd.oasis.opendocument.formula-template + + + + odg + application/vnd.oasis.opendocument.graphics + + + + odi + application/vnd.oasis.opendocument.image + + + + odm + application/vnd.oasis.opendocument.text-master + + + + odp + application/vnd.oasis.opendocument.presentation + + + + ods + application/vnd.oasis.opendocument.spreadsheet + + + + odt + application/vnd.oasis.opendocument.text + + + oga + audio/ogg + + + ogg + audio/ogg + + + ogv + video/ogg + + + + ogx + application/ogg + + + onepkg + application/onenote + + + onetmp + application/onenote + + + onetoc + application/onenote + + + onetoc2 + application/onenote + + + opf + application/oebps-package+xml + + + oprc + application/vnd.palm + + + org + application/vnd.lotus-organizer + + + osf + application/vnd.yamaha.openscoreformat + + + osfpvg + application/vnd.yamaha.openscoreformat.osfpvg+xml + + + otc + application/vnd.oasis.opendocument.chart-template + + + otf + application/x-font-otf + + + + otg + application/vnd.oasis.opendocument.graphics-template + + + + oth + application/vnd.oasis.opendocument.text-web + + + oti + application/vnd.oasis.opendocument.image-template + + + + otp + application/vnd.oasis.opendocument.presentation-template + + + + ots + application/vnd.oasis.opendocument.spreadsheet-template + + + + ott + application/vnd.oasis.opendocument.text-template + + + oxt + application/vnd.openofficeorg.extension + + + p + text/x-pascal + + + p10 + application/pkcs10 + + + p12 + application/x-pkcs12 + + + p7b + application/x-pkcs7-certificates + + + p7c + application/pkcs7-mime + + + p7m + application/pkcs7-mime + + + p7r + application/x-pkcs7-certreqresp + + + p7s + application/pkcs7-signature + + + p8 + application/pkcs8 + + + pas + text/x-pascal + + + paw + application/vnd.pawaafile + + + pbd + application/vnd.powerbuilder6 + + + pbm + image/x-portable-bitmap + + + pcf + application/x-font-pcf + + + pcl + application/vnd.hp-pcl + + + pclxl + application/vnd.hp-pclxl + + + pct + image/pict + + + pcurl + application/vnd.curl.pcurl + + + pcx + image/x-pcx + + + pdb + application/vnd.palm + + + pdf + application/pdf + + + pfa + application/x-font-type1 + + + pfb + application/x-font-type1 + + + pfm + application/x-font-type1 + + + pfr + application/font-tdpfr + + + pfx + application/x-pkcs12 + + + pgm + image/x-portable-graymap + + + pgn + application/x-chess-pgn + + + pgp + application/pgp-encrypted + + + pic + image/pict + + + pict + image/pict + + + pkg + application/octet-stream + + + pki + application/pkixcmp + + + pkipath + application/pkix-pkipath + + + plb + application/vnd.3gpp.pic-bw-large + + + plc + application/vnd.mobius.plc + + + plf + application/vnd.pocketlearn + + + pls + audio/x-scpls + + + pml + application/vnd.ctc-posml + + + png + image/png + + + pnm + image/x-portable-anymap + + + pnt + image/x-macpaint + + + portpkg + application/vnd.macports.portpkg + + + pot + application/vnd.ms-powerpoint + + + potm + application/vnd.ms-powerpoint.template.macroenabled.12 + + + potx + application/vnd.openxmlformats-officedocument.presentationml.template + + + ppam + application/vnd.ms-powerpoint.addin.macroenabled.12 + + + ppd + application/vnd.cups-ppd + + + ppm + image/x-portable-pixmap + + + pps + application/vnd.ms-powerpoint + + + ppsm + application/vnd.ms-powerpoint.slideshow.macroenabled.12 + + + ppsx + application/vnd.openxmlformats-officedocument.presentationml.slideshow + + + ppt + application/vnd.ms-powerpoint + + + pptm + application/vnd.ms-powerpoint.presentation.macroenabled.12 + + + pptx + application/vnd.openxmlformats-officedocument.presentationml.presentation + + + pqa + application/vnd.palm + + + prc + application/x-mobipocket-ebook + + + pre + application/vnd.lotus-freelance + + + prf + application/pics-rules + + + ps + application/postscript + + + psb + application/vnd.3gpp.pic-bw-small + + + psd + image/vnd.adobe.photoshop + + + psf + application/x-font-linux-psf + + + pskcxml + application/pskc+xml + + + ptid + application/vnd.pvi.ptid1 + + + pub + application/x-mspublisher + + + pvb + application/vnd.3gpp.pic-bw-var + + + pwn + application/vnd.3m.post-it-notes + + + pya + audio/vnd.ms-playready.media.pya + + + pyv + video/vnd.ms-playready.media.pyv + + + qam + application/vnd.epson.quickanime + + + qbo + application/vnd.intu.qbo + + + qfx + application/vnd.intu.qfx + + + qps + application/vnd.publishare-delta-tree + + + qt + video/quicktime + + + qti + image/x-quicktime + + + qtif + image/x-quicktime + + + qwd + application/vnd.quark.quarkxpress + + + qwt + application/vnd.quark.quarkxpress + + + qxb + application/vnd.quark.quarkxpress + + + qxd + application/vnd.quark.quarkxpress + + + qxl + application/vnd.quark.quarkxpress + + + qxt + application/vnd.quark.quarkxpress + + + ra + audio/x-pn-realaudio + + + ram + audio/x-pn-realaudio + + + rar + application/x-rar-compressed + + + ras + image/x-cmu-raster + + + rcprofile + application/vnd.ipunplugged.rcprofile + + + rdf + application/rdf+xml + + + rdz + application/vnd.data-vision.rdz + + + rep + application/vnd.businessobjects + + + res + application/x-dtbresource+xml + + + rgb + image/x-rgb + + + rif + application/reginfo+xml + + + rip + audio/vnd.rip + + + rl + application/resource-lists+xml + + + rlc + image/vnd.fujixerox.edmics-rlc + + + rld + application/resource-lists-diff+xml + + + rm + application/vnd.rn-realmedia + + + rmi + audio/midi + + + rmp + audio/x-pn-realaudio-plugin + + + rms + application/vnd.jcp.javame.midlet-rms + + + rnc + application/relax-ng-compact-syntax + + + roff + text/troff + + + rp9 + application/vnd.cloanto.rp9 + + + rpss + application/vnd.nokia.radio-presets + + + rpst + application/vnd.nokia.radio-preset + + + rq + application/sparql-query + + + rs + application/rls-services+xml + + + rsd + application/rsd+xml + + + rss + application/rss+xml + + + rtf + application/rtf + + + rtx + text/richtext + + + s + text/x-asm + + + saf + application/vnd.yamaha.smaf-audio + + + sbml + application/sbml+xml + + + sc + application/vnd.ibm.secure-container + + + scd + application/x-msschedule + + + scm + application/vnd.lotus-screencam + + + scq + application/scvp-cv-request + + + scs + application/scvp-cv-response + + + scurl + text/vnd.curl.scurl + + + sda + application/vnd.stardivision.draw + + + sdc + application/vnd.stardivision.calc + + + sdd + application/vnd.stardivision.impress + + + sdkd + application/vnd.solent.sdkm+xml + + + sdkm + application/vnd.solent.sdkm+xml + + + sdp + application/sdp + + + sdw + application/vnd.stardivision.writer + + + see + application/vnd.seemail + + + seed + application/vnd.fdsn.seed + + + sema + application/vnd.sema + + + semd + application/vnd.semd + + + semf + application/vnd.semf + + + ser + application/java-serialized-object + + + setpay + application/set-payment-initiation + + + setreg + application/set-registration-initiation + + + sfd-hdstx + application/vnd.hydrostatix.sof-data + + + sfs + application/vnd.spotfire.sfs + + + sgl + application/vnd.stardivision.writer-global + + + sgm + text/sgml + + + sgml + text/sgml + + + sh + application/x-sh + + + shar + application/x-shar + + + shf + application/shf+xml + + + + sig + application/pgp-signature + + + silo + model/mesh + + + sis + application/vnd.symbian.install + + + sisx + application/vnd.symbian.install + + + sit + application/x-stuffit + + + sitx + application/x-stuffitx + + + skd + application/vnd.koan + + + skm + application/vnd.koan + + + skp + application/vnd.koan + + + skt + application/vnd.koan + + + sldm + application/vnd.ms-powerpoint.slide.macroenabled.12 + + + sldx + application/vnd.openxmlformats-officedocument.presentationml.slide + + + slt + application/vnd.epson.salt + + + sm + application/vnd.stepmania.stepchart + + + smf + application/vnd.stardivision.math + + + smi + application/smil+xml + + + smil + application/smil+xml + + + snd + audio/basic + + + snf + application/x-font-snf + + + so + application/octet-stream + + + spc + application/x-pkcs7-certificates + + + spf + application/vnd.yamaha.smaf-phrase + + + spl + application/x-futuresplash + + + spot + text/vnd.in3d.spot + + + spp + application/scvp-vp-response + + + spq + application/scvp-vp-request + + + spx + audio/ogg + + + src + application/x-wais-source + + + sru + application/sru+xml + + + srx + application/sparql-results+xml + + + sse + application/vnd.kodak-descriptor + + + ssf + application/vnd.epson.ssf + + + ssml + application/ssml+xml + + + st + application/vnd.sailingtracker.track + + + stc + application/vnd.sun.xml.calc.template + + + std + application/vnd.sun.xml.draw.template + + + stf + application/vnd.wt.stf + + + sti + application/vnd.sun.xml.impress.template + + + stk + application/hyperstudio + + + stl + application/vnd.ms-pki.stl + + + str + application/vnd.pg.format + + + stw + application/vnd.sun.xml.writer.template + + + sub + image/vnd.dvb.subtitle + + + sus + application/vnd.sus-calendar + + + susp + application/vnd.sus-calendar + + + sv4cpio + application/x-sv4cpio + + + sv4crc + application/x-sv4crc + + + svc + application/vnd.dvb.service + + + svd + application/vnd.svd + + + svg + image/svg+xml + + + svgz + image/svg+xml + + + swa + application/x-director + + + swf + application/x-shockwave-flash + + + swi + application/vnd.aristanetworks.swi + + + sxc + application/vnd.sun.xml.calc + + + sxd + application/vnd.sun.xml.draw + + + sxg + application/vnd.sun.xml.writer.global + + + sxi + application/vnd.sun.xml.impress + + + sxm + application/vnd.sun.xml.math + + + sxw + application/vnd.sun.xml.writer + + + t + text/troff + + + tao + application/vnd.tao.intent-module-archive + + + tar + application/x-tar + + + tcap + application/vnd.3gpp2.tcap + + + tcl + application/x-tcl + + + teacher + application/vnd.smart.teacher + + + tei + application/tei+xml + + + teicorpus + application/tei+xml + + + tex + application/x-tex + + + texi + application/x-texinfo + + + texinfo + application/x-texinfo + + + text + text/plain + + + tfi + application/thraud+xml + + + tfm + application/x-tex-tfm + + + thmx + application/vnd.ms-officetheme + + + tif + image/tiff + + + tiff + image/tiff + + + tmo + application/vnd.tmobile-livetv + + + torrent + application/x-bittorrent + + + tpl + application/vnd.groove-tool-template + + + tpt + application/vnd.trid.tpt + + + tr + text/troff + + + tra + application/vnd.trueapp + + + trm + application/x-msterminal + + + tsd + application/timestamped-data + + + tsv + text/tab-separated-values + + + ttc + application/x-font-ttf + + + ttf + application/x-font-ttf + + + ttl + text/turtle + + + twd + application/vnd.simtech-mindmapper + + + twds + application/vnd.simtech-mindmapper + + + txd + application/vnd.genomatix.tuxedo + + + txf + application/vnd.mobius.txf + + + txt + text/plain + + + u32 + application/x-authorware-bin + + + udeb + application/x-debian-package + + + ufd + application/vnd.ufdl + + + ufdl + application/vnd.ufdl + + + ulw + audio/basic + + + umj + application/vnd.umajin + + + unityweb + application/vnd.unity + + + uoml + application/vnd.uoml+xml + + + uri + text/uri-list + + + uris + text/uri-list + + + urls + text/uri-list + + + ustar + application/x-ustar + + + utz + application/vnd.uiq.theme + + + uu + text/x-uuencode + + + uva + audio/vnd.dece.audio + + + uvd + application/vnd.dece.data + + + uvf + application/vnd.dece.data + + + uvg + image/vnd.dece.graphic + + + uvh + video/vnd.dece.hd + + + uvi + image/vnd.dece.graphic + + + uvm + video/vnd.dece.mobile + + + uvp + video/vnd.dece.pd + + + uvs + video/vnd.dece.sd + + + uvt + application/vnd.dece.ttml+xml + + + uvu + video/vnd.uvvu.mp4 + + + uvv + video/vnd.dece.video + + + uvva + audio/vnd.dece.audio + + + uvvd + application/vnd.dece.data + + + uvvf + application/vnd.dece.data + + + uvvg + image/vnd.dece.graphic + + + uvvh + video/vnd.dece.hd + + + uvvi + image/vnd.dece.graphic + + + uvvm + video/vnd.dece.mobile + + + uvvp + video/vnd.dece.pd + + + uvvs + video/vnd.dece.sd + + + uvvt + application/vnd.dece.ttml+xml + + + uvvu + video/vnd.uvvu.mp4 + + + uvvv + video/vnd.dece.video + + + uvvx + application/vnd.dece.unspecified + + + uvx + application/vnd.dece.unspecified + + + vcd + application/x-cdlink + + + vcf + text/x-vcard + + + vcg + application/vnd.groove-vcard + + + vcs + text/x-vcalendar + + + vcx + application/vnd.vcx + + + vis + application/vnd.visionary + + + viv + video/vnd.vivo + + + vor + application/vnd.stardivision.writer + + + vox + application/x-authorware-bin + + + vrml + model/vrml + + + vsd + application/vnd.visio + + + vsf + application/vnd.vsf + + + vss + application/vnd.visio + + + vst + application/vnd.visio + + + vsw + application/vnd.visio + + + vtu + model/vnd.vtu + + + vxml + application/voicexml+xml + + + w3d + application/x-director + + + wad + application/x-doom + + + wav + audio/x-wav + + + wax + audio/x-ms-wax + + + + wbmp + image/vnd.wap.wbmp + + + wbs + application/vnd.criticaltools.wbs+xml + + + wbxml + application/vnd.wap.wbxml + + + wcm + application/vnd.ms-works + + + wdb + application/vnd.ms-works + + + weba + audio/webm + + + webm + video/webm + + + webp + image/webp + + + wg + application/vnd.pmi.widget + + + wgt + application/widget + + + wks + application/vnd.ms-works + + + wm + video/x-ms-wm + + + wma + audio/x-ms-wma + + + wmd + application/x-ms-wmd + + + wmf + application/x-msmetafile + + + + wml + text/vnd.wap.wml + + + + wmlc + application/vnd.wap.wmlc + + + + wmls + text/vnd.wap.wmlscript + + + + wmlsc + application/vnd.wap.wmlscriptc + + + wmv + video/x-ms-wmv + + + wmx + video/x-ms-wmx + + + wmz + application/x-ms-wmz + + + woff + application/x-font-woff + + + wpd + application/vnd.wordperfect + + + wpl + application/vnd.ms-wpl + + + wps + application/vnd.ms-works + + + wqd + application/vnd.wqd + + + wri + application/x-mswrite + + + wrl + model/vrml + + + wsdl + application/wsdl+xml + + + wspolicy + application/wspolicy+xml + + + wtb + application/vnd.webturbo + + + wvx + video/x-ms-wvx + + + x32 + application/x-authorware-bin + + + x3d + application/vnd.hzn-3d-crossword + + + xap + application/x-silverlight-app + + + xar + application/vnd.xara + + + xbap + application/x-ms-xbap + + + xbd + application/vnd.fujixerox.docuworks.binder + + + xbm + image/x-xbitmap + + + xdf + application/xcap-diff+xml + + + xdm + application/vnd.syncml.dm+xml + + + xdp + application/vnd.adobe.xdp+xml + + + xdssc + application/dssc+xml + + + xdw + application/vnd.fujixerox.docuworks + + + xenc + application/xenc+xml + + + xer + application/patch-ops-error+xml + + + xfdf + application/vnd.adobe.xfdf + + + xfdl + application/vnd.xfdl + + + xht + application/xhtml+xml + + + xhtml + application/xhtml+xml + + + xhvml + application/xv+xml + + + xif + image/vnd.xiff + + + xla + application/vnd.ms-excel + + + xlam + application/vnd.ms-excel.addin.macroenabled.12 + + + xlc + application/vnd.ms-excel + + + xlm + application/vnd.ms-excel + + + xls + application/vnd.ms-excel + + + xlsb + application/vnd.ms-excel.sheet.binary.macroenabled.12 + + + xlsm + application/vnd.ms-excel.sheet.macroenabled.12 + + + xlsx + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + + + xlt + application/vnd.ms-excel + + + xltm + application/vnd.ms-excel.template.macroenabled.12 + + + xltx + application/vnd.openxmlformats-officedocument.spreadsheetml.template + + + xlw + application/vnd.ms-excel + + + xml + application/xml + + + xo + application/vnd.olpc-sugar + + + xop + application/xop+xml + + + xpi + application/x-xpinstall + + + xpm + image/x-xpixmap + + + xpr + application/vnd.is-xpr + + + xps + application/vnd.ms-xpsdocument + + + xpw + application/vnd.intercon.formnet + + + xpx + application/vnd.intercon.formnet + + + xsl + application/xml + + + xslt + application/xslt+xml + + + xsm + application/vnd.syncml+xml + + + xspf + application/xspf+xml + + + xul + application/vnd.mozilla.xul+xml + + + xvm + application/xv+xml + + + xvml + application/xv+xml + + + xwd + image/x-xwindowdump + + + xyz + chemical/x-xyz + + + yang + application/yang + + + yin + application/yin+xml + + + z + application/x-compress + + + Z + application/x-compress + + + zaz + application/vnd.zzazz.deck+xml + + + zip + application/zip + + + zir + application/vnd.zul + + + zirz + application/vnd.zul + + + zmm + application/vnd.handheld-entertainment+xml + + + + + + + + + + + + + + + + + + index.html + index.htm + index.jsp + + + \ No newline at end of file diff --git a/settings/eclipse/workspace/update/.metadata/.plugins/net.sf.eclipsecs.core/checkstyle-config.xml b/settings/eclipse/workspace/update/.metadata/.plugins/net.sf.eclipsecs.core/checkstyle-config.xml new file mode 100644 index 000000000..fe975d618 --- /dev/null +++ b/settings/eclipse/workspace/update/.metadata/.plugins/net.sf.eclipsecs.core/checkstyle-config.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ant.core.prefs b/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ant.core.prefs new file mode 100644 index 000000000..bbd95a0ab --- /dev/null +++ b/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ant.core.prefs @@ -0,0 +1,3 @@ +#Thu Mar 15 11:21:23 CET 2012 +ant_home_entries=${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-antlr.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-apache-bcel.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-apache-bsf.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-apache-log4j.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-apache-oro.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-apache-regexp.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-apache-resolver.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-apache-xalan2.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-commons-logging.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-commons-net.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-jai.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-javamail.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-jdepend.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-jmf.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-jsch.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-junit.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-junit4.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-launcher.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-netrexx.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-swing.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-testutil.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant.jar,${client.env.home}\\software\\eclipse\\plugins\\org.apache.ant_1.8.2.v20110505-1300\\lib\\ant-contrib-1.0b3.jar, +eclipse.preferences.version=1 diff --git a/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.compare.prefs b/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.compare.prefs new file mode 100644 index 000000000..979a15455 --- /dev/null +++ b/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.compare.prefs @@ -0,0 +1,3 @@ +#Tue Nov 10 10:18:44 CET 2009 +eclipse.preferences.version=1 +org.eclipse.compare.IgnoreWhitespace=true diff --git a/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs b/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..7f492f870 --- /dev/null +++ b/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +version=1 +eclipse.preferences.version=1 +encoding=UTF-8 diff --git a/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.core.prefs b/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.core.prefs new file mode 100644 index 000000000..bdcc41212 --- /dev/null +++ b/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.core.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.debug.core.USE_STEP_FILTERS=false +org.eclipse.debug.core.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE=false diff --git a/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs b/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..7d29fc29d --- /dev/null +++ b/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,336 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch +org.eclipse.jdt.core.classpathVariable.ECLIPSE_HOME=${client.env.home}/software/eclipse/ +org.eclipse.jdt.core.classpathVariable.JRE_LIB=${client.env.home}/software/java/jre/lib/rt.jar +org.eclipse.jdt.core.classpathVariable.JRE_SRC=${client.env.home}/software/java/src.zip +org.eclipse.jdt.core.classpathVariable.JRE_SRCROOT= +org.eclipse.jdt.core.classpathVariable.M2_REPO=${M2_REPO} +org.eclipse.jdt.core.classpathVariable.MAVEN_REPO=${M2_REPO} +org.eclipse.jdt.core.codeComplete.camelCaseMatch=enabled +org.eclipse.jdt.core.codeComplete.deprecationCheck=disabled +org.eclipse.jdt.core.codeComplete.suggestStaticImports=enabled +org.eclipse.jdt.core.codeComplete.visibilityCheck=enabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fieldHiding=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=enabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled +org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL +org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,REVIEW +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=16 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=120 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=0 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=1 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=2 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.timeoutForParameterNameFromAttachedJavadoc=50 diff --git a/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.debug.ui.prefs b/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.debug.ui.prefs new file mode 100644 index 000000000..6830a8509 --- /dev/null +++ b/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.debug.ui.prefs @@ -0,0 +1,5 @@ +#Fri Feb 03 19:17:14 CET 2012 +org.eclipse.jdt.debug.ui.javaDebug.SuspendOnUncaughtExceptions=false +org.eclipse.debug.ui.VariableView.org.eclipse.jdt.debug.ui.show_null_entries=true +eclipse.preferences.version=1 +org.eclipse.jdt.debug.ui.prompt_unable_to_install_breakpoint=false diff --git a/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs b/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..224784fb6 --- /dev/null +++ b/settings/eclipse/workspace/update/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,152 @@ +#Tue Nov 10 10:37:31 CET 2009 +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=false +cleanup.remove_trailing_whitespaces_ignore_empty=true +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_clientpe +cleanup_settings_version=2 +content_assist_proposals_background=255,255,255 +content_assist_proposals_foreground=0,0,0 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +fontPropagated=true +formatter_profile=_clientpe +formatter_settings_version=12 +org.eclipse.jdt.internal.ui.navigator.layout=2 +org.eclipse.jdt.ui.cleanupprofiles.version=2 +org.eclipse.jdt.ui.cleanupprofiles=\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n +org.eclipse.jdt.ui.editor.tab.width= +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.formatterprofiles.version=12 +org.eclipse.jdt.ui.formatterprofiles=\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;net;org;com;de; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.javadoclocations.migrated=true +org.eclipse.jdt.ui.keywordthis=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.code_templates_migrated=true +org.eclipse.jdt.ui.text.custom_code_templates=