You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@syncope.apache.org by giacomolm <gi...@git.apache.org> on 2015/05/21 14:52:41 UTC

[GitHub] syncope pull request: 1 2 x

GitHub user giacomolm opened a pull request:

    https://github.com/apache/syncope/pull/5

    1 2 x

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/giacomolm/syncope 1_2_X

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/syncope/pull/5.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #5
    
----
commit c040d9e4e475ed6741aa6575bca0b94acfc5ae88
Author: giacomolm <gi...@hotmail.it>
Date:   2015-04-14T14:33:45Z

    [SYNCOPE-654] JPA error messages and Syncope client exceptions are correctly displayed

commit 76a95e544d2ea6842986fff095c1110d2b346c8a
Author: giacomolm <gi...@hotmail.it>
Date:   2015-05-18T13:35:43Z

    Merge upstream/1_2_X

commit 3e86b0307a30d749c2969bb7b4fdaae158965543
Author: giacomolm <gi...@hotmail.it>
Date:   2015-05-18T13:38:04Z

    Padding diff

commit 6983cd19887792bd72d26fe5f99ec489b6040501
Author: giacomolm <gi...@hotmail.it>
Date:   2015-05-19T15:46:53Z

    [SYNCOPE-668] JobInstanceLoader is able to return the correct task id or report id starting from its job name

commit 2f09e44424bd167f3fb0d4378e527289a1c34b3f
Author: giacomolm <gi...@hotmail.it>
Date:   2015-05-21T12:44:32Z

    [SYNCOPE-660] Asynchronous jobs delegated to Quartz, like Task and Report, now can be checked and interrupted during execution

commit cfa7d2339da56185a923108c216586ac24db33c0
Author: giacomolm <gi...@hotmail.it>
Date:   2015-05-21T12:49:38Z

    Merge remote-tracking branch 'upstream/1_2_X' into 1_2_X

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request: [SYNCOPE 660] Asynchronous jobs delegated to...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/5#discussion_r30799524
  
    --- Diff: core/src/main/java/org/apache/syncope/core/rest/controller/TaskController.java ---
    @@ -401,4 +404,26 @@ protected AbstractTaskTO resolveReference(final Method method, final Object... a
     
             throw new UnresolvedReferenceException();
         }
    +
    +    @Override
    +    @PreAuthorize("hasRole('TASK_READ')")
    --- End diff --
    
    Same as above: `TASK_LIST`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request: [SYNCOPE 660] Asynchronous jobs delegated to...

