org.dbe.eve.simulator
Class Service

java.lang.Object
  extended by org.dbe.eve.simulator.AbstractService
      extended by org.dbe.eve.simulator.Service
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
GroupedService

public class Service
extends AbstractService
implements java.lang.Cloneable

Represents a service


Field Summary
private  java.awt.Color color
           
private  java.util.Vector MigrationPath
           
private  int position
           
private  SME ProviderSME
           
 
Fields inherited from class org.dbe.eve.simulator.AbstractService
attributes, ID, logger
 
Constructor Summary
Service(int ID)
          Constructs an Service with an ID, random Attributes.
Service(int ID, int numberOfAttributes)
          Constructs an Service with an ID and generates a specific number of random Attributes.
Service(SME providerSME, int ID)
          Constructs a Service with an ID, random Attributes and set the provider SME of this Service.
Service(SME providerSME, int ID, java.awt.Color serviceColor)
          Constructs a Service with an ID, random Attributes and set the provider SME of this Service.
Service(java.util.Vector attributes, int id)
          Constructs a Service with an Vector of Attributes
Service(java.util.Vector attributes, SME ProviderSME, int id)
          Constructs an Service with an Vector of Attributes and set the provider SME of this Service.
 
Method Summary
 java.lang.Object clone()
          create hard copy of an Service
 org.w3c.dom.Element getAsXMLElement(org.w3c.dom.Document xmldoc, java.lang.String tagName)
           
 java.awt.Color getColor()
          return the color of the Service
 boolean getCurrentUsefullness()
          return true if the Service is usefull for the present owner SME or false if not
 java.util.Vector getMigrationPath()
          Returns the MigrationPath in which the current and past owner SMEs and the usefullness of the Service for these SMEs are stored
 int getNumberOfHops()
          return the number of Hops the service did since its generation
 int getNumberOfUselessHops()
          This methode returns the amount of hops where the Service was useless for the SME
 SME getOwnerSME()
          return the current owner of the Service
 int getPosition()
           
 SME getProviderSME()
          return the Provider or Producer SME
 java.util.Vector getSMEsWhereServiceWasUseful()
          return all SMEs at which the service was useful
 void setColor(java.awt.Color newcolor)
          set the color
 void setOwnerSME(SME newOwner, boolean usefull)
          adds the current OWNER SME to the MigrationPath
 void setPosition(int position)
           
 void setProviderSME(SME ProviderSME)
          set the Provider SME
 
Methods inherited from class org.dbe.eve.simulator.AbstractService
addAttribute, compareTo, getAttributes, getServiceID, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

position

private int position

ProviderSME

private SME ProviderSME

MigrationPath

private java.util.Vector MigrationPath

color

private java.awt.Color color
Constructor Detail

Service

public Service(int ID)
Constructs an Service with an ID, random Attributes.

Parameters:
ID -

Service

public Service(SME providerSME,
               int ID)
Constructs a Service with an ID, random Attributes and set the provider SME of this Service.

Parameters:
providerSME - is the SME which generated the Service
ID - is the ID of this Service

Service

public Service(SME providerSME,
               int ID,
               java.awt.Color serviceColor)
Constructs a Service with an ID, random Attributes and set the provider SME of this Service.

Parameters:
providerSME - is the SME which generated the Service
ID - is the ID of this Service

Service

public Service(java.util.Vector attributes,
               SME ProviderSME,
               int id)
Constructs an Service with an Vector of Attributes and set the provider SME of this Service.

Parameters:
attributes - is a Vector of Attribute
ProviderSME - is the SME which generated the Service

Service

public Service(java.util.Vector attributes,
               int id)
Constructs a Service with an Vector of Attributes

Parameters:
attributes - is a Vector of Attribute
id - the id for the service

Service

public Service(int ID,
               int numberOfAttributes)
Constructs an Service with an ID and generates a specific number of random Attributes.

Parameters:
ID - is the ID of this Service
numberOfAttributes - is the number of Attributes of this Service
Method Detail

getProviderSME

public SME getProviderSME()
return the Provider or Producer SME

Returns:
SME the provider of this Service

setProviderSME

public void setProviderSME(SME ProviderSME)
set the Provider SME


setColor

public void setColor(java.awt.Color newcolor)
set the color


setOwnerSME

public void setOwnerSME(SME newOwner,
                        boolean usefull)
adds the current OWNER SME to the MigrationPath

Parameters:
newOwner - represents the current OWNER SME
usefull - shows if the Service is usefull for the SME or not.

getSMEsWhereServiceWasUseful

public java.util.Vector getSMEsWhereServiceWasUseful()
return all SMEs at which the service was useful

Returns:
vector of SMEs

getOwnerSME

public SME getOwnerSME()
return the current owner of the Service

Returns:
SME the current owner

getColor

public java.awt.Color getColor()
return the color of the Service


getCurrentUsefullness

public boolean getCurrentUsefullness()
return true if the Service is usefull for the present owner SME or false if not

Returns:
boolean

getMigrationPath

public java.util.Vector getMigrationPath()
Returns the MigrationPath in which the current and past owner SMEs and the usefullness of the Service for these SMEs are stored

Returns:
HashMap the migrationPath

getNumberOfUselessHops

public int getNumberOfUselessHops()
This methode returns the amount of hops where the Service was useless for the SME

Returns:
int the number of useless Hops

getNumberOfHops

public int getNumberOfHops()
return the number of Hops the service did since its generation

Returns:
number of hops

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
create hard copy of an Service

Overrides:
clone in class java.lang.Object
Returns:
Object returns the cloned Service
Throws:
java.lang.CloneNotSupportedException

getPosition

public int getPosition()

setPosition

public void setPosition(int position)

getAsXMLElement

public org.w3c.dom.Element getAsXMLElement(org.w3c.dom.Document xmldoc,
                                           java.lang.String tagName)