Package tokbox.com.opentok.exception

Examples of tokbox.com.opentok.exception.OpenTokException


      inner_builder.append(data_string_builder.toString());

      token_string_builder.append(Base64.encode(inner_builder.toString()));

    }catch (java.security.SignatureException e) {
        throw new OpenTokException(e.getMessage());
    }

    return token_string_builder.toString();
  }
View Full Code Here


    public OpenTokSession create_session(final String location, final Map<String, String> params) throws OpenTokException {
    params.put("location", location);
    final TokBoxXML xmlResponse = this.do_request("/session/create", params);
    if(xmlResponse.hasElement("error", "Errors")) {
      throw new OpenTokException("Unable to create session");
    }
    final String session_id = xmlResponse.getElementValue("session_id", "Session");
    return new OpenTokSession(session_id);
  }
View Full Code Here

  public TokBoxXML(final String xmlString) throws OpenTokException{
   
    try {
      this.xml = TokBoxUtils.setupDocument(xmlString);
    } catch(IOException ioe) {
      throw new OpenTokException(ioe.toString())
    } catch(ParserConfigurationException pce) {
      throw new OpenTokException(pce.toString());
    } catch(SAXException saxe) {
      throw new OpenTokException(saxe.toString());
    }
  }
View Full Code Here

    return token;
  }

  public static Document setupDocument(final String xmlResponse) throws ParserConfigurationException, SAXException, IOException, OpenTokException {
    if(null == xmlResponse) {
      throw new OpenTokException("There was an error in retrieving the response. Please make sure that you are pointing to the correct server");
    }

    final DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder;
    Document document;
   
    builder = dbFactory.newDocumentBuilder();
    document = builder.parse(new InputSource(new StringReader(xmlResponse)));
    final Node errorNodes = TokBoxUtils.parseXML("error", document.getElementsByTagName("error"));

    if(null != errorNodes) {
      throw new OpenTokException(xmlResponse);
    }

    return document;
  }
View Full Code Here

TOP

Related Classes of tokbox.com.opentok.exception.OpenTokException

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.