orca.shirako.api
Interface IKernel

All Known Implementing Classes:
Kernel

public interface IKernel

IKernel defines the public kernel interface for use by actors.


Method Summary
 Slice[] getClientSlices()
          Returns all client slices registered with the kernel.
 Slice[] getInventorySlices()
          Returns all inventory slices registered with the kernel.
 ResourceReservation getReservation(ReservationID rid)
          Returns the reservation with the given reservation identifier.
 ResourceReservation[] getReservations(SliceID sliceID)
          Returns all reservations in the given slice
 Slice getSlice(SliceID sliceID)
          Returns the slice with the given name.
 Slice[] getSlices()
          Returns all slice registered with the kernel.
 IShirakoPlugin getSlicesPlugin()
          Returns the Shirako plugin.
 void registerReservation(ResourceReservation reservation)
          Registers the given reservation with the kernel.
 void registerSlice(Slice slice)
          Registers the slice with the kernel: adds the slice object to the kernel data structures and adds a database record for the slice.
 void removeReservation(ReservationID rid)
          Unregisters the reservation from the kernel data structures and removes its record from the database.
 void removeSlice(SliceID sliceID)
          Unregisters the slice (if it is registered with the kernel) and removes it from the database.
 void reregisterReservation(ResourceReservation reservation)
          Registers a previously unregistered reservation with the kernel.
 void reregisterSlice(Slice slice)
          Registers the slice with the kernel: adds the slice object to the kernel data structures.
 void tick()
          Checks all reservations for completions or problems.
 void unregisterReservation(ReservationID rid)
          Unregisters the reservation from the kernel data structures.
 void unregisterSlice(SliceID sliceID)
          Unregisters the slice and releases any resources that it may hold.
 

Method Detail

registerSlice

void registerSlice(Slice slice)
                   throws java.lang.Exception
Registers the slice with the kernel: adds the slice object to the kernel data structures and adds a database record for the slice.

Parameters:
slice - slice to register
Throws:
java.lang.Exception - if the slice is already registered or a database error occurs. If a database error occurs, the slice will be unregistered.

reregisterSlice

void reregisterSlice(Slice slice)
                     throws java.lang.Exception
Registers the slice with the kernel: adds the slice object to the kernel data structures. The slice object must have an existing database record.

Parameters:
slice - slice to register
Throws:
java.lang.Exception - if the slice is already registered or a database error occurs. If a database error occurs, the slice will be unregistered.

unregisterSlice

void unregisterSlice(SliceID sliceID)
                     throws java.lang.Exception
Unregisters the slice and releases any resources that it may hold.

Note: A slice can be unregistered only if it contains only closed or failed reservations.

Parameters:
sliceID - identifier of slice to unregister
Throws:
java.lang.Exception

removeSlice

void removeSlice(SliceID sliceID)
                 throws java.lang.Exception
Unregisters the slice (if it is registered with the kernel) and removes it from the database.

Note: A slice can be removed only if it contains only closed or failed reservations.

Parameters:
sliceID - identifier of slice to remove
Throws:
java.lang.Exception

getSlice

Slice getSlice(SliceID sliceID)
Returns the slice with the given name.

Parameters:
sliceID - identifier of slice to return
Returns:
the requested slice or null if no slice with the requested name is registered with the kernel.

getSlices

Slice[] getSlices()
Returns all slice registered with the kernel.

Returns:
an array of slices registered with the kernel

getInventorySlices

Slice[] getInventorySlices()
Returns all inventory slices registered with the kernel.

Returns:
an array of inventory slices registered with the kernel

getClientSlices

Slice[] getClientSlices()
Returns all client slices registered with the kernel.

Returns:
an array of client slices registered with the kernel

registerReservation

void registerReservation(ResourceReservation reservation)
                         throws java.lang.Exception
Registers the given reservation with the kernel. Adds a database record for the reservation. The containing slice should have been previously registered with the kernel and no database record should exist. When registering a reservation with an existing database record use reregisterReservation(ResourceReservation). Only reservations that are not closed or failed can be registered. Closed or failed reservations will be ignored.

Parameters:
reservation - the reservation to register
Throws:
java.lang.IllegalArgumentException - when the passed in argument is illegal
java.lang.Exception - if the reservation has already been registered with the kernel.
java.lang.RuntimeException - when a database error occurs. In this case the reservation will be unregistered from the kernel data structures.

reregisterReservation

void reregisterReservation(ResourceReservation reservation)
                           throws java.lang.Exception
Registers a previously unregistered reservation with the kernel. The containing slice should have been previously registered with the kernel and a database record for the reservation should exist. When registering a reservation without and existing database record use registerReservation(ResourceReservation). Only reservations that are not closed or failed can be registered. Closed or failed reservations will be ignored.

Parameters:
reservation - the reservation to reregister
Throws:
java.lang.IllegalArgumentException - when the passed in argument is illegal
java.lang.Exception - if the reservation has already been registered with the kernel or the reservation does not have a database record. In the latter case the reservation will be unregistered from the kernel data structures.
java.lang.RuntimeException - if a database error occurs

unregisterReservation

void unregisterReservation(ReservationID rid)
                           throws java.lang.Exception
Unregisters the reservation from the kernel data structures.

Note: does not remove the reservation database record.

*

Note:Only failed, closed, or close waiting reservations can be unregistered.

Parameters:
rid - identifier for reservation to unregister
Throws:
java.lang.IllegalArgumentException - when the passed in argument is illegal
java.lang.Exception

getReservation

ResourceReservation getReservation(ReservationID rid)
Returns the reservation with the given reservation identifier.

Parameters:
rid - reservation identifier
Returns:
reservation with the given reservation identifier

getReservations

ResourceReservation[] getReservations(SliceID sliceID)
Returns all reservations in the given slice

Parameters:
sliceID - identifier of slice
Returns:
an array of all reservations in the slice

removeReservation

void removeReservation(ReservationID rid)
                       throws java.lang.Exception
Unregisters the reservation from the kernel data structures and removes its record from the database.

Note:Only failed, closed, or close waiting reservations can be removed.

Parameters:
rid - identifier of reservation to remove
Throws:
java.lang.Exception

tick

void tick()
          throws java.lang.Exception
Checks all reservations for completions or problems. We might want to do these a few at a time.

Throws:
java.lang.Exception

getSlicesPlugin

IShirakoPlugin getSlicesPlugin()
Returns the Shirako plugin.

Returns:
Shirako plugin


Copyright © 2007 Network/Internet Computing Lab. All Rights Reserved.