ZoweConfig

class ZoweConfig(schema: String, val profiles: Map<String, ZoweConfigProfile>, val defaults: Map<String, String>)

Represents an object model of zowe.config.json file.

Author

Valiantsin Krus

Since

2021-08-12

Constructors

Link copied to clipboard
fun ZoweConfig(schema: String, profiles: Map<String, ZoweConfigProfile>, defaults: Map<String, String>)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
inner class PropertyBuilder(val propName: String)

Builder class for setting the sequence of profiles to search property by name.

Functions

Link copied to clipboard
fun extractSecureProperties(filePathTokens: Array<String>, keytar: KeytarWrapper = DefaultKeytarWrapper())
fun extractSecureProperties(filePath: String, keytar: KeytarWrapper = DefaultKeytarWrapper())

Extracts secure properties from secure store by zowe config file path in current instance.

Link copied to clipboard
fun profile(searchPath: String?): ZoweConfigProfile?

Searches profile by its path. For example if profile has path "gr1.example" then it will search profile "example" in "gr1" group.

Link copied to clipboard
fun saveSecureProperties(filePathTokens: Array<String>, keytar: KeytarWrapper = DefaultKeytarWrapper())
fun saveSecureProperties(filePath: String, keytar: KeytarWrapper = DefaultKeytarWrapper())

Updates secure object for provided file in credential object and save these changes to credential storage.

Link copied to clipboard

Searches for a property with creating profiles sequence to search.

Link copied to clipboard

Searches where to set property value and sets it after searching by given profiles sequence. For example if given profiles sequence is zosmf -> base then it checks that zosmf profile or its parent contains property and if so, then method will set property in this profile else method will try to find property in base profile and set it there etc. If profile with corresponding property not found then nothing will happen.

Link copied to clipboard
fun toJson(): String

Deserializes current ZoweConfig instance to JSON string without secure properties.

Link copied to clipboard

Creates ZOSConnection based on zowe config or throws exception if data is not correct.

Link copied to clipboard
fun updateProperty(propName: String, propValue: Any?, block: ZoweConfig.PropertyBuilder.() -> Unit)

Searches for a property and updates it in found profile with creating profiles sequence to search.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var host: String?
Link copied to clipboard
Link copied to clipboard
var port: Long?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var user: String?
Link copied to clipboard

Extensions

Link copied to clipboard