Examples of DeploymentSynchronizer


Examples of org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizer

        DeploymentSynchronizer synchronizer = getSynchronizer(filePath);
        return synchronizer.getLastCheckoutTime();
    }

    public String getRegistryPath(String filePath) throws DeploymentSynchronizerException {
        DeploymentSynchronizer synchronizer = getSynchronizer(filePath);
        return synchronizer.getRegistryPath();
    }
View Full Code Here

Examples of org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizer

        DeploymentSynchronizer synchronizer = getSynchronizer(filePath);
        return synchronizer.getRegistryPath();
    }

    public void checkout(String filePath) throws DeploymentSynchronizerException {
        DeploymentSynchronizer synchronizer = getSynchronizer(filePath);
        try {
            synchronizer.checkout();
        } catch (SynchronizationException e) {
            throw new DeploymentSynchronizerException("Error while invoking checkout on the " +
                    "repository at: " + filePath, e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizer

                    "repository at: " + filePath, e);
        }
    }

    public void commit(String filePath) throws DeploymentSynchronizerException {
        DeploymentSynchronizer synchronizer = getSynchronizer(filePath);
        try {
            synchronizer.commit();
        } catch (SynchronizationException e) {
            throw new DeploymentSynchronizerException("Error while invoking commit on the " +
                    "repository at: " + filePath, e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizer

    }

    private DeploymentSynchronizer getSynchronizer(String filePath)
            throws DeploymentSynchronizerException {

        DeploymentSynchronizer synchronizer = syncManager.getSynchronizer(filePath);
        if (synchronizer == null) {
            throw new DeploymentSynchronizerException("A repository synchronizer has not been " +
                    "engaged for the file path: " + filePath);
        }
        return synchronizer;
View Full Code Here

Examples of org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizer

        if (config.isEnabled()) {
            UserRegistry registry = Utils.getRegistry(tenantId);
            String registryPath = getCarbonRepositoryRegistryPath(tenantId);
            String filePath = MultitenantUtils.getAxis2RepositoryPath(tenantId);

            DeploymentSynchronizer synchronizer = DeploymentSynchronizationManager.getInstance().
                createSynchronizer(registry, registryPath, filePath);
            synchronizer.setAutoCommit(config.isAutoCommit());
            synchronizer.setAutoCheckout(config.isAutoCheckout());
            synchronizer.setPeriod(config.getPeriod());

            if (config.isUseEventing() && ServiceReferenceHolder.getEventingService() != null) {
                AutoCheckoutController checkoutController = new EventingBasedAutoCheckoutController(
                        registry, registryPath);
                synchronizer.setAutoCheckoutController(checkoutController);
            }

            return synchronizer;
        }
View Full Code Here

Examples of org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizer

        String registryPath = pathElement.getText();
        int tenantId = Integer.parseInt(tenantElement.getText());

        DeploymentSynchronizationManager syncManager = DeploymentSynchronizationManager.getInstance();
        String filePath = MultitenantUtils.getAxis2RepositoryPath(tenantId);
        DeploymentSynchronizer synchronizer = syncManager.getSynchronizer(filePath);
        if (synchronizer == null || !synchronizer.isAutoCheckout()) {
            log.warn("Unable to find the synchronizer for the file path: " + filePath);
            return;
        }

        String absoluteRegistryPath = Utils.getAbsoluteRegistryPath(synchronizer.getRegistryPath());
        if (absoluteRegistryPath.endsWith("/")) {
            absoluteRegistryPath = absoluteRegistryPath.substring(0,
                    absoluteRegistryPath.lastIndexOf('/'));
        }

        if (registryPath.startsWith(absoluteRegistryPath)) {
            try {
                Date date = DATE_FORMAT.parse(timestamp);
                AutoCheckoutController checkoutController = synchronizer.getAutoCheckoutController();
                if (checkoutController instanceof EventingBasedAutoCheckoutController) {
                    ((EventingBasedAutoCheckoutController) checkoutController).requestCheckout(
                            date.getTime());
                }
            } catch (ParseException e) {
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.