Package org.wso2.carbon.logging.service

Examples of org.wso2.carbon.logging.service.LogViewerException


    }

    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

      logIndex = getLogInfo(tenantId, serviceName);
    } else {
      if (isSuperTenantUser()) {
        logIndex = getLocalLogInfo();
      } else {
        throw new LogViewerException(
            "Syslog Appender needs to be configured to view the log files");
      }
    }
    return logIndex;
  }
View Full Code Here

      end = maxLogs;
    }
    try {
      logStream = getInputStream(logFile, tenantId, serviceName);
    } catch (Exception e) {
      throw new LogViewerException("Cannot find the specified file location to the log file",
          e);
    }
    DataInputStream dataInput = new DataInputStream(logStream);
    int index = 1;
    String line;
    try {
      while ((line = dataInput.readLine()) != null) {
        if (index <= end && index > start) {
          logsList.add(line);
        }
        index++;
      }
      dataInput.close();
    } catch (IOException e) {
      throw new LogViewerException("Cannot read the log file", e);
    }
    return logsList.toArray(new String[logsList.size()]);
  }
View Full Code Here

    InputStream is;
    int tenantId = getTenantIdForDomain(tenantDomain);
    try {
      is = getInputStream(logFile, tenantId, serviceName);
    } catch (LogViewerException e) {
      throw new LogViewerException("Cannot read InputStream from the file " + logFile, e);
    }
    try {
      byte[] c = new byte[1024];
      int count = 0;
      int readChars = 0;
      while ((readChars = is.read(c)) != -1) {
        for (int i = 0; i < readChars; ++i) {
          if (c[i] == '\n') {
            ++count;
          }
        }
      }
      return count;
    } catch (IOException e) {
      throw new LogViewerException("Cannot read file size from the " + logFile, e);
    } finally {
      try {
        is.close();
      } catch (IOException e) {
        throw new LogViewerException("Cannot close the input stream " + logFile, e);
      }
    }
  }
View Full Code Here

    InputStream is;
    try {
      int tenantId = getTenantIdForDomain(tenantDomain);
      is = getInputStream(logFile, tenantId, serviceName);
    } catch (Exception e) {
      throw new LogViewerException("Cannot read InputStream from the file " + logFile, e);
    }
    DataInputStream dataInput = new DataInputStream(is);
    try {
      int count = 1;
      try {
        while ((line = dataInput.readLine()) != null) {
          if (count == lineNo) {
            return line;
          }
          count++;
        }
      } catch (IOException e) {
        throw new LogViewerException("Cannot read line number from the " + logFile, e);
      }
    } finally {
      try {
        dataInput.close();
        is.close();
      } catch (IOException e) {
        throw new LogViewerException("Cannot close the input stream " + logFile, e);
      }
    }
    return null;
  }
View Full Code Here

                + LoggingConstants.FILE_SEPARATOR
                + ServerConfiguration.getInstance().getFirstProperty("Name")
                + LoggingConstants.FILE_SEPARATOR;
          }
        } catch (Exception e) {
          throw new LogViewerException("Cannot get log ServerURL for Tenant Service", e);
        }
      } else {
        serverurl = syslogServerURL + LoggingConstants.FILE_SEPARATOR + tenantId
            + LoggingConstants.FILE_SEPARATOR
            + ServerConfiguration.getInstance().getFirstProperty("Name")
View Full Code Here

TOP

Related Classes of org.wso2.carbon.logging.service.LogViewerException

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.