org.jenkinsci.plugins.externalscheduler
Class RestScheduler

java.lang.Object
  extended by org.jenkinsci.plugins.externalscheduler.RestScheduler
All Implemented Interfaces:
Scheduler

public final class RestScheduler
extends Object
implements Scheduler

Planner implementation that work as a remote proxy for REST API planner

Author:
ogondza

Constructor Summary
RestScheduler(URL serviceDestination)
           
RestScheduler(URL serviceDestination, com.sun.jersey.api.client.Client client)
           
 
Method Summary
 String name()
           
 boolean queue(StateProvider stateProvider, NodeAssignments assignments)
          Put new state into planner
 URL remoteUrl()
          Get planner URL
 Score score()
          Get planner score
 NodeAssignments solution()
          Get planner solution
 Scheduler stop()
          Stop planner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestScheduler

public RestScheduler(URL serviceDestination)
              throws SchedulerException
Throws:
SchedulerException

RestScheduler

public RestScheduler(URL serviceDestination,
                     com.sun.jersey.api.client.Client client)
              throws SchedulerException
Throws:
SchedulerException
Method Detail

remoteUrl

public URL remoteUrl()
Description copied from interface: Scheduler
Get planner URL

Specified by:
remoteUrl in interface Scheduler
Returns:
Associated URL
See Also:
Scheduler.remoteUrl()

name

public String name()

score

public Score score()
            throws SchedulerException
Description copied from interface: Scheduler
Get planner score

Specified by:
score in interface Scheduler
Returns:
score
Throws:
SchedulerException
See Also:
Scheduler.score()

solution

public NodeAssignments solution()
                         throws SchedulerException
Description copied from interface: Scheduler
Get planner solution

Specified by:
solution in interface Scheduler
Returns:
New assignments
Throws:
SchedulerException
See Also:
Scheduler.solution()

queue

public boolean queue(StateProvider stateProvider,
                     NodeAssignments assignments)
              throws SchedulerException
Description copied from interface: Scheduler
Put new state into planner

Specified by:
queue in interface Scheduler
Parameters:
stateProvider - Jenkins state
assignments - Current assignments
Returns:
updated or not
Throws:
SchedulerException
See Also:
Scheduler.queue(org.jenkinsci.plugins.externalscheduler.StateProvider, org.jenkinsci.plugins.externalscheduler.NodeAssignments)

stop

public Scheduler stop()
               throws SchedulerException
Description copied from interface: Scheduler
Stop planner

Specified by:
stop in interface Scheduler
Returns:
self
Throws:
SchedulerException
See Also:
Scheduler.stop()


Copyright © 2004-2013. All Rights Reserved.