Package org.apache.syncope.common.to

Examples of org.apache.syncope.common.to.PushTaskTO


                    private static final long serialVersionUID = -7834632442532690940L;

                    @Override
                    public Page createPage() {
                        return reference.equals(SyncTaskTO.class) ? new SyncTaskModalPage(window, new SyncTaskTO(),
                                pageRef) : new PushTaskModalPage(window, new PushTaskTO(), pageRef);
                    }
                });

                window.show(target);
            }
View Full Code Here


    private void fill(final AbstractSyncTask task, final AbstractSyncTaskTO taskTO) {
        SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidSyncTask);

        if (task instanceof PushTask && taskTO instanceof PushTaskTO) {
            final PushTask pushTask = (PushTask) task;
            final PushTaskTO pushTaskTO = (PushTaskTO) taskTO;

            pushTask.setUserFilter(pushTaskTO.getUserFilter());
            pushTask.setRoleFilter(pushTaskTO.getRoleFilter());

            pushTask.setMatchingRule(pushTaskTO.getMatchingRule() == null
                    ? MatchingRule.LINK : pushTaskTO.getMatchingRule());

            pushTask.setUnmatchingRule(pushTaskTO.getUnmatchingRule() == null
                    ? UnmatchingRule.ASSIGN : pushTaskTO.getUnmatchingRule());

        } else if (task instanceof SyncTask && taskTO instanceof SyncTaskTO) {
            final SyncTask syncTask = (SyncTask) task;
            final SyncTaskTO syncTaskTO = (SyncTaskTO) taskTO;
View Full Code Here

        assertEquals(roleTemplate, task.getRoleTemplate());
    }

    @Test
    public void createPushTask() {
        PushTaskTO task = new PushTaskTO();
        task.setName("Test create Push");
        task.setResource(RESOURCE_NAME_WS2);
        task.setUserFilter(
                SyncopeClient.getUserSearchConditionBuilder().hasNotResources(RESOURCE_NAME_TESTDB2).query());
        task.setRoleFilter(
                SyncopeClient.getRoleSearchConditionBuilder().isNotNull("cool").query());
        task.setMatchingRule(MatchingRule.LINK);

        final Response response = taskService.create(task);
        final PushTaskTO actual = getObject(response.getLocation(), TaskService.class, PushTaskTO.class);
        assertNotNull(actual);

        task = taskService.read(actual.getId());
        assertNotNull(task);
        assertEquals(task.getId(), actual.getId());
        assertEquals(task.getJobClassName(), actual.getJobClassName());
        assertEquals(task.getUserFilter(), actual.getUserFilter());
        assertEquals(task.getRoleFilter(), actual.getRoleFilter());
        assertEquals(UnmatchingRule.ASSIGN, actual.getUnmatchingRule());
        assertEquals(MatchingRule.LINK, actual.getMatchingRule());
    }
View Full Code Here

        assertNotNull(taskTO);
        assertNotNull(taskTO.getExecutions());
        assertTrue(taskTO.getExecutions().isEmpty());

        final PushTaskTO pushTaskTO = taskService.<PushTaskTO>read(17L);
        assertEquals(UnmatchingRule.ASSIGN, pushTaskTO.getUnmatchingRule());
        assertEquals(MatchingRule.UPDATE, pushTaskTO.getMatchingRule());
    }
View Full Code Here

                    private static final long serialVersionUID = 2054811145491901166L;

                    @Override
                    public ActionLinksPanel getActions(final String componentId, final IModel<AbstractTaskTO> model) {

                        final PushTaskTO taskTO = (PushTaskTO) model.getObject();

                        final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, pageRef);

                        panel.add(new ActionLink() {

                            private static final long serialVersionUID = -3722207913631435501L;

                            @Override
                            public void onClick(final AjaxRequestTarget target) {

                                window.setPageCreator(new ModalWindow.PageCreator() {

                                    private static final long serialVersionUID = -7834632442532690940L;

                                    @Override
                                    public Page createPage() {
                                        return new PushTaskModalPage(window, taskTO, pageRef);
                                    }
                                });

                                window.show(target);
                            }
                        }, ActionLink.ActionType.EDIT, TASKS);

                        panel.add(new ActionLink() {

                            private static final long serialVersionUID = -3722207913631435501L;

                            @Override
                            public void onClick(final AjaxRequestTarget target) {
                                try {
                                    restClient.startExecution(taskTO.getId(), false);
                                    getSession().info(getString(Constants.OPERATION_SUCCEEDED));
                                } catch (SyncopeClientException scce) {
                                    error(scce.getMessage());
                                }

                                target.add(container);
                                ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
                            }
                        }, ActionLink.ActionType.EXECUTE, TASKS);

                        panel.add(new ActionLink() {

                            private static final long serialVersionUID = -3722207913631435501L;

                            @Override
                            public void onClick(final AjaxRequestTarget target) {
                                try {
                                    restClient.startExecution(taskTO.getId(), true);
                                    getSession().info(getString(Constants.OPERATION_SUCCEEDED));
                                } catch (SyncopeClientException scce) {
                                    error(scce.getMessage());
                                }

                                target.add(container);
                                ((NotificationPanel) getPage().get(Constants.FEEDBACK)).refresh(target);
                            }
                        }, ActionLink.ActionType.DRYRUN, TASKS);

                        panel.add(new ActionLink() {

                            private static final long serialVersionUID = -3722207913631435501L;

                            @Override
                            public void onClick(final AjaxRequestTarget target) {
                                try {
                                    restClient.delete(taskTO.getId(), SyncTaskTO.class);
                                    info(getString(Constants.OPERATION_SUCCEEDED));
                                } catch (SyncopeClientException scce) {
                                    error(scce.getMessage());
                                }
                                target.add(container);
View Full Code Here

TOP

Related Classes of org.apache.syncope.common.to.PushTaskTO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.