Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
import org.zstack.header.errorcode.ErrorCode;

/**
* Created by LiangHanYu on 2022/6/9 18:30
* 内存快照验证扩展点
*
* <p>触发时机:创建内存快照前,验证 VM 是否符合条件</p>
* <p>调用位置:VolumeSnapshotGroupCreator.validate()</p>
*
* <h3>使用场景:</h3>
* <p>各模块通过此扩展点检查 VM 的外部设备或网络引用
* 是否与内存快照兼容。</p>
*
* @since 5.0.0
Comment on lines +6 to +15
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Javadoc 应使用英文编写

根据编码规范,代码中不应包含中文,包括注释和错误消息都应当使用正确的、无拼写错误的英文来编写。请将此 Javadoc 翻译为英文。

建议的英文 Javadoc
-/**
- * 内存快照验证扩展点
- *
- * <p>触发时机:创建内存快照前,验证 VM 是否符合条件</p>
- * <p>调用位置:VolumeSnapshotGroupCreator.validate()</p>
- *
- * <h3>使用场景:</h3>
- * <p>各模块通过此扩展点检查 VM 的外部设备或网络引用
- * 是否与内存快照兼容。</p>
- *
- * `@since` 5.0.0
- */
+/**
+ * Extension point for validating memory snapshot creation.
+ *
+ * <p>Trigger: Before creating a memory snapshot, validate whether the VM meets the conditions.</p>
+ * <p>Call site: VolumeSnapshotGroupCreator.validate()</p>
+ *
+ * <h3>Usage:</h3>
+ * <p>Modules use this extension point to check whether the VM's external devices
+ * or network references are compatible with memory snapshots.</p>
+ *
+ * `@since` 5.0.0
+ */

根据编码规范:代码里不应当有中文,包括报错、注释等都应当使用正确的、无拼写错误的英文来写。

🤖 Prompt for AI Agents
In
`@header/src/main/java/org/zstack/header/storage/snapshot/group/MemorySnapshotValidatorExtensionPoint.java`
around lines 6 - 15, Translate the Javadoc for
MemorySnapshotValidatorExtensionPoint into clear, idiomatic English (replace the
current Chinese text) so it documents the extension point purpose, trigger
timing (before creating a memory snapshot), the invocation site
(VolumeSnapshotGroupCreator.validate()), and usage scenario (modules check VM
external devices or network references for compatibility with memory snapshots);
keep the `@since` tag and ensure no Chinese remains in the comment.

