GridSim 5.0 beta

gridsim
Class GridUser

Object
  extended by Thread
      extended by Sim_entity
          extended by GridSimCore
              extended by GridSim
                  extended by GridUser
All Implemented Interfaces:
Cloneable, Runnable
Direct Known Subclasses:
DataGridUser

public class GridUser
extends GridSim

GridUser class acts as a medium to communicate with AbstractGIS entity. For more details on how to use this class, please look at examples/RegionalGIS directory.

Since:
GridSim Toolkit 3.2
Author:
Anthony Sulistio
Invariant:
$none

Nested Class Summary
 
Nested classes/interfaces inherited from class Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  int gisID_
          A regional GIS entity ID that is needed for communication
 
Fields inherited from class GridSim
GRIDSIM_VERSION_STRING, PAUSE
 
Fields inherited from class GridSimCore
input, NETWORK_TYPE, output
 
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
GridUser(String name, Link link)
          Creates a GridUser object
GridUser(String name, Link link, String regionalGIS)
          Creates a GridUser object
 
Method Summary
 void finishSimulation()
          Tells the GridSim that this entity finishes its simulation / experiment.
 void finishSimulation(double time)
          Tells the GridSim that this entity finishes its simulation / experiment.
 Object[] getGlobalResourceARList()
          Gets a list of global resources that support advance reservation.
 Object[] getGlobalResourceList()
          Gets a list of global resources.
protected  Object[] getList(int eventTag)
          Gets a list of other request to the regional GIS entity as defined in gisID_.
protected  Object[] getList(int eventTag, int otherRegionalID)
          Gets a list of other request to the given regional GIS entity ID.
 Object[] getLocalResourceARList()
          Gets a list of local resources that support advance reservation from a regional GIS entity, defined in gisID_.
 Object[] getLocalResourceList()
          Gets a list of local resources from a regional GIS entity, defined in gisID_.
 int getRegionalGISId()
          Gets the regional GIS entity ID
 Object[] getRegionalGISList()
          Gets a list of all regional GIS entity IDs
 String getRegionalGISName()
          Gets the regional GIS entity name
 boolean setRegionalGIS(AbstractGIS gis)
          Sets a regional GIS for this entity to communicate with
 boolean setRegionalGIS(String gisName)
          Sets a regional GIS entity name for this entity to communicate with
 
Methods inherited from class GridSim
clock, disableDebugMode, enableDebugMode, getAdvancedReservationList, getEntityId, getEntityName, getEntityName, getEntityName, getGISId, getGridInfoServiceEntityId, getGridResourceList, getGridSimShutdownEntityId, getGridStatisticsEntityId, getNetworkType, getNumFreePE, getNumFreePE, getNumPE, getNumPE, getResourceCharacteristics, getResourceDynamicInfo, getSimulationCalendar, getSimulationStartDate, getVisualizer, gridletCancel, gridletCancel, gridletMove, gridletMove, gridletPause, gridletPause, gridletReceive, gridletReceive, gridletReceive, gridletResume, gridletResume, gridletStatus, gridletStatus, gridletSubmit, gridletSubmit, gridletSubmit, gridSimHold, init, init, init, initNetworkType, isDebugModeEnabled, isResourceExist, isResourceExist, isTraceEnabled, pauseSimulation, pauseSimulation, receiveEventObject, receiveEventObject, recordStatistics, recordStatistics, recordStatistics, recordStatistics, resourceSupportAR, resourceSupportAR, resumeSimulation, setGIS, shutdownGridStatisticsEntity, shutdownUserEntity, startGridSimulation, startGridSimulation, stopGridSimulation
 
Methods inherited from class GridSimCore
finalizeGridSimulation, getLink, getPingResult, isNetworked, ping, ping, ping, ping, pingBlockingCall, pingBlockingCall, pingBlockingCall, pingBlockingCall, send, send, send, send, send, send, setBackgroundTraffic, setBackgroundTraffic, terminateIOEntities
 
Methods inherited from class Sim_entity
add_generator, add_param, add_port, body, clone, get_id, get_name, get_port, get_port, get_stat, run, send_on, set_invisible, set_stat, sim_cancel, sim_completed, sim_current, sim_get_next, sim_get_next, sim_hold_for, sim_hold, sim_pause_for, sim_pause_for, sim_pause_until, sim_pause_until, sim_pause, sim_process_for, sim_process_for, sim_process_until, sim_process_until, sim_process, sim_putback, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_select, sim_trace, sim_wait_for, sim_wait_for, sim_wait_for, sim_wait, sim_waiting, sim_waiting
 
