org.figure8.join.businessfacades.environment
Class DefaultResourceManager

java.lang.Object
  extended by org.figure8.join.businessfacades.environment.DefaultResourceManager
All Implemented Interfaces:
ResourceManager

public class DefaultResourceManager
extends java.lang.Object
implements ResourceManager

Default implementation of ResourceManager.

Version:
$Revision: 1.6 $
Author:
Laurent Broudoux

Constructor Summary
DefaultResourceManager()
          Creates a new DefaultResourceManager.
 
Method Summary
 void closeEISMapping(EISMapping mapping)
          Closes the specified EISMapping.
 void closeResourceMapping(ResourceMapping mapping)
          Closes the specified ResourceMapping.
 EISMapping getEISMapping(long id)
          Retrieve an EISMapping using its unique identifier
 GatewayTrackingView getGatewayTrackingView(java.lang.String name, java.util.Date startDate, java.util.Date endDate)
          Get a configuration changes tracking view for a specified gateway on a specified time period (between start date and end date included).
 Machine getMachine(long id)
          Retrieve the Machine having the specified identifier
 java.util.List getMachines()
          Retrieve the available machines used by integration team.
 Resource getResource(long id)
          Retrieve the Resource hanving the specified identifier
 Resource getResource(java.lang.String name)
          Retrieve the Resource having the specified name
 ResourceMapping getResourceMapping(long id)
          Retrieve a ResourceMapping using its unique identifier
 java.util.List getResources(AbstractResourceType resourceType)
          Retrieve resources having the specified resource type
 java.util.List getResources(java.lang.String category)
          Retrieve resources corresponding to specified category
 ResourceType getResourceType(java.lang.String key)
          Retrieve the ResourceType having the specified key
 java.util.List getResourceTypes()
          Retrieve all defined resource types
 java.util.List getResourceTypes(java.lang.String category)
          Retrieve ResourceTypes corresponding to specified category
 ResourceVersion getResourceVersion(long id)
          Retrieve the ResourceVersion having this identifier
 ResourceVersion getResourceVersion(java.lang.String name)
          Retrieve the ResourceVersion having the specified name
 java.util.List getResourceVersions(VersionedResourceType resourceType)
          Retrieve the available resource versions for a resource type
 VersionedResource getVersionedResource(java.lang.String name, java.util.Date configDate)
          Get a view representing versioned resource configuration at a specified date
 VersionedResourceTrackingView getVersionedResourceTrackingView(java.lang.String name, java.util.Date startDate, java.util.Date endDate)
          Get a version updates traking view for a specified versioned resource on a specified time period (between start date and end date included).
 void mapEISOnGateway(EIS eis, Gateway gateway)
          Create a new mapping of an EIS onto a gateway.
 void mapResourceOnEnvironment(AbstractResource resource, PhysicalEnvironment environment)
          Create a new mapping of an infrastructure resource onto a physical one.
 void saveMachine(Machine machine)
          Save a Machine within datastore (create or update).
 void saveResource(AbstractResource resource)
          Save a Resource within datastore (create or update).
 void saveResourceType(AbstractResourceType type)
          Save a ResourceType within datastore (create or update).
 void saveResourceVersion(ResourceVersion version)
          Save a ResourceVersion within datastore (create or update)
 void setEISMappingDao(EISMappingDao eisMappingDao)
           
 void setMachineDao(MachineDao machineDao)
           
 void setResourceDao(ResourceDao resourceDao)
           
 void setResourceMappingDao(ResourceMappingDao resourceMappingDao)
           
 void setResourceTypeDao(ResourceTypeDao resourceTypeDao)
           
 void setResourceVersionDao(ResourceVersionDao resourceVersionDao)
           
 void setVersionedResourceUpdateDao(VersionedResourceUpdateDao resourceUpdateDao)
           
 void updateResource(VersionedResource resource, ResourceVersion version)
          Update a versioned resource using a resource version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultResourceManager

public DefaultResourceManager()
Creates a new DefaultResourceManager.

Method Detail

setMachineDao

public void setMachineDao(MachineDao machineDao)
Parameters:
machineDao - The MachineDao implementation to use.

setResourceDao

public void setResourceDao(ResourceDao resourceDao)
Parameters:
resourceDao - The ResourceDao implementation to use.

setResourceTypeDao

public void setResourceTypeDao(ResourceTypeDao resourceTypeDao)
Parameters:
resourceTypeDao - The ResourceTypeDao implementation to use.

setResourceMappingDao

public void setResourceMappingDao(ResourceMappingDao resourceMappingDao)
Parameters:
resourceMappingDao - The ResourceMappingDao implementation to use