*/
public interface MemorySnapshotValidatorExtensionPoint {
default ErrorCode checkVmWhereMemorySnapshotExistExternalDevices(String VmInstanceUuid) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
import org.zstack.header.errorcode.ErrorCode;
import org.zstack.header.network.l3.L3NetworkInventory;

/**
* @deprecated This interface has no implementations and should be removed.
* Use {@link org.zstack.header.vm.extensions.VmInstanceDetachNicExtensionPoint} instead.
*/
@Deprecated
public interface DetachNicExtensionPoint {
ErrorCode validateDetachNicByDriverTypeAndClusterType(L3NetworkInventory l3, VmInstanceInventory vm);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

import java.util.List;

/**
* 内存快照资源配置归档扩展点
*
* <p>触发时机:创建内存快照时,归档与 VM 相关的资源配置</p>
* <p>调用位置:MemorySnapshotManager.archiveResourceConfig()</p>
*
* <h3>使用场景:</h3>
* <p>当 VM 执行内存快照时,各模块通过此扩展点提供需要归档的资源配置,
* 以便恢复快照时可以同时恢复相关配置状态。</p>
*
* @since 5.0.0
*/
Comment on lines +5 to +16
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Javadoc 应使用英文编写

根据编码规范,代码中不应包含中文,包括注释和错误消息都应当使用正确的、无拼写错误的英文来编写。请将此 Javadoc 翻译为英文。

建议的英文 Javadoc
-/**
- * 内存快照资源配置归档扩展点
- *
- * <p>触发时机:创建内存快照时,归档与 VM 相关的资源配置</p>
- * <p>调用位置:MemorySnapshotManager.archiveResourceConfig()</p>
- *
- * <h3>使用场景:</h3>
- * <p>当 VM 执行内存快照时,各模块通过此扩展点提供需要归档的资源配置,
- * 以便恢复快照时可以同时恢复相关配置状态。</p>
- *
- * `@since` 5.0.0
- */
+/**
+ * Extension point for archiving resource configurations during memory snapshot creation.
+ *
+ * <p>Trigger: When creating a memory snapshot, archive VM-related resource configurations.</p>
+ * <p>Call site: MemorySnapshotManager.archiveResourceConfig()</p>
+ *
+ * <h3>Usage:</h3>
+ * <p>When a VM performs a memory snapshot, modules provide resource configurations
+ * to be archived via this extension point, allowing related configuration states
+ * to be restored when the snapshot is recovered.</p>
+ *
+ * `@since` 5.0.0
+ */

根据编码规范:代码里不应当有中文,包括报错、注释等都应当使用正确的、无拼写错误的英文来写。

🤖 Prompt for AI Agents
In
`@header/src/main/java/org/zstack/header/vm/ResourceConfigMemorySnapshotExtensionPoint.java`
around lines 5 - 16, Translate the Javadoc for the
ResourceConfigMemorySnapshotExtensionPoint interface from Chinese to clear,
idiomatic English while preserving the structure and tags (including the
description, trigger/call location lines, usage scenario paragraph, and the
`@since` 5.0.0 tag); update the comment text to explain that this extension point
archives VM-related resource configuration when creating memory snapshots, is
invoked by MemorySnapshotManager.archiveResourceConfig(), and that modules
should provide configuration to be restored with the snapshot. Ensure no Chinese
remains and keep formatting and annotations intact.

public interface ResourceConfigMemorySnapshotExtensionPoint {
List<ArchiveResourceConfigBundle.ResourceConfigBundle> getNeedToArchiveResourceConfig(String resourceUuid);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import org.zstack.header.network.l3.L3NetworkInventory;

/**
* Created by xing5 on 2016/4/18.
* @deprecated Use {@link org.zstack.header.vm.extensions.VmInstanceAttachL3NetworkExtensionPoint#afterAttachL3Network} instead.
*/
@Deprecated
public interface VmAfterAttachL3NetworkExtensionPoint {
void vmAfterAttachL3Network(VmInstanceInventory vm, L3NetworkInventory l3);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
import org.zstack.header.core.NoErrorCompletion;

/**
* Created by LiangHanYu on 2022/4/13 13:24
* @deprecated Use {@link org.zstack.header.vm.extensions.VmInstanceAttachL3NetworkExtensionPoint#afterAttachL3Network} instead.
*/
@Deprecated
public interface VmAfterAttachNicExtensionPoint {
void afterAttachNic(String nicUuid, VmInstanceInventory vmInstanceInventory, Completion completion);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@


/**
* Created by Mei Lei on 8/23/16.
* @deprecated Use {@link org.zstack.header.vm.extensions.VmExpungeExtensionPoint#afterExpunge} instead.
*/
@Deprecated
public interface VmAfterExpungeExtensionPoint {
void vmAfterExpunge(VmInstanceInventory inv);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import org.zstack.header.network.l3.L3NetworkInventory;

/**
* Created by xing5 on 2016/4/18.
* @deprecated Use {@link org.zstack.header.vm.extensions.VmInstanceAttachL3NetworkExtensionPoint#beforeAttachL3Network} instead.
*/
@Deprecated
public interface VmBeforeAttachL3NetworkExtensionPoint {
void vmBeforeAttachL3Network(VmInstanceInventory vm, L3NetworkInventory l3);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@


/**
* Created by Mei Lei on 8/23/16.
* @deprecated Use {@link org.zstack.header.vm.extensions.VmExpungeExtensionPoint#beforeExpunge} instead.
*/
@Deprecated
public interface VmBeforeExpungeExtensionPoint {
void vmBeforeExpunge(VmInstanceInventory inv);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import org.zstack.header.errorcode.ErrorCode;

/**
* Created by frank on 7/18/2015.
* @deprecated Use {@link org.zstack.header.vm.extensions.VmInstanceDetachNicExtensionPoint} instead.
*/
@Deprecated
public interface VmDetachNicExtensionPoint {
void preDetachNic(VmNicInventory nic);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
import org.zstack.header.network.l3.L3NetworkInventory;

/**
* Created by xing5 on 2016/4/18.
* @deprecated Use {@link org.zstack.header.vm.extensions.VmInstanceAttachL3NetworkExtensionPoint#failedToAttachL3Network} instead.
*/
@Deprecated
public interface VmFailToAttachL3NetworkExtensionPoint {
void vmFailToAttachL3Network(VmInstanceInventory vm, L3NetworkInventory l3, ErrorCode error);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package org.zstack.header.vm;

/**
* @deprecated This interface has no implementations and should be removed.
* Use {@link org.zstack.header.vm.extensions.VmInstanceAttachL3NetworkExtensionPoint} instead.
*/
@Deprecated
public interface VmInstanceAttachNicExtensionPoint {
void afterAttachNicToVm(VmNicInventory nic);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

import org.zstack.header.errorcode.ErrorCode;

/**
* @deprecated Use {@link org.zstack.header.vm.extensions.VmDestroyExtensionPoint} instead.
*/
@Deprecated
public interface VmInstanceDestroyExtensionPoint {
String preDestroyVm(VmInstanceInventory inv);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package org.zstack.header.vm;

/**
* Created by Qi Le on 2019-08-21
* @deprecated Use {@link org.zstack.header.vm.extensions.VmDbDeleteContext} with a single-phase extension point instead.
*/
@Deprecated
Comment on lines 3 to +6
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

弃用引用不完整:与 VmJustBeforeDeleteFromDbExtensionPoint 存在相同问题。

同样引用了上下文类 VmDbDeleteContext 而非具体的扩展点接口。建议统一修复,指向明确的替代扩展点接口。

🤖 Prompt for AI Agents
In
`@header/src/main/java/org/zstack/header/vm/VmJustAfterDeleteFromDbExtensionPoint.java`
around lines 3 - 6, The `@deprecated` Javadoc in
VmJustAfterDeleteFromDbExtensionPoint currently links to the context class
VmDbDeleteContext instead of the actual single-phase extension point interface;
update the `@deprecated` tag to point to the concrete replacement extension point
in org.zstack.header.vm.extensions (replace the VmDbDeleteContext reference with
the correct extension-point interface name), and apply the identical change to
VmJustBeforeDeleteFromDbExtensionPoint so both deprecation comments reference
the explicit replacement interface rather than the context class.

public interface VmJustAfterDeleteFromDbExtensionPoint {
void vmJustAfterDeleteFromDbExtensionPoint(VmInstanceInventory inv, String accountUuid);
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package org.zstack.header.vm;

/**
* Created by xing5 on 2017/6/26.
* @deprecated Use {@link org.zstack.header.vm.extensions.VmDbDeleteContext} with a single-phase extension point instead.
*/
@Deprecated
Comment on lines 3 to +6
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for VmDbDeleteContext and related extension point interfaces
echo "=== Searching for VmDbDeleteContext ==="
fd -e java . | xargs rg -l "VmDbDeleteContext" | head -20

echo -e "\n=== Searching for VmDbDelete*ExtensionPoint interfaces ==="
fd -e java . | xargs rg "interface.*VmDbDelete.*ExtensionPoint" -A 2

echo -e "\n=== Checking VmJustBeforeDeleteFromDbExtensionPoint ==="
fd -e java . -name "*VmJustBeforeDeleteFromDb*" -exec cat {} \;

echo -e "\n=== Comparing with similar deprecation patterns ==="
fd -e java . | xargs rg "@Deprecated" -B 2 | grep -A 2 "VmDeleteExtensionPoint\|VmDbDelete" | head -30

Repository: MatheMatrix/zstack

Length of output: 1558


🏁 Script executed:

#!/bin/bash
# Get the full content of VmJustBeforeDeleteFromDbExtensionPoint
echo "=== Full content of VmJustBeforeDeleteFromDbExtensionPoint ==="
cat header/src/main/java/org/zstack/header/vm/VmJustBeforeDeleteFromDbExtensionPoint.java

echo -e "\n=== Full content of VmDbDeleteContext ==="
cat header/src/main/java/org/zstack/header/vm/extensions/VmDbDeleteContext.java

echo -e "\n=== Check for all extension points related to VmDelete ==="
fd -e java . | xargs rg "interface.*ExtensionPoint" | grep -i "vmdelete\|vmdestroy\|vm.*delete" | head -20

echo -e "\n=== Check VmJustAfterDeleteFromDbExtensionPoint ==="
cat header/src/main/java/org/zstack/header/vm/VmJustAfterDeleteFromDbExtensionPoint.java

Repository: MatheMatrix/zstack

Length of output: 2425


🏁 Script executed:

#!/bin/bash
# Check VmDestroyExtensionPoint to see what it looks like
echo "=== Full content of VmDestroyExtensionPoint ==="
cat header/src/main/java/org/zstack/header/vm/extensions/VmDestroyExtensionPoint.java

echo -e "\n=== Search for VmDbDeleteExtensionPoint ==="
fd -e java . | xargs rg "VmDbDeleteExtensionPoint" 2>/dev/null || echo "Not found"

echo -e "\n=== Search for extension points that use VmDbDeleteContext ==="
fd -e java . | xargs rg "VmDbDeleteContext" -A 5 -B 5

Repository: MatheMatrix/zstack

Length of output: 4431


🏁 Script executed:

#!/bin/bash
# Search for where VmJustBeforeDeleteFromDbExtensionPoint is actually used/implemented
echo "=== Usages of VmJustBeforeDeleteFromDbExtensionPoint ==="
fd -e java . | xargs rg "VmJustBeforeDeleteFromDbExtensionPoint" | grep -v "\.java:-"

echo -e "\n=== Look for recent VM delete/destroy extension point implementations ==="
fd -e java . | xargs rg "implements.*Delete.*ExtensionPoint\|implements.*Destroy.*ExtensionPoint" | head -20

echo -e "\n=== Search for pattern: what is the actual replacement mentioned in code ==="
fd -e java . | xargs rg "single-phase extension point" -B 3 -A 3

Repository: MatheMatrix/zstack

Length of output: 3216


🏁 Script executed:

#!/bin/bash
# Check if there's any mention of what to use instead or if there's documentation
echo "=== Check for VmDbDelete* in extensions package ==="
fd -e java . header/src/main/java/org/zstack/header/vm/extensions/ | xargs ls -la

echo -e "\n=== Check VmDestroyContext to see how it differs ==="
find . -name "VmDestroyContext.java" -exec cat {} \;

echo -e "\n=== Check if there are any recent changes or comments about the replacement ==="
fd -e java . | xargs rg "VmDestroyExtensionPoint\|VmDbDelete" -B 2 -A 2 | grep -E "(TODO|FIXME|NOTE|phase)" | head -20

Repository: MatheMatrix/zstack

Length of output: 2470


🏁 Script executed:

#!/bin/bash
# Check if VmDbDeleteExtensionPoint is planned/mentioned anywhere
echo "=== Search for any TODO, FIXME, or future references to VmDbDelete ==="
fd -e java . | xargs rg "VmDbDelete" -B 3 -A 3

echo -e "\n=== Check git history or comments about when VmDbDeleteContext was added ==="
git log --oneline --all -- "header/src/main/java/org/zstack/header/vm/extensions/VmDbDeleteContext.java" | head -10

echo -e "\n=== Look for pattern in similar deprecated interfaces ==="
fd -e java . | xargs rg "@Deprecated" -B 3 | grep -E "Use.*Context.*extension" -B 3 -A 3

Repository: MatheMatrix/zstack

Length of output: 3792


🏁 Script executed:

#!/bin/bash
# Check if there's any documentation or comments about VmDbDeleteContext usage
echo "=== Search for implementations or usages of VmDbDeleteContext ==="
fd -e java . | xargs rg "VmDbDeleteContext" -A 5 | grep -v "^header/" | head -40

echo -e "\n=== Check the refactor commit message ==="
git show 1a4fa661c --stat | head -50

echo -e "\n=== Check related extension point interfaces with multiple phases ==="
cat header/src/main/java/org/zstack/header/vm/extensions/VmExpungeExtensionPoint.java

Repository: MatheMatrix/zstack

Length of output: 3974


弃用说明缺少具体的扩展点接口名称。

当前弃用注释引用了 VmDbDeleteContext(上下文类),但未指明对应的扩展点接口。注释仅说"with a single-phase extension point"而未命名具体的扩展点,这会导致开发者无法明确迁移目标。应补充具体的扩展点接口名称,使迁移路径清晰。

🤖 Prompt for AI Agents
In
`@header/src/main/java/org/zstack/header/vm/VmJustBeforeDeleteFromDbExtensionPoint.java`
around lines 3 - 6, Update the deprecation Javadoc on
VmJustBeforeDeleteFromDbExtensionPoint to name the exact single-phase
extension-point interface developers should migrate to (in addition to the
VmDbDeleteContext). Replace the vague phrase "with a single-phase extension
point" with a concrete fully-qualified interface reference (for example:
org.zstack.header.vm.extensions.<ExactExtensionPointInterfaceName>) so the
comment clearly shows the target extension-point to use when migrating.

public interface VmJustBeforeDeleteFromDbExtensionPoint {
void vmJustBeforeDeleteFromDb(VmInstanceInventory inv);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import org.zstack.header.network.l3.L3NetworkInventory;

/**
* Created by xing5 on 2016/4/18.
* @deprecated Use {@link org.zstack.header.vm.extensions.VmInstanceAttachL3NetworkExtensionPoint#preAttachL3Network} instead.
*/
@Deprecated
public interface VmPreAttachL3NetworkExtensionPoint {
void vmPreAttachL3Network(VmInstanceInventory vm, L3NetworkInventory l3);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package org.zstack.header.vm.extensions;

import org.zstack.header.network.l3.L3NetworkInventory;
import org.zstack.header.vm.VmInstanceInventory;
import org.zstack.header.vm.VmNicInventory;

import java.util.HashMap;
import java.util.Map;

/**
* Context object for VM L3 Network attachment operations.
*
* <p>This context is passed through all lifecycle phases (pre/before/after/failedTo)
* allowing extensions to share state between phases.</p>
*/
public class VmAttachL3NetworkContext {
private VmInstanceInventory vm;
private L3NetworkInventory l3;
private VmNicInventory nic;
private String accountUuid;
private Map<String, Object> additionalData = new HashMap<>();

public VmInstanceInventory getVm() {
return vm;
}

public void setVm(VmInstanceInventory vm) {
this.vm = vm;
}

public L3NetworkInventory getL3() {
return l3;
}

public void setL3(L3NetworkInventory l3) {
this.l3 = l3;
}

public VmNicInventory getNic() {
return nic;
}

public void setNic(VmNicInventory nic) {
this.nic = nic;
}

public String getAccountUuid() {
return accountUuid;
}

public void setAccountUuid(String accountUuid) {
this.accountUuid = accountUuid;
}

public Map<String, Object> getAdditionalData() {
return additionalData;
}

public void putData(String key, Object value) {
additionalData.put(key, value);
}

@SuppressWarnings("unchecked")
public <T> T getData(String key) {
return (T) additionalData.get(key);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.zstack.header.vm.extensions;

import org.zstack.header.vm.VmInstanceInventory;

import java.util.HashMap;
import java.util.Map;

public class VmDbDeleteContext {
private VmInstanceInventory vm;
private String accountUuid;
private Map<String, Object> additionalData = new HashMap<>();

public VmInstanceInventory getVm() { return vm; }
public void setVm(VmInstanceInventory vm) { this.vm = vm; }
public String getAccountUuid() { return accountUuid; }
public void setAccountUuid(String accountUuid) { this.accountUuid = accountUuid; }
public Map<String, Object> getAdditionalData() { return additionalData; }
public void putData(String key, Object value) { additionalData.put(key, value); }
@SuppressWarnings("unchecked")
public <T> T getData(String key) { return (T) additionalData.get(key); }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.zstack.header.vm.extensions;

import org.zstack.header.errorcode.ErrorCode;
import org.zstack.header.vm.VmInstanceInventory;

import java.util.HashMap;
import java.util.Map;

public class VmDestroyContext {
private VmInstanceInventory vm;
private String accountUuid;
private ErrorCode error;
private Map<String, Object> additionalData = new HashMap<>();

public VmInstanceInventory getVm() { return vm; }
public void setVm(VmInstanceInventory vm) { this.vm = vm; }
public String getAccountUuid() { return accountUuid; }
public void setAccountUuid(String accountUuid) { this.accountUuid = accountUuid; }
public ErrorCode getError() { return error; }
public void setError(ErrorCode error) { this.error = error; }
public Map<String, Object> getAdditionalData() { return additionalData; }
public void putData(String key, Object value) { additionalData.put(key, value); }
@SuppressWarnings("unchecked")
public <T> T getData(String key) { return (T) additionalData.get(key); }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.zstack.header.vm.extensions;

import org.zstack.header.core.Completion;

/**
* VM Instance Destroy Extension Point (unified)
*
* <p>Trigger: When user calls DestroyVmInstance API</p>
* <p>Call site: VmInstanceBase via VmInstanceExtensionPointEmitter</p>
*
* <h3>Phase Description:</h3>
* <ul>
* <li>preDestroy - Can reject the destroy operation</li>
* <li>beforeDestroy - Preparation before destroy</li>
* <li>afterDestroy - Post-processing after destroy</li>
* <li>failedToDestroy - Cleanup on failure</li>
* </ul>
*/
public interface VmDestroyExtensionPoint {
default String preDestroy(VmDestroyContext ctx) { return null; }
default void beforeDestroy(VmDestroyContext ctx) {}
default void afterDestroy(VmDestroyContext ctx, Completion completion) { completion.success(); }
default void failedToDestroy(VmDestroyContext ctx) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package org.zstack.header.vm.extensions;

import org.zstack.header.errorcode.ErrorCode;
import org.zstack.header.vm.VmInstanceInventory;
import org.zstack.header.vm.VmNicInventory;

import java.util.HashMap;
import java.util.Map;

/**
* Context object for VM NIC detachment operations.
*
* <p>This context is passed through all lifecycle phases (pre/before/after/failedTo)
* allowing extensions to share state between phases.</p>
*/
public class VmDetachNicContext {
private VmInstanceInventory vm;
private VmNicInventory nic;
private String accountUuid;
private ErrorCode error;
private Map<String, Object> additionalData = new HashMap<>();

public VmInstanceInventory getVm() {
return vm;
}

public void setVm(VmInstanceInventory vm) {
this.vm = vm;
}

public VmNicInventory getNic() {
return nic;
}

public void setNic(VmNicInventory nic) {
this.nic = nic;
}

public String getAccountUuid() {
return accountUuid;
}

public void setAccountUuid(String accountUuid) {
this.accountUuid = accountUuid;
}

public ErrorCode getError() {
return error;
}

public void setError(ErrorCode error) {
this.error = error;
}

public Map<String, Object> getAdditionalData() {
return additionalData;
}

public void putData(String key, Object value) {
additionalData.put(key, value);
}

@SuppressWarnings("unchecked")
public <T> T getData(String key) {
return (T) additionalData.get(key);
}
}
Loading