org.dbe.eve.simulator
Class DemandedAndUsedServicePool

java.lang.Object
  extended by org.dbe.eve.simulator.DemandedAndUsedServicePool

public class DemandedAndUsedServicePool
extends java.lang.Object

The DemandedAndUsedServicePool consists of DemandedAndUsedServicePoolElements which are stored in an Vector. Each DemandedAndUsedServicePool element looks like this | activity | demandedService | UsedService | MigrationHistory of the UsedServices Population |

Author:
Markus

Field Summary
(package private)  java.util.Vector DemandedAndUsedServices
           
(package private) static org.apache.log4j.Logger logger
           
 
Constructor Summary
DemandedAndUsedServicePool()
          default constructor
 
Method Summary
 boolean addDemandedService(DemandedService demService)
          add an DemandedService to this pool
 void addDemandedServices(java.util.Vector servicesToAdd)
          Add an Vector of DemandedServices to the DemandedAndUsedServicePool of the SME.
 boolean addUsedServices(DemandedService demService, Service usedService)
          link an UsedService to an already stored DemandedService
 boolean addUsedServices(DemandedService demService, Service usedService, java.util.Vector migHist)
          link an UsedService to an already stored DemandedService
 void clearDemandedAndUsedServicePool()
           
 boolean containsDemandedService(DemandedService demService)
          search in the DemandedAndUsedServicePool if an DemandedService is already stored and active in this pool.
 java.util.Vector getActiveDemandedServices()
          return all DemandedService which are stored in this pool excluding the inactive ones
 java.util.Vector getActiveUsedServices()
          return all UsedServices which are stored in this pool excluding the inactive ones
 DemandedService getDemandedService(Service usedService)
          returns the DemandedService which is stored in the same DemandedAndUsedServicePoolElement as the used service.
 java.util.Vector getDemandedServices()
          return all DemandedService which are stored in this pool also the inactive ones
 java.util.Vector getMigrationHistory(Service usedService)
          returns the MigrationHistory of a usedService stored.
 java.util.Vector getMigrationHistoryOfActiveUsedServices()
          returns the MigrationHistory of all aktive usedService stored.
 int getSize()
           
 Service getUsedService(DemandedService demService)
          returns the usedService which is stored in the same DemandedAndUsedServicePoolElement as the demanded service.
 java.util.Vector getUsedServices()
          return all UsedServices which are stored in this pool also the inactive ones
 boolean isActive(DemandedService demService)
          return true if the searched demanded service is active
 boolean removeUsedService(Service serviceToRemove)
          removes an used Service from the DemandedAndUsedServicePool
 boolean setDemandedServiceInactive(DemandedService demService)
          set an DemandedService inactive
 void setMigrationHistory(Service usedService, java.util.Vector migHist)
          set the MigrationHistory of a usedService stored.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DemandedAndUsedServices

java.util.Vector DemandedAndUsedServices

logger

static org.apache.log4j.Logger logger
Constructor Detail

DemandedAndUsedServicePool

public DemandedAndUsedServicePool()
default constructor

Method Detail

addDemandedServices

public void addDemandedServices(java.util.Vector servicesToAdd)
Add an Vector of DemandedServices to the DemandedAndUsedServicePool of the SME. If the DemandedService is already stored in the DemandedAndUsedServicePool the DemandedService isn't added.

Parameters:
servicesToAdd - is the Service which should be added

containsDemandedService

public boolean containsDemandedService(DemandedService demService)
search in the DemandedAndUsedServicePool if an DemandedService is already stored and active in this pool.

Parameters:
demService - is the DemandedService which is searched
Returns:
true if the demandedService is already stored in this pool.

addDemandedService

public boolean addDemandedService(DemandedService demService)
add an DemandedService to this pool

Parameters:
demService - is the DemandedService which should be added
Returns:
true if the DemandedService isn't already stored in the pool and the DemandedService was added

setDemandedServiceInactive

public boolean setDemandedServiceInactive(DemandedService demService)
set an DemandedService inactive

Parameters:
demService - the DemandedService which should be set inactive
Returns:
true if the DemandedService was found in the pool and set inactive

addUsedServices

public boolean addUsedServices(DemandedService demService,
                               Service usedService)
link an UsedService to an already stored DemandedService

Parameters:
demService - is the DemandedService
usedService - is the UsedService
Returns:
true if the DemandedService was found and the UsedService was added to the DemandedAndUsedServicePoolElement

addUsedServices

public boolean addUsedServices(DemandedService demService,
                               Service usedService,
                               java.util.Vector migHist)
link an UsedService to an already stored DemandedService

Parameters:
demService - is the DemandedService
usedService - is the UsedService
Returns:
true if the DemandedService was found and the UsedService was added to the DemandedAndUsedServicePoolElement

getDemandedServices

public java.util.Vector getDemandedServices()
return all DemandedService which are stored in this pool also the inactive ones

Returns:
Vector of DemandedService

getActiveDemandedServices

public java.util.Vector getActiveDemandedServices()
return all DemandedService which are stored in this pool excluding the inactive ones

Returns:
Vector of DemandedService

getUsedServices

public java.util.Vector getUsedServices()
return all UsedServices which are stored in this pool also the inactive ones

Returns:
Vector of UsedService

getActiveUsedServices

public java.util.Vector getActiveUsedServices()
return all UsedServices which are stored in this pool excluding the inactive ones

Returns:
Vector of UsedService

getDemandedService

public DemandedService getDemandedService(Service usedService)
returns the DemandedService which is stored in the same DemandedAndUsedServicePoolElement as the used service.

Parameters:
usedService - is the Service to which the DemandedService should be found
Returns:
DemandedService is the searched DemandedService

getMigrationHistory

public java.util.Vector getMigrationHistory(Service usedService)
returns the MigrationHistory of a usedService stored.

Parameters:
usedService - is the Service to which the DemandedService should be found
Returns:
DemandedService is the searched DemandedService

getMigrationHistoryOfActiveUsedServices

public java.util.Vector getMigrationHistoryOfActiveUsedServices()
returns the MigrationHistory of all aktive usedService stored.

Parameters:
usedService - is the Service to which the DemandedService should be found
Returns:
DemandedService is the searched DemandedService

setMigrationHistory

public void setMigrationHistory(Service usedService,
                                java.util.Vector migHist)
set the MigrationHistory of a usedService stored.

Parameters:
usedService - is the Service to which the DemandedService should be found
migHist - is the migrationHistory of the usedService

getUsedService

public Service getUsedService(DemandedService demService)
returns the usedService which is stored in the same DemandedAndUsedServicePoolElement as the demanded service.

Parameters:
demService - is the demanded service to which the usedService should be found
Returns:
Service is the searched used service

isActive

public boolean isActive(DemandedService demService)
return true if the searched demanded service is active

Parameters:
demService - is the demanded service which activeness is searched
Returns:
true if the demanded service is active

removeUsedService

public boolean removeUsedService(Service serviceToRemove)
removes an used Service from the DemandedAndUsedServicePool

Parameters:
serviceToRemove - is the service which should be removed
Returns:
true is the the service was found and removed form the DemandedAndUsedServicePool

getSize

public int getSize()

clearDemandedAndUsedServicePool

public void clearDemandedAndUsedServicePool()