eu.emi.dsr.infrastructure
Class InfrastructureManager

java.lang.Object
  extended by eu.emi.dsr.infrastructure.InfrastructureManager
All Implemented Interfaces:
ServiceInfrastructure

public class InfrastructureManager
extends Object
implements ServiceInfrastructure

Author:
g.szigeti

Constructor Summary
InfrastructureManager(Configuration config)
          Constructor Create connection to the H2 database.
 
Method Summary
 void addChildDSR(String identifier)
          Add child DSR service url
 boolean dbSynchronization(List<String> ids, Method method, int responsestatus)
          Database synchronization with the parent.
protected  void finalize()
          Destructor Stop every open connection.
 List<String> getChildDSRs()
          Get every child DSR services
 String getParent()
          Get parent DSR
 List<String> getParentsRoute()
          Get parents route
 void handleDelete(String identifier)
          Handle the unsent delete message.
 void handleRegistration(List<String> identifiers)
          Handle the unsent registration message.
 void handleUpdate(List<String> identifiers)
          Handle the unsent update message.
 void setParent(String identifier)
          Set the parent DSR
 void setParentsRoute(List<String> identifiers)
          Set the parents route
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InfrastructureManager

public InfrastructureManager(Configuration config)
Constructor Create connection to the H2 database.

Parameters:
configuration -
Method Detail

finalize

protected void finalize()
                 throws SQLException
Destructor Stop every open connection.

Overrides:
finalize in class Object
Parameters:
None -
Throws:
SQLException

setParentsRoute

public void setParentsRoute(List<String> identifiers)
                     throws EmptyIdentifierFailureException,
                            NullPointerFailureException
Description copied from interface: ServiceInfrastructure
Set the parents route

Specified by:
setParentsRoute in interface ServiceInfrastructure
Throws:
EmptyIdentifierFailureException - throws exception if identifiers is empty
NullPointerFailureException - throws exception if identifiers is a NULL pointer

getParentsRoute

public List<String> getParentsRoute()
Description copied from interface: ServiceInfrastructure
Get parents route

Specified by:
getParentsRoute in interface ServiceInfrastructure
Returns:
a collection of network entries from this component to the global peer to peer network

getChildDSRs

public List<String> getChildDSRs()
Description copied from interface: ServiceInfrastructure
Get every child DSR services

Specified by:
getChildDSRs in interface ServiceInfrastructure
Returns:
a collection of child entries, that registered directly for this service

addChildDSR

public void addChildDSR(String identifier)
                 throws EmptyIdentifierFailureException,
                        NullPointerFailureException
Description copied from interface: ServiceInfrastructure
Add child DSR service url

Specified by:
addChildDSR in interface ServiceInfrastructure
Throws:
EmptyIdentifierFailureException - throws exception if identifier is empty
NullPointerFailureException - throws exception if identifier is a NULL pointer

setParent

public void setParent(String identifier)
               throws EmptyIdentifierFailureException,
                      NullPointerFailureException
Description copied from interface: ServiceInfrastructure
Set the parent DSR

Specified by:
setParent in interface ServiceInfrastructure
Throws:
EmptyIdentifierFailureException - throws exception if identifiers is empty
NullPointerFailureException - throws exception if identifiers is a NULL pointer

getParent

public String getParent()
Description copied from interface: ServiceInfrastructure
Get parent DSR

Specified by:
getParent in interface ServiceInfrastructure
Returns:
parent component's URL

handleRegistration

public void handleRegistration(List<String> identifiers)
Handle the unsent registration message.

Parameters:
list - of service identifier

handleUpdate

public void handleUpdate(List<String> identifiers)
Handle the unsent update message.

Parameters:
list - of service identifier

handleDelete

public void handleDelete(String identifier)
Handle the unsent delete message.

Parameters:
service - identifier

dbSynchronization

public boolean dbSynchronization(List<String> ids,
                                 Method method,
                                 int responsestatus)
Database synchronization with the parent.

Returns:
True or False. It is depends from DB synchronization.


Copyright © 2012. All Rights Reserved.