use of com.microsoft.azure.docker.model.DockerContainer in project azure-tools-for-java by Microsoft.
the class DockerContainerNode method refreshItems.
@Override
protected void refreshItems() throws AzureCmdException {
try {
Map<String, DockerImage> dockerImages = AzureDockerImageOps.getImages(dockerHost);
Map<String, DockerContainer> dockerContainers = AzureDockerContainerOps.getContainers(dockerHost);
AzureDockerContainerOps.setContainersAndImages(dockerContainers, dockerImages);
dockerHost.dockerImages = dockerImages;
if (dockerContainers != null) {
DockerContainer updatedDockerContainer = dockerContainers.get(dockerContainer.name);
if (updatedDockerContainer != null) {
dockerContainer = updatedDockerContainer;
setDockerContainerIconPath();
}
}
} catch (Exception e) {
DefaultLoader.getUIHelper().logError(e.getMessage(), e);
}
}
use of com.microsoft.azure.docker.model.DockerContainer in project azure-tools-for-java by Microsoft.
the class DockerHostNode method refreshDockerHostInstance.
private void refreshDockerHostInstance(VirtualMachine vm) {
if (vm != null) {
DockerHost updatedDockerHost = AzureDockerVMOps.getDockerHost(vm, dockerManager.getDockerVaultsMap());
if (updatedDockerHost != null) {
updatedDockerHost.sid = dockerHost.sid;
updatedDockerHost.hostVM.sid = dockerHost.hostVM.sid;
if (updatedDockerHost.certVault == null) {
updatedDockerHost.certVault = dockerHost.certVault;
updatedDockerHost.hasPwdLogIn = dockerHost.hasPwdLogIn;
updatedDockerHost.hasSSHLogIn = dockerHost.hasSSHLogIn;
updatedDockerHost.isTLSSecured = dockerHost.isTLSSecured;
}
dockerManager.updateDockerHost(updatedDockerHost);
dockerHost = updatedDockerHost;
if (dockerHost.certVault != null) {
try {
// it might throw here if the credentials are invalid
Map<String, DockerImage> dockerImages = AzureDockerImageOps.getImages(dockerHost);
Map<String, DockerContainer> dockerContainers = AzureDockerContainerOps.getContainers(dockerHost);
AzureDockerContainerOps.setContainersAndImages(dockerContainers, dockerImages);
dockerHost.dockerImages = dockerImages;
} catch (Exception e) {
DefaultLoader.getUIHelper().logError(e.getMessage(), e);
}
}
setIconPath(getDockerHostIcon());
for (DockerImage dockerImage : updatedDockerHost.dockerImages.values()) {
try {
addChildNode(new DockerImageNode(this, dockerManager, updatedDockerHost, dockerImage));
} catch (Exception ignored) {
}
}
}
}
}
use of com.microsoft.azure.docker.model.DockerContainer in project azure-tools-for-java by Microsoft.
the class DockerImageNode method refreshItems.
@Override
protected void refreshItems() {
try {
Map<String, DockerContainer> dockerContainers = AzureDockerContainerOps.getContainers(dockerHost);
AzureDockerContainerOps.setContainersAndImages(dockerContainers, dockerHost.dockerImages);
if (dockerHost.dockerImages != null) {
dockerImage = dockerHost.dockerImages.get(AzureDockerImageOps.getDockerImageMapKey(dockerImage));
if (dockerImage != null) {
for (DockerContainer dockerContainer : dockerImage.containers.values()) {
addChildNode(new DockerContainerNode(this, dockerManager, dockerHost, dockerContainer));
}
}
}
} catch (Exception e) {
DefaultLoader.getUIHelper().logError(e.getMessage(), e);
}
}
Aggregations