Invoking Backup and Restore Service using LiveCycle Remoting

This article assumes that you have some knowledge of programming concepts and are familiar with web services and LiveCycle Remoting. For information about using web services and LiveCycle Remoting, see "Invoking LiveCycle ES Using LiveCycle Remoting" and "Invoking LiveCycle ES Using Web Services" in Programming with LiveCycle. The Backup and Restore service lets you put LiveCycle ES into backup mode, which enables hot backups to be performed. Hot backups permit you to backup the LiveCycle server while it is running, eliminating any downtime. The Backup and Restore service does not actually perform a backup of LiveCycle ES or restore your system. Instead, it puts your server in a state that enables you to perform consistent and reliable backups while your server continues to run. You are responsible for backing up the Global Document Storage (GDS) and the database connected to the LiveCycle ES server. The GDS is a directory used to store files, such as files used with long-lived processes.

As an administrator, you can use the LiveCycle Administration Console to put LiveCycle ES into backup mode. You can also programmatically put LiveCycle ES into backup mode using the Java API and web services, but because the Backup and Restore service cannot be used in a process created using Workbench ES, it cannot be invoked using LiveCycle Remoting as described in Programming with LiveCycle ES. To invoke the Backup and Restore service using LiveCycle Remoting, you must invoke the service directly. You may want to invoke the Backup and Restore service programmatically because you want to build software applications for backing up your server.

The trick to invoking a service directly using LiveCycle Remoting is to know the name of the service and the string values to refer to types, methods, and properties. To determine the string values, you can look at the WSDL on the server by referring to the WSDL by its name. (See the table at Invoking LiveCycle ES Using APIs > Invoking LiveCycle ES using Web Services). For example, to use the Backup and Restore service, you type the following in a web browser:

http://localhost:8080/soap/services/BackupService?wsdl&lc_version=8.2.1

From returned WSDL, you can then determine the string names of the types, methods, and properties to use as values for accessing the remote objects for your ActionScript and MXML code. Alternatively, you can also determine the values to use by stepping through accessed objects using the debugger in Flex Builder and see the results from the ResultEvent.result property.

This blog entry, describes how to write ActionScript and MXML code to invoke the Backup and Restore service using LiveCycle Remoting to do the following tasks:

  • Enter backup mode.
  • Leave backup mode.


Entering Backup mode

You enter backup mode to allow for hot backups of a LiveCycle ES server. When you enter backup mode, you specify the following information based on your organization’s backup procedures:

  • A unique label to identify the backup mode session that may be useful for your backup processes
  • The time for the backup procedure to complete
  • A flag to indicate whether to be in continuous backup mode, which is useful only if you are performing rolling backups. Rolling backups is a way to provide continous backups, which means that a new backup mode session is initiated as soon as the previous session is complete.

Before you write applications to enter into backup mode, it is recommended that you understand the backup procedures that will be used after you put the LiveCycle ES server in backup mode. For more information about considerations when performing backups for LiveCycle ES, see Administering LiveCycle ES.

Steps to enter backup mode using LiveCycle Remoting

