Package org.serviceconnector.web.cmd

Examples of org.serviceconnector.web.cmd.WebCommandException


   *             the exception
   */
  private void downloadAndReplace(XMLStreamWriter writer, IWebRequest request) throws Exception {
    String serviceName = request.getParameter("service");
    if (serviceName == null) {
      throw new WebCommandException("service is missing");
    }
    ServiceRegistry serviceRegistry = AppContext.getServiceRegistry();
    Service service = serviceRegistry.getService(serviceName);
    if (service == null) {
      throw new WebCommandException("service " + serviceName + " not found");
    }
    if (service instanceof FileService == false && service instanceof CascadedFileService == false) {
      throw new WebCommandException("service " + serviceName + " is not a file or cascaded file service");
    }
    writer.writeStartElement("service");
    writer.writeCharacters(serviceName);
    writer.writeEndElement();
    List<String> fileList = request.getParameterList("file");
View Full Code Here


   *             the exception
   */
  private void uploadLogAndDumpFiles(XMLStreamWriter writer, IWebRequest request) throws Exception {
    String serviceName = request.getParameter("service");
    if (serviceName == null) {
      throw new WebCommandException("service is missing");
    }
    String sdate = request.getParameter("date");
    Date date = DateTimeUtility.getCurrentDate();
    if (sdate != null && sdate.isEmpty() == false) {
      date = WebUtil.getXMLDateFromString(sdate);
    }
    ServiceRegistry serviceRegistry = AppContext.getServiceRegistry();
    Service service = serviceRegistry.getService(serviceName);
    if (service == null) {
      throw new WebCommandException("service " + serviceName + " not found");
    }
    if (service instanceof FileService == false && service instanceof CascadedFileService == false) {
      throw new WebCommandException("service " + serviceName + " is not a file or cascaded file service");
    }
    writer.writeStartElement("service");
    writer.writeCharacters(serviceName);
    writer.writeEndElement();
    writer.writeStartElement("date");
View Full Code Here

   * @throws Exception
   *             the exception
   */
  private String uploadLogAndDumpFiles(Service service, String serviceName, Date date) throws Exception {
    if (!(service instanceof FileService || service instanceof CascadedFileService)) {
      throw new WebCommandException("upload current log and dump files, service is not a file or cascaded file service");
    }
    SCClient client = null;
    // try to connect client
    client = connectClientToService(service);
    // client gets destroyed at the end of upload inside the uploadLogFiles method
    // has to be inside because the upload works asynchronous
    if (client == null) {
      throw new WebCommandException("upload current log and dump files, client cannot connect and attach to local responder");
    }
    String fileName = this.uploadLogAndDumpFiles(client, service, serviceName, date);
    return fileName;
  }
View Full Code Here

   *             the exception
   */
  private void downloadAndReplace(XMLStreamWriter writer, IWebRequest request) throws Exception {
    String serviceName = request.getParameter("service");
    if (serviceName == null) {
      throw new WebCommandException("service is missing");
    }
    ServiceRegistry serviceRegistry = AppContext.getServiceRegistry();
    Service service = serviceRegistry.getService(serviceName);
    if (service == null) {
      throw new WebCommandException("service " + serviceName + " not found");
    }
    if (service instanceof FileService == false && service instanceof CascadedFileService == false) {
      throw new WebCommandException("service " + serviceName + " is not a file or cascaded file service");
    }
    writer.writeStartElement("service");
    writer.writeCharacters(serviceName);
    writer.writeEndElement();
    List<String> fileList = request.getParameterList("file");
View Full Code Here

   *             the exception
   */
  private void uploadLogAndDumpFiles(XMLStreamWriter writer, IWebRequest request) throws Exception {
    String serviceName = request.getParameter("service");
    if (serviceName == null) {
      throw new WebCommandException("service is missing");
    }
    String sdate = request.getParameter("date");
    Date date = DateTimeUtility.getCurrentDate();
    if (sdate != null && sdate.isEmpty() == false) {
      date = WebUtil.getXMLDateFromString(sdate);
    }
    ServiceRegistry serviceRegistry = AppContext.getServiceRegistry();
    Service service = serviceRegistry.getService(serviceName);
    if (service == null) {
      throw new WebCommandException("service " + serviceName + " not found");
    }
    if (service instanceof FileService == false && service instanceof CascadedFileService == false) {
      throw new WebCommandException("service " + serviceName + " is not a file or cascaded file service");
    }
    writer.writeStartElement("service");
    writer.writeCharacters(serviceName);
    writer.writeEndElement();
    writer.writeStartElement("date");
View Full Code Here

   * @throws Exception
   *             the exception
   */
  private String uploadLogAndDumpFiles(Service service, String serviceName, Date date) throws Exception {
    if (!(service instanceof FileService || service instanceof CascadedFileService)) {
      throw new WebCommandException("upload current log and dump files, service is not a file or cascaded file service");
    }
    SCClient client = null;
    // try to connect client
    client = connectClientToService(service);
    // client gets destroyed at the end of upload inside the uploadLogFiles method
    // has to be inside because the upload works asynchronous
    if (client == null) {
      throw new WebCommandException("upload current log and dump files, client cannot connect and attach to local responder");
    }
    String fileName = this.uploadLogAndDumpFiles(client, service, serviceName, date);
    return fileName;
  }
View Full Code Here

TOP

Related Classes of org.serviceconnector.web.cmd.WebCommandException

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.