当前位置: 首页>>代码示例>>Java>>正文


Java WebClient.put方法代码示例

本文整理汇总了Java中org.apache.cxf.jaxrs.client.WebClient.put方法的典型用法代码示例。如果您正苦于以下问题:Java WebClient.put方法的具体用法?Java WebClient.put怎么用?Java WebClient.put使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cxf.jaxrs.client.WebClient的用法示例。


在下文中一共展示了WebClient.put方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: joinOrUpdateP2PSwarm

import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
public void joinOrUpdateP2PSwarm( final P2PConfig config ) throws PeerException
{
    WebClient client = null;
    Response response;
    try
    {
        remotePeer.checkRelation();
        String path = "/p2ptunnel";

        client = WebClientBuilder.buildPeerWebClient( peerInfo, path, provider );

        client.type( MediaType.APPLICATION_JSON );
        response = client.put( config );
    }
    catch ( Exception e )
    {
        LOG.error( e.getMessage(), e );
        throw new PeerException( String.format( "Error joining/updating P2P swarm: %s", e.getMessage() ) );
    }
    finally
    {
        WebClientBuilder.close( client );
    }

    WebClientBuilder.checkResponse( response );
}
 
开发者ID:subutai-io,项目名称:base,代码行数:27,代码来源:PeerWebClient.java

示例2: updateEnvironmentPubKey

import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
public void updateEnvironmentPubKey( PublicKeyContainer publicKeyContainer ) throws PeerException
{
    WebClient client = null;
    Response response;
    try
    {
        remotePeer.checkRelation();
        String path = "/pek";

        client = WebClientBuilder.buildPeerWebClient( peerInfo, path, provider );

        client.type( MediaType.APPLICATION_JSON );
        client.accept( MediaType.APPLICATION_JSON );
        response = client.put( publicKeyContainer );
    }
    catch ( Exception e )
    {
        LOG.error( e.getMessage(), e );
        throw new PeerException( String.format( "Error updating peer environment key: %s", e.getMessage() ) );
    }
    finally
    {
        WebClientBuilder.close( client );
    }

    WebClientBuilder.checkResponse( response );
}
 
开发者ID:subutai-io,项目名称:base,代码行数:28,代码来源:PeerWebClient.java

示例3: generateSshKeysForEnvironment

import org.apache.cxf.jaxrs.client.WebClient; //导入方法依赖的package包/类
public SshKeys generateSshKeysForEnvironment( final EnvironmentId environmentId,
                                              final SshEncryptionType sshKeyType ) throws PeerException
{
    WebClient client = null;
    Response response;
    try
    {
        String path = String.format( "/%s/containers/sshkeys/%s", environmentId.getId(), sshKeyType );

        client = WebClientBuilder.buildEnvironmentWebClient( peerInfo, path, provider );

        client.accept( MediaType.APPLICATION_JSON );

        response = client.put( null );
    }
    catch ( Exception e )
    {
        LOG.error( e.getMessage(), e );
        throw new PeerException( "Error generating ssh keys in environment: " + e.getMessage() );
    }
    finally
    {
        WebClientBuilder.close( client );
    }

    return WebClientBuilder.checkResponse( response, SshKeys.class );
}
 
开发者ID:subutai-io,项目名称:base,代码行数:28,代码来源:EnvironmentWebClient.java


注:本文中的org.apache.cxf.jaxrs.client.WebClient.put方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。