org.apache.xmlrpc.common.XmlRpcStreamRequestConfig类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(179)

本文整理了Java中org.apache.xmlrpc.common.XmlRpcStreamRequestConfig类的一些代码示例,展示了XmlRpcStreamRequestConfig类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlRpcStreamRequestConfig类的具体详情如下:
包路径:org.apache.xmlrpc.common.XmlRpcStreamRequestConfig
类名称:XmlRpcStreamRequestConfig

XmlRpcStreamRequestConfig介绍

[英]Interface of a client configuration for a transport, which is implemented by writing to a stream.
[中]传输的客户端配置接口,通过写入流来实现。

代码示例

代码示例来源:origin: org.apache.xmlrpc/xmlrpc-client

protected boolean isCompressingRequest(XmlRpcStreamRequestConfig pConfig) {
  return pConfig.isEnabledForExtensions()
    && pConfig.isGzipCompressing();
}

代码示例来源:origin: org.sonatype.sisu/sisu-xmlrpc-server

/** Called to prepare the output stream. Typically used for enabling
 * compression, or similar filters.
 * @param pConnection The connection object.
 */
protected OutputStream getOutputStream(ServerStreamConnection pConnection,
                    XmlRpcStreamRequestConfig pConfig, OutputStream pStream) throws IOException {
  if (pConfig.isEnabledForExtensions()  &&  pConfig.isGzipRequesting()) {
    return new GZIPOutputStream(pStream);
  } else {
    return pStream;
  }
}

代码示例来源:origin: xmlrpc/xmlrpc-client

protected void setCompressionHeaders(XmlRpcHttpClientConfig pConfig) {
  if (pConfig.isGzipCompressing()) {
    setRequestHeader("Content-Encoding", "gzip");
  }
  if (pConfig.isGzipRequesting()) {
    setRequestHeader("Accept-Encoding", "gzip");
  }
}

代码示例来源:origin: xmlrpc/xmlrpc-client

protected boolean isCompressingRequest(XmlRpcStreamRequestConfig pConfig) {
  return pConfig.isEnabledForExtensions()
    && pConfig.isGzipCompressing();
}

代码示例来源:origin: org.apache.xmlrpc/xmlrpc-client

protected boolean isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig) {
  return pConfig.isGzipRequesting();
}

代码示例来源:origin: org.sonatype.sisu/sisu-xmlrpc-server

/** Returns, whether the requests content length is required.
 */
protected boolean isContentLengthRequired(XmlRpcStreamRequestConfig pConfig) {
  if (!pConfig.isEnabledForExtensions()) {
    // The spec requires a content-length.
    return true;
  }
  boolean isRequired = !((XmlRpcHttpServerConfig) getConfig()).isContentLengthOptional();
  if(pConfig instanceof XmlRpcHttpRequestConfig) {
    isRequired |= !((XmlRpcHttpRequestConfig)pConfig).isContentLengthOptional();
  }
  return isRequired;
}

代码示例来源:origin: org.apache.xmlrpc/xmlrpc-common

map.put("faultString", pMessage == null ? "" : pMessage);
if (pThrowable != null  &&  extensions  &&  (pConfig instanceof XmlRpcStreamRequestConfig)  &&
    ((XmlRpcStreamRequestConfig) pConfig).isEnabledForExceptions()) {
  try {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();

代码示例来源:origin: org.ogema.drivers/homematic-xmlrpc-ll

protected Object readResponse(XmlRpcStreamRequestConfig pConfig, InputStream pStream) throws XmlRpcException {
    InputSource isource = new InputSource(pStream);
    isource.setEncoding(pConfig.getEncoding()); //jl
    XMLReader xr = newXMLReader();
    XmlRpcResponseParser xp;
    try {
      xp = new XmlRpcResponseParser(pConfig, getClient().getTypeFactory());
      xr.setContentHandler(xp);
      xr.parse(isource);
    } catch (SAXException e) {
      throw new XmlRpcClientException("Failed to parse server's response: " + e.getMessage(), e);
    } catch (IOException e) {
      throw new XmlRpcClientException("Failed to read server's response: " + e.getMessage(), e);
    }
    if (xp.isSuccess()) {
      return xp.getResult();
    }
    Throwable t = xp.getErrorCause();
    if (t == null) {
      throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage());
    }
    if (t instanceof XmlRpcException) {
      throw (XmlRpcException) t;
    }
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    }
    throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage(), t);
  }
}

