Package org.apache.syncope.common.to

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


    private LoggerDAO loggerDAO;

    private List<LoggerTO> list(final SyncopeLoggerType type) {
        List<LoggerTO> result = new ArrayList<LoggerTO>();
        for (SyncopeLogger syncopeLogger : loggerDAO.findAll(type)) {
            LoggerTO loggerTO = new LoggerTO();
            BeanUtils.copyProperties(syncopeLogger, loggerTO);
            result.add(loggerTO);
        }

        auditManager.audit(Category.logger, LoggerSubCategory.list, Result.success,
View Full Code Here


        LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
        Logger logger = lc.getLogger(name);
        logger.setLevel(level);

        LoggerTO result = new LoggerTO();
        BeanUtils.copyProperties(syncopeLogger, result);

        auditManager.audit(Category.logger, LoggerSubCategory.setLevel, Result.success,
                String.format("Successfully set level %s to logger %s (%s)", level, name, expectedType));
View Full Code Here

            throw new NotFoundException("Logger " + name);
        } else if (expectedType != syncopeLogger.getType()) {
            throwInvalidLogger(expectedType);
        }

        LoggerTO loggerToDelete = new LoggerTO();
        BeanUtils.copyProperties(syncopeLogger, loggerToDelete);

        // remove SyncopeLogger from local storage, so that LoggerLoader won't load this next time
        loggerDAO.delete(syncopeLogger);
View Full Code Here

        public List<LoggerTO> getLoggers() {
            LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
            List<LoggerTO> result = new ArrayList<LoggerTO>(lc.getLoggerList().size());
            for (Logger logger : lc.getLoggerList()) {
                if (logger.getLevel() != null) {
                    LoggerTO loggerTO = new LoggerTO();
                    loggerTO.setName(logger.getName());
                    loggerTO.setLevel(SyncopeLoggerLevel.fromLevel(logger.getLevel()));
                    result.add(loggerTO);
                }
            }

            return result;
View Full Code Here

    public void setLevel() {
        List<LoggerTO> loggers = loggerService.list(LoggerType.NORMAL);
        assertNotNull(loggers);
        int startSize = loggers.size();

        LoggerTO logger = new LoggerTO();
        logger.setName("TEST");
        logger.setLevel(SyncopeLoggerLevel.INFO);
        loggerService.update(LoggerType.NORMAL, logger.getName(), logger);
        logger = loggerService.read(LoggerType.NORMAL, logger.getName());
        assertNotNull(logger);
        assertEquals(SyncopeLoggerLevel.INFO, logger.getLevel());

        loggers = loggerService.list(LoggerType.NORMAL);
        assertNotNull(loggers);
        assertEquals(startSize + 1, loggers.size());
View Full Code Here

        List<AuditLoggerName> audits = CollectionWrapper.wrapLogger(loggerService.list(LoggerType.AUDIT));
        assertNotNull(audits);
        assertFalse(audits.contains(auditLoggerName));

        LoggerTO loggerTO = new LoggerTO();
        String name = auditLoggerName.toLoggerName();
        loggerTO.setName(name);
        loggerTO.setLevel(SyncopeLoggerLevel.DEBUG);
        loggerService.update(LoggerType.AUDIT, name, loggerTO);

        audits = CollectionWrapper.wrapLogger(loggerService.list(LoggerType.AUDIT));
        assertNotNull(audits);
        assertTrue(audits.contains(auditLoggerName));
View Full Code Here

        return result;
    }

    public void setLogLevel(final String name, final SyncopeLoggerLevel level) {
        LoggerTO loggerTO = new LoggerTO();
        loggerTO.setName(name);
        loggerTO.setLevel(level);
        getService(LoggerService.class).update(LoggerType.NORMAL, name, loggerTO);
    }
View Full Code Here

        getService(LoggerService.class).update(LoggerType.NORMAL, name, loggerTO);
    }

    public void enableAudit(final AuditLoggerName auditLoggerName) {
        String name = auditLoggerName.toLoggerName();
        LoggerTO loggerTO = new LoggerTO();
        loggerTO.setName(name);
        loggerTO.setLevel(SyncopeLoggerLevel.DEBUG);
        getService(LoggerService.class).update(LoggerType.AUDIT, name, loggerTO);
    }
View Full Code Here

    public void setLevel() {
        List<LoggerTO> loggers = loggerService.list(LoggerType.NORMAL);
        assertNotNull(loggers);
        int startSize = loggers.size();

        LoggerTO logger = new LoggerTO();
        logger.setName("TEST");
        logger.setLevel(SyncopeLoggerLevel.INFO);
        loggerService.update(LoggerType.NORMAL, logger.getName(), logger);
        logger = loggerService.read(LoggerType.NORMAL, logger.getName());
        assertNotNull(logger);
        assertEquals(SyncopeLoggerLevel.INFO, logger.getLevel());

        loggers = loggerService.list(LoggerType.NORMAL);
        assertNotNull(loggers);
        assertEquals(startSize + 1, loggers.size());
View Full Code Here

        List<AuditLoggerName> audits = CollectionWrapper.wrapLogger(loggerService.list(LoggerType.AUDIT));
        assertNotNull(audits);
        assertFalse(audits.contains(auditLoggerName));

        LoggerTO loggerTO = new LoggerTO();
        String name = auditLoggerName.toLoggerName();
        loggerTO.setName(name);
        loggerTO.setLevel(SyncopeLoggerLevel.DEBUG);
        loggerService.update(LoggerType.AUDIT, name, loggerTO);

        audits = CollectionWrapper.wrapLogger(loggerService.list(LoggerType.AUDIT));
        assertNotNull(audits);
        assertTrue(audits.contains(auditLoggerName));
View Full Code Here

TOP

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

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.