本文整理了Java中io.cattle.platform.core.model.Account.getRemoved()
方法的一些代码示例,展示了Account.getRemoved()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Account.getRemoved()
方法的具体详情如下:
包路径:io.cattle.platform.core.model.Account
类名称:Account
方法名:getRemoved
[英]Getter for cattle.account.removed
.
[中]cattle.account.removed
的Getter。
代码示例来源:origin: rancher/cattle
@Override
public Account validateToken(String password) {
String[] parts = password.split(":");
if (parts.length != 3) {
return null;
}
Date date = null;
try {
long time = Long.parseLong(parts[1]);
if (System.currentTimeMillis() > (time + RegistrationToken.getAllowedTime())) {
return null;
}
date = new Date(time);
} catch (NumberFormatException e) {
return null;
}
Credential cred = authDao.getCredential(parts[0]);
if (cred == null) {
return null;
}
String token = RegistrationToken.createToken(cred.getPublicValue(), cred.getSecretValue(), date);
if (!password.equals(token)) {
return null;
}
Account account = objectManager.loadResource(Account.class, cred.getAccountId());
if (account == null || !accountDao.isActiveAccount(account) || account.getRemoved() != null) {
return null;
}
return account;
}
代码示例来源:origin: rancher/cattle
protected void startStacks(Account account) throws IOException {
if (account.getRemoved() != null) {
return;
}
List<Long> createdStackIds = DataAccessor.fieldLongList(account, AccountConstants.FIELD_CREATED_STACKS);
List<Long> startedStackIds = DataAccessor.fieldLongList(account, AccountConstants.FIELD_STARTED_STACKS);
if (!startedStackIds.isEmpty() || createdStackIds.isEmpty()) {
return;
}
if (!hostDao.hasActiveHosts(account.getId())) {
return;
}
startedStackIds = new ArrayList<>();
for (Long stackId : createdStackIds) {
Stack stack = objectManager.loadResource(Stack.class, stackId);
if (stack == null) {
continue;
}
stack = resourceMonitor.waitForNotTransitioning(stack);
if (CommonStatesConstants.ACTIVE.equals(stack.getState())) {
for (Service service : objectManager.find(Service.class, SERVICE.STACK_ID, stackId, SERVICE.REMOVED, null)) {
processManager.scheduleStandardProcess(StandardProcess.ACTIVATE, service, null);
}
}
startedStackIds.add(stackId);
}
objectManager.setFields(account, AccountConstants.FIELD_STARTED_STACKS, startedStackIds);
}
代码示例来源:origin: rancher/cattle
if (account != null && account.getRemoved() == null) {
deactivateThenScheduleRemove(account, state.getData());
for (Long accountId : authedRoleAccountIds) {
account = objectManager.loadResource(Account.class, accountId);
if (account != null && account.getRemoved() == null) {
deactivateThenScheduleRemove(account, state.getData());
代码示例来源:origin: rancher/cattle
protected void process(long accountId) throws IOException {
Account account = objectManager.loadResource(Account.class, accountId);
if (account == null || account.getRemoved() != null) {
return;
代码示例来源:origin: rancher/cattle
/**
* {@inheritDoc}
*/
@Override
public void from(io.cattle.platform.core.model.Account from) {
setId(from.getId());
setName(from.getName());
setKind(from.getKind());
setUuid(from.getUuid());
setDescription(from.getDescription());
setState(from.getState());
setCreated(from.getCreated());
setRemoved(from.getRemoved());
setRemoveTime(from.getRemoveTime());
setData(from.getData());
setExternalId(from.getExternalId());
setExternalIdType(from.getExternalIdType());
setHealthState(from.getHealthState());
setProjectTemplateId(from.getProjectTemplateId());
setDefaultNetworkId(from.getDefaultNetworkId());
setVersion(from.getVersion());
setRevision(from.getRevision());
}
内容来源于网络,如有侵权,请联系作者删除!