setResourceVersionDao

public void setResourceVersionDao(ResourceVersionDao resourceVersionDao)
Parameters:
resourceVersionDao - The ResourceVersionDao implementation to use

setVersionedResourceUpdateDao

public void setVersionedResourceUpdateDao(VersionedResourceUpdateDao resourceUpdateDao)
Parameters:
resourceUpdateDao - The VersionedResourceUpdateDao implementation to use

setEISMappingDao

public void setEISMappingDao(EISMappingDao eisMappingDao)
Parameters:
eisMappingDao - The EISMappingDao implementation to use

saveResourceType

public void saveResourceType(AbstractResourceType type)
                      throws DuplicateEntityException
Save a ResourceType within datastore (create or update). Only types that are EntityObjects (AbstractResourceTypes) can be saved at that time.

Specified by:
saveResourceType in interface ResourceManager
Parameters:
type - The ResourceType to save
Throws:
DuplicateEntityException - if a ResourceType with same key already exists

getResourceTypes

public java.util.List getResourceTypes(java.lang.String category)
Retrieve ResourceTypes corresponding to specified category

Specified by:
getResourceTypes in interface ResourceManager
Parameters:
category - The category resource types whould belong to
Returns:
A list of org.figure8.join.businessobjects.environment.ResourceType of this category

getResourceTypes

public java.util.List getResourceTypes()
Retrieve all defined resource types

Specified by:
getResourceTypes in interface ResourceManager
Returns:
A list of org.figure8.join.businessobjects.environment.ResourceType

getResourceType

public ResourceType getResourceType(java.lang.String key)
Retrieve the ResourceType having the specified key

Specified by:
getResourceType in interface ResourceManager
Parameters:
key - The unique key identifier of the ResourceType
Returns:
The ResourceType having this key or null if no type has the specified key

saveResource

public void saveResource(AbstractResource resource)
                  throws DuplicateEntityException
Save a Resource within datastore (create or update). Only resource that are EntityObjects (AbstractResources) can be saved at that time.

Specified by:
saveResource in interface ResourceManager
Parameters:
resource - The Resource to save
Throws:
DuplicateEntityException - if a resource wiht same key already exists

getResources

public java.util.List getResources(AbstractResourceType resourceType)
Retrieve resources having the specified resource type

Specified by:
getResources in interface ResourceManager
Parameters:
resourceType - The type resources should belong to
Returns:
A list of org.figure8.join.businessobjects.environment.Resource of this type

getResources

public java.util.List getResources(java.lang.String category)
Retrieve resources corresponding to specified category

Specified by:
getResources in interface ResourceManager
Parameters:
category - The category resources should belong to
Returns:
A list of org.figure8.join.businessobjects.environment.Resource of this category

getResource

public Resource getResource(java.lang.String name)
Retrieve the Resource having the specified name

Specified by:
getResource in interface ResourceManager
Parameters:
name - The name of the Resource to retrieve
Returns:
The corresponding Resource or null if no Resource has the specified name

getResource

public Resource getResource(long id)
Retrieve the Resource hanving the specified identifier

Specified by:
getResource in interface ResourceManager
Parameters:
id - The identifier of Resource to retrieve
Returns:
The corresponding Resource or null if no Resource has this identifier

getGatewayTrackingView

public GatewayTrackingView getGatewayTrackingView(java.lang.String name,
                                                  java.util.Date startDate,
                                                  java.util.Date endDate)
Get a configuration changes tracking view for a specified gateway on a specified time period (between start date and end date included).

Specified by:
getGatewayTrackingView in interface ResourceManager
Parameters:
name - The name of gateway to retrieve a tracking view for
startDate - The date to start the configuration changes tracking
endDate - The date to end the configuration changes tracking
Returns:
A GatewayTrackingView for requested tracking period

getVersionedResource

public VersionedResource getVersionedResource(java.lang.String name,
                                              java.util.Date configDate)
Get a view representing versioned resource configuration at a specified date

Specified by:
getVersionedResource in interface ResourceManager
Parameters:
name - The name of resource to retrieve configuration for
configDate - The date to get resource configuration
Returns:
A VersionedResource for requested date

getVersionedResourceTrackingView

public VersionedResourceTrackingView getVersionedResourceTrackingView(java.lang.String name,
                                                                      java.util.Date startDate,
                                                                      java.util.Date endDate)
Get a version updates traking view for a specified versioned resource on a specified time period (between start date and end date included).

