IConfigureRuntime Interface

The Unisys.AgileBusiness.RuntimeAPI namespace contains the IConfigureRuntime interface that enables you to perform the Runtime Administration tasks and optimize performance by configuring the component settings for the internal AB Suite runtime components such as runtime manager, deployment server, and others. The RuntimeFactory class includes methods to return the IConfigureRuntime objects.

Refer to Definition of the IConfigureRuntime Interface for more information about the interface.

Namespace: Unisys.AgileBusiness.RuntimeAPI

Assembly: Unisys.AgileBusiness.RuntimeAPI (in Unisys.AgileBusiness.RuntimeAPI.dll)

Syntax

You can create the IConfigureRuntime object by using RuntimeFactory.GetRuntime() method.

IConfigureRuntime RuntimeConfig = RuntimeFactory.GetRuntime()

The IConfigureRuntime interface exposes the following members.

Methods

Method

Description

AddView()

Called by an application to create a view that can be used by protocol adapters to connect to applications.

ConfigureLog()

Called by an application to configure logging at the server level to capture details of deployment, database reorganization, and application transactions.

ConfigureSocketAdapter()

Called by an application to configure the adapter details for RATL socket over TCP/IP or Hub socket.

ConfigureQueueAdapter()

Called by an application to configure adapter details for RATL over MSMQ and for SOAP over MSMQ.

DeleteView()

Called by an application to delete an existing view.

SetComponentProperties()

Called by an application to configure the pooling settings and user role information of an AB Suite internal COM+ application.

SetEnvironmentConfiguration()

Called by an application to modify the behavior of AB Suite Windows Runtime systems by modifying the AB Suite runtime settings

Note: The interface enables you to perform the administration tasks required for pre-deployed applications.

Required Security Privileges

By default, a local administrator can access the methods.

To allow non-administrative users to access this utility, the users must be a member of the "Runtime Administrators" COM+ role of Runtime Manager application or member of the "AB Suite Runtime Administrators" user group.

IConfigureRuntime.AddView Method

This method allows you to add a view for the following list of protocol adapters.

Syntax

The syntax of the AddView method for SOAP over HTTP (Web Services) is:

AddView(parameter As Unisys.AgileBusiness.RuntimeAPI.SoapHttpViewParameter)

Argument

Return Value

If this method succeeds, it returns the StatusInfo object with the status code: Error, Warning, or Success and status message, if any.

Syntax

The syntax of the AddView method for SOAP over MSMQ is:

AddView(parameter As Unisys.AgileBusiness.RuntimeAPI.SoapMsmqViewParameter)

Argument

Return Value

If this method succeeds, it returns the StatusInfo object with the status code: Error, Warning, or Success and status message, if any.

Syntax

The syntax of the AddView method for HUB is:

AddView(parameter As Unisys.AgileBusiness.RuntimeAPI.HubViewParameter)

Argument

Return Value

If this method succeeds, it returns the StatusInfo object with the status code: Error, Warning, or Success and status message, if any.

Syntax

The syntax of the AddView method for Non-Formatted Input-Output, Offline Input or Generalized Interfaces is:

AddView(parameter As Unisys.AgileBusiness.RuntimeAPI.Nof_Off_GliViewParameter)

Argument

Return Value

If this method succeeds, it returns the StatusInfo object with the status code: Error, Warning, or Success and status message, if any.

Syntax

The syntax of the AddView method for RATL over TCP/IP is

AddView(parameter As Unisys.AgileBusiness.RuntimeAPI.RATLTcpIpViewParameter)

Argument

Return Value

If this method succeeds, it returns the StatusInfo object with the status code: Error, Warning, or Success and status message, if any.

Syntax

The syntax of the AddView method for RATL over MSMQ is

AddView(parameter As Unisys.AgileBusiness.RuntimeAPI.RatlMsmqViewParameter)

Argument

Return Value

If this method succeeds, it returns the StatusInfo object with the status code: Error, Warning, or Success and status message, if any.

IConfigureRuntime.DeleteView Method

This method allows you to delete a view for the protocol adapters.

Syntax

DeleteView(viewName As String)

Arguments

viewName: string

The view from which you want to terminate connection

Return Value

If this method succeeds, it returns the StatusInfo object with the status code: Error, Warning, or Success and status message, if any.

Using the IConfigureRuntime Interface to interpret the AddView and DeleteView methods

 public class SampleProgram
   {
	     static void Main(string[] args)
      {
          // Get the Runtime config.
          IConfigureRuntime config = RuntimeFactory.GetRuntime();
          // Construct the RATLTcpIpViewParameter.
          RATLTcpIpViewParameter parameter = new RATLTcpIpViewParameter()
          {
              ViewName = "RATLTCPIP",
              SystemName = "SYS",
              ServerName = "LOCALHOST",
              EnableLogging = true
          };
          // Invoke AddView to create view.
          StatusInfo statusInfo = config.AddView(parameter);
          //Print the status message.
          Console.WriteLine(statusInfo.StatusMessage);
          // Delete view.
          statusInfo = config.DeleteView("RATLTCPIP");
          //Print the status message.
          Console.WriteLine(statusInfo.StatusMessage);
     }
   }
}

