Session-creation attributes

Client-side features of the SessionCreationAttributes API enable developers to dynamically specify the priority and the associated service while creating a session.

Scope


Applicability

Details

Operating system

  • Windows

  • Linux

  • Solaris

Limitations

None


About client-side session creation workload attributes

The following attributes can be specified at session creation. You can apply SessionPriority and ServiceName separately, together, or not at all.
ServiceName

Any service name that exists in the application profile. Workload submitted to the session is sent to the service specified in the SessionCreationAttributes.

If session type is specified, the configured value for ServiceName in the session type will be used as default.

If session type is not specified when creating the session, the default ServiceName is the service configured as default="true" in the application profile.

SessionFlags

Flags that control how the API will interact with the session.

SessionName

Text to be associated with the session. This name does not have to be unique and exists to give informational details as desired by the creator of the session. SessionName is limited to 256 characters.

SessionPriority

A priority between 1 and 10,000.

If session type is specified, the configured value for SessionPriority in the session type will be used as default and ServiceName.

If no value is configured for SessionPriority, the default SessionPriority of 1 is used.

If session type is not specified when creating the session, the default SessionPriority is 1.

SessionTag

A text to be associated with a session that can be used in administrative operations. SessionTag is limited to 128 characters.

SessionType

A name associated with a collection of other attributes that can be assigned to a session on its creation. The session type specified with the API must match the session type that is defined in the application profile.

The session type is optional. If you leave this parameter blank " " or do not set a session type, system default values are used for session attributes. If you specify a session type in the client application, you must also configure the session type in the application profile—the session type name in your application profile and session type you specify in the client must match. If you use an incorrect session type in the client and the specified session type cannot be found in the applicatin profile, an exception is thrown to the client.

Example: Set workload session attributes with SessionCreationAttributes API

To set a priority of 100 and use the service named calc service associated with the session named My Session, your session creation code would look like this:
C++
SessionCreationAttributes attrs;
attrs.setSessionPriority(100);
attrs.setServiceName("calc");
attrs.setSessionName("My Session");
attrs.setSessionType("LongRunningSession");
attrs.setSessionFlags(ReceiveSync);
attrs.setSessionTag("S9v234");
...
C# (.NET)
SessionCreationAttributes attrs = new SessionCreationAttributes();
attrs.SessionPriority = 100;
attrs.ServiceName="calc";
attrs.SessionName="My Session";
attrs.SessionType="LongRunningSession"; 
attrs.SessionFlags = ReceiveSync; 
attrs.SessionTag="S9v234";
...
Java
SessionCreationAttributes attrs = new SessionCreationAttributes();
attrs.setSessionPriority(100);
attrs.setServiceName("calc");
attrs.setSessionName("My Session")
attrs.setSessionType("LongRunningSession");
attrs.setSessionFlags(ReceiveSync);
attrs.setSessionTag("S9v234");
...