org.dbe.eve
Class HabitatServiceImpl

java.lang.Object
  extended by org.dbe.eve.HabitatServiceImpl
All Implemented Interfaces:
java.io.Serializable, HabitatService, org.dbe.servent.Adapter, org.dbe.servent.tools.CoreAdapter

public class HabitatServiceImpl
extends java.lang.Object
implements HabitatService, org.dbe.servent.tools.CoreAdapter, java.io.Serializable

See Also:
Serialized Form

Constructor Summary
HabitatServiceImpl()
          Empty consturctor.
 
Method Summary
 void createEvEService(java.lang.String smid, SBVRDescription model)
          Creates a new EvEService with the indicated definition.
 void deploy()
           
 void destroy()
           
 SolutionSet findBestGuessSolution(SBVRDescription model)
          Find the best services that fit the indicated model.
 ServicePool getEvEServicePool()
           
 java.lang.String getHomeDir()
           
 java.lang.String getId()
          Return the Identifier of this habitat
 NetworkManagerImpl getNetworkManager()
           
 org.dbe.servent.ServentContext getServentContext()
           
 org.dbe.servent.ServiceContext getServiceContext()
           
 ServiceManager getServiceManager()
           
 void importEvEService(EvEService service)
          The send method is invoked by the local HabitatService, if the habitat thinks that a service is worth spreading to the connected habitats
 void importServiceManifest(java.lang.String smData)
           
 void init(org.dbe.servent.ServentContext context)
           
 void init(org.dbe.servent.ServiceContext context)
           
 void recordNewRequest(org.dbe.servent.InvokationRequest request)
          Record a new Request in the Habitat.
 void recordNewResponse(org.dbe.servent.InvokationResponse response)
          Record a response for a request in the Habitat.
 void recordServiceUsage(org.dbe.accounting.metering.usagedata.ServiceUsageType serviceUsageType)
           
 void removeEvEService(java.lang.String smid)
          Remove an EvEService from the pool or form the monitoring services.
 void unDeploy()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HabitatServiceImpl

public HabitatServiceImpl()
Empty consturctor. It is needed to get no parameter.

Method Detail

unDeploy

public void unDeploy()

deploy

public void deploy()

createEvEService

public void createEvEService(java.lang.String smid,
                             SBVRDescription model)
Description copied from interface: HabitatService
Creates a new EvEService with the indicated definition. If the service exists, he old service is overwritten.

Specified by:
createEvEService in interface HabitatService
Parameters:
smid - serviceManifest Id of the service, as create by the Semantic Registry
model - The SBVR Description of the Service
See Also:
HabitatService.createEvEService(java.lang.String, org.dbe.eve.SBVRDescription)

recordNewRequest

public void recordNewRequest(org.dbe.servent.InvokationRequest request)
Description copied from interface: HabitatService
Record a new Request in the Habitat. This request is a call that have been received by the servent. TODO: it is possible this InvokationRequest will be changed for a more suitable object

Specified by:
recordNewRequest in interface HabitatService
Parameters:
request - invokation request
See Also:
HabitatService.recordNewRequest(org.dbe.servent.InvokationRequest)

importEvEService

public void importEvEService(EvEService service)
Description copied from interface: HabitatService
The send method is invoked by the local HabitatService, if the habitat thinks that a service is worth spreading to the connected habitats

Specified by:
importEvEService in interface HabitatService
See Also:
HabitatService.importEvEService(org.dbe.eve.EvEService)

importServiceManifest

public void importServiceManifest(java.lang.String smData)

removeEvEService

public void removeEvEService(java.lang.String smid)
Description copied from interface: HabitatService
Remove an EvEService from the pool or form the monitoring services. This will happend when a service will no longer exists in the DBENetwork (usually because it has been undeployed)

Specified by:
removeEvEService in interface HabitatService
Parameters:
smid - serviceManifest identifier (this is the same EvEService identifier)
See Also:
HabitatService.removeEvEService(java.lang.String)

findBestGuessSolution

public SolutionSet findBestGuessSolution(SBVRDescription model)
Description copied from interface: HabitatService
Find the best services that fit the indicated model. This service is only a Guess based on the data the Habitat stores. It usually will not be the real best solution because we do not use ALL the data available in the DBE.

Specified by:
findBestGuessSolution in interface HabitatService
Parameters:
model - DBVR model
Returns:
array with the smids
See Also:
HabitatService.findBestGuessSolution(org.dbe.eve.SBVRDescription)

getEvEServicePool

public ServicePool getEvEServicePool()
See Also:
getEvEServicePool()

init

public void init(org.dbe.servent.ServiceContext context)
Specified by:
init in interface org.dbe.servent.Adapter
See Also:
Adapter.init(org.dbe.servent.ServiceContext)

destroy

public void destroy()
Specified by:
destroy in interface org.dbe.servent.Adapter
See Also:
Adapter.destroy()

getServiceContext

public org.dbe.servent.ServiceContext getServiceContext()

getId

public java.lang.String getId()
Description copied from interface: HabitatService
Return the Identifier of this habitat

Specified by:
getId in interface HabitatService
Returns:
id The Service Id of this habitat as written in the deployment.properties

init

public void init(org.dbe.servent.ServentContext context)
Specified by:
init in interface org.dbe.servent.tools.CoreAdapter

recordNewResponse

public void recordNewResponse(org.dbe.servent.InvokationResponse response)
Description copied from interface: HabitatService
Record a response for a request in the Habitat.

Specified by:
recordNewResponse in interface HabitatService
Parameters:
response - invokation response

getNetworkManager

public NetworkManagerImpl getNetworkManager()

getServentContext

public org.dbe.servent.ServentContext getServentContext()

recordServiceUsage

public void recordServiceUsage(org.dbe.accounting.metering.usagedata.ServiceUsageType serviceUsageType)

getHomeDir

public java.lang.String getHomeDir()

getServiceManager

public ServiceManager getServiceManager()