Specified by:
getVersionedResourceTrackingView in interface ResourceManager
Parameters:
name - The name of resource to retrieve a tracking view for
startDate - The date to start the resource version updates tracking
endDate - The date to end the resource version updates tracking
Returns:
A VersionedResourceTrackingView for requested tracking period

saveResourceVersion

public void saveResourceVersion(ResourceVersion version)
                         throws DuplicateEntityException
Save a ResourceVersion within datastore (create or update)

Specified by:
saveResourceVersion in interface ResourceManager
Parameters:
version - The resource version to save
Throws:
DuplicateEntityException - is a resource with same name already exists

getResourceVersions

public java.util.List getResourceVersions(VersionedResourceType resourceType)
Retrieve the available resource versions for a resource type

Specified by:
getResourceVersions in interface ResourceManager
Parameters:
resourceType - The VersionedResourceType to get versions for
Returns:
A list of org.figure8.join.businessobjects.environment.ResourceVersion

getResourceVersion

public ResourceVersion getResourceVersion(java.lang.String name)
Retrieve the ResourceVersion having the specified name

Specified by:
getResourceVersion in interface ResourceManager
Parameters:
name - The name of ResourceVersion to retrieve
Returns:
The corresponding ResourceVersion or null if no one has this name

getResourceVersion

public ResourceVersion getResourceVersion(long id)
Retrieve the ResourceVersion having this identifier

Specified by:
getResourceVersion in interface ResourceManager
Parameters:
id - The unique identifier of ResourceVersion to retrieve
Returns:
The corresponding ResourceVersion or null if no one has this identifier

updateResource

public void updateResource(VersionedResource resource,
                           ResourceVersion version)
Update a versioned resource using a resource version

Specified by:
updateResource in interface ResourceManager
Parameters:
resource - The VersionedResource to update
version - The ResourceVersion to use for update

saveMachine

public void saveMachine(Machine machine)
                 throws DuplicateEntityException
Save a Machine within datastore (create or update).

Specified by:
saveMachine in interface ResourceManager
Parameters:
machine - The Machine to save
Throws:
DuplicateEntityException - if a machine with same name already exists.

getMachines

public java.util.List getMachines()
Retrieve the available machines used by integration team.

Specified by:
getMachines in interface ResourceManager
Returns:
A List of org.figure8.join.businessobjects.environment.Machine

getMachine

public Machine getMachine(long id)
Retrieve the Machine having the specified identifier

Specified by:
getMachine in interface ResourceManager
Parameters:
id - The identifier ot Machine to retrieve
Returns:
The corresponding Machine or null if no Machine has this identifier

getResourceMapping

public ResourceMapping getResourceMapping(long id)
Retrieve a ResourceMapping using its unique identifier

Specified by:
getResourceMapping in interface ResourceManager
Parameters:
id - The unique identifier of mapping to retrieve
Returns:
The corresponding ResourceMapping or null if no one match

mapResourceOnEnvironment

public void mapResourceOnEnvironment(AbstractResource resource,
                                     PhysicalEnvironment environment)
Create a new mapping of an infrastructure resource onto a physical one. This closes the previously existing active mapping on environment for a resource of same type (if any).

Specified by:
mapResourceOnEnvironment in interface ResourceManager
Parameters:
resource - The infrastructure resource to map onto environemnt
environment - The physical environment to be mapped with resource

closeResourceMapping

public void closeResourceMapping(ResourceMapping mapping)
Closes the specified ResourceMapping. This involves deactivating it and removing it from active mapping list within its related physical environments.

Specified by:
closeResourceMapping in interface ResourceManager
Parameters:
mapping - The ResourceMapping to close

getEISMapping

public EISMapping getEISMapping(long id)
Retrieve an EISMapping using its unique identifier

Specified by:
getEISMapping in interface ResourceManager
Parameters:
id - The unique identifier of mapping to retrieve
Returns:
The corresponding EISMapping or null if no one match

mapEISOnGateway

public void mapEISOnGateway(EIS eis,
                            Gateway gateway)
Create a new mapping of an EIS onto a gateway. This closes the previously existing active mapping on gateway for the EIS of same type (if any).

Specified by:
mapEISOnGateway in interface ResourceManager
Parameters:
eis - The EIS to map onto gateway
gateway - The gateway to be mapped with EIS

closeEISMapping

public void closeEISMapping(EISMapping mapping)
Closes the specified EISMapping. This involves deactivating it and removing is from active mapping list within its related gateway.

Specified by:
closeEISMapping in interface ResourceManager
Parameters:
mapping - The EISMapping to close


Copyright © 2005-2008 Join. All Rights Reserved.