本文整理汇总了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 );
}
示例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 );
}
示例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 );
}