profiles~ProfileManager()

Management service for profiles.

new ProfileManager()

Methods

afterPropertiesSet()

Initialization after the components in the application context have been constructed.

create(nameopt, hostnameopt, portopt, descriptionopt) → {Promise.<tree.Node>}

Creates a new profile.
Parameters:
Name Type Attributes Default Description
name string <optional>
the profile name.
hostname string <optional>
localhost the hostname of Inexor Flex.
port number <optional>
31416 the grpc port of Inexor Flex.
description string <optional>
the description of Inexor Flex.
Returns:
Promise.<tree.Node> - - the tree node which represents the profile

exists(nameopt) → {boolean}

Returns if an profile with the given name exists.
Parameters:
Name Type Attributes Description
name number <optional>
the profile name
Returns:
boolean - - True, if the profile exists.

getAllProfiles() → {array}

Returns the names of the available profiles.
Returns:
array - - The list of profile names.

getConfigPath(filenameopt, profileopt) → {string}

Returns the path for the given configuration file with respect of the current profile.
Parameters:
Name Type Attributes Default Description
filename string <optional>
The filename.
profile string <optional>
null The profile to use or null for the current profile.
Returns:
string - - The path to the configuration file.

getCurrentProfile() → {tree.Node}

Returns the tree node which represents the current profile.
Returns:
tree.Node - - the tree node which represents the profile.

getCurrentProfileName() → {string}

Returns the name of the current profile.
Returns:
string - - The name of the current profile.

getDefaultProfile() → {tree.Node}

Returns the tree node which represents the default profile.
Returns:
tree.Node - - the tree node which represents the profile.

getDefaultProfileName() → {string}

Returns the name of the default profile.
Returns:
string - - The name of the default profile.

getProfile(name) → {tree.Node}

Returns the tree node which represents the profile with the given name.
Parameters:
Name Type Description
name string The name of the profile.
Returns:
tree.Node - - The tree node which represents the profile.

getProfilesConfigPath(filenameopt) → {string}

Returns the path for the given configuration file with respect of the current profile.
Parameters:
Name Type Attributes Description
filename string <optional>
The filename.
Returns:
string - - The path to the configuration file.

loadProfiles(filenameopt)

Loads the list of profiles from profiles.toml.
Parameters:
Name Type Attributes Default Description
filename string <optional>
profiles.toml The filename.

remove(nameopt)

Removes the profile with the given name.
Parameters:
Name Type Attributes Description
name string <optional>
The name of the profile.

saveProfiles(instanceNode, filenameopt) → {Promise.<bool>}

Save the profiles to a TOML file.
Parameters:
Name Type Attributes Description
instanceNode tree.Node The instance to save.
filename string <optional>
The filename.
Returns:
Promise.<bool>

setCurrentProfile(name)

Sets the name of the current profile. Warning: do not use this function! Use switchTo instead!
Parameters:
Name Type Description
name string The name of the profile.

setDependencies()

Sets the dependencies from the application context.

switchTo(nameopt)

Switches to the profile with the given name.
Parameters:
Name Type Attributes Description
name string <optional>
The name of the profile.