org.iids.aos.systemservices
Interface LocationManager

All Superinterfaces:
SystemService
All Known Implementing Classes:
LocalLocationManager

public interface LocationManager
extends SystemService

Author:
mobach@cs.vu.nl

Field Summary
static java.lang.String HOST_MANAGER_LOCATION
           
static java.lang.String LOCATION_MANAGER_ADDRESS
           
static java.lang.String LOOKUP_REGISTRATION_NAME
           
 
Method Summary
 AgreementOffer acceptLease(java.lang.String leaseIdentifier)
           
 AgentID create_agentid()
          Generate ID for a new agent, which can be used to create an agent on a host in this location.
 AgentScapeID create_agentscapeid()
          Generate ID for new service.
 boolean deregister(AgentScapeID id)
          Deregister host manager with location manager.
 Address insert_agent(AgentID agentID, java.lang.String leaseIdentifier)
          Finds a suitable host to run the agent on, and return the address where this host manager can be contacted.
 java.util.HashMap<AgentScapeID,java.util.List<AgentID>> list_agents()
          Obtain list of all agents in this location.
 java.util.HashMap<AgentScapeID,Address> list_hosts()
          Obtain a list of all the hosts that are part of this location.
 MigrationEndpoint local_migration_request(AgentID agentId, java.lang.String leaseIdentifier, AgentScapeID requestingAgentServer, AgentScapeID destLocationId)
          Called by a host manager (part of this location) to instruct the location manager to start the migration process by contacting the remote location manager.
 java.lang.String pingString()
           
 void pingVoid()
           
 int register(AgentScapeID id, Address address)
          Register host manager with location.
 void rejectLease(java.lang.String leaseIdentifier)
           
 MigrationEndpoint remote_migration_request(AgentID agentId, java.lang.String leaseIdentifier, Address requestingLocationAddress, Address requestingHostAddress)
          Called by location manager that initiates migration, to request migration of an agent to this location.
 AgreementOffer requestLease(AgreementOffer leaseRequest)
           
 AgreementOffer requestLeaseStatus(java.lang.String leaseIdentifier)
           
 TemplateList requestTemplates()
           
 
Methods inherited from interface org.iids.aos.systemservices.SystemService
pingService, shutdown, unbind
 

Field Detail

LOOKUP_REGISTRATION_NAME

static final java.lang.String LOOKUP_REGISTRATION_NAME
See Also:
Constant Field Values

LOCATION_MANAGER_ADDRESS

static final java.lang.String LOCATION_MANAGER_ADDRESS
See Also:
Constant Field Values

HOST_MANAGER_LOCATION

static final java.lang.String HOST_MANAGER_LOCATION
See Also:
Constant Field Values
Method Detail

register

int register(AgentScapeID id,
             Address address)
Register host manager with location.

TODO exceptions

Parameters:
id - The AgentScapeID of the host manager to add.
address - Address where host manager can be contacted.
Returns:
timeout in seconds after which registration will be automatically removed. Renew before that time.

deregister

boolean deregister(AgentScapeID id)
Deregister host manager with location manager.

TODO exceptions

Parameters:
id - The AgentScapeID of the host manager to remove.
Returns:
true if deregistration has succeeded, false otherwise

create_agentid

AgentID create_agentid()
Generate ID for a new agent, which can be used to create an agent on a host in this location.

Returns:
The newly generated AgentID.

create_agentscapeid

AgentScapeID create_agentscapeid()
Generate ID for new service.

XXX experimental..


insert_agent

Address insert_agent(AgentID agentID,
                     java.lang.String leaseIdentifier)
                     throws AgentCreationException
Finds a suitable host to run the agent on, and return the address where this host manager can be contacted.

Parameters:
agentID - ID of the agent XXX unused parameter.
leaseIdentifier - The lease to extract the host information from.
Returns:
Address of hostmanager where agent will run.
Throws:
AgentCreationException - If the agreement provider in the lease cannot be located. TODO should be NegotiationLibException?

remote_migration_request

MigrationEndpoint remote_migration_request(AgentID agentId,
                                           java.lang.String leaseIdentifier,
                                           Address requestingLocationAddress,
                                           Address requestingHostAddress)
                                           throws MigrationFailedException
Called by location manager that initiates migration, to request migration of an agent to this location.

Parameters:
agentId - The AgentID of the agent to be migrated.
leaseIdentifier - Identifier of the lease that contains agent placement.
requestingLocationAddress - Address of source LocationManager XXX unused?
requestingHostAddress - Address of source HostManager.
Returns:
Migration endpoint where the agent container can be sent to.
Throws:
MigrationFailedException - Error performing migration request.

local_migration_request

MigrationEndpoint local_migration_request(AgentID agentId,
                                          java.lang.String leaseIdentifier,
                                          AgentScapeID requestingAgentServer,
                                          AgentScapeID destLocationId)
                                          throws MigrationFailedException
Called by a host manager (part of this location) to instruct the location manager to start the migration process by contacting the remote location manager.

Parameters:
agentId - The AgentID of the agent to be migrated.
leaseIdentifier - Identifier of the lease that contains agent placement.
requestingAgentServer - The Address of the requesting agent server.
destLocationId - Target location for the agent.
Returns:
Migration endpoint where the agent container can be sent to.
Throws:
MigrationFailedException - Error performing migration request.

requestTemplates

TemplateList requestTemplates()

requestLease

AgreementOffer requestLease(AgreementOffer leaseRequest)

acceptLease

AgreementOffer acceptLease(java.lang.String leaseIdentifier)

rejectLease

void rejectLease(java.lang.String leaseIdentifier)

requestLeaseStatus

AgreementOffer requestLeaseStatus(java.lang.String leaseIdentifier)

list_agents

java.util.HashMap<AgentScapeID,java.util.List<AgentID>> list_agents()
Obtain list of all agents in this location.

Repeatedly queries all host managers for a list of agents that are running there. The entire collection of all AgentID's that are running on all hosts in this location, is returned by this method.

Returns:
List of all agents that are present in this location.

list_hosts

java.util.HashMap<AgentScapeID,Address> list_hosts()
Obtain a list of all the hosts that are part of this location.

XXX experimental call...

Returns:
A map of <AgentScapeID,Address> pairs.

pingString

java.lang.String pingString()

pingVoid

void pingVoid()


Copyright © 2003, 2004 IIDS Group. All Rights Reserved.