Methods inherited from class Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

gisID_

protected int gisID_
A regional GIS entity ID that is needed for communication

Constructor Detail

GridUser

public GridUser(String name,
                Link link)
         throws Exception
Creates a GridUser object

Parameters:
name - this entity name
link - a network link connecting this entity
Throws:
Exception - happens if either name or link is empty
Pre Condition:
name != null, link != null
Post Condition:
$none

GridUser

public GridUser(String name,
                Link link,
                String regionalGIS)
         throws Exception
Creates a GridUser object

Parameters:
name - this entity name
link - a network link connecting this entity
regionalGIS - a regional GridInformationService (GIS) entity name
Throws:
Exception - happens if one of the inputs is empty
Pre Condition:
name != null, link != null, regionalGIS != null
Post Condition:
$none
Method Detail

getRegionalGISName

public String getRegionalGISName()
Gets the regional GIS entity name

Returns:
regional GIS entity name or null if GIS does not exist
Pre Condition:
$none
Post Condition:
$none

finishSimulation

public void finishSimulation()
Tells the GridSim that this entity finishes its simulation / experiment.

Pre Condition:
$none
Post Condition:
$none

finishSimulation

public void finishSimulation(double time)
Tells the GridSim that this entity finishes its simulation / experiment.

Parameters:
time - expected finish time
Pre Condition:
time > 0
Post Condition:
$none

getRegionalGISId

public int getRegionalGISId()
Gets the regional GIS entity ID

Returns:
regional GIS entity ID or -1 if GIS does not exist
Pre Condition:
$none
Post Condition:
$none

setRegionalGIS

public boolean setRegionalGIS(String gisName)
Sets a regional GIS entity name for this entity to communicate with

Parameters:
gisName - a regional GIS entity name
Returns:
true if it is successful, false otherwise
Pre Condition:
gisName != null
Post Condition:
$none

setRegionalGIS

public boolean setRegionalGIS(AbstractGIS gis)
Sets a regional GIS for this entity to communicate with

Parameters:
gis - a regional GIS entity
Returns:
true if it is successful, false otherwise
Pre Condition:
gis != null
Post Condition:
$none

getRegionalGISList

public Object[] getRegionalGISList()
Gets a list of all regional GIS entity IDs

Returns:
a list of all regional GIS IDs in Integer object or null if GIS entities do not exist
Pre Condition:
$none
Post Condition:
$none

getLocalResourceARList

public Object[] getLocalResourceARList()
Gets a list of local resources that support advance reservation from a regional GIS entity, defined in gisID_.

Returns:
a list of local resource IDs in Integer object or null if local resources do not exist.
Pre Condition:
$none
Post Condition:
$none

getGlobalResourceARList

public Object[] getGlobalResourceARList()
Gets a list of global resources that support advance reservation. Global resource means a resource that is registered to other regional GIS entities.

Returns:
a list of local resource IDs in Integer object or null if global resources do not exist.
Pre Condition:
$none
Post Condition:
$none

getLocalResourceList

public Object[] getLocalResourceList()
Gets a list of local resources from a regional GIS entity, defined in gisID_.

Returns:
a list of local resource IDs in Integer object or null if local resources do not exist.
Pre Condition:
$none
Post Condition:
$none

getGlobalResourceList

public Object[] getGlobalResourceList()
Gets a list of global resources. Global resource means a resource that is registered to other regional GIS entities.

Returns:
a list of local resource IDs in Integer object or null if global resources do not exist.
Pre Condition:
$none
Post Condition:
$none

getList

protected Object[] getList(int eventTag)
Gets a list of other request to the regional GIS entity as defined in gisID_. Type of request is defined in the tag name.

Parameters:
eventTag - an event tag name or type of request
Returns:
a list of this request or null if not found
Pre Condition:
$none
Post Condition:
$none

getList

protected Object[] getList(int eventTag,
                           int otherRegionalID)
Gets a list of other request to the given regional GIS entity ID. Type of request is defined in the tag name.

Parameters:
eventTag - an event tag name or type of request
otherRegionalID - a regional GIS or destination ID
Returns:
a list of this request or null if not found
Pre Condition:
$none
Post Condition:
$none

GridSim 5.0 beta

The University of Melbourne, Australia, 2009