To enter backup mode by using LiveCycle Remoting, perform the following tasks:

  1. Include necessary files in your development project. These files are important to include in your project for compiling your code properly and using the Backup and Restore Service API.

    Include the adobe-remoting-provider.swc file that enables you to perform remoting. (See "Invoking LiveCycle ES Using LiveCycle Remoting" in Programming with LiveCycle ES.)

  2. Create a BackupService client object to use the Backup and Restore Service API.
    • Create an mx:RemoteObject instance through either ActionScript or MXML. Associate it with the name assigned to the remoting endpoint for the Backup and Restore service. You can see the name of the service in Applications and Services in LiveCycle Administration Console. (See Applications and Services Administration Help.)
    • Configure the enterBackupMode method using the mx:method tag that belongs to the mx:RemoteObject tag.
    • Create a ChannelSet object by using its constructor for connecting to the LiveCycle ES server and add a channel by invoking the ChannelSet object `s addChannel method and passing an AMFChannel object that specifies a unique ID and a URL that includes the default remoting URL, such as http://localhost:8080/remoting/messagebroker/amf, for a local instance of the LiveCycle ES server.
    • Specify the LiveCycle ES user name and password by invoking the mx:RemoteObject instance’s setCredentials method and passing the following values:
      • A string value that specifies the user name.
      • A string value that specifies the corresponding password value.

    • Attach the ChannelSet object to the mx:RemoteObject instance by assigning the ChannelSet object to the mx:RemoteObject instance’s channelSet data member.

  3. Before you enter backup mode, determine a unique label, the amount of time that you want to allocate to perform the backup, and whether you want the LiveCycle ES server to stay in backup mode. These considerations are important to integrate with the backup procedures established by your organization. (See Administering LiveCycle ES.)

    For example, if you are writing a Flex application, you may want to get the parameters for performing the backup based on input from a user.

  4. Enter backup mode with the parameters that are consistent with the backup procedures at your organization. For each of the required parameters that includes the label, time to perform the time-out, and whether to be in continuous backup mode:

    • Create an Object instance that stores the input parameter that the Backup and Restore Service API enterBackupMode operation requires. For each input parameter, assign the parameter to the Object instance by using the following syntax:params["aLabel"] = "BackupTimeLabel"

    • where param is the name of the Object instance that stores parameter values. In this situation, aLabel stores the name of the label that is passed to the Backup and Restore service.

      You specify label, backup time, and whether to keep the server in continuous backup mode by using aLabel, aBackupModeTimeout, and aContinuousCoverageMode respectively, as keys for the parameters. You specify the following information for each of the values that you determined from step 3:
      • aLabel: A string value that that specifies a unique human-readable label that identifies the backup mode session. It is recommended that you do not use spaces or characters that cannot be encoded into XML format.
      • aBackupModeTimeout: An integer value that specifies the number of minutes to stay in backup mode. You can specify a value from 1 to 10080(one week).
      • aContinuousCoverageMode: A Boolean value that specifies whether to be in continous backup mode. A value of True specifies to be in continuous backup mode. Continous backup mode means that a new backup mode session will be started after the current one is completed. A value of False means that continous backup mode is not used and after leaving backup mode, the purging of files from the GDS resumes.



      Note: You can determine the strings to use by accessing the WSDL and looking at the input parameters for the enterBackupMode method.

  5. Enter backup mode by calling the mx:RemoteObject instance’s enterBackupMode method and passing the Object instance that stores the input parameter values.

  6. After you enter backup mode, you can retrieve information about the session. The information that you can retrieve after you enter backup mode may be useful for integrating with your backup procedures. For example, the label, backup ID, and start time may be useful as input for filenames for your backup procedure.

    • Within the main MXML file, create a BackupModeEntryResult instance by using its constructor. You can create a BackupModeEntryResultobject from a custom ActionScript class that you create. The class contains properties that are returned. The names must correspond to the names in the BackupModeEntryResult object.
    • Using the ResultEvent.result property by using the index that contains the result. For the Backup and Restore Service API, the result is accessed using the BackupModeEntryResult as a key which provides an Object object that you coerce to the BackupModeEntryResult instance you created.
    • Retrieve each value using the names of the properties you defined in the BackupModeEntryResultobject you created and use them accordingly as input or parameters for your backup procedures.
    • You can determine the names to provide to each property in the ActionScript class you create by accessing the web service using a tool such as .NET Webservice WebStudio, or you can debug in Flex Builder and see the results from the ResultEvent.result.

  7. After you successfully enter backup mode, you can perform a backup of the Global Document Storage (GDS) and the database that the LiveCycle ES server is connected to. This step is specific to your organization, since you can perform this step manually or youcan run other tools to perform the backup procedure.

    Backup the Global Document Storage (GDS) and the database which your LiveCycle ES server is connected to. The actions to perform the backup are not part of the LiveCycle ES SDK and may even include manual steps specific to the backup procedures in your organization.

Example code: Entering Backup mode using LiveCycle Remoting.

  • Click here to view the main MXML to enter backup mode.
  • Click here view the BackupModeEntryResult class.

Leaving backup mode using LiveCycle Remoting

You leave backup mode to resume normal operation of the LiveCycle ES server.

Steps to leave backup mode by using LiveCycle Remoting

  1. Include necessary files in your development project. These files are important to include in your project for compiling your code properly and using the Backup and Restore Service API.

    Include the adobe-remoting-provider.swc file that enables you to perform remoting. (See "Invoking LiveCycle ES Using LiveCycle Remoting" in Programming with LiveCycle ES.)

  2. Create a BackupService client object to use the Backup and Restore Service API.
  3. You do not use a BackupService client API object directly in LiveCycle Remoting. Instead, you create a RemoteObject instance and specify the method to invoke on the LiveCycle ES server. To use the Backup and Restore Service API in LiveCycle Remoting, perform these steps:

    • Create an mx:RemoteObjectinstance through either ActionScript or MXML. Associate it with the name assigned to the remoting endpoint for the Backup and Restore service. This step allows you to use the Backup and Restore Service API client object using LiveCycle Remoting. You can see the name of the service using Applications and Services in LiveCycle Administration Console. (See Applications and Services Administration Help.)
    • Configure the RemoteObject instance to use the leaveBackupMode method using the mx:method tag nested below the mx:RemoteObject tag.
    • Create a ChannelSet object by using its constructor for connecting to the LiveCycle ES server. Add a channel by using the ChannelSet object `s addChannel method and passing an AMFChannel object that specifies a unique ID for the channel, and a URL that includes the default remoting URL, such as http://localhost:8080/remoting/messagebroker/amf, for a local instance of the LiveCycle ES server.
    • Specify the LiveCycle ES user name and password by invoking the mx:RemoteObject instance’s setCredentials method and passing the following values:
      • A String value that specifies the user name.
      • A String value that specifies the corresponding password value.

    • Attach the ChannelSet object to the mx:RemoteObject instance by assigning the ChannelSet object to the mx:RemoteObject instance’s channelSet data member.

  4. Leave backup mode by calling the mx:RemoteObject instance’s leaveBackupMode method.

  5. Retrieve information about the operation to verify that it was successful.


  6. Within the main MXML file, create a BackupModeResult instance by using its constructor. You can create a BackupModeResult object, which is created from a custom ActionScript class that you create. The class contains properties that are returned. The names must correspond to the names in the BackupModeResult object.
    • Using the ResultEvent object’s result property by using the index that contains the result. For the Backup and Restore Service API, the result is accessed using the success as a key which provides an Object instance that you coerce to the BackupModeResult instance you created.
    • Retrieve the backup mode identifier using the id property that was defined in the BackupModeResult object you created.
    • Note:You can determine the name of the property in the ActionScript class you create by accessing the web service using a tool such as .NET Webservice WebStudio, or when you debug in Flex Builder and see the results from the ResultEventobject’s resultproperty.

Example code: Leaving Backup mode using LiveCycle Remoting.

  • Click here to view the main MXML to leave backup mode.
  • Click here view the BackupModeResult class.
VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 0.0/10 (0 votes cast)

Comments are closed.