Package org.wso2.carbon.deployment.synchronizer

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


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

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


        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

        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

                    "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

    }

    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

        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

        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

        }

        public void run() {
            try {
                MessageContext msgCtx = ((Axis2MessageContext) synCtx).getAxis2MessageContext();
                Event<MessageContext> event = new Event(msgCtx);
                subscriptions = subscriptionManager.getMatchingSubscriptions(event);
            } catch (EventException e) {
                handleException("Matching subscriptions fetching error", e);
            }
View Full Code Here

     * @throws EventException event
     */
    private void processGetStatusRequest(MessageContext mc,
                                         ResponseMessageBuilder messageBuilder)
            throws AxisFault, EventException {
        Subscription subscription =
                SubscriptionMessageBuilder.createGetStatusMessage(mc);
        if (log.isDebugEnabled()) {
            log.debug("GetStatus request recived for SynapseSubscription ID : " +
                    subscription.getId());
        }
        subscription = subscriptionManager.getSubscription(subscription.getId());
        if (subscription != null) {
            if (log.isDebugEnabled()) {
                log.debug("Sending GetStatus responce for SynapseSubscription ID : " +
                        subscription.getId());
            }
            //send the responce
            SOAPEnvelope soapEnvelope = messageBuilder.genGetStatusResponse(subscription);
            dispatchResponse(soapEnvelope, EventingConstants.WSE_GET_STATUS_RESPONSE,
                    mc, false);
View Full Code Here


    public SynapseSubscription() {
        this.setId(UIDGenerator.generateURNString());
        this.setDeliveryMode(EventingConstants.WSE_DEFAULT_DELIVERY_MODE);
        SubscriptionData subscriptionData = new SubscriptionData();
        subscriptionData.setProperty(SynapseEventingConstants.STATIC_ENTRY, "false");
        this.setSubscriptionData(subscriptionData);
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.deployment.synchronizer.DeploymentSynchronizer$AutoSyncTask

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.