Class RuleBasedLocationResolver

  • All Implemented Interfaces:
    TaskLocationResolver

    public class RuleBasedLocationResolver
    extends Object
    implements TaskLocationResolver
    This class represents a task location resolver, which assigns the locations according to a filtering rules given as parameters. If task-type-pattern matches and task-name-pattern matches, check existing addresses of address-pattern, and if addresses exist, select address in round-robin fashion, if not move onto next rule in sequence, if none matches, the task is not scheduled. [task-type-pattern],[task-name-pattern],[address-pattern]
    • Constructor Detail

      • RuleBasedLocationResolver

        public RuleBasedLocationResolver()
    • Method Detail

      • init

        public void init​(Map<String,​String> properties)
                  throws org.wso2.carbon.ntask.common.TaskException
        Description copied from interface: TaskLocationResolver
        Initializes the task location resolver with the given properties.
        Specified by:
        init in interface TaskLocationResolver
        Parameters:
        properties - The property map
        Throws:
        org.wso2.carbon.ntask.common.TaskException
      • getLocation

        public int getLocation​(TaskServiceContext ctx,
                               TaskInfo taskInfo)
                        throws org.wso2.carbon.ntask.common.TaskException
        Description copied from interface: TaskLocationResolver
        Returns the location the given task should be scheduled in.
        Specified by:
        getLocation in interface TaskLocationResolver
        Parameters:
        ctx - The task context, which contains environmental information on other tasks etc..
        taskInfo - The task information of the task to be scheduled
        Returns:
        The location of the task to be scheduled
        Throws:
        org.wso2.carbon.ntask.common.TaskException