本文整理汇总了Java中com.github.dockerjava.api.command.AuthCmd类的典型用法代码示例。如果您正苦于以下问题:Java AuthCmd类的具体用法?Java AuthCmd怎么用?Java AuthCmd使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AuthCmd类属于com.github.dockerjava.api.command包,在下文中一共展示了AuthCmd类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import com.github.dockerjava.api.command.AuthCmd; //导入依赖的package包/类
@Override
protected AuthResponse execute(AuthCmd command) {
WebTarget webResource = getBaseResource().path("/auth");
LOGGER.trace("POST: {}", webResource);
Response response = webResource.request().accept(MediaType.APPLICATION_JSON)
.post(entity(command.getAuthConfig(), MediaType.APPLICATION_JSON));
if (response.getStatus() == 401) {
throw new UnauthorizedException("Unauthorized");
}
return response.readEntity(AuthResponse.class);
}
示例2: execute
import com.github.dockerjava.api.command.AuthCmd; //导入依赖的package包/类
@Override
protected AuthResponse execute(AuthCmd command) {
WebTarget webResource = getBaseResource().path("/auth");
LOGGER.trace("POST: {}", webResource);
return webResource.request().accept(MediaType.APPLICATION_JSON)
.post(command.getAuthConfig(), new TypeReference<AuthResponse>() {
});
}
示例3: createAuthCmdExec
import com.github.dockerjava.api.command.AuthCmd; //导入依赖的package包/类
@Override
public AuthCmd.Exec createAuthCmdExec() {
return new AuthCmdExec(getBaseResource(), getDockerClientConfig());
}
示例4: authCmd
import com.github.dockerjava.api.command.AuthCmd; //导入依赖的package包/类
/**
* Authenticate with the server, useful for checking authentication.
*/
@Override
public AuthCmd authCmd() {
return new AuthCmdImpl(getDockerCmdExecFactory().createAuthCmdExec(), authConfig());
}
示例5: AuthCmdImpl
import com.github.dockerjava.api.command.AuthCmd; //导入依赖的package包/类
public AuthCmdImpl(AuthCmd.Exec exec, AuthConfig authConfig) {
super(exec);
withAuthConfig(authConfig);
}
示例6: withAuthConfig
import com.github.dockerjava.api.command.AuthCmd; //导入依赖的package包/类
public AuthCmd withAuthConfig(AuthConfig authConfig) {
this.authConfig = authConfig;
return this;
}
示例7: executeAuthRequest
import com.github.dockerjava.api.command.AuthCmd; //导入依赖的package包/类
/**
* Produces a Authorization request
*
* @param client
* @param message
* @return
*/
private AuthCmd executeAuthRequest(DockerClient client, Message message) {
LOGGER.debug("Executing Docker Auth Request");
AuthCmd authCmd = client.authCmd();
AuthConfig authConfig = client.authConfig();
if (authCmd != null) {
authCmd.withAuthConfig(authConfig);
}
return authCmd;
}
示例8: authCmd
import com.github.dockerjava.api.command.AuthCmd; //导入依赖的package包/类
/**
* Authenticate with the server, useful for checking authentication.
*/
AuthCmd authCmd();