Package org.wso2.carbon.registry.core

Examples of org.wso2.carbon.registry.core.LogEntry


    }

    public byte[] getProcessImage(String processId) {

        QName qName = decode(processId);
        SVGInterface svg = createSVG(qName);
        return svg.toPNGBytes();
    }
View Full Code Here


    private SVGInterface createSVG(QName qName) {

        // generate new
        InputStream in = getBpelDescriptor(qName);

        SVGInterface svg = null;

        try {
            svg = BPEL2SVGUtil.generate(in);

            if (svg == null)
View Full Code Here

   
    protected static SVGImpl generateSVGImpl(java.io.InputStream is) throws java.io.IOException {
      byte[] b=new byte[is.available()];
      is.read(b);
   
      BPELInterface bpel = new BPELImpl();
        OMElement bpelStr = bpel.load(new String(b));
       
        bpel.processBpelString(bpelStr);

        LayoutManager layoutManager = BPEL2SVGFactory.getInstance().getLayoutManager();
        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

   * @param transformer The optional image transformer
   * @throws java.io.IOException Failed to generate the representation
   */
    public static void generate(java.io.InputStream is, java.io.OutputStream os,
                SVGImageTransformer transformer) throws java.io.IOException {
        SVGImpl svg = generateSVGImpl(is);
       
        if (transformer == null) {
          String str=svg.getHeaders()+svg.generateSVGString();
          os.write(str.getBytes());
        } else {
          transformer.transform(svg, os);
        }
    }
View Full Code Here

        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

        } else if (scheme.equals(ClusteringConstants.MembershipScheme.MULTICAST_BASED)) {
            membershipScheme = new MulticastBasedMembershipScheme(parameters, primaryDomain,
                                                                  nwConfig.getJoin().getMulticastConfig());
            membershipScheme.init();
        } else if (scheme.equals(HazelcastConstants.AWS_MEMBERSHIP_SCHEME)) {
            membershipScheme = new AWSBasedMembershipScheme(parameters, primaryDomain,
                                                            nwConfig.getJoin().getAwsConfig());
            membershipScheme.init();
        } else {
            String msg = "Invalid membership scheme '" + scheme +
                         "'. Supported schemes are multicast & wka";
View Full Code Here

    private int ownerTenantId;
    private CacheManagerFactoryImpl cacheManagerFactory;

    public HazelcastCacheManager(String name, CacheManagerFactoryImpl cacheManagerFactory) {
        this.cacheManagerFactory = cacheManagerFactory;
        CarbonContext carbonContext = CarbonContext.getThreadLocalCarbonContext();
        if (carbonContext == null) {
            throw new IllegalStateException("CarbonContext cannot be null");
        }
        ownerTenantDomain = carbonContext.getTenantDomain();
        if (ownerTenantDomain == null) {
            throw new IllegalStateException("Tenant domain cannot be " + ownerTenantDomain);
        }
        ownerTenantId = carbonContext.getTenantId();
        if (ownerTenantId == MultitenantConstants.INVALID_TENANT_ID) {
            throw new IllegalStateException("Tenant ID cannot be " + ownerTenantId);
        }
        this.name = name;
        status = Status.STARTED;
View Full Code Here

    private long capacity = CachingConstants.DEFAULT_CACHE_CAPACITY;
    private EvictionAlgorithm evictionAlgorithm = CachingConstants.DEFAULT_EVICTION_ALGORITHM;

    public CacheImpl(String cacheName, CacheManager cacheManager) {
        CarbonContext carbonContext = CarbonContext.getThreadLocalCarbonContext();
        if (carbonContext == null) {
            throw new IllegalStateException("CarbonContext cannot be null");
        }
        ownerTenantDomain = carbonContext.getTenantDomain();
        if (ownerTenantDomain == null) {
            throw new IllegalStateException("Tenant domain cannot be " + ownerTenantDomain);
        }
        ownerTenantId = carbonContext.getTenantId();
        if (ownerTenantId == MultitenantConstants.INVALID_TENANT_ID) {
            throw new IllegalStateException("Tenant ID cannot be " + ownerTenantId);
        }
        this.cacheName = cacheName;
        this.cacheManager = cacheManager;
View Full Code Here

                requestOptions);
        Document introspection =
                resp.getDocument();
        Feed feed = (Feed) introspection.getRoot();
        List entries = feed.getEntries();
        LogEntry logs[] = null;
        if (entries != null) {
            logs = new LogEntry[entries.size()];
            for (int i = 0; i < entries.size(); i++) {
                Entry entry = (Entry) entries.get(i);
                LogEntry logEntry = new LogEntry();
                logEntry.setDate(entry.getEdited());
                logEntry.setActionData(entry.getContent());
                logEntry.setUserName(entry.getAuthor().getName());
                logEntry.setAction(Integer.parseInt(
                        entry.getSimpleExtension(new QName(APPConstants.NAMESPACE, "action"))));
                String path = entry.getSimpleExtension(new QName(APPConstants.NAMESPACE, "path"));
                logEntry.setResourcePath(path);
                logs[i] = logEntry;
            }
        }
        abderaClient.teardown();
        return logs;
View Full Code Here

    private static String [] constructActivityStatementsfornormaluser(Registry registry, LogEntry[] logs,String Username) {

        ArrayList<String> list = new ArrayList<String>();
        for (int i = 0; i < logs.length; i++) {

            LogEntry logEntry = logs[i];
            if(logEntry.getUserName().equals(Username)){
                if (logEntry.getAction() == LogEntry.ADD) {
                    String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has added the resource " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                    list.add(entry);

                } else if (logEntry.getAction() == LogEntry.UPDATE) {
                    String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has updated the resource " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                    list.add(entry);

                } else if (logEntry.getAction() == LogEntry.DELETE_RESOURCE) {
                    String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has deleted the resource " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                    list.add(entry);

                } else if (logEntry.getAction() == LogEntry.COMMENT) {
                    String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has commented on resource " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " on " + CommonUtil.formatDate(logEntry.getDate()) + " with the following comment." + "|" + logEntry.getActionData();
                    list.add(entry);

                } else if (logEntry.getAction() == LogEntry.DELETE_COMMENT) {
                    String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has deleted the comment '" + logEntry.getActionData() + "' on the resource " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                    list.add(entry);

                } else if (logEntry.getAction() == LogEntry.TAG) {
                    String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has tagged the resource " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " with tag '" + logEntry.getActionData() + "' on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                    list.add(entry);

                } else if (logEntry.getAction() == LogEntry.REMOVE_TAG) {
                    String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has removed the tag '" + logEntry.getActionData() + "' on the resource " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                    list.add(entry);

                } else if (logEntry.getAction() == LogEntry.RATING) {
                    String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has rated the resource " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " with rating " + logEntry.getActionData() + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                    list.add(entry);

                } else if (logEntry.getAction() == LogEntry.ADD_ASSOCIATION) {
                    String[] actionData = logEntry.getActionData().split(";");
                    if (actionData != null && actionData.length >= 2) {
                        String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has added an association of type " + actionData[0] + " from the resource " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " to the resource " + actionData[1] + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                        list.add(entry);
                    }

                } else if (logEntry.getAction() == LogEntry.REMOVE_ASSOCIATION) {
                    String[] actionData = logEntry.getActionData().split(";");
                    if (actionData != null && actionData.length >= 2) {
                        String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has removed an association of type " + actionData[0] + " from the resource " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " to the resource " + actionData[1] + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                        list.add(entry);
                    }

                } else if (logEntry.getAction() == LogEntry.RESTORE) {
                    String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has restored the resource " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + ((logEntry.getActionData() != null) ? " to the version " + logEntry.getActionData() : "") + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                    list.add(entry);

                } else if (logEntry.getAction() == LogEntry.ASSOCIATE_ASPECT) {
                    String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has associated the aspect " + logEntry.getActionData() + " to the resource " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                    list.add(entry);

                } else if (logEntry.getAction() == LogEntry.COPY) {
                    String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has copied the resource " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " to the Location " + logEntry.getActionData() + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                    list.add(entry);

                } else if (logEntry.getAction() == LogEntry.RENAME) {
                    String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has renamed the resource " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " to new Name: " + logEntry.getActionData() + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                    list.add(entry);

                } else if (logEntry.getAction() == LogEntry.MOVE) {
                    String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has moved the resource " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " to the Location " + logEntry.getActionData() + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                    list.add(entry);

                } else if (logEntry.getAction() == LogEntry.CREATE_SYMBOLIC_LINK) {
                    String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has created a symbolic link " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " to the Location " + logEntry.getActionData() + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                    list.add(entry);

                } else if (logEntry.getAction() == LogEntry.CREATE_REMOTE_LINK) {
                    if (logEntry.getActionData().contains(";")) {
                        String[] actionData = logEntry.getActionData().split(";");
                        if (actionData != null && actionData.length >= 2) {
                            String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has created a remote link " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " to the instance " + actionData[0] + " at path " + actionData[1] + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                            list.add(entry);
                        }
                    } else {
                        String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has created a remote link " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " to the Location " + logEntry.getActionData() + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                        list.add(entry);
                    }

                } else if (logEntry.getAction() == LogEntry.REMOVE_LINK) {
                    String entry = Boolean.toString(resourceExists(registry, logEntry)) + "|" + logEntry.getUserName() + "|" + logEntry.getUserName() + "|" + " has removed link " + "|" + logEntry.getResourcePath() + "|" + logEntry.getResourcePath() + "|" + " on " + CommonUtil.formatDate(logEntry.getDate()) + ".";
                    list.add(entry);
                }
            }

        }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.LogEntry

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.