• Print  |
  • Feedback  |

FOCUS AREAS

Developer Resources

Products

Technologies

API Reference

SAS AppDev Studio 3.0 Developer's Site

Middleware Server: Working with User Profiles

In addition to setting MWS options using the rollover database, you can create user profiles that provide unique and customized connection information. User profiles prevent any log-in information from being either embedded in the client application or gathered at run time and transmitted to the host. User profiles also enable connection information to be maintained on the server, which allows for easy transition to other servers. In order to work with user profiles, you must:

To specify the name of the user profile file:

  1. Open the RocfORB.properties file.
  2. Set the profileProcessor.profileDatabase key value. The default value is RocfORB.profiles.

To create or edit profile information:

  1. Open the user profile file (for example, RocfORB.profiles). This file can typically be found at the following path: \install-directory\Java\SAS (where install-directory is the directory in which AppDev Studio was installed).
  2. Add or edit lines as needed. See the User Profile File Example for more information.

To specify the use of a user profile on the client:

  1. Select Tools [arrow] Register Connections from within webAF or Tools [arrow] AppDev Studio Connections from within webEIS.

  2. Select an existing connection, and then click Edit.

  3. In the Edit Connection window, select the Middleware tab.

  4. Verify that the Use Middleware check box is selected.

  5. Select the Use Profile check box.

  6. Enter the name of a profile that is defined in your user profiles file in the Profile Name text field.

    For example, if you have already created a user profile called solaris, then you might enter solaris. This would cause MWS to use the connection properties associated with the solaris user profile for all users of your application, applet, JavaServer Page, or servlet.

Profile Example

User Profile File Example

The following is an example user profile file:

# ROCFORB.profiles
# Profile definitions for SAS Middleware Server

# Global debug flags
# debug.connection.logTrap=false;
# debug.connection.traceProxyClient=false;

# unix profile
solaris.connection.propertyFileKey=debug
solaris.connection.serverArchitecture=UNIX
solaris.connection.host=solarisbox.mycompany.com
solaris.connection.username=jsmith
solaris.connection.password=pswrd
solaris.connection.commandPrompt=$
solaris.connection.command=./runsas -dmr

# production profile
# production.connection.host=localhost
# production.connection.funnelHost=somePC.mycompany.com

In the example above, two profiles currently exist: a UNIX profile called solaris and a production profile called production. Notice that the solaris profile is available for use; its lines are uncommented. To edit a profile, find the lines that correspond to the profile that you need to edit and change them. For example, you might need to change the username= and password= values for the solaris profile.

To add a simple user profile named MyProfile to this file, add the following lines of code:

# My local PC profile
MyProfile.connection.serverArchitecture=PC
MyProfile.connection.host=MyMachine

These lines simply state that you are connecting to a PC and that the host is called MyMachine.

MWS also enables the user to create a custom profile processor that can then verify user information against legacy systems or an LDAP server, for example. For more information, see Custom Profile Processors.

Customizing a User Profile to use Advanced MWS Features

You can do more than specify a basic user profile by editing or adding to the lines of the user profile code listed in the RocfORB.profiles file. This section provides examples of what you can do to customize user profiles. Each example edits or builds upon the My local PC profile user profile that was added to the RocfORB.profiles file in the previous section.

Using the IOM Spawner

MWS uses the SAS Connect Spawner in many instances. In order to use the SAS IOM Spawner, edit the serverArchitecture property value of a user profile.

To use the IOM Spawner:

  1. Change the value of MyProfile.connection.serverArchitecture=PC to MyProfile.connection.serverArchitecture=IOM.

  2. When you start MWS, select the SAS IOM Spawner instead of the SAS Connect Spawner. For more information on starting and stopping MWS, see Using Middleware Server.

Preloading a Class

Preloading classes can significantly reduce the amount of time that it takes your project to start. The class, such as an MDDB class, is loaded when MWS starts instead of when the client reaches the browser.

To preload a class using a user profile:

  1. Add the line of code shown in bold below:

    # My local PC profile
    MyProfile.connection.serverArchitecture=PC
    MyProfile.connection.host=localhost
    MyProfile.connection.initialClass=four-level class name
    
  2. Stop and restart MWS so that your changes take effect.

