Package org.libreplan.business.common.entities

Examples of org.libreplan.business.common.entities.ConnectorException


     */
    private TypeOfWorkHours getTypeOfWorkHours() throws ConnectorException {
        Connector connector = connectorDAO
                .findUniqueByName(PredefinedConnectors.JIRA.getName());
        if (connector == null) {
            throw new ConnectorException(_("JIRA connector not found"));
        }

        TypeOfWorkHours typeOfWorkHours;
        String name = connector.getPropertiesAsMap().get(
                PredefinedConnectorProperties.JIRA_HOURS_TYPE);

        if (StringUtils.isBlank(name)) {
            throw new ConnectorException(
                    _("Hours type should not be empty to synchronine timesheets"));
        }

        try {
            typeOfWorkHours = typeOfWorkHoursDAO.findUniqueByName(name);
View Full Code Here


    @Override
    @Transactional(readOnly = true)
    public List<SynchronizationInfo> exportTimesheets() throws ConnectorException {
        Connector connector = getTimConnector();
        if (connector == null) {
            throw new ConnectorException(_("Tim connector not found"));
        }
        if (!connector.areConnectionValuesValid()) {
            throw new ConnectorException(
                    _("Connection values of Tim connector are invalid"));
        }

        synchronizationInfo = new SynchronizationInfo(_("Export"));
View Full Code Here

    @Override
    @Transactional(readOnly = true)
    public void exportTimesheets(String productCode, Order order)
            throws ConnectorException {
        if (productCode == null || productCode.isEmpty()) {
            throw new ConnectorException(_("Product code should not be empty"));
        }
        if (order == null) {
            throw new ConnectorException(_("Order should not be empty"));
        }

        Connector connector = getTimConnector();
        if (connector == null) {
            throw new ConnectorException(_("Tim connector not found"));
        }

        if (!connector.areConnectionValuesValid()) {
            throw new ConnectorException(
                    _("Connection values of Tim connector are invalid"));
        }

        exportTimesheets(productCode, order, connector);
    }
View Full Code Here

    @Transactional
    public List<SynchronizationInfo> importRosters() throws ConnectorException {
        Connector connector = connectorDAO
                .findUniqueByName(PredefinedConnectors.TIM.getName());
        if (connector == null) {
            throw new ConnectorException(_("Tim connector not found"));
        }

        if (!connector.areConnectionValuesValid()) {
            throw new ConnectorException(
                    _("Connection values of Tim connector are invalid"));
        }

        Map<String, String> properties = connector.getPropertiesAsMap();
        String url = properties.get(PredefinedConnectorProperties.SERVER_URL);

        String userName = properties
                .get(PredefinedConnectorProperties.USERNAME);

        String password = properties
                .get(PredefinedConnectorProperties.PASSWORD);

        int nrDaysRosterFromTim = Integer.parseInt(properties
                .get(PredefinedConnectorProperties.TIM_NR_DAYS_ROSTER));

        int productivityFactor = Integer.parseInt(properties
                .get(PredefinedConnectorProperties.TIM_PRODUCTIVITY_FACTOR));


        String departmentIds = properties
                .get(PredefinedConnectorProperties.TIM_DEPARTAMENTS_IMPORT_ROSTER);

        if (StringUtils.isBlank(departmentIds)) {
            LOG.warn("No departments configured");
            throw new ConnectorException(_("No departments configured"));
        }

        String[] departmentIdsArray = StringUtils.stripAll(StringUtils.split(
                departmentIds, ","));
View Full Code Here

    @Override
    @Transactional(readOnly = true)
    public List<String> getAllJiraLabels() throws ConnectorException {
        Connector connector = getJiraConnector();
        if (connector == null) {
            throw new ConnectorException(_("JIRA connector not found"));
        }

        String jiraLabels = connector.getPropertiesAsMap().get(
                PredefinedConnectorProperties.JIRA_LABELS);
View Full Code Here

    @Transactional(readOnly = true)
    public List<IssueDTO> getJiraIssues(String label) throws ConnectorException {

        Connector connector = getJiraConnector();
        if (connector == null) {
            throw new ConnectorException(_("JIRA connector not found"));
        }

        if (!connector.areConnectionValuesValid()) {
            throw new ConnectorException(
                    _("Connection values of JIRA connector are invalid"));
        }

        return getJiraIssues(label, connector);
    }
View Full Code Here

    @Override
    @Transactional
    public List<SynchronizationInfo> syncOrderElementsWithJiraIssues() throws ConnectorException {
        Connector connector = getJiraConnector();
        if (connector == null) {
            throw new ConnectorException(_("JIRA connector not found"));
        }
        if (!connector.areConnectionValuesValid()) {
            throw new ConnectorException(
                    _("Connection values of JIRA connector are invalid"));
        }

        List<OrderSyncInfo> orderSyncInfos = orderSyncInfoDAO
                .findByConnectorName(PredefinedConnectors.JIRA.getName());
View Full Code Here

TOP

Related Classes of org.libreplan.business.common.entities.ConnectorException

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.