package com.bocloud.cmp.entity.enums.jumpserver;

import com.bocloud.cmp.entity.enums.CloudProvider;

public enum JumpServerLock {
    VENDOR("CloudVendor_{vendorId}"),
    RESOURCE(CloudProvider.JUMPSERVER + ".{vendorId}.resource"),
    RESOURCE_GROUP(CloudProvider.JUMPSERVER + ".{vendorId}.resourceGroup"),
    DEPARTMENT(CloudProvider.JUMPSERVER + ".{vendorId}.department"),
    RESOURCE_GROUP_PROJECT(CloudProvider.JUMPSERVER + ".{vendorId}.resourceGroupProject"),
    USER(CloudProvider.JUMPSERVER + ".{vendorId}.user"),
    USER_GROUP(CloudProvider.JUMPSERVER + ".{vendorId}.userGroup"),
    RULE(CloudProvider.JUMPSERVER + ".{vendorId}.rule"),
    KILL_SESSION(CloudProvider.JUMPSERVER + ".{vendorId}.killSession"),
    CMD_TEMPLATE(CloudProvider.JUMPSERVER + ".{vendorId}.cmdTemplate"),
    DANGER_CMD(CloudProvider.JUMPSERVER + ".{vendorId}.dangerCmd"),
    ;
    private final String name;

    JumpServerLock(String name) {
        this.name = name;
    }

    public String getName(long vendorId) {
        return this.name.replace("{vendorId}", String.valueOf(vendorId));
    }
}
