本文整理匯總了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();