Visit Platform at http://www.platform.com

Platform Symphony 5.0 Java API Reference

com.platform.symphony.soam
Class SessionCreationAttributes

java.lang.Object
  extended by com.platform.symphony.soam.SessionCreationAttributes

public final class SessionCreationAttributes
extends java.lang.Object

Container for all attributes that may be required upon session creation.

See Also:
Connection.createSession(SessionCreationAttributes)

Constructor Summary
SessionCreationAttributes()
          Default constructor.
 
Method Summary
 void addDefinition(ResourceAttributeDefinition attributeDefinition)
          Add resource attribute definition to resource reference object of the session.
 void enableDataCompression(boolean compressionEnable)
          Enables or disables data compression for a session.
 void enableDirectDataTransfer(boolean directDataTransferEnable)
          Enables or disables Direct Data Transfer for a session.
 void setCommonData(Message commonData)
          Sets the common data.
 void setCommonData(java.io.Serializable commonData)
          Sets the common data.
 void setDataCompressionFlags(long dataCompressionFlag)
          Sets any flag associated with data compression.
 void setDataCompressionThreshold(int threshold)
          Sets the threshold for triggering data compression.
 void setDefaultResourceAttributeValue(double value)
          Sets the default value of resource attribute for the session.
 void setDirectDataTransferFlags(long ddtFlags)
          Sets any flag associated with Direct Data Transfer.
 void setPreemptionRank(int sessionPreemptionRank)
          Sets the preemption rank of the session.
 void setPreemptive(boolean preemptive)
          Specifies whether the session preempts sessions with lower priority when it has workload to run.
 void setResourceGroupFilter(java.lang.String filter)
          Applies a resource group filter to this session.
 void setResourcePreference(ResourcePreference resourcePreference)
          Sets the resource preference object of the session.
 void setServiceName(java.lang.String serviceName)
          Sets the service name to be associated with the session.
 void setServiceToSlotRatio(ServiceToSlotRatio ratio)
          Applies a slot usage requirement to this session by specifying a service to slot ratio.
 void setSessionCallback(SessionCallback callback)
          Sets the session callback.
 void setSessionFlags(long flags)
          Sets the session flags.
 void setSessionName(java.lang.String name)
          Sets the name of the session.
 void setSessionPriority(int priority)
          Sets the priority of the session.
 void setSessionTag(java.lang.String tag)
          Sets the session tag.
 void setSessionType(java.lang.String type)
          Sets the session type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionCreationAttributes

public SessionCreationAttributes()
Default constructor. Constructs a SessionCreationAttributes object with default settings.

Method Detail

setSessionName

public void setSessionName(java.lang.String name)
                    throws SoamException
Sets the name of the session. The session name attribute tells Symphony what name to give your session, so that the session can be easily identified. Maximum 256 characters. Default session name is "".

Parameters:
name - The session name.
Throws:
SoamException

setSessionType

public void setSessionType(java.lang.String type)
                    throws SoamException
Sets the session type. The session type argument tells Symphony which type of session to create. In the application profile, you can define different types of sessions with different attributes. Symphony also defines a system default session type with the name "". For this argument, specify the name of the session type you would like to use. Default value is "".

Parameters:
type - The session type.
Throws:
SoamException

setSessionFlags

public void setSessionFlags(long flags)
                     throws SoamException
Sets the session flags. The session flags are used to inform the API of any extended behavior to associate with the session. When not specified the default flag will be Session.SYNC. See the com.platform.symphony.soam.Session object for explanation of flags and their usage.

Parameters:
flags - The session flags.
Throws:
SoamException
See Also:
Session

setCommonData

public void setCommonData(Message commonData)
                   throws SoamException
Sets the common data. This method allows you to provide common data to the created session. Common data is any data that is common to all of the tasks in your session. You can send common data rather than sending duplicate data to each task, and thus save on network overhead. Default value is null - no common data.

Parameters:
commonData - The common data for the session.
Throws:
SoamException

setCommonData

public void setCommonData(java.io.Serializable commonData)
                   throws SoamException
Sets the common data. This method allows you to provide common data to the created session. Common data is any data that is common to all of the tasks in your session. You can send common data rather than sending duplicate data to each task, and thus save on network overhead. Default value is null - no common data.

Parameters:
commonData - The common data for the session.
Throws:
SoamException

setSessionCallback

public void setSessionCallback(SessionCallback callback)
                        throws SoamException
Sets the session callback. This method allows you to specify a SessionCallback object, which is a handler that will allow you to process your session's task results asynchronously. The session callback should only be provided when you have set the appropriate session flags to indicate that you will be receiving task results asynchronously. Default value is null - no session callback.

Parameters:
callback - The session callback.
Throws:
SoamException

setSessionTag

public void setSessionTag(java.lang.String tag)
                   throws SoamException
Sets the session tag. Session tag is just a string that will be associated with the created session. Maximum length 128 characters. Default value is "", which means that no session tag is associated with the session.

Parameters:
tag - The session tag.
Throws:
SoamException

setServiceName

public void setServiceName(java.lang.String serviceName)
                    throws SoamException
Sets the service name to be associated with the session. This methods allows the developer to dynamically associate a service name with the session being created. You can define multiple Service sections in your application profile, where each service may be different. Setting the service name on your session means that this session will be serviced by the specified service section.

Note: The service name can only be one of the names defined in the application profile.

Parameters:
serviceName - The service name.
Throws:
SoamException

setSessionPriority

public void setSessionPriority(int priority)
                        throws SoamException
Sets the priority of the session. Depending on the scheduling policy in effect for an application, a session's priority may impact the assignment of service instances to a session, whenever the Session Manager attempts to make scheduling decisions. The higher the priority the greater the likelihood that a service instance will be assigned to this session (if one is available).