Posted by giacomolm <gi...@git.apache.org>.
Github user giacomolm commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/5#discussion_r30801181
  
    --- Diff: core/src/main/java/org/apache/syncope/core/rest/controller/AbstractJobController.java ---
    @@ -0,0 +1,154 @@
    +/*
    + * 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.
    + */
    +package org.apache.syncope.core.rest.controller;
    +
    +import static org.apache.syncope.core.rest.controller.AbstractController.LOG;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +import org.apache.syncope.common.AbstractBaseBean;
    +import org.apache.syncope.common.to.AbstractExecTO;
    +import org.apache.syncope.common.types.JobAction;
    +import org.apache.syncope.common.types.JobStatusType;
    +import org.quartz.JobExecutionContext;
    +import org.quartz.JobKey;
    +import org.quartz.Scheduler;
    +import org.quartz.SchedulerException;
    +import org.quartz.Trigger;
    +import org.quartz.impl.matchers.GroupMatcher;
    +import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.scheduling.quartz.SchedulerFactoryBean;
    +
    +abstract class AbstractJobController<T extends AbstractBaseBean> extends AbstractTransactionalController<T> {
    +
    +    @Autowired
    +    protected SchedulerFactoryBean scheduler;
    +
    +    protected abstract Long getIdFromJobName(JobKey jobKey);
    +
    +    public <E extends AbstractExecTO> List<E> list(final JobStatusType type, final Class<E> reference) {
    +        List<E> jobExecTOs = new ArrayList<E>();
    +
    +        switch (type) {
    +            case ALL:
    +                try {
    +                    for (String groupName : scheduler.getScheduler().getJobGroupNames()) {
    +                        for (JobKey jobKey : scheduler.getScheduler().getJobKeys(GroupMatcher.jobGroupEquals(groupName))) {
    +
    +                            Long jobId = getIdFromJobName(jobKey);
    +                            if (jobId != null) {
    +                                List<? extends Trigger> jobTriggers = scheduler.getScheduler().getTriggersOfJob(jobKey);
    +                                if (jobTriggers.size() > 0) {
    +                                    for (Trigger t : jobTriggers) {
    +                                        E jobExecTO = reference.newInstance();
    +                                        jobExecTO.setId(jobId);
    +                                        jobExecTO.
    +                                                setStatus(scheduler.getScheduler().getTriggerState(t.getKey()).name());
    +                                        jobExecTO.setStartDate(t.getStartTime());
    +                                        jobExecTOs.add(jobExecTO);
    +                                    }
    +                                } else {
    +                                    E jobExecTO = reference.newInstance();
    +                                    jobExecTO.setId(jobId);
    +                                    jobExecTO.setStatus("Not Scheduled");
    +                                    jobExecTOs.add(jobExecTO);
    +                                }
    +                            }
    +                        }
    +                    }
    +                } catch (SchedulerException ex) {
    +                    LOG.debug("Problems during retrieving all scheduled jobs {}", ex);
    +                } catch (InstantiationException ex) {
    +                    LOG.debug("Problems during instantiating {}  {}", reference, ex);
    +                } catch (IllegalAccessException ex) {
    +                    LOG.debug("Problems during accessing {}  {}", reference, ex);
    +                }
    +                break;
    +            case RUNNING:
    +                try {
    +                    for (JobExecutionContext jec : scheduler.getScheduler().getCurrentlyExecutingJobs()) {
    +                        Long jobId = getIdFromJobName(jec.getJobDetail().getKey());
    +                        if (jobId != null) {
    +                            E jobExecTO = reference.newInstance();
    +                            jobExecTO.setId(jobId);
    +                            jobExecTO.setStatus("Running");
    --- End diff --
    
    This should works ```scheduler.getScheduler().getTriggerState(jec.getTrigger().getKey()).name()```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request: [SYNCOPE 660] Asynchronous jobs delegated to...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/5#discussion_r30799348
  
    --- Diff: core/src/main/java/org/apache/syncope/core/rest/controller/AbstractJobController.java ---
    @@ -0,0 +1,154 @@
    +/*
    + * 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.
    + */
    +package org.apache.syncope.core.rest.controller;
    +
    +import static org.apache.syncope.core.rest.controller.AbstractController.LOG;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +import org.apache.syncope.common.AbstractBaseBean;
    +import org.apache.syncope.common.to.AbstractExecTO;
    +import org.apache.syncope.common.types.JobAction;
    +import org.apache.syncope.common.types.JobStatusType;
    +import org.quartz.JobExecutionContext;
    +import org.quartz.JobKey;
    +import org.quartz.Scheduler;
    +import org.quartz.SchedulerException;
    +import org.quartz.Trigger;
    +import org.quartz.impl.matchers.GroupMatcher;
    +import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.scheduling.quartz.SchedulerFactoryBean;
    +
    +abstract class AbstractJobController<T extends AbstractBaseBean> extends AbstractTransactionalController<T> {
    +
    +    @Autowired
    +    protected SchedulerFactoryBean scheduler;
    +
    +    protected abstract Long getIdFromJobName(JobKey jobKey);
    +
    +    public <E extends AbstractExecTO> List<E> list(final JobStatusType type, final Class<E> reference) {
    +        List<E> jobExecTOs = new ArrayList<E>();
    +
    +        switch (type) {
    +            case ALL:
    +                try {
    +                    for (String groupName : scheduler.getScheduler().getJobGroupNames()) {
    +                        for (JobKey jobKey : scheduler.getScheduler().getJobKeys(GroupMatcher.jobGroupEquals(groupName))) {
    +
    +                            Long jobId = getIdFromJobName(jobKey);
    +                            if (jobId != null) {
    +                                List<? extends Trigger> jobTriggers = scheduler.getScheduler().getTriggersOfJob(jobKey);
    +                                if (jobTriggers.size() > 0) {
    +                                    for (Trigger t : jobTriggers) {
    +                                        E jobExecTO = reference.newInstance();
    +                                        jobExecTO.setId(jobId);
    +                                        jobExecTO.
    +                                                setStatus(scheduler.getScheduler().getTriggerState(t.getKey()).name());
    +                                        jobExecTO.setStartDate(t.getStartTime());
    +                                        jobExecTOs.add(jobExecTO);
    +                                    }
    +                                } else {
    +                                    E jobExecTO = reference.newInstance();
    +                                    jobExecTO.setId(jobId);
    +                                    jobExecTO.setStatus("Not Scheduled");
    +                                    jobExecTOs.add(jobExecTO);
    +                                }
    +                            }
    +                        }
    +                    }
    +                } catch (SchedulerException ex) {
    +                    LOG.debug("Problems during retrieving all scheduled jobs {}", ex);
    +                } catch (InstantiationException ex) {
    +                    LOG.debug("Problems during instantiating {}  {}", reference, ex);
    +                } catch (IllegalAccessException ex) {
    +                    LOG.debug("Problems during accessing {}  {}", reference, ex);
    +                }
    +                break;
    +            case RUNNING:
    +                try {
    +                    for (JobExecutionContext jec : scheduler.getScheduler().getCurrentlyExecutingJobs()) {
    +                        Long jobId = getIdFromJobName(jec.getJobDetail().getKey());
    +                        if (jobId != null) {
    +                            E jobExecTO = reference.newInstance();
    +                            jobExecTO.setId(jobId);
    +                            jobExecTO.setStatus("Running");
    --- End diff --
    
    Why not using `scheduler.getScheduler().getTriggerState(t.getKey()).name()`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request: [SYNCOPE 660] Asynchronous jobs delegated to...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on the pull request:

    https://github.com/apache/syncope/pull/5#issuecomment-104318602
  
    All is fine @giacomolm, please go ahead and merge


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request: 1 2 x

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/5#discussion_r30798393
  
    --- Diff: common/src/main/java/org/apache/syncope/common/services/TaskService.java ---
    @@ -242,4 +244,24 @@ TaskExecTO execute(@NotNull @PathParam("taskId") Long taskId,
         @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
         @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
         BulkActionResult bulk(@NotNull BulkAction bulkAction);
    +
    +    /**
    +     * List all the tasks of a particular type
    --- End diff --
    
    Please change this description: it should be something like as "List task jobs of the given type"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request: [SYNCOPE 660] Asynchronous jobs delegated to...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/5#discussion_r30799470
  
    --- Diff: core/src/main/java/org/apache/syncope/core/rest/controller/ReportController.java ---
    @@ -341,4 +340,24 @@ protected ReportTO resolveReference(final Method method, final Object... args)
     
             throw new UnresolvedReferenceException();
         }
    +
    +    @Override
    +    @PreAuthorize("hasRole('REPORT_READ')")
    --- End diff --
    
    Shouldn't this be `REPORT_LIST`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request: [SYNCOPE 660] Asynchronous jobs delegated to...

Posted by giacomolm <gi...@git.apache.org>.
Github user giacomolm commented on the pull request:

    https://github.com/apache/syncope/pull/5#issuecomment-104286722
  
    thanks @ilgrosso !! Please check this new revision c1faf13


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request: [SYNCOPE 660] Asynchronous jobs delegated to...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/5#discussion_r30799389
  
    --- Diff: core/src/main/java/org/apache/syncope/core/rest/controller/AbstractJobController.java ---
    @@ -0,0 +1,154 @@
    +/*
    + * 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.
    + */
    +package org.apache.syncope.core.rest.controller;
    +
    +import static org.apache.syncope.core.rest.controller.AbstractController.LOG;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +import org.apache.syncope.common.AbstractBaseBean;
    +import org.apache.syncope.common.to.AbstractExecTO;
    +import org.apache.syncope.common.types.JobAction;
    +import org.apache.syncope.common.types.JobStatusType;
    +import org.quartz.JobExecutionContext;
    +import org.quartz.JobKey;
    +import org.quartz.Scheduler;
    +import org.quartz.SchedulerException;
    +import org.quartz.Trigger;
    +import org.quartz.impl.matchers.GroupMatcher;
    +import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.scheduling.quartz.SchedulerFactoryBean;
    +
    +abstract class AbstractJobController<T extends AbstractBaseBean> extends AbstractTransactionalController<T> {
    +
    +    @Autowired
    +    protected SchedulerFactoryBean scheduler;
    +
    +    protected abstract Long getIdFromJobName(JobKey jobKey);
    +
    +    public <E extends AbstractExecTO> List<E> list(final JobStatusType type, final Class<E> reference) {
    +        List<E> jobExecTOs = new ArrayList<E>();
    +
    +        switch (type) {
    +            case ALL:
    +                try {
    +                    for (String groupName : scheduler.getScheduler().getJobGroupNames()) {
    +                        for (JobKey jobKey : scheduler.getScheduler().getJobKeys(GroupMatcher.jobGroupEquals(groupName))) {
    +
    +                            Long jobId = getIdFromJobName(jobKey);
    +                            if (jobId != null) {
    +                                List<? extends Trigger> jobTriggers = scheduler.getScheduler().getTriggersOfJob(jobKey);
    +                                if (jobTriggers.size() > 0) {
    +                                    for (Trigger t : jobTriggers) {
    +                                        E jobExecTO = reference.newInstance();
    +                                        jobExecTO.setId(jobId);
    +                                        jobExecTO.
    +                                                setStatus(scheduler.getScheduler().getTriggerState(t.getKey()).name());
    +                                        jobExecTO.setStartDate(t.getStartTime());
    +                                        jobExecTOs.add(jobExecTO);
    +                                    }
    +                                } else {
    +                                    E jobExecTO = reference.newInstance();
    +                                    jobExecTO.setId(jobId);
    +                                    jobExecTO.setStatus("Not Scheduled");
    +                                    jobExecTOs.add(jobExecTO);
    +                                }
    +                            }
    +                        }
    +                    }
    +                } catch (SchedulerException ex) {
    +                    LOG.debug("Problems during retrieving all scheduled jobs {}", ex);
    +                } catch (InstantiationException ex) {
    +                    LOG.debug("Problems during instantiating {}  {}", reference, ex);
    +                } catch (IllegalAccessException ex) {
    +                    LOG.debug("Problems during accessing {}  {}", reference, ex);
    +                }
    +                break;
    +            case RUNNING:
    +                try {
    +                    for (JobExecutionContext jec : scheduler.getScheduler().getCurrentlyExecutingJobs()) {
    +                        Long jobId = getIdFromJobName(jec.getJobDetail().getKey());
    +                        if (jobId != null) {
    +                            E jobExecTO = reference.newInstance();
    +                            jobExecTO.setId(jobId);
    +                            jobExecTO.setStatus("Running");
    +                            jobExecTO.setStartDate(jec.getFireTime());
    +                            jobExecTOs.add(jobExecTO);
    +                        }
    +                    }
    +                } catch (SchedulerException ex) {
    +                    LOG.debug("Problems during retrieving all currently executing jobs {}", ex);
    +                } catch (InstantiationException ex) {
    +                    LOG.debug("Problems during instantiating {}  {}", reference, ex);
    +                } catch (IllegalAccessException ex) {
    +                    LOG.debug("Problems during accessing {}  {}", reference, ex);
    +                }
    +                break;
    +            case SCHEDULED:
    +                try {
    +                    for (String groupName : scheduler.getScheduler().getJobGroupNames()) {
    +                        for (JobKey jobKey : scheduler.getScheduler().getJobKeys(GroupMatcher.jobGroupEquals(groupName))) {
    +                            Long jobId = getIdFromJobName(jobKey);
    +                            if (jobId != null) {
    +                                List<? extends Trigger> jobTriggers = scheduler.getScheduler().getTriggersOfJob(jobKey);
    +                                for (Trigger t : jobTriggers) {
    +                                    E jobExecTO = reference.newInstance();
    +                                    jobExecTO.setId(jobId);
    +                                    jobExecTO.setStatus(scheduler.getScheduler().getTriggerState(t.getKey()).name());
    +                                    jobExecTO.setStartDate(t.getStartTime());
    --- End diff --
    
    Why not setting status here?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request: 1 2 x

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/5#discussion_r30798500
  
    --- Diff: common/src/main/java/org/apache/syncope/common/services/ReportService.java ---
    @@ -192,4 +195,25 @@
         @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
         Response exportExecutionResult(@NotNull @PathParam("executionId") Long executionId,
                 @QueryParam("format") ReportExecExportFormat fmt);
    +    
    +    
    +    /**
    +     * List all the reports of a particular type
    +     *
    +     * @param type of report (like All, Running, Scheduled)
    --- End diff --
    
    Same here: "type of report job" (no need to give examples, you have a proper Enum)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request: [SYNCOPE 660] Asynchronous jobs delegated to...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on the pull request:

    https://github.com/apache/syncope/pull/5#issuecomment-104273316
  
    Some minor comments in-line, nice work @giacomolm LGTM!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request: 1 2 x

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/5#discussion_r30798373
  
    --- Diff: common/src/main/java/org/apache/syncope/common/services/ReportService.java ---
    @@ -192,4 +195,25 @@
         @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
         Response exportExecutionResult(@NotNull @PathParam("executionId") Long executionId,
                 @QueryParam("format") ReportExecExportFormat fmt);
    +    
    +    
    +    /**
    +     * List all the reports of a particular type
    --- End diff --
    
    Please change this description: it should be something like as "List report jobs of the given type"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request: [SYNCOPE 660] Asynchronous jobs delegated to...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/5#discussion_r30799130
  
    --- Diff: core/src/main/java/org/apache/syncope/core/quartz/AbstractTaskJob.java ---
    @@ -176,4 +183,15 @@ public void execute(final JobExecutionContext context) throws JobExecutionExcept
         protected boolean hasToBeRegistered(final TaskExec execution) {
             return false;
         }
    +
    +    @Override
    +    public void interrupt() throws UnableToInterruptJobException {        
    +        Thread thread = this.runningThread.getAndSet(null);
    +        if (thread != null) {
    +            LOG.info("Interrupting job time {} ", new Date().toString());
    +            thread.interrupt();
    +        }
    +        else LOG.debug("Unable to retrieve the right thread related to the current job execution");
    --- End diff --
    
    Please add brackets.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request: [SYNCOPE 660] Asynchronous jobs delegated to...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/5#discussion_r30799252
  
    --- Diff: core/src/main/java/org/apache/syncope/core/quartz/AbstractTaskJob.java ---
    @@ -176,4 +183,15 @@ public void execute(final JobExecutionContext context) throws JobExecutionExcept
         protected boolean hasToBeRegistered(final TaskExec execution) {
             return false;
         }
    +
    +    @Override
    +    public void interrupt() throws UnableToInterruptJobException {        
    +        Thread thread = this.runningThread.getAndSet(null);
    +        if (thread != null) {
    +            LOG.info("Interrupting job time {} ", new Date().toString());
    --- End diff --
    
    Please consistently use `LOG.debug` and format the date according to `SyncopeConstants` format.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request: [SYNCOPE 660] Asynchronous jobs delegated to...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/5#discussion_r30798792
  
    --- Diff: core/src/main/java/org/apache/syncope/core/quartz/AbstractTaskJob.java ---
    @@ -99,6 +100,11 @@
         protected Task task;
     
         /**
    +     * The current running thread containing the task to be executed.
    +     */
    +    AtomicReference<Thread> runningThread = new AtomicReference<Thread>();
    --- End diff --
    
    Please explicitly set the scope here (hint: `protected`)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request: [SYNCOPE 660] Asynchronous jobs delegated to...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/syncope/pull/5


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] syncope pull request: [SYNCOPE 660] Asynchronous jobs delegated to...

Posted by ilgrosso <gi...@git.apache.org>.
Github user ilgrosso commented on a diff in the pull request:

    https://github.com/apache/syncope/pull/5#discussion_r30798576
  
    --- Diff: common/src/main/java/org/apache/syncope/common/types/JobAction.java ---
    @@ -0,0 +1,53 @@
    +/*
    + * 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.
    + */
    +package org.apache.syncope.common.types;
    +
    +import javax.xml.bind.annotation.XmlEnum;
    +
    +@XmlEnum
    +public enum JobAction {
    +
    +    START("start"),
    --- End diff --
    
    No need for providing the `fromString` or explicit labels here (same for all enums)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---