Setting the Rollover Server

To set a rollover server (or servers) within a user profile:

  1. Add the line of code shown in bold below:

    # My local PC profile
    MyProfile.connection.serverArchitecture=PC
    MyProfile.connection.host=localhost
    MyProfile.serverRollover=machineA, machineB
    

    The new line of code states that when all SAS sessions on the server localhost are used, then SAS sessions on the machine named machineA should be used. When machineA is full, SAS sessions should rollover to machineB. Note that the machine defined by host= and all machines in the serverRollover= option must share the same server architecture.

  2. Stop and restart MWS so that your changes take effect.

Setting Rollover Server Options

To set rollover server options for any new rollover server that you set:

  1. Open the funnel.cfg file. This file can typically be found at the following path: \install-directory\Java\SAS (where install-directory is the directory in which AppDev Studio was installed).

  2. Locate the lines of code that correspond to the machines (hosts) that have been enabled:

    # syntax is:
    # serveraddress=<number of SAS sessions>/<number of clients>
    localhost=1/1
    machineA=1/1
    machineB=1/*
    
  3. Modify the code for each machine as needed. The current code has localhost handling one SAS session with one client before rolling over to machineA. machineA is configured the same way; machineB is configured to handle one SAS session with an infinite number of clients. This may not be ideal, as client requests could slow due to queuing.

  4. (Optional) If you would like to view the status of your settings, see Viewing MWS Status in Using Middleware Server.

Preloading SAS Sessions with User Profiles

Preloading SAS sessions before you need to use them saves time when your application, applet, JavaServer Page, or servlet needs to connect to data using MWS. You can use the RocfORB.profiles file to specify preloading information.

To preload SAS sessions through a user profile:

  1. Open the RocfORB.profiles file.

  2. Locate the lines of code that begin with #Preload SAS Sessions.

  3. Set the following lines of code for the SAS session that you want to preload:

    preload1.profile=profilename
    preload1.asynchronousStartup=false
    preload1.autoRestart=true
    preload1.preloadedClients=2
    preload1.retain=false
    

    The following table describes each of the preloaded properties:

    Preload Property Description Value Information
    profile specifies the name of the profile that you want to preload. appropriate profile name
    asynchronousStartup determines whether all SAS sessions should be started at once (True) or not (False). true or false
    autoRestart indicates whether the connection should be used by one client only and, if used, should then be discarded and another connection created in its place. See Terminating Preloaded SAS Sessions Abruptly when autoRestart=true for more details. true or false
    preloadedClients specifies the number of client spaces that you would like to make available at start up. Having at least two spaces means that two clients can connect without requiring any startup time. a numeric value
    retain

    If true, then all preloaded SAS sessions are retained for further clients. That is, when a preloaded client is released, another preloaded client space is created in the same SAS session for future use.

    If false, then preloaded SAS sessions are not retained after a preloaded client has been used. If another client is needed, then a new SAS session is started and the client is placed in the new session.

    true or false

  4. Set the appropriate properties for any other SAS sessions that you want to preload. Note that the prefix for the lines of code for any preload must be unique. In the example above, the prefix preload1 was used. Therefore, you might use preload2 as the prefix for the next preload.

  5. Stop and restart MWS in order to have your new properties take effect.

  6. (Optional) If you would like to view the status of your settings, see Viewing MWS Status in Using Middleware Server.

Terminating Preloaded SAS Sessions Abruptly when autoRestart=true

An abrupt termination of a preloaded SAS session occurs when

An unexpected SAS server shutdown might occur if

If a preloaded SAS session is abruptly terminated when the autoRestart preload property is set to true, MWS does not automatically restart the preloaded SAS session instantly. Instead, SAS and any preloaded SAS sessions are queued to restart when the next SAS session is requested.

To request the next SAS session, connect to data from a webAF or a webEIS client. All the preloaded SAS sessions will reappear and any old SAS sessions will be removed.

Note: There are a number of ways in which you can cleanly terminate preloaded SAS sessions, including the following examples: