Examples of PropagationStatusTO


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

            // 5. verify that propagation was successful
            List<PropagationStatusTO> props = userTO.getPropagationStatusTOs();
            assertNotNull(props);
            assertEquals(1, props.size());
            PropagationStatusTO prop = props.iterator().next();
            assertNotNull(prop);
            assertEquals("ws-target-resource-1", prop.getResource());
            assertEquals(PropagationTaskExecStatus.SUCCESS, prop.getStatus());
        } catch (Exception e) {
            LOG.error("Unexpected exception", e);
        } finally {
            // 6. restore initial cipher algorithm
            pwdCipherAlgo.setValue(origpwdCipherAlgo);
View Full Code Here

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

        // 3. verify that propagation was successful
        List<PropagationStatusTO> props = userTO.getPropagationStatusTOs();
        assertNotNull(props);
        assertEquals(1, props.size());
        PropagationStatusTO prop = props.iterator().next();
        assertNotNull(prop);
        assertEquals(RESOURCE_NAME_LDAP, prop.getResource());
        assertEquals(PropagationTaskExecStatus.SUCCESS, prop.getStatus());
    }
View Full Code Here

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

        fragment.setOutputMarkupId(true);
        container.add(fragment);

        if (mode == UserModalPage.Mode.ADMIN) {
            // add Syncope propagation status
            PropagationStatusTO syncope = new PropagationStatusTO();
            syncope.setResource("Syncope");
            syncope.setStatus(PropagationTaskExecStatus.SUCCESS);

            List<PropagationStatusTO> propagations = new ArrayList<PropagationStatusTO>();
            propagations.add(syncope);
            propagations.addAll(attributable.getPropagationStatusTOs());

            fragment.add(new Label("info",
                    ((attributable instanceof UserTO) && ((UserTO) attributable).getUsername() != null)
                    ? ((UserTO) attributable).getUsername()
                    : ((attributable instanceof RoleTO) && ((RoleTO) attributable).getName() != null)
                    ? ((RoleTO) attributable).getName()
                    : String.valueOf(attributable.getId())));

            final ListView<PropagationStatusTO> propRes = new ListView<PropagationStatusTO>("resources", propagations) {

                private static final long serialVersionUID = -1020475259727720708L;

                @Override
                protected void populateItem(final ListItem<PropagationStatusTO> item) {
                    final PropagationStatusTO propTO = (PropagationStatusTO) item.getDefaultModelObject();

                    final ListView attributes = getConnObjectView(propTO);

                    final Fragment attrhead;
                    if (attributes.getModelObject() == null || attributes.getModelObject().isEmpty()) {
                        attrhead = new Fragment("attrhead", "emptyAttrHeadFrag", page);
                    } else {
                        attrhead = new Fragment("attrhead", "attrHeadFrag", page);
                    }

                    item.add(attrhead);
                    item.add(attributes);

                    attrhead.add(new Label("resource", propTO.getResource()));

                    attrhead.add(new Label("propagation", propTO.getStatus() == null
                            ? "UNDEFINED" : propTO.getStatus().toString()));

                    final Image image;
                    final String alt, title;
                    switch (propTO.getStatus()) {

                        case SUCCESS:
                        case SUBMITTED:
                        case CREATED:
                            image = new Image("icon", "statuses/active.png");
View Full Code Here

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

            // 5. verify that propagation was successful
            List<PropagationStatusTO> props = userTO.getPropagationStatusTOs();
            assertNotNull(props);
            assertEquals(1, props.size());
            PropagationStatusTO prop = props.iterator().next();
            assertNotNull(prop);
            assertEquals("ws-target-resource-1", prop.getResource());
            assertEquals(PropagationTaskExecStatus.SUCCESS, prop.getStatus());
        } catch (Exception e) {
            LOG.error("Unexpected exception", e);
        } finally {
            // 6. restore initial cipher algorithm
            pwdCipherAlgo.setValue(origpwdCipherAlgo);
View Full Code Here

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

        // 3. verify that propagation was successful
        List<PropagationStatusTO> props = userTO.getPropagationStatusTOs();
        assertNotNull(props);
        assertEquals(1, props.size());
        PropagationStatusTO prop = props.iterator().next();
        assertNotNull(prop);
        assertEquals(RESOURCE_NAME_LDAP, prop.getResource());
        assertEquals(PropagationTaskExecStatus.SUCCESS, prop.getStatus());
    }
View Full Code Here

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

    @Override
    public void handle(final String resource, final PropagationTaskExecStatus executionStatus,
            final ConnectorObject beforeObj, final ConnectorObject afterObj) {

        final PropagationStatusTO propagation = new PropagationStatusTO();
        propagation.setResource(resource);
        propagation.setStatus(executionStatus);

        if (beforeObj != null) {
            propagation.setBeforeObj(connObjectUtil.getConnObjectTO(beforeObj));
        }

        if (afterObj != null) {
            propagation.setAfterObj(connObjectUtil.getConnObjectTO(afterObj));
        }

        propagations.add(propagation);
    }
View Full Code Here

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

        // 5. verify that propagation was successful
        List<PropagationStatusTO> props = userTO.getPropagationStatusTOs();
        assertNotNull(props);
        assertEquals(1, props.size());
        PropagationStatusTO prop = props.iterator().next();
        assertNotNull(prop);
        assertEquals(RESOURCE_NAME_WS1, prop.getResource());
        assertEquals(PropagationTaskExecStatus.SUBMITTED, prop.getStatus());

        // 6. restore initial cipher algorithm
        pwdCipherAlgo.setValue(origpwdCipherAlgo);
        configurationService.update(pwdCipherAlgo.getKey(), pwdCipherAlgo);
    }
View Full Code Here

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

        // 3. verify that propagation was successful
        List<PropagationStatusTO> props = userTO.getPropagationStatusTOs();
        assertNotNull(props);
        assertEquals(1, props.size());
        PropagationStatusTO prop = props.iterator().next();
        assertNotNull(prop);
        assertEquals(RESOURCE_NAME_LDAP, prop.getResource());
        assertEquals(PropagationTaskExecStatus.SUCCESS, prop.getStatus());
    }
View Full Code Here

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

        fragment.setOutputMarkupId(true);
        container.add(fragment);

        if (mode == UserModalPage.Mode.ADMIN) {
            // add Syncope propagation status
            PropagationStatusTO syncope = new PropagationStatusTO();
            syncope.setResource("Syncope");
            syncope.setStatus(PropagationTaskExecStatus.SUCCESS);

            List<PropagationStatusTO> propagations = new ArrayList<PropagationStatusTO>();
            propagations.add(syncope);
            propagations.addAll(attributable.getPropagationStatusTOs());

            fragment.add(new Label("info",
                    ((attributable instanceof UserTO) && ((UserTO) attributable).getUsername() != null)
                    ? ((UserTO) attributable).getUsername()
                    : ((attributable instanceof RoleTO) && ((RoleTO) attributable).getName() != null)
                    ? ((RoleTO) attributable).getName()
                    : String.valueOf(attributable.getId())));

            final ListView<PropagationStatusTO> propRes = new ListView<PropagationStatusTO>("resources",
                    propagations) {

                private static final long serialVersionUID = -1020475259727720708L;

                @Override
                protected void populateItem(final ListItem<PropagationStatusTO> item) {
                    final PropagationStatusTO propTO = (PropagationStatusTO) item.getDefaultModelObject();

                    final ListView attributes = getConnObjectView(propTO);

                    final Fragment attrhead;
                    if (attributes.getModelObject() == null || attributes.getModelObject().isEmpty()) {
                        attrhead = new Fragment("attrhead", "emptyAttrHeadFrag", page);
                    } else {
                        attrhead = new Fragment("attrhead", "attrHeadFrag", page);
                    }

                    item.add(attrhead);
                    item.add(attributes);

                    attrhead.add(new Label("resource", propTO.getResource()));

                    attrhead.add(new Label("propagation", propTO.getStatus() == null
                            ? "UNDEFINED" : propTO.getStatus().toString()));

                    final Image image;
                    final String alt, title;
                    final ModalWindow failureWindow = new ModalWindow("failureWindow");
                    final AjaxLink<?> failureWindowLink = new AjaxLink<Void>("showFailureWindow") {

                        private static final long serialVersionUID = -7978723352517770644L;

                        @Override
                        public void onClick(AjaxRequestTarget target) {
                            failureWindow.show(target);
                        }
                    };

                    switch (propTO.getStatus()) {

                        case SUCCESS:
                        case SUBMITTED:
                        case CREATED:
                            image = new Image("icon", IMG_STATUSES + StatusUtils.Status.ACTIVE.toString()
                                    + Constants.PNG_EXT);
                            alt = "success icon";
                            title = "success";
                            failureWindow.setVisible(false);
                            failureWindowLink.setEnabled(false);
                            break;

                        default:
                            image = new Image("icon", IMG_STATUSES + StatusUtils.Status.SUSPENDED.toString()
                                    + Constants.PNG_EXT);
                            alt = "failure icon";
                            title = "failure";
                    }

                    image.add(new Behavior() {

                        private static final long serialVersionUID = 1469628524240283489L;

                        @Override
                        public void onComponentTag(final Component component, final ComponentTag tag) {
                            tag.put("alt", alt);
                            tag.put("title", title);
                        }
                    });
                    final FailureMessageModalPage executionFailureMessagePage;
                    if (propTO.getFailureReason() != null) {
                        executionFailureMessagePage = new FailureMessageModalPage(failureWindow.getContentId(), propTO.
                                getFailureReason());
                    } else {
                        executionFailureMessagePage = new FailureMessageModalPage(failureWindow.getContentId(),
                                StringUtils.EMPTY);
                    }
View Full Code Here

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

    @Override
    public void handle(final String resource, final PropagationTaskExecStatus executionStatus,
            final String failureReason, final ConnectorObject beforeObj, final ConnectorObject afterObj) {

        final PropagationStatusTO propagation = new PropagationStatusTO();
        propagation.setResource(resource);
        propagation.setStatus(executionStatus);
        propagation.setFailureReason(failureReason);

        if (beforeObj != null) {
            propagation.setBeforeObj(connObjectUtil.getConnObjectTO(beforeObj));
        }

        if (afterObj != null) {
            propagation.setAfterObj(connObjectUtil.getConnObjectTO(afterObj));
        }

        propagations.add(propagation);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.