IConfigureRuntime.SetComponentProperties Method

This method allows you to configure the component settings such as, Application Pooling and Recycling, Object Pooling, and Role settings for the AB Suite internal COM+ applications.

Syntax

The syntax of the SetComponentProperties method is

SetComponentProperties (Unisys.AgileBusiness.RuntimeAPI. ComponentProperties properties)

Argument

Refer to Configure Runtime Utility for more information about the various member settings and restrictions. Refer to the Agile Business Suite Installation and Configuration Guide for more information about the available COM+ roles.

Return Value

If this method succeeds, it returns the StatusInfo object with the status code; Error, Warning, or Success and status message, if any.

Using the IConfigureRuntime Interface for SetComponentProperties Method

The following steps and code example illustrates the implementation of IConfigureRuntime for configuring the pooling and role settings for a pre-deployed system.

  1. Create a new C# Class Library in Microsoft Visual Studio.

  2. Add a reference to the following assembly that you need when calling from the Class Library:

    • Unisys.AgileBusiness.RuntimeAPI.dll (from <AB Suite 7.0 Installation directory>\bin64 folder)

  3. Add the following code to the Class.

    public class SampleProgram
    {
           static void Main(string[] args)
           {
                // Get the Runtime config
                IConfigureRuntime config = RuntimeFactory.GetRuntime();
    //Create users list
    IList<string> users = new List<string>();
    users.Add( User1 );
    
    //Create the ComponentProperties parameter
    IList<ComponentRoles> rolesList = new List<ComponentRoles>();
    ComponentRoles role = new ComponentRoles()
    {
        RoleName = "Readers",
        UserNames = users
    };
        rolesList.Add(role);
        ComponentProperties parameter = new ComponentProperties()
    {
        ApplicationPoolSize = 3,
    RecycleLifetimeLimit = 10080,
    RecycleMemoryLimit = 750000,
        RecycleExpirationTimeout= 20,
    MinimumPoolSize = 5,
    MaximumPoolSize = 5,
    Roles = rolesList
            };
    
    // Invoke SetComponentProperties
            status = config.SetComponentProperties(parameter);
    }
    }
  4. Build the Class Library.

IConfigureRuntime.SetEnvironmentConfiguration Method

This method allows you to configure the AB Suite runtime settings.

Syntax

SetEnvironmentConfiguration(configuration As
Unisys.AgileBusiness.RuntimeAPI.RegistryConfigurations, Optional value As String = "0")

Arguments

Return Value

If this method succeeds, it returns the StatusInfo object with the status code: Error, Warning, or Success and the status message, if any.

Using the IConfigureRuntime Interface for SetEnvironementConfiguration Method

The following steps and code example illustrates the implementation of IConfigureRuntime for configuring the AB Suite runtime settings.

  1. Create a new C# Class Library in Microsoft Visual Studio.

  2. Add a reference to the following assembly that you need when calling from the Class Library:

    • Unisys.AgileBusiness.RuntimeAPI.dll (from <AB Suite 7.0 Installation directory>\bin64 folder)

  3. Add the following code to the Class.

       public class SampleProgram
           {
              static void Main(string[] args)
    				{
    	    			  // Get the Runtime config
                   IConfigureRuntime config = RuntimeFactory.GetRuntime();
      // Invoke SetEnvironmentConfiguration to apply the runtime configuration
      StatusInfo status = runtime.SetEnvironmentConfiguration(configuration);
      //Print the status message.
      Console.WriteLine(statusInfo.StatusMessage);
      }
      }
  4. Build the Class Library.

IConfigureRuntime.ConfigureLog Method

This method allows you to read and update the System, DBReorg, Deployment log, and Runtime API log details.

Syntax

ConfigureLog(Unisys.AgileBusiness.RuntimeAPI.ConfigureLogParameter logParameter, 
Unisys.AgileBusiness.RuntimeAPI.ModeType mode)

Arguments

Return Value

If this method succeeds, it returns the StatusInfo object with the status code: Error, Warning, or Success and the status message, if any. Refer to Configure Log Files Utility for more information on validation messages.

Using the IConfigureRuntime Interface for the ConfigureLog Method

