[ 
https://issues.apache.org/jira/browse/JAMES-2149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16516600#comment-16516600
 ] 

ASF GitHub Bot commented on JAMES-2149:
---------------------------------------

Github user chibenwa commented on the issue:

    https://github.com/apache/james-project/pull/119
  
    Hi @nstdio 
    
    Here is the build output for your PR:
    
    ```
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [INFO] There are 26 errors 
reported by Checkstyle 8.5 with checkstyle.xml ruleset.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[26] 
(imports) CustomImportOrder: Imports without groups should be placed at the end 
of the import list: 'com.github.fge.lambdas.consumers.ThrowingBiConsumer'.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[27] 
(imports) CustomImportOrder: Imports without groups should be placed at the end 
of the import list: 'com.github.steveash.guavate.Guavate'.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[28] 
(imports) CustomImportOrder: Imports without groups should be placed at the end 
of the import list: 'io.swagger.annotations.Api'.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[29] 
(imports) CustomImportOrder: Imports without groups should be placed at the end 
of the import list: 'io.swagger.annotations.ApiImplicitParam'.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[30] 
(imports) CustomImportOrder: Imports without groups should be placed at the end 
of the import list: 'io.swagger.annotations.ApiImplicitParams'.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[31] 
(imports) CustomImportOrder: Imports without groups should be placed at the end 
of the import list: 'io.swagger.annotations.ApiOperation'.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[32] 
(imports) CustomImportOrder: Imports without groups should be placed at the end 
of the import list: 'io.swagger.annotations.ApiResponse'.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[33] 
(imports) CustomImportOrder: Imports without groups should be placed at the end 
of the import list: 'io.swagger.annotations.ApiResponses'.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[34] 
(imports) CustomImportOrder: Import statement for 
'org.apache.james.core.Domain' is in the wrong order. Should be in the 
'SPECIAL_IMPORTS' group, expecting group 'STANDARD_JAVA_PACKAGE' on this line.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[35] 
(imports) CustomImportOrder: Import statement for 
'org.apache.james.rrt.api.RecipientRewriteTable' is in the wrong order. Should 
be in the 'SPECIAL_IMPORTS' group, expecting group 'STANDARD_JAVA_PACKAGE' on 
this line.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[36] 
(imports) CustomImportOrder: Import statement for 
'org.apache.james.rrt.api.RecipientRewriteTableException' is in the wrong 
order. Should be in the 'SPECIAL_IMPORTS' group, expecting group 
'STANDARD_JAVA_PACKAGE' on this line.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[37] 
(imports) CustomImportOrder: Import statement for 
'org.apache.james.rrt.lib.Mapping' is in the wrong order. Should be in the 
'SPECIAL_IMPORTS' group, expecting group 'STANDARD_JAVA_PACKAGE' on this line.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[38] 
(imports) CustomImportOrder: Import statement for 
'org.apache.james.rrt.lib.MappingSource' is in the wrong order. Should be in 
the 'SPECIAL_IMPORTS' group, expecting group 'STANDARD_JAVA_PACKAGE' on this 
line.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[39] 
(imports) CustomImportOrder: Import statement for 
'org.apache.james.rrt.lib.Mappings' is in the wrong order. Should be in the 
'SPECIAL_IMPORTS' group, expecting group 'STANDARD_JAVA_PACKAGE' on this line.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[40] 
(imports) CustomImportOrder: Import statement for 
'org.apache.james.webadmin.Routes' is in the wrong order. Should be in the 
'SPECIAL_IMPORTS' group, expecting group 'STANDARD_JAVA_PACKAGE' on this line.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[41] 
(imports) CustomImportOrder: Import statement for 
'org.apache.james.webadmin.utils.ErrorResponder' is in the wrong order. Should 
be in the 'SPECIAL_IMPORTS' group, expecting group 'STANDARD_JAVA_PACKAGE' on 
this line.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[42] 
(imports) CustomImportOrder: Import statement for 
'org.apache.james.webadmin.utils.JsonTransformer' is in the wrong order. Should 
be in the 'SPECIAL_IMPORTS' group, expecting group 'STANDARD_JAVA_PACKAGE' on 
this line.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[43] 
(imports) CustomImportOrder: Import statement for 
'org.eclipse.jetty.http.HttpStatus' is in the wrong order. Should be in the 
'SPECIAL_IMPORTS' group, expecting group 'STANDARD_JAVA_PACKAGE' on this line.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[44] 
(imports) CustomImportOrder: Imports without groups should be placed at the end 
of the import list: 'spark.HaltException'.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[45] 
(imports) CustomImportOrder: Imports without groups should be placed at the end 
of the import list: 'spark.Request'.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[46] 
(imports) CustomImportOrder: Imports without groups should be placed at the end 
of the import list: 'spark.Response'.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[47] 
(imports) CustomImportOrder: Imports without groups should be placed at the end 
of the import list: 'spark.Service'.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[55] 
(imports) CustomImportOrder: Wrong lexicographical order for 'java.util.List' 
import. Should be before 'javax.ws.rs.Produces'.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[56] 
(imports) CustomImportOrder: Wrong lexicographical order for 'java.util.Map' 
import. Should be before 'javax.ws.rs.Produces'.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[57] 
(imports) CustomImportOrder: Wrong lexicographical order for 
'java.util.Optional' import. Should be before 'javax.ws.rs.Produces'.
    [0f7cca769367be82fcf05803a81a1a2949cad8b1] [ERROR] 
src/main/java/org/apache/james/webadmin/routes/DomainMappingsRoutes.java:[58] 
(imports) CustomImportOrder: Wrong lexicographical order for 
'java.util.function.Function' import. Should be before 'javax.ws.rs.Produces'.
    ```
    
    As you can see, there is some checkstyle violation due to impport ordering.
    
    In order to help you solving it, here is my IntelliJ configuration for 
import ordering:
    
    ```
    import static all other imports
    <blank line>
    import java.*
    <blank line>
    import javax.*
    <blank line>
    import org.*
    <blank line>
    import com.*
    <blank line>
    import all other imports
    ```
    
    (intelliJ -> File -> Settings -> Editor -> Code style -> Java -> Imports -> 
Import layout)
    
    BTW you can check the checkstyle by running `mvn clean install -DskipTests` 
then `mvn checkstyle:check`.
    
    Cheers,
    
    Benoit


> Create domain mappings via webadmin
> -----------------------------------
>
>                 Key: JAMES-2149
>                 URL: https://issues.apache.org/jira/browse/JAMES-2149
>             Project: James Server
>          Issue Type: New Feature
>          Components: webadmin
>    Affects Versions: master
>            Reporter: Tellier Benoit
>            Priority: Major
>              Labels: feature, newbie
>
> Nowadays, the Rewrite Table engine supports domain redirections. That is to 
> say [email protected] will be rewritten as [email protected].
> However, such a feature is not exposed via webadmin.
> You will need to :
>  - Create a new **DomainMappingsRoutes** in webadmin-data
>  - You will expose in this routes, using directly RecipientsRewriteTable, the 
> endpoitns for adding, removing and listing domain mappings.
> {code:java}
> GET /domainMappings/
> {"fromDomain1":"toDomain1", "fromDomain2": "toDomain2"}
> PUT /domainMappings/fromDomain
> "toDomain"
> DELETE /domainMappings/fromDomain
> "toDomain"
> {code}
> You will write a test class from your endpoints. See *GroupsRoutesTest*.
> Don't hesitate to ask for help on the *Gitter* chat.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to