Package org.apache.syncope.common.to

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


        property.getValues().clear();
        property.getValues().add(Boolean.TRUE);
        connectorService.update(ldapResource.getConnectorId(), resourceConnector);

        // 6. Sync the user from the resource
        SyncTaskTO syncTask = new SyncTaskTO();
        syncTask.setName("LDAP Sync Task");
        syncTask.setPerformCreate(true);
        syncTask.setPerformUpdate(true);
        syncTask.setFullReconciliation(true);
        syncTask.setResource(RESOURCE_NAME_LDAP);
        syncTask.getActionsClassNames().add(LDAPPasswordSyncActions.class.getName());
        Response taskResponse = taskService.create(syncTask);

        SyncTaskTO actual = getObject(taskResponse.getLocation(), TaskService.class, SyncTaskTO.class);
        assertNotNull(actual);

        syncTask = taskService.read(actual.getId());
        assertNotNull(syncTask);
        assertEquals(actual.getId(), syncTask.getId());
        assertEquals(actual.getJobClassName(), syncTask.getJobClassName());

        TaskExecTO execution = execSyncTask(syncTask.getId(), 50, false);
        final String status = execution.getStatus();
        assertNotNull(status);
        assertTrue(PropagationTaskExecStatus.valueOf(status).isSuccessful());
View Full Code Here


                    private static final long serialVersionUID = 2054811145491901166L;

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

                        final SyncTaskTO taskTO = (SyncTaskTO) 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 SyncTaskModalPage(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) {

                                window.setPageCreator(new ModalWindow.PageCreator() {

                                    private static final long serialVersionUID = -7834632442532690940L;

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

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

                        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 RoleTemplateModalPage(pageRef, window, taskTO);
                                    }
                                });

                                window.show(target);
                            }
                        }, ActionLink.ActionType.ROLE_TEMPLATE, 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.SyncTaskTO

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.