Interface InstanceAllocator
-
- All Known Implementing Classes:
EphemeralInstanceAllocator
public interface InstanceAllocatorThe interface used to getInstanceallocations for a user/team and request new allocations
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description uk.co.ractf.polaris.api.instance.Instanceallocate(uk.co.ractf.polaris.api.instanceallocation.InstanceRequest request)Allocate anInstanceto a user based on theAllocationrules defined in theChallenge, this should return the same instance if called multiple times with the sameInstanceRequest, unless a call torequestNewAllocation(InstanceRequest)has been made, in which case the instance returned from here will be avoided where possible.uk.co.ractf.polaris.api.instance.InstancerequestNewAllocation(uk.co.ractf.polaris.api.instanceallocation.InstanceRequest request)Discard the currentInstanceallocation and get a new one, also add the currentlyInstanceto an avoid list so the instance allocator can avoid allocating that instance to the same user/team again.
-
-
-
Method Detail
-
allocate
uk.co.ractf.polaris.api.instance.Instance allocate(uk.co.ractf.polaris.api.instanceallocation.InstanceRequest request)
Allocate anInstanceto a user based on theAllocationrules defined in theChallenge, this should return the same instance if called multiple times with the sameInstanceRequest, unless a call torequestNewAllocation(InstanceRequest)has been made, in which case the instance returned from here will be avoided where possible.- Parameters:
request- the instance request- Returns:
- the allocated instance
-
requestNewAllocation
uk.co.ractf.polaris.api.instance.Instance requestNewAllocation(uk.co.ractf.polaris.api.instanceallocation.InstanceRequest request)
Discard the currentInstanceallocation and get a new one, also add the currentlyInstanceto an avoid list so the instance allocator can avoid allocating that instance to the same user/team again.- Parameters:
request- the instance request to ge- Returns:
- a new instance for the user/team
-
-