|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.ac.ulg.montefiore.run.totem.repository.facade.RepositoryManagerObserver
be.ac.ulg.montefiore.run.totem.repository.facade.RepositoryManager
public class RepositoryManager
This class is a singleton that provides a global access point to the
algorithms. Note that this class uses the preferences.xml
file to list the available algorithms.
Creation date: 10-mars-2005
Method Summary | |
---|---|
TotemAlgorithm |
getAlgo(java.lang.String name)
Returns the instance of the algorithm name . |
TotemAlgorithm |
getAlgo(java.lang.String name,
int asId)
Returns the instance of the algorithm name . |
TotemAlgorithm |
getAlgo(java.lang.String name,
int asId,
int tmId)
Returns the instance of the algorithm name . |
java.util.List<ParameterDescriptor> |
getAlgoParameters(java.lang.String algoName)
Returns a list of the algorithm parameters used to start the algorithm |
java.util.List<TotemAlgorithm> |
getAllStartedAlgos()
returns a list of all the started algorithms |
java.util.List<TotemAlgorithm> |
getAllStartedAlgos(java.lang.Class filter)
returns a list of all the started algorithms that inherits from the class filter |
java.util.List<TotemAlgorithm> |
getAllStartedAlgos(int asId)
returns all started algos that can be used on the given domain i.e. |
java.util.List<TotemAlgorithm> |
getAllStartedAlgos(int asId,
java.lang.Class filter)
returns all started algos of class filter that can be used on the given domain,
i.e. |
java.util.List<java.lang.Class> |
getAllTotemAlgos()
returns a list containing the class of each algo |
java.util.List<java.lang.Class> |
getAllTotemAlgos(java.lang.Class filter)
returns a list containing the class of each algo that inherits from the class filter |
static RepositoryManager |
getInstance()
Returns the single instance of the RepositoryManager. |
void |
startAlgo(java.lang.String name,
java.util.HashMap<java.lang.String,java.lang.String> params)
Starts the algorithm name . |
void |
startAlgo(java.lang.String name,
java.util.HashMap<java.lang.String,java.lang.String> params,
int asId)
Starts the algorithm name . |
void |
startAlgo(java.lang.String name,
java.util.HashMap<java.lang.String,java.lang.String> params,
int asId,
int tmId)
Starts the algorithm name . |
void |
stopAlgorithm(java.lang.String name)
Stops the algorithm name . |
void |
stopAlgorithm(java.lang.String name,
int asId)
Stops the algorithm name . |
void |
stopAlgorithm(java.lang.String name,
int asId,
int tmId)
Stops the algorithm name . |
void |
stopAlgorithms()
Stops all the started algorithms. |
void |
stopAlgorithms(int asId)
|
Methods inherited from class be.ac.ulg.montefiore.run.totem.repository.facade.RepositoryManagerObserver |
---|
addListener, getNbListeners, notifyStartAlgo, notifyStopAlgo, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static RepositoryManager getInstance()
public void startAlgo(java.lang.String name, java.util.HashMap<java.lang.String,java.lang.String> params) throws AlgorithmInitialisationException
name
. This algorithm must have been
specified in the preferences.xml
file. If it implements
DomainSyncAlgorithm
or
DomainTMSyncAlgorithm
, we use default
values for the AS ID and the TM ID.
name
- The name of the algorithm to start.params
- The parameters to give to the algorithm.
It can be null
.
AlgorithmInitialisationException
- If the algorithm was not
specified in the preferences file, if the specified class was not
found, if the algorithm doesn't implement TotemAlgorithm
,
if there is an error during the instantiation of the class, if the
algorithm was already started, or if the algorithm requires an AS ID
and/or a TM ID and that there are no default values.public void startAlgo(java.lang.String name, java.util.HashMap<java.lang.String,java.lang.String> params, int asId) throws AlgorithmInitialisationException
name
. This algorithm must have been
specified in the preferences.xml
file and must implement
DomainSyncAlgorithm
or
DomainTMSyncAlgorithm
(we use default
value for the TM ID in this latter case).
name
- The name of the algorithm to start.params
- The parameters to give to the algorithm. It can be
null
.asId
- The domain on which the algorithm will operate.
AlgorithmInitialisationException
- If the algorithm was not
specified in the preferences file, if the specified class was not
found, if there is an error during the instantiation of the class, if
the algorithm was already started, if the algorithm doesn't implement
TotemAlgorithm
, or if the algorithm requires a TM ID and
that there is no default value.public void startAlgo(java.lang.String name, java.util.HashMap<java.lang.String,java.lang.String> params, int asId, int tmId) throws AlgorithmInitialisationException
name
. This algorithm must have been
specified in the preferences.xml
file and must implement
DomainTMSyncAlgorithm
.
name
- The name of the algorithm to start.params
- The parameters to give to the algorithm. It can be
null
.asId
- The domain on which the algorithm will operate.tmId
- The traffic matrix on which the algorithm will operate.
AlgorithmInitialisationException
- If the algorithm was not
specified in the preferences file, if the specified class was not
found, if the algorithm doesn't implement
DomainTMSyncAlgorithm
, if there is an
error during the instantiation of the class, or if the algorithm was
already started.public TotemAlgorithm getAlgo(java.lang.String name) throws NoSuchAlgorithmException
name
. We use default
values for the AS ID and TM ID if necessary.
name
- The name of the algorithm.
name
.
NoSuchAlgorithmException
- If the algorithm doesn't exist or if
it was not started, or if default values are required but not available.public TotemAlgorithm getAlgo(java.lang.String name, int asId) throws NoSuchAlgorithmException
name
. We use default
value for TM ID if necessary. If the algorithm doesn't require an AS
ID, asId
is ignored.
name
- The name of the algorithm.asId
- The domain on which it operates.
name
.
NoSuchAlgorithmException
- If the algorithm doesn't exist or if
it was not started, or if a default value is required but not
available.public TotemAlgorithm getAlgo(java.lang.String name, int asId, int tmId) throws NoSuchAlgorithmException
name
. If the
algorithm doesn't require an AS ID and/or a TM ID, asId
and/or tmId
are ignored.
name
- The name of the algorithm.asId
- The domain on which it operates.tmId
- The traffic matrix on which it operates.
name
.
NoSuchAlgorithmException
- If the algorithm doesn't exist or if
it was not started.public void stopAlgorithms()
public void stopAlgorithms(int asId)
public void stopAlgorithm(java.lang.String name) throws NoSuchAlgorithmException
name
. We use default values for the AS
ID and the TM ID if necessary.
name
- The name of the algorithm to stop.
NoSuchAlgorithmException
- If the algorithm doesn't exist, if it
was not started or if there is no default value for the AS ID and/or
the TM ID.public void stopAlgorithm(java.lang.String name, int asId) throws NoSuchAlgorithmException
name
. We use a default value for the
TM ID if necessary.
name
- The name of the algorithm to stop.asId
- The AS ID of the domain on which the algorithm operated.
NoSuchAlgorithmException
- If the algorithm doesn't exist, if it
was not started or if there is no default value for the TM ID.public void stopAlgorithm(java.lang.String name, int asId, int tmId) throws NoSuchAlgorithmException
name
.
name
- The name of the algorithm to stop.asId
- The AS ID of the domain on which the algorithm operated.tmId
- The TM ID of the traffic matrix on which the algorithm
operated.
NoSuchAlgorithmException
- If the algorithm doesn't exist or if
it was not started.public java.util.List<java.lang.Class> getAllTotemAlgos()
public java.util.List<java.lang.Class> getAllTotemAlgos(java.lang.Class filter)
filter
-
public java.util.List<TotemAlgorithm> getAllStartedAlgos()
public java.util.List<TotemAlgorithm> getAllStartedAlgos(java.lang.Class filter)
filter
-
public java.util.List<TotemAlgorithm> getAllStartedAlgos(int asId, java.lang.Class filter)
filter
that can be used on the given domain,
i.e. every DomainAlgorithm and DomainTrafficAlgorithm started on the given domain,
plus algorithms that are independant of any domain.
asId
- filter
-
public java.util.List<TotemAlgorithm> getAllStartedAlgos(int asId)
asId
-
public java.util.List<ParameterDescriptor> getAlgoParameters(java.lang.String algoName) throws NoSuchAlgorithmException
algoName
- Algorithm name
NoSuchAlgorithmException
- if the algorithm was not found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |