Class SystemRestoreManager
- java.lang.Object
-
- com.carfey.ops.api.embedded.AbstractAPIManager
-
- com.carfey.ops.api.embedded.SystemRestoreManager
-
public class SystemRestoreManager extends AbstractAPIManager
Class used to export Obsidian configuration using the Obsidian public embedded API. Execution history, notification history and logs are not included. This class can be used for copying Obsidian environments, as a backup, or as a snapshot for review.Example:
SystemRestoreConfiguration config = new SystemRestoreManager().getConfiguration(); System.out.println("SystemRestoreConfiguration: " + config);- Since:
- 3.0
- See Also:
- Embedded API Wiki, REST API Wiki, Carfey Date
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.carfey.ops.api.embedded.AbstractAPIManager
AbstractAPIManager.ActionCallable
-
-
Constructor Summary
Constructors Constructor Description SystemRestoreManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SystemRestoreConfigurationgetConfiguration()Returns the full system restore configuration for the system which can be used as a backup or to populate another Obsidian instance using either the JSON initialization file orupdateConfiguration(SystemRestoreConfiguration, String).SystemRestoreConfigurationgetConfiguration(SystemRestoreParameters parameters)Returns the optionally filtered system restore configuration for the system which can be used as a backup or to populate another Obsidian instance using either the JSON initialization file orupdateConfiguration(SystemRestoreConfiguration, String).protected java.util.Map<java.lang.String,java.lang.String[]>getUpdateConfigParams()SystemRestoreConfigurationupdateConfiguration(SystemRestoreConfiguration config, java.lang.String auditUser)Updates the Obsidian installation with the supplied system restore configuration.-
Methods inherited from class com.carfey.ops.api.embedded.AbstractAPIManager
addParameter, runApiTarget, validateRequired, withTransaction
-
-
-
-
Method Detail
-
getConfiguration
public SystemRestoreConfiguration getConfiguration() throws java.lang.Exception
Returns the full system restore configuration for the system which can be used as a backup or to populate another Obsidian instance using either the JSON initialization file orupdateConfiguration(SystemRestoreConfiguration, String).The value returned by this method may be used directly with
updateConfiguration(SystemRestoreConfiguration, String), though some users may wish the tweak the return value before using the output to update another environment.Note: Users returned with this object do not include the current passwords since they cannot be determined, and also as a security measure. All users will be returned with the password "changeme".
- Returns:
- the
SystemRestoreConfiguration - Throws:
java.lang.Exception- Any type of unexpected exception.
-
getConfiguration
public SystemRestoreConfiguration getConfiguration(SystemRestoreParameters parameters) throws java.lang.Exception
Returns the optionally filtered system restore configuration for the system which can be used as a backup or to populate another Obsidian instance using either the JSON initialization file orupdateConfiguration(SystemRestoreConfiguration, String).The value returned by this method may be used directly with
updateConfiguration(SystemRestoreConfiguration, String), though some users may wish the tweak the return value before using the output to update another environment.Note: Users returned with this object do not include the current passwords since they cannot be determined, and also as a security measure. All users will be returned with the password "changeme".
- Parameters:
parameters-SystemRestoreParametersallows for defining filters.- Returns:
- the
SystemRestoreConfiguration - Throws:
java.lang.Exception- Any type of unexpected exception.
-
updateConfiguration
public SystemRestoreConfiguration updateConfiguration(SystemRestoreConfiguration config, java.lang.String auditUser) throws ValidationException, java.lang.Exception
Updates the Obsidian installation with the supplied system restore configuration.The provided
SystemRestoreConfigurationis processed into Obsidian using the noted APIs according to the following additional rules:- Jobs
If a job already exists with the same nickname, the rules noted in
JobSaveRequest.isUpdateAttributes()andJobSaveRequest.isUpdateSchedule()apply. - Job Chains
Job chains are only ever created when no chains currently exist, unless
ChainsRequest.isReplaceAll()is set to true, in which case all job chains are deleted before creating the supplied chains. - Job Conflicts
Requests to update job conflicts always overwrite any existing job conflicts fully. If an empty list is supplied, all chains will be deleted. Note that this is different from a null or missing value.
- Custom Calendars
If a calendar already exists with the same name, the existing calendar will be updated.
- Global Parameters
If left null, global parameters are left as is. If an empty list or a list of parameters is supplied, configured global parameters will be fully replaced with the supplied configuration.
- Notification Subscribers
If a subscriber already exists with the same email address, the existing subscriber will be updated.
- Notification Templates
If a template already exists with the same name, the existing template will be updated.
- System Parameters
System parameters with names matching the supplied
SystemParametervalues are updated. All other values are left as is. - Users
If a user already exists with the same name, the rules noted in
UserSaveRequest.isUpdate()apply.
- Parameters:
config- configuration to updateauditUser- Optional user that is marked in audit columns. Defaults to "embeddedAPI".- Returns:
- the complete
SystemRestoreConfigurationas it would be returned bygetConfiguration() - Throws:
ValidationException- A validation error which prevents the action from succeeding.java.lang.Exception- Any other type of unexpected exception.- See Also:
JobManager.addJob(JobCreationRequest request, String auditUser),JobManager.updateJob(long jobId, JobUpdateRequest request, String auditUser),JobManager.addJobSchedule(long jobId, ScheduleCreationRequest request, String auditUser),JobManager.addChain(JobChainUpdateRequest request, String auditUser),JobManager.deleteChain(long chainId, String auditUser),JobManager.updateGlobalParameters(GlobalParameterUpdateRequest request, String auditUser),CustomCalendarManager.addCalendar(CustomCalendarUpdateRequest request, String auditUser),CustomCalendarManager.updateCalendar(long calendarId, CustomCalendarUpdateRequest request, String auditUser),SystemParameterManager.updateParameter(String name, String value, String auditUser),NotificationManager.addSubscriber(SubscriberUpdateRequest request, String auditUser),NotificationManager.updateSubscriber(long subscriberId, SubscriberUpdateRequest request, String auditUser),NotificationManager.addTemplate(TemplateUpdateRequest request, String auditUser),NotificationManager.updateTemplate(long templateId, TemplateUpdateRequest request, String auditUser),UserManager.addUser(UserCreationRequest request, String auditUser),UserManager.updateUser(long userId, UserUpdateRequest request, String auditUser)
- Jobs
-
getUpdateConfigParams
protected java.util.Map<java.lang.String,java.lang.String[]> getUpdateConfigParams()
-
-