Class JobCommonSLA<T extends JobCommonSLA<T>>

java.lang.Object
org.jppf.node.protocol.JobCommonSLA<T>
Type Parameters:
T - the type of SLA.
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JobClientSLA, JobSLA

public class JobCommonSLA<T extends JobCommonSLA<T>> extends Object implements Serializable
This interface represents the Service Level Agreement between a JPPF job and a server. It determines the state, conditions and order in which a job will be executed.
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • JobCommonSLA

      public JobCommonSLA()
      Default constructor.
  • Method Details

    • getExecutionPolicy

      public ExecutionPolicy getExecutionPolicy()
      Get the tasks execution policy.
      Returns:
      an ExecutionPolicy instance.
    • setExecutionPolicy

      public T setExecutionPolicy(ExecutionPolicy executionPolicy)
      Set the tasks execution policy.
      Parameters:
      executionPolicy - an ExecutionPolicy instance.
      Returns:
      this SLA, for method call chaining.
    • getJobSchedule

      public JPPFSchedule getJobSchedule()
      Get the job schedule.
      Returns:
      a JPPFSchedule instance.
    • setJobSchedule

      public T setJobSchedule(JPPFSchedule jobSchedule)
      Set the job schedule.
      Parameters:
      jobSchedule - a JPPFSchedule instance.
      Returns:
      this SLA, for method call chaining.
    • getJobExpirationSchedule

      public JPPFSchedule getJobExpirationSchedule()
      Get the job expiration schedule configuration.
      Returns:
      a JPPFSchedule instance.
    • setJobExpirationSchedule

      public T setJobExpirationSchedule(JPPFSchedule jobExpirationSchedule)
      Set the job expiration schedule configuration.
      Parameters:
      jobExpirationSchedule - a JPPFSchedule instance.
      Returns:
      this SLA, for method call chaining.
    • copyTo

      protected T copyTo(T sla)
      Create a copy of this job SLA.
      Parameters:
      sla - a JobCommonSLA into which to copy the attributes of this instance.
      Returns:
      a JobCommonSLA instance.
    • getMaxDispatchSize

      public int getMaxDispatchSize()
      Get the maximum number of tasks allowed in a dispatch of the job. This value will override the one computed by the load-balancer when maxDispatchSize < loadBalancerSize.

      By default, when setMaxDispatchSize(int) has not yet been called, this method will return Integer.MAX_VALUE.

      Returns:
      the maximum number of of tasks allowed in a job dispatch.
      Since:
      6.1
    • setMaxDispatchSize

      public T setMaxDispatchSize(int maxDispatchSize)
      Set the maximum number of tasks allowed in a dispatch of the job.
      Parameters:
      maxDispatchSize - the maximum dispatch size to set. Values less than or equal to 0 are ignored and have no effect.
      Returns:
      this SLA, for method call chaining.
      Since:
      6.1
    • isAllowMultipleDispatchesToSameChannel

      public boolean isAllowMultipleDispatchesToSameChannel()
      Determine whether to allow multiple concurrent dispatches of the job to the same driver (client-side SLA) or to the same node (server-side SLA).
      Returns:
      true (the default) if multiple dispatches of the job can be sent to the same channel, false otherwise.
      Since:
      6.1
    • setAllowMultipleDispatchesToSameChannel

      public T setAllowMultipleDispatchesToSameChannel(boolean allowMultipleDispatchesToSameChannel)
      Specifiy whether to allow multiple concurrent dispatches of the job to the same driver (client-side SLA) or to the same node (server-side SLA).
      Parameters:
      allowMultipleDispatchesToSameChannel - true to allow multiple dispatches of the job to be sent to the same channel, false otherwise.
      Returns:
      this SLA, for method call chaining.
      Since:
      6.1
    • getPreferencePolicy

      public Preference getPreferencePolicy()
      Get the preference policy.for this job SLA.
      Returns:
      a Preference policy instance, or null if it was not set.
      Since:
      6.1
    • setPreferencePolicy

      public T setPreferencePolicy(Preference preferencePolicy)
      Set the preference policy for this job SLA.
      Parameters:
      preferencePolicy - a Preference policy instance, which may be null
      Returns:
      this SLA, for method call chaining.
      Since:
      6.1