Package org.apache.stratos.messaging.event.instance.notifier

Examples of org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent


    @Override
    public boolean process(String type, String message, Object object) {
        if (ArtifactUpdatedEvent.class.getName().equals(type)) {
            // Parse complete message and build event
            ArtifactUpdatedEvent event = (ArtifactUpdatedEvent) Util.jsonToObject(message, ArtifactUpdatedEvent.class);

            // Notify event listeners
            notifyEventListeners(event);
            return true;
        }
View Full Code Here


            }
        }
    }

    private void onArtifactUpdateEvent(ArtifactUpdatedEvent event) {
        ArtifactUpdatedEvent artifactUpdatedEvent = event;
        if(log.isInfoEnabled()) {
            log.info(String.format("Artifact update event received: %s", artifactUpdatedEvent.toString()));
        }

        String clusterIdInPayload = CartridgeAgentConfiguration.getInstance().getClusterId();
        String localRepoPath = CartridgeAgentConfiguration.getInstance().getAppPath();
        String clusterIdInMessage = artifactUpdatedEvent.getClusterId();
        String repoURL = artifactUpdatedEvent.getRepoURL();
        String repoPassword = CartridgeAgentUtils.decryptPassword(artifactUpdatedEvent.getRepoPassword());
        String repoUsername = artifactUpdatedEvent.getRepoUserName();
        String tenantId = artifactUpdatedEvent.getTenantId();
        boolean isMultitenant = CartridgeAgentConfiguration.getInstance().isMultitenant();

        if(StringUtils.isNotEmpty(repoURL) && (clusterIdInPayload != null) && clusterIdInPayload.equals(clusterIdInMessage)) {
            if(log.isInfoEnabled()) {
                log.info("Executing git checkout");
View Full Code Here

     * @param repository
     * @param clusterId
     * @param tenantId
     */
    public void sendArtifactUpdateEvent(Repository repository, String clusterId, String tenantId) {
        ArtifactUpdatedEvent artifactUpdateEvent = new ArtifactUpdatedEvent();
        artifactUpdateEvent.setClusterId(clusterId);
        artifactUpdateEvent.setRepoUserName(repository.getUserName());
        artifactUpdateEvent.setRepoPassword(repository.getPassword());
        artifactUpdateEvent.setRepoURL(repository.getUrl());
        artifactUpdateEvent.setTenantId(tenantId);

        log.info(String.format("Publishing artifact updated event: [cluster] %s " +
                "[repo-URL] %s [repo-username] %s [repo-password] %s [tenant-id] %s",
                clusterId, repository.getUrl(), repository.getUserName(), repository.getPassword(), tenantId));
        publish(artifactUpdateEvent);
View Full Code Here

TOP

Related Classes of org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent

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.