Package org.apache.syncope.console.commons.status

Examples of org.apache.syncope.console.commons.status.StatusBean


        connObjects = statusUtils.getConnectorObjects(subject);

        final List<StatusBean> statusBeans = new ArrayList<StatusBean>(connObjects.size() + 1);
        initialStatusBeanMap = new LinkedHashMap<String, StatusBean>(connObjects.size() + 1);

        final StatusBean syncope = new StatusBean(subject, "syncope");

        if (subject instanceof UserTO) {
            syncope.setAccountLink(((UserTO) subject).getUsername());

            Status syncopeStatus = Status.UNDEFINED;
            if (((UserTO) subject).getStatus() != null) {
                try {
                    syncopeStatus = Status.valueOf(((UserTO) subject).getStatus().toUpperCase());
                } catch (IllegalArgumentException e) {
                    LOG.warn("Unexpected status found: {}", ((UserTO) subject).getStatus(), e);
                }
            }
            syncope.setStatus(syncopeStatus);
        } else if (subject instanceof RoleTO) {
            syncope.setAccountLink(((RoleTO) subject).getDisplayName());
            syncope.setStatus(Status.ACTIVE);
        }

        statusBeans.add(syncope);
        initialStatusBeanMap.put(syncope.getResourceName(), syncope);

        for (ConnObjectWrapper entry : connObjects) {
            final StatusBean statusBean = statusUtils.getStatusBean(
                    entry.getAttributable(),
                    entry.getResourceName(),
                    entry.getConnObjectTO(),
                    subject instanceof RoleTO);
View Full Code Here


            final List<StatusBean> statusBeans = new ArrayList<StatusBean>(connObjects.size() + 1);
            final LinkedHashMap<String, StatusBean> initialStatusBeanMap = new LinkedHashMap<String, StatusBean>(
                    connObjects.size());

            for (ConnObjectWrapper entry : connObjects) {
                final StatusBean statusBean = statusUtils.getStatusBean(
                        entry.getAttributable(),
                        entry.getResourceName(),
                        entry.getConnObjectTO(),
                        RoleTO.class.isAssignableFrom(typeRef));
View Full Code Here

                statusUtils.getConnectorObjects(Collections.singletonList(subjectTO), resources);

        final List<StatusBean> statusBeans = new ArrayList<StatusBean>(connObjects.size());

        for (ConnObjectWrapper entry : connObjects) {
            final StatusBean statusBean = statusUtils.getStatusBean(
                    subjectTO,
                    entry.getResourceName(),
                    entry.getConnObjectTO(),
                    subjectTO instanceof RoleTO);
View Full Code Here

            final List<ConnObjectWrapper> connObjects = statusUtils.getConnectorObjects(subjectTO);

            final List<StatusBean> statusBeans = new ArrayList<StatusBean>(connObjects.size() + 1);

            for (ConnObjectWrapper entry : connObjects) {
                final StatusBean statusBean = statusUtils.getStatusBean(
                        subjectTO,
                        entry.getResourceName(),
                        entry.getConnObjectTO(),
                        subjectTO instanceof RoleTO);

                statusBeans.add(statusBean);
                resources.remove(entry.getResourceName());
            }

            if (statusOnly) {
                final StatusBean syncope = new StatusBean(subjectTO, "Syncope");

                syncope.setAccountLink(((UserTO) subjectTO).getUsername());

                Status syncopeStatus = Status.UNDEFINED;
                if (((UserTO) subjectTO).getStatus() != null) {
                    try {
                        syncopeStatus = Status.valueOf(((UserTO) subjectTO).getStatus().toUpperCase());
                    } catch (IllegalArgumentException e) {
                        LOG.warn("Unexpected status found: {}", ((UserTO) subjectTO).getStatus(), e);
                    }
                }
                syncope.setStatus(syncopeStatus);

                statusBeans.add(syncope);
            } else {
                for (String resource : resources) {
                    final StatusBean statusBean = statusUtils.getStatusBean(
                            subjectTO,
                            resource,
                            null,
                            subjectTO instanceof RoleTO);

                    statusBean.setLinked(false);
                    statusBeans.add(statusBean);
                }
            }

            return statusBeans;
View Full Code Here

TOP

Related Classes of org.apache.syncope.console.commons.status.StatusBean

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.