org.gcube.vremanagement.resourcemanager.impl.brokerage
Class InternalBroker

java.lang.Object
  extended by org.gcube.vremanagement.resourcemanager.impl.brokerage.InternalBroker
All Implemented Interfaces:
Broker

public class InternalBroker
extends java.lang.Object
implements Broker

Trivial default Broker that assigns the target gHNs to services with a round robin policy

Author:
Manuele Simi (ISTI-CNR)

Constructor Summary
InternalBroker()
           
 
Method Summary
 void initialize(GCUBEScope scope)
          Initializes the Broker instance
 void makePlan(Session session, java.util.Set<ScopedDeployedService> services, java.lang.String[] suggestedGHNs)
          Creates a deployment plan for the given services
 void sendFeedback(Session session)
          Sends feedback to the broker about the execution of the plan for the given session
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InternalBroker

public InternalBroker()
Method Detail

initialize

public void initialize(GCUBEScope scope)
                throws java.lang.Exception
Initializes the Broker instance

Specified by:
initialize in interface Broker
Parameters:
scope - the scope where the broker will act
Throws:
java.lang.Exception - if the initialization fails (depends on the broker's nature)

makePlan

public void makePlan(Session session,
                     java.util.Set<ScopedDeployedService> services,
                     java.lang.String[] suggestedGHNs)
              throws java.lang.Exception
Creates a deployment plan for the given services

Specified by:
makePlan in interface Broker
Parameters:
session - the current session
services - the services to deploy
suggestedGHNs - the (eventually) GHNs suggested for the deployment, if specified, only these nodes will be used by the planner
Throws:
java.lang.Exception - if the preparation of the plan fails

sendFeedback

public void sendFeedback(Session session)
                  throws java.lang.Exception
Sends feedback to the broker about the execution of the plan for the given session

Specified by:
sendFeedback in interface Broker
Parameters:
session - the current session
Throws:
java.lang.Exception - if the broker is not able to manage the feedback