1 | /* |
---|
2 | * Title: GridSim Toolkit |
---|
3 | * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation |
---|
4 | * of Parallel and Distributed Systems such as Clusters and Grids |
---|
5 | * Licence: GPL - http://www.gnu.org/copyleft/gpl.html |
---|
6 | * |
---|
7 | * Author: Anthony Sulistio |
---|
8 | * Organization: The University of Melbourne, Australia |
---|
9 | * Created on: Wednesday, 22 August 2007 |
---|
10 | * Copyright (c) 2008, The University of Melbourne, Australia |
---|
11 | */ |
---|
12 | |
---|
13 | package gridsim.gssim.network; |
---|
14 | |
---|
15 | import gridsim.net.Link; |
---|
16 | import gridsim.util.TrafficGenerator; |
---|
17 | |
---|
18 | import java.util.Collection; |
---|
19 | |
---|
20 | /** |
---|
21 | * This class contains the structure for Input and Output entities. |
---|
22 | * |
---|
23 | * @since GridSim Toolkit 4.2 |
---|
24 | * @author Anthony Sulistio |
---|
25 | */ |
---|
26 | public interface NetIO { |
---|
27 | /** A constant that denotes 1 byte in bits */ |
---|
28 | public static final int BITS = 8; |
---|
29 | |
---|
30 | /** |
---|
31 | * Sets this entity's link. This should be used only if the network |
---|
32 | * extensions are being used. |
---|
33 | * |
---|
34 | * @param link |
---|
35 | * the link to which this entity should send/receive data |
---|
36 | */ |
---|
37 | void addLink(Link link); |
---|
38 | |
---|
39 | /** |
---|
40 | * Gets the baud rate |
---|
41 | * |
---|
42 | * @return the baud rate |
---|
43 | */ |
---|
44 | double getBaudRate(); |
---|
45 | |
---|
46 | /** |
---|
47 | * Sets the background traffic generator for <b>Output</b> entity only. |
---|
48 | * <p> |
---|
49 | * When simulation starts, this entity will automatically sends junk packets |
---|
50 | * to resource entities. |
---|
51 | * |
---|
52 | * @param gen |
---|
53 | * a background traffic generator |
---|
54 | * @return <tt>true</tt> if successful, <tt>false</tt> otherwise |
---|
55 | */ |
---|
56 | boolean setBackgroundTraffic(TrafficGenerator gen); |
---|
57 | |
---|
58 | /** |
---|
59 | * Sets the background traffic generator for <b>Output</b> entity only. |
---|
60 | * <p> |
---|
61 | * When simulation starts, this entity will automatically sends junk packets |
---|
62 | * to resource entities and other entities. <br> |
---|
63 | * NOTE: Sending background traffic to itself is not supported. |
---|
64 | * |
---|
65 | * @param gen |
---|
66 | * a background traffic generator |
---|
67 | * @param userName |
---|
68 | * a collection of user entity name (in String object). |
---|
69 | * @return <tt>true</tt> if successful, <tt>false</tt> otherwise |
---|
70 | * @pre gen != null |
---|
71 | * @pre userName != null |
---|
72 | * @post $none |
---|
73 | */ |
---|
74 | boolean setBackgroundTraffic(TrafficGenerator gen, Collection userName); |
---|
75 | |
---|
76 | } // end interface |
---|
77 | |
---|