Class EphemeralInstanceAllocator

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      uk.co.ractf.polaris.api.instance.Instance allocate​(uk.co.ractf.polaris.api.instanceallocation.InstanceRequest request)
      Allocate an Instance to a user based on the Allocation rules defined in the Challenge, this should return the same instance if called multiple times with the same InstanceRequest, unless a call to InstanceAllocator.requestNewAllocation(InstanceRequest) has been made, in which case the instance returned from here will be avoided where possible.
      uk.co.ractf.polaris.api.instance.Instance requestNewAllocation​(uk.co.ractf.polaris.api.instanceallocation.InstanceRequest request)
      Discard the current Instance allocation and get a new one, also add the currently Instance to an avoid list so the instance allocator can avoid allocating that instance to the same user/team again.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EphemeralInstanceAllocator

        public EphemeralInstanceAllocator​(ClusterState clusterState)
    • Method Detail

      • allocate

        public uk.co.ractf.polaris.api.instance.Instance allocate​(uk.co.ractf.polaris.api.instanceallocation.InstanceRequest request)
        Description copied from interface: InstanceAllocator
        Allocate an Instance to a user based on the Allocation rules defined in the Challenge, this should return the same instance if called multiple times with the same InstanceRequest, unless a call to InstanceAllocator.requestNewAllocation(InstanceRequest) has been made, in which case the instance returned from here will be avoided where possible.
        Specified by:
        allocate in interface InstanceAllocator
        Parameters:
        request - the instance request
        Returns:
        the allocated instance
      • requestNewAllocation

        public uk.co.ractf.polaris.api.instance.Instance requestNewAllocation​(uk.co.ractf.polaris.api.instanceallocation.InstanceRequest request)
        Description copied from interface: InstanceAllocator
        Discard the current Instance allocation and get a new one, also add the currently Instance to an avoid list so the instance allocator can avoid allocating that instance to the same user/team again.
        Specified by:
        requestNewAllocation in interface InstanceAllocator
        Parameters:
        request - the instance request to ge
        Returns:
        a new instance for the user/team