代码示例来源:origin: xmlrpc/xmlrpc-client

protected boolean isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig) {
  return pConfig.isGzipRequesting();
}

代码示例来源:origin: org.apache.xmlrpc/xmlrpc-server

/** Returns, whether the requests content length is required.
 */
protected boolean isContentLengthRequired(XmlRpcStreamRequestConfig pConfig) {
  if (!pConfig.isEnabledForExtensions()) {
    // The spec requires a content-length.
    return true;
  }
  boolean isRequired = !((XmlRpcHttpServerConfig) getConfig()).isContentLengthOptional();
  if(pConfig instanceof XmlRpcHttpRequestConfig) {
    isRequired |= !((XmlRpcHttpRequestConfig)pConfig).isContentLengthOptional();
  }
  return isRequired;
}

代码示例来源:origin: org.sonatype.sisu/sisu-xmlrpc-common

map.put("faultString", pMessage == null ? "" : pMessage);
if (pThrowable != null  &&  extensions  &&  (pConfig instanceof XmlRpcStreamRequestConfig)  &&
    ((XmlRpcStreamRequestConfig) pConfig).isEnabledForExceptions()) {
  try {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();

代码示例来源:origin: org.sonatype.sisu/sisu-xmlrpc-client

protected boolean isCompressingRequest(XmlRpcStreamRequestConfig pConfig) {
  return pConfig.isEnabledForExtensions()
    && pConfig.isGzipCompressing();
}

代码示例来源:origin: rosjava/rosjava_core

/** Called to prepare the output stream. Typically used for enabling
 * compression, or similar filters.
 * @param pConnection The connection object.
 */
protected OutputStream getOutputStream(ServerStreamConnection pConnection,
                    XmlRpcStreamRequestConfig pConfig, OutputStream pStream) throws IOException {
  if (pConfig.isEnabledForExtensions()  &&  pConfig.isGzipRequesting()) {
    return new GZIPOutputStream(pStream);
  } else {
    return pStream;
  }
}

代码示例来源:origin: rosjava/rosjava_core

protected boolean isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig) {
  return pConfig.isGzipRequesting();
}

代码示例来源:origin: rosjava/rosjava_core

map.put("faultString", pMessage == null ? "" : pMessage);
if (pThrowable != null  &&  extensions  &&  (pConfig instanceof XmlRpcStreamRequestConfig)  &&
    ((XmlRpcStreamRequestConfig) pConfig).isEnabledForExceptions()) {
  try {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();

代码示例来源:origin: org.ogema.drivers/homematic-xmlrpc-ll

protected boolean isCompressingRequest(XmlRpcStreamRequestConfig pConfig) {
  return pConfig.isEnabledForExtensions()
    && pConfig.isGzipCompressing();
}

代码示例来源:origin: org.apache.xmlrpc/xmlrpc-server

/** Called to prepare the output stream. Typically used for enabling
 * compression, or similar filters.
 * @param pConnection The connection object.
 */
protected OutputStream getOutputStream(ServerStreamConnection pConnection,
                    XmlRpcStreamRequestConfig pConfig, OutputStream pStream) throws IOException {
  if (pConfig.isEnabledForExtensions()  &&  pConfig.isGzipRequesting()) {
    return new GZIPOutputStream(pStream);
  } else {
    return pStream;
  }
}

代码示例来源:origin: rosjava/rosjava_core

protected boolean isCompressingRequest(XmlRpcStreamRequestConfig pConfig) {
  return pConfig.isEnabledForExtensions()
    && pConfig.isGzipCompressing();
}

代码示例来源:origin: org.sonatype.sisu/sisu-xmlrpc-server

protected OutputStream getOutputStream(ServerStreamConnection pConnection, XmlRpcStreamRequestConfig pConfig, OutputStream pStream) throws IOException {
    if (pConfig.isEnabledForExtensions()  &&  pConfig.isGzipRequesting()) {
      setResponseHeader(pConnection, "Content-Encoding", "gzip");
    }
    return super.getOutputStream(pConnection, pConfig, pStream);
  }
}

代码示例来源:origin: rosjava/rosjava_core

protected InputStream getInputStream(XmlRpcStreamRequestConfig pConfig,
                   ServerStreamConnection pConnection) throws IOException {
  InputStream istream = pConnection.newInputStream();
  if (pConfig.isEnabledForExtensions()  &&  pConfig.isGzipCompressing()) {
    istream = new GZIPInputStream(istream);
  }
  return istream;
}

相关文章