Note: The session priority can be any number between 1 and 10,000 (inclusive).

Parameters:
priority - The priority of the session.
Throws:
SoamException

setPreemptionRank

public void setPreemptionRank(int sessionPreemptionRank)
                       throws SoamException
Sets the preemption rank of the session. A session's preemptionRank will impact the reclaim behavior among sessions. The session with lower preemptionRank is more desirable to be reclaimed.

Note: The preemptionRank can be any number between 1 and 10,000 (inclusive).

Parameters:
sessionPreemptionRank - The reclaim rank of the session.
Throws:
SoamException

enableDataCompression

public void enableDataCompression(boolean compressionEnable)
                           throws SoamException
Enables or disables data compression for a session.

Data compression will be triggered once the serialized data size is larger than the Data Compression Threshold. The default Data Compression Threshold is 1KB. Data compression can be enabled or disabled while creating the session and cannot be changed once the session has been created. When not explicitly specified, data compression will be disabled.

Note: Once enabled, all data compression attributes will be applied to common data, common data updates, task input and task output.

Parameters:
compressionEnable - Enable or disable data compression.
Throws:
SoamException

setDataCompressionThreshold

public void setDataCompressionThreshold(int threshold)
                                 throws SoamException
Sets the threshold for triggering data compression.

When data compression is enabled for a session, the Data Compression Threshold will be the amount of serialized data (in kilobytes) to allow before triggering compression. The default value for this threshold is 1 kilobyte.

Note: Sets this value has no effect if data compression is disabled.

Parameters:
threshold - The data compression threshold.
Throws:
SoamException

setDataCompressionFlags

public void setDataCompressionFlags(long dataCompressionFlag)
                             throws SoamException
Sets any flag associated with data compression.

When data compression is enabled for a session, compression flags can be used to modify the behavior of the data compression feature. The default value for this flag is DataCompressionFlags.BEST_SPEED.

Note: Sets this value has no effect if data compression is disabled.

Parameters:
dataCompressionFlag - The Compression flags.
Throws:
SoamException
See Also:
DataCompressionFlags

enableDirectDataTransfer

public void enableDirectDataTransfer(boolean directDataTransferEnable)
                              throws SoamException
Enables or disables Direct Data Transfer for a session.

Direct Data Transfer will provide a way to directly send the data from the client to the service transparently to the client application or vice versa. This attribute may be set during session creation operations. If this attribute is not set by the application it means Direct Data Transfer will not be enabled.

Note: Once enabled, all Direct Data Transfer attributes will be applied to common data, common data updates, task input and task output.

Parameters:
directDataTransferEnable - Flag that specifies whether to enable the Direct Data Transfer feature.
Throws:
SoamException

setDirectDataTransferFlags

public void setDirectDataTransferFlags(long ddtFlags)
                                throws SoamException
Sets any flag associated with Direct Data Transfer.

When Direct Data Transfer is enabled for a session, Direct Data Transfer flags can be used to modify the behavior of the Direct Data Transfer feature.

Note: Setting this value has no effect if Direct Data Transfer is disabled.

Parameters:
ddtFlags - The Direct Data Transfer flags.
Throws:
SoamException
See Also:
DirectDataTransferFlags

setPreemptive

public void setPreemptive(boolean preemptive)
                   throws SoamException
Specifies whether the session preempts sessions with lower priority when it has workload to run.

If set to true, the session with higher priority preempts sessions with lower priority to get resources and finish the session as soon as possible.

Parameters:
preemptive - Specifies whether the session preempts others.
Throws:
SoamException

setServiceToSlotRatio

public void setServiceToSlotRatio(ServiceToSlotRatio ratio)
                           throws SoamException
Applies a slot usage requirement to this session by specifying a service to slot ratio. This service to slot ratio overrides the one defined for the SessionType in the application profile. Tasks from this session can only run on service instances that occupy the appropriate number of slots.

The ratio specified must be either 1:N or N:1, where N is a positive integer. For N:1, the maximum value of N is 10. A 1:N ratio means that 1 service instance runs on multiple slots. An N:1 ratio means that multiple service instances run on 1 slot. Default value is 1:1.

Parameters:
ratio - The number of service to slot ratio to apply to this session.
Throws:
SoamException

setResourceGroupFilter

public void setResourceGroupFilter(java.lang.String filter)
                            throws SoamException
Applies a resource group filter to this session. This resource group filter overrides the one defined for the SessionType in the application profile. Tasks from a session can only run on resources that belong to one of the resource groups listed in the filter. Default value is "", meaning that no filter is specified; the application-level resource group will take effect.

Parameters:
filter - The resource group filter to apply to this session.
Throws:
SoamException

setDefaultResourceAttributeValue

public void setDefaultResourceAttributeValue(double value)
                                      throws SoamException
Sets the default value of resource attribute for the session. A session's default value of resource attribute will impact the resource schedule behavior among sessions.

Note: The value range is -1.000001e+300 to 1.000001e+300

Parameters:
value - The default value of the resource attribute for the session.
Throws:
SoamException

addDefinition

public void addDefinition(ResourceAttributeDefinition attributeDefinition)
                   throws SoamException
Add resource attribute definition to resource reference object of the session.

Parameters:
attributeDefinition - The resource attribute definition for resource preference of the session.
Throws:
SoamException

setResourcePreference

public void setResourcePreference(ResourcePreference resourcePreference)
                           throws SoamException
Sets the resource preference object of the session.

Parameters:
resourcePreference - The resource reference of the session.
Throws:
SoamException

Version 5.0
Date Modified: -DREL_DATE=Nov 11 2009
Platform Computing. Accelerating Intelligence(TM).
Copyright (C) 2001-2009 Platform Computing Corporation. All rights reserved.