The following steps and code example illustrate the implementation of IConfigureRuntime for Get (read) and Set (write) methods of Configure log:

  1. Create a new C# Class Library in Microsoft Visual Studio.

  2. Add a reference to the following assembly that you need when calling from the Class Library:

    • Unisys.AgileBusiness.RuntimeAPI.dll (from <AB Suite 7.0 Installation directory>\bin64 folder)

  3. Add the following code to the Class to get and set configure log data into the Sample application

      namespace SampleConfigLog
      {
          using System;
          using Unisys.AgileBusiness.RuntimeAPI;
          class Program
          {
              static void Main(string[] args)
              {
                  //Get the Runtime config
                  IConfigureRuntime config = RuntimeFactory.GetRuntime();
                  //Construct the ConfigureLogParameter
                  ConfigureLogParameter parameter = new ConfigureLogParameter()
                  {
                       LogName = LogFileName.System,
                       LogStatus = LogStatus.Enable,
                       Level = LogLevel.Information,
                       FilePath = @"C:\TEMP",
                       FileSize = 10000,
                       NoOfBackups = 7
                  };
                  //Invoke configurelog to update with the new values
                  StatusInfo statusInfo = config.ConfigureLog(parameter,
                  ModeType.Write);
                  Console.WriteLine(statusInfo.StatusMessage);
                  //Invoke configurelog to read the values
                  statusInfo = config.ConfigureLog(parameter, ModeType.Read);
                  if (statusInfo.Status == StatusEnum.Success)
                  {
                      //Prints the read values
                      Console.WriteLine("File Name : " + parameter.LogName);
                      Console.WriteLine("Enable : " + parameter.LogStatus);
                      Console.WriteLine("Log Level : " + parameter.Level);
                      Console.WriteLine("File Path : " + parameter.FilePath);
                      Console.WriteLine("Reset File Size : " + parameter.FileSize);
                      Console.WriteLine("No of backups : " + parameter.NoOfBackups);
                  }
                  else
                  {
                      Console.WriteLine(statusInfo.Status + statusInfo.StatusMessage);
                  }
           }
      }
  4. Build the Class Library.

IConfigureRuntime.ConfigureSocketAdapter Method

This method allows you to configure the RATL socket or Hub socket adapter details.

Syntax

ConfigureSocketAdapter(Unisys.AgileBusiness.RuntimeAPI.SocketParameter 
socketParameter, Unisys.AgileBusiness.RuntimeAPI.ModeType mode)

Arguments

Return Value

If this method succeeds, it returns the StatusInfo object with the status code: Error, Warning, or Success and the status message, if any. Refer to Configure Protocol Adapters Utility for more information on validation messages.

Using the IConfigureRuntime Interface for the ConfigureSocketAdapter Method

The following steps and code example illustrates the implementation of IConfigureRuntime for Get (read) and Set (write) methods of ConfigureSocketAdapter for RATL socket:

  1. Create a new C# Class Library in Microsoft Visual Studio.

  2. Add a reference to the following assembly that you need when calling from the Class Library:

    • Unisys.AgileBusiness.RuntimeAPI.dll (from <AB Suite 7.0 Installation directory>\bin64 folder)

  3. Add the following code to the Class to get and set configure adapter details for RatlSocket into the Sample application.

      namespace SampleConfigSocketAdapter
      {
          using System;
          using Unisys.AgileBusiness.RuntimeAPI;
          class Program
          {
              static void Main(string[] args)
              {
                  //Get the Runtime config
                  IConfigureRuntime config = RuntimeFactory.GetRuntime();
                  //Construct the Socket parameter
                  SocketParameter parameter = new SocketParameter()
                  {
                      SocketType = SocketType.RatlSocket,
                      PortNumber = 2850,
                      LogStatus = LogStatus.Enable,
                      FilePath = @"C:\TEMP",
                      FileSize = 1000,
                      NoOfBackups = 7
                  };
                  //Invoke ConfigureSocketAdapter to update with the new values
                  StatusInfo statusInfo = config.ConfigureSocketAdapter(parameter,
                  ModeType.Write);
                  Console.WriteLine(statusInfo.StatusMessage);
                  //Invoke ConfigureSocketAdapter to read the values
                  statusInfo = config.ConfigureSocketAdapter(parameter, ModeType.Read);
                  if (statusInfo.Status == StatusEnum.Success)
                  {
                      //Prints the read values
                      Console.WriteLine("Socket Name : " + parameter.RatlSocketName);
                      Console.WriteLine("Port Number : " + parameter.PortNumber);
                      Console.WriteLine("Time out : " + parameter.TimeOut);
                      Console.WriteLine("Session timeout : " +
                      parameter.SessionProtectionTimeOut);
                      Console.WriteLine("Enable : " + parameter.LogStatus);
                      Console.WriteLine("File Path : " + parameter.FilePath);
                      Console.WriteLine("Reset File Size : " + parameter.FileSize);
                      Console.WriteLine("No of backups : " + parameter.NoOfBackups);
                  }
                  else
                  {
                      Console.WriteLine(statusInfo.Status + statusInfo.StatusMessage);
                  }
              }
          }
  4. Build the Class Library.

IConfigureRuntime.ConfigureQueueAdapter Method

This method allows you to configure the RatlQueue/SoapQueue adapter details.

Syntax

ConfigureQueueAdapter(Unisys.AgileBusiness.RuntimeAPI.QueueParameter queueParameter,
Unisys.AgileBusiness.RuntimeAPI.ModeType mode)

Arguments

Return Value

If this method succeeds, it returns the StatusInfo object with the status code: Error, Warning, or Success and the status message, if any. Refer to Configure Protocol Adapters Utility for more information on validation messages.

Using the IConfigureRuntime Interface for the ConfigureQueueAdapter Method

The following steps and code example illustrates the implementation of IAdmin for Get (read) and Set (write) methods of Configure Adapter for RatlQueue:

  1. Create a new C# Class Library in Microsoft Visual Studio.

  2. Add a reference to the following assembly that you need when calling from the Class Library:

    • Unisys.AgileBusiness.RuntimeAPI.dll (from <AB Suite 7.0 Installation directory>\bin64 folder)

  3. Add the following code to the Class to get and set configure adapter details for RatlQueue into the Sample application.

      namespace SampleConfigQueueAdapter
      {
          using System;
          using Unisys.AgileBusiness.RuntimeAPI;
          class Program
          {
              static void Main(string[] args)
              {
                  //Get the Runtime config.
                  IConfigureRuntime config = RuntimeFactory.GetRuntime();
                  //Construct the Socket parameter
                  QueueParameter parameter = new QueueParameter()
                  {
                      QueueType = QueueType.RatlQueue,
                      ServerName = "ServerName",
                      LogStatus = LogStatus.Enable,
                      FilePath = @"C:\TEMP",
                      FileSize = 1000,
                      NoOfBackups = 7
                  };
                  //Invoke ConfigureQueueAdapter to update with the new values.
                  StatusInfo statusInfo = config. ConfigureQueueAdapter(parameter,
                  ModeType.Write);
                  Console.WriteLine(statusInfo.StatusMessage);
                  //Invoke ConfigureQueueAdapter to read the values
                  statusInfo = config. ConfigureQueueAdapter(parameter, ModeType.Read);
                  if (statusInfo.Status == StatusEnum.Success)
                  {
                      //Prints the read values
                      Console.WriteLine("Queue Name : " + parameter. QueueType);
                      Console.WriteLine("Server Name : " + parameter. ServerName);
                      Console.WriteLine("Enable : " + parameter.LogStatus);
                      Console.WriteLine("File Path : " + parameter.FilePath);
                      Console.WriteLine("Reset File Size : " + parameter.FileSize);
                      Console.WriteLine("No of backups : " + parameter.NoOfBackups);
                  }
                  else
                  {
                      Console.WriteLine(statusInfo.Status + statusInfo.StatusMessage);
                  }
              }
          }
      }
  4. Build the Class Library.

Definition of the IConfigureRuntime Interface

Following is the definition of the IConfigureRuntime interface.

  namespace Unisys.AgileBusiness.RuntimeAPI
  {
      public interface IConfigureRuntime
      {
           StatusInfo AddView(parameter As 
           Unisys.AgileBusiness.RuntimeAPI.HubViewParameter);
           StatusInfo AddView(parameter As 
           Unisys.AgileBusiness.RuntimeAPI.Nof_Off_GliViewParameter);
           StatusInfo AddView(parameter As 
           Unisys.AgileBusiness.RuntimeAPI.RatlMsmqViewParameter);
           StatusInfo AddView(parameter As 
           Unisys.AgileBusiness.RuntimeAPI.RATLTcpIpViewParameter);
           StatusInfo AddView(parameter As
           Unisys.AgileBusiness.RuntimeAPI.SoapHttpViewParameter);
           StatusInfo AddView(parameter As 
           Unisys.AgileBusiness.RuntimeAPI.SoapMsmqViewParameter);
           StatusInfo ConfigureQueueAdapter(QueueParameter queueParameter, 
           ModeType mode);
           StatusInfo ConfigureSocketAdapter(SocketParameter socketParameter, 
           ModeType mode);
           StatusInfo ConfigureLog(LogParameter logParameter,
           ModeType mode);
           StatusInfo DeleteView(viewName As String);
           StatusInfo SetComponentProperties (properties As 
           Unisys.AgileBusiness.RuntimeAPI.ComponentProperties); 
           StatusInfo SetEnvironmentConfiguration(configuration As 
           Unisys.AgileBusiness.RuntimeAPI.RegistryConfigurations, 
           Optional value As String = "0");
       }
  }