Creates an instance of ProfileManager - Performs basic parameter validation and will create the required profile root directory (if it does not exist) and will attempt to load type configurations from the existing profile root directory (unless the type definitions are passed on the constructor parameters).
See the interface for details.
The meta file suffix - always appended to the meta file to distinguish from other profiles. Users then cannot supply a profile name that would conflict with the meta file.
The default profile file extension (YAML format) - all profiles are stored in YAML format including the meta profile file.
Accessor that returns a copy of of the profile configuration document.
Accessor for the load counter (protects against circular loading)
Accessor for the logger instance - passed on the constructor
Accessor the input parameters to the constructor - used sometimes to create other instances of profile managers.
Accesor for the product display name.
Accessor for the profile root directory - supplied on the constructor - used to construct the profile type directory.
Accessor for the profile type specified on the constructor.
Accessor for the profile type configuration for this manager.
Accessor for the full set of type configurations - passed on the constructor or obtained from reading the profile root directories and meta files.
Accessor for the profile meta file name - constructed as "
Accessor for the profile type root directory (contained within the profile root directory and named by the type itself)
Accessor for the schema of this type - JSON schema standard
After the DefaultCredentialManager reports an error resolution of recreating a credential, add instruction to recreate the profile.
The additional details of an error thrown by DefaultCredentialManager.
An error details string that contains an instruction to recreate the profile (when appropriate).
Clears the default profile for the profile managers type.
Constructs the full path to the profile of the managers "type".
The profile name to construct the path
Take command line arguments from the user and create a profile from them using the schema and configuration for the profile type
CLI arguments specified by the user
the profile with name and type to use to start the profile creation
profile which provides the finished profile on fulfill
Deletes a profile from disk. Ensures that the parameters are correct and removes the profile. If the profile is listed as a dependency of other profiles it will NOT delete the profile unless "rejectIfDependency" is set to false.
See the interface for details
Overridden loadProfile functionality Before the BasicProfileManager deletes the profile, we remove the secure properties associated with the profile
Delete control params - see the interface for full details
Invokes the profile IO method to delete the profile from disk.
The name of the profile to delete.
Helper routine to find nested properties Inspired by the inner function of insertCliArgumentsIntoProfile
profile property
Dot notation path of a property (e.g. my.nested.property)
Current value of the property while traversing down the object tree
Function to be executed if we are supposed to process secure properties
Processed version of a property
Obtains all profile names for the profile "type" specified on the manager. The names are obtained from the filesystem (in the profile type directory) and the meta file is NOT returned in the list.
Returns the default profile name for this "type" or "undefined" if no default is set.
Default style of building of profile fields to option definitions defined in the schema Will only work if there is a one-to-one option definition mapping for schema fields
the arguments specified by the user
the profile so far, which will be updated
Build the "dependencies" field of a profile object from command line arguments
the command line arguments from the user
the profile object so far.
Checks if the profile object passed is "empty" - meaning it has no contents other than that type or name. A profile can only specify "dependencies", in the event that it is just acting as a "pointer" to another profile.
The profile to check for "emptiness".
True if the profile object is empty.
Load a profile from disk. Ensures that the parameters are valid and loads the profile specified by name OR the default profile if requested. If load default is requested, any name supplied is ignored.
See the interface for details.
NOTE: This is just a copy of BasicProfileManager.loadAll REASON: We needed the Abstract profile manager to call the CLI profile manager to handle loading of secure properties Loads all profiles from every type. Profile types are determined by reading all directories within the profile root directory.
Loads all dependencies for the profile specified - returns the list in the response structure. Sub-dependencies are also loaded.
the name of hte profile to load dependencies for
The profile to load dependencies.
Standard load failed error message and Imperative Error.
The name of the profile for which the load failed.
Overridden loadProfile functionality After the BasicProfileManager loads the profile, we process the secured properties for the CLi to use
Load control params - see the interface for full details
Loads a specific profile (by name).
The name of the profile to load.
Locate the existing profile for the name specified.
The profile to locate
Merge two profiles together. Useful when updating existing profiles with a few new fields, for example.
the old profile, fields on this will have lower precedence
the new profile, fields on this will have higher precedence
Save a profile to disk. Ensures that the profile specified is valid (basic and schema validation) and invokes the implementations "saveProfile" method to perform the save and formulate the response.
See interface for details
Overridden saveProfile functionality. If CLI args are provided, profile fields are built from the args. Otherwise BaseProfileManager functionality is used.
parameters for the save, potentially including CLI args
Sets the default profile for the profile managers type.
The name of the new default
Update the profile - The action performed is dictacted by the implementation of the Abstract manager.
See the interface for details
Overridden updateProfile functionality If CLI args are provided, profile fields are built from the arguments. Otherwise the BaseProfileManager update functionality is used
parameters, potentially including CLI args
when fulfilled
If a custom handler is provided for update, the handler will be loaded and invoked in order to build the finished profile
the old profile to update
new profile which may have fields populated, which will be updated from the CLI args
CLi arguments specified by the user
should the profiles be merged? (will be skipped if there is a custom update profile handler)
Update an existing profile with arguments from the user based on the schema and configuration for this profile type
parameters including args
the pre-existing profile to update
new profile which will have fields set from CLI args
promise which provides the finished profile on fulfill
Validate a profile. Includes basic and schema validation. Can be called explicitly, but is also called during loads and saves to protect the integrity of the profiles against the type definitions.
See the interface for details
Validate a profile's structure, skipping the validation if we haven't built the profile's fields from the CLI arguments yet.
validate profile parameters. if these don't have readyForValidation = true, validation is skipped
Validates the profile against the schema for its type and reports and errors located.
the name of the profile to validate
The profile to validate.
Performs basic validation of a profile object - ensures that all fields are present (if required).
the name of the profile to validate
the type of profile to validate
The profile to validate.
Validates a profiles contents against the required dependencies specified on the profile configuration type document. If the document indicates that a dependency is required and that dependency is missing from the input profile, an error is thrown.
The profile to validate dependency specs
Static method to initialize the profile environment. Accepts the profile root directory (normally supplied by your Imperative configuration documents) and all profile "type" configuration documents and constructs the directories needed to manage profiles of all types. You must execute this method before beginning to use profiles OR you must supply all the type configuration documents (normally obtained from your Imperative configuration document) to the constructor of
Generated using TypeDoc
A profile management API compatible with transforming command line arguments into profiles