org.objectweb.dsrg.sofa.repository
Class RepositoryFacade

java.lang.Object
  extended by org.objectweb.dsrg.sofa.repository.RepositoryFacade

public class RepositoryFacade
extends java.lang.Object

An object simplifying access to the repository.


Nested Class Summary
static class RepositoryFacade.RepositoryFacadeException
          Repository facade exception.
static class RepositoryFacade.UnsupportedSchemeException
          Unsupported scheme exception.
 class RepositoryFacade.VersionMap
          Maps element names to their current versions.
 
Method Summary
 Architecture createArchitecture(Architecture previous, Frame _implements)
          Creates new version of already existing architecture.
 Architecture createArchitecture(java.lang.String name, Frame _implements)
          Creates new architecture
 Aspect createAspect(Aspect prev)
          Creates new version of the already existing aspect.
 Aspect createAspect(java.lang.String name)
          Creates new aspect.
 AssemblyDescriptor createAssemblyDesc(AssemblyDescriptor previous, Architecture topLevelArch)
          Creates new version of already existing assembly descriptor.
 AssemblyDescriptor createAssemblyDesc(java.lang.String name, Architecture topLevelArch)
          Creates new assembly descriptor.
 CodeBundle createCodeBundle(java.lang.String name, VersionedEntity entity)
          Creates code bundle for the given entity.
 DeploymentPlan createDeploymentPlan(DeploymentPlan plan, AssemblyDescriptor assembly)
          Creates new version of the already existing deplplan plan for the given assembly descriptor.
 DeploymentPlan createDeploymentPlan(java.lang.String name, AssemblyDescriptor assembly)
          Creates new deplplan plan for the given assembly descriptor.
 RepositoryFacade.VersionMap createEmptyVersionMap()
          Creates an empty version map.
 Frame createFrame(Frame previous)
          Creates new version of already existing frame.
 Frame createFrame(java.lang.String name)
          Creates new frame.
 InterfaceType createInterfaceType(InterfaceType previous, java.lang.String signature)
          Creates new version of already existing interface type.
 InterfaceType createInterfaceType(java.lang.String name, java.lang.String signature)
          Creates new interface type.
 MicroComponent createMicroComponent(MicroComponent prev)
          Creates new version of the already existing micro component.
 MicroComponent createMicroComponent(java.lang.String name)
          Creates new micro component.
 CodeBundle createStandaloneCodeBundle(CodeBundle previous)
          Creates new version of already existing code bundle.
 CodeBundle createStandaloneCodeBundle(java.lang.String name)
          Creates standalone code bundle.
 VersionedEntity getLastHeadVersion(java.lang.String name)
          Returns the last head version of the given object or null if object does not exist.
 DeploymentPlan lookupDeploymentPlanByVersion(java.lang.String name, java.lang.String version)
          Looks up deployment plan.
 java.util.List<VersionedEntity> lookupEntityByName(java.lang.String name)
          Looks up all entities with the given name.
 VersionedEntity lookupEntityByTag(java.lang.String name, java.lang.String tag)
          Looks up entity with given name and version tag.
 VersionedEntity lookupEntityByVersion(java.lang.String name, java.lang.String version)
          Looks up entity.
 Architecture updateArchitecture(java.io.File srcxmi, Architecture orig, RepositoryFacade.VersionMap vm)
          Updates the given architecture according to info obtained from the xmi file - WARNING: it can return a different instance.
 AssemblyDescriptor updateAssembly(java.io.File srcxmi, AssemblyDescriptor orig, RepositoryFacade.VersionMap vm)
          Updates the given assembly descriptor according to info obtained from the xmi file - WARNING: it can return a different instance.
 Frame updateFrame(java.io.File srcxmi, Frame orig, RepositoryFacade.VersionMap vm)
          Updates the given frame according to info obtained from the xmi file - WARNING: it can return a different instance.
 InterfaceType updateInterfaceType(java.io.File srcxmi, InterfaceType orig)
          Updates the given interface type according to info obtained from the xmi file - WARNING: it can return a different instance.
 CodeBundle updateStandaloneCodeBundle(java.io.File srcxmi, CodeBundle orig, RepositoryFacade.VersionMap vm)
          Updates the given standalone code bundle according to info obtained from the xmi file - WARNING: it can return a different instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createInterfaceType

public InterfaceType createInterfaceType(java.lang.String name,
                                         java.lang.String signature)
Creates new interface type.

Parameters:
name - name of the interface type
signature - signature
Returns:
interface type

createInterfaceType

public InterfaceType createInterfaceType(InterfaceType previous,
                                         java.lang.String signature)
Creates new version of already existing interface type.

Parameters:
previous - previous version
signature - signature
Returns:
interface type

createFrame

public Frame createFrame(java.lang.String name)
Creates new frame.

Parameters:
name - name
Returns:
frame

createFrame

public Frame createFrame(Frame previous)
Creates new version of already existing frame.

Parameters:
previous - previous version
Returns:
frame

createArchitecture

public Architecture createArchitecture(java.lang.String name,
                                       Frame _implements)
Creates new architecture

Parameters:
name - name
_implements - frame implemented by the architecture
Returns:
architecture

createArchitecture

public Architecture createArchitecture(Architecture previous,
                                       Frame _implements)
Creates new version of already existing architecture.

Parameters:
previous - previous version
_implements - frame implemented by the architecture
Returns:
architecture

createAssemblyDesc

public AssemblyDescriptor createAssemblyDesc(java.lang.String name,
                                             Architecture topLevelArch)
Creates new assembly descriptor.

Parameters:
name - name
topLevelArch - top level architecture
Returns:
assembly descriptor

createAssemblyDesc

public AssemblyDescriptor createAssemblyDesc(AssemblyDescriptor previous,
                                             Architecture topLevelArch)
Creates new version of already existing assembly descriptor.

Parameters:
previous - previous version
topLevelArch - top level architecture
Returns:
assembly descriptor

createCodeBundle

public CodeBundle createCodeBundle(java.lang.String name,
                                   VersionedEntity entity)
Creates code bundle for the given entity.

Parameters:
name - name of the code bundle
entity - entity for which code bundle has to be created
Returns:
code bundle

createStandaloneCodeBundle

public CodeBundle createStandaloneCodeBundle(java.lang.String name)
Creates standalone code bundle.

Parameters:
name - name of the code bundle
Returns:
code bundle

createStandaloneCodeBundle

public CodeBundle createStandaloneCodeBundle(CodeBundle previous)
Creates new version of already existing code bundle.

Parameters:
previous - previous version
Returns:
code bundle

createDeploymentPlan

public DeploymentPlan createDeploymentPlan(java.lang.String name,
                                           AssemblyDescriptor assembly)
Creates new deplplan plan for the given assembly descriptor.

Parameters:
name - name of the deployment plan
assembly - assembly
Returns:
deployment plan

createDeploymentPlan

public DeploymentPlan createDeploymentPlan(DeploymentPlan plan,
                                           AssemblyDescriptor assembly)
Creates new version of the already existing deplplan plan for the given assembly descriptor.

Parameters:
plan - previous version
assembly - assembly
Returns:
deployment plan

createMicroComponent

public MicroComponent createMicroComponent(java.lang.String name)
Creates new micro component.

Parameters:
name - name of the micro component
Returns:
micro component

createMicroComponent

public MicroComponent createMicroComponent(MicroComponent prev)
Creates new version of the already existing micro component.

Parameters:
prev - previous version
Returns:
micro component

createAspect

public Aspect createAspect(java.lang.String name)
Creates new aspect.

Parameters:
name - name of the aspect
Returns:
aspect

createAspect

public Aspect createAspect(Aspect prev)
Creates new version of the already existing aspect.

Parameters:
prev - previous version
Returns:
aspect

lookupEntityByName

public java.util.List<VersionedEntity> lookupEntityByName(java.lang.String name)
Looks up all entities with the given name. It just calls RepositoryUtil.lookupNamedEntityByName(String, RepositoryQuery).

Parameters:
name - name of an entity
Returns:
list with all entities with the given name or null

lookupEntityByTag

public VersionedEntity lookupEntityByTag(java.lang.String name,
                                         java.lang.String tag)
Looks up entity with given name and version tag. It just calls RepositoryUtil.lookupNamedEntityByTag(String, String, RepositoryQuery).

Parameters:
name - entity name
tag - version tag
Returns:
entity with appropriate name and version tag or null

lookupEntityByVersion

public VersionedEntity lookupEntityByVersion(java.lang.String name,
                                             java.lang.String version)
Looks up entity.

Parameters:
name - name of an entity
version - version identifier of an entity
Returns:
entity or null

lookupDeploymentPlanByVersion

public DeploymentPlan lookupDeploymentPlanByVersion(java.lang.String name,
                                                    java.lang.String version)
Looks up deployment plan.

Parameters:
name - name of the deployment plan
version - version of the deployment plan
Returns:
deployment plan or null

getLastHeadVersion

public VersionedEntity getLastHeadVersion(java.lang.String name)
Returns the last head version of the given object or null if object does not exist.

Parameters:
name - name of the given object
Returns:
last head version or null

updateInterfaceType

public InterfaceType updateInterfaceType(java.io.File srcxmi,
                                         InterfaceType orig)
                                  throws RepositoryFacade.RepositoryFacadeException
Updates the given interface type according to info obtained from the xmi file - WARNING: it can return a different instance.

Parameters:
srcxmi - xmi with new info
orig - original object to be updated
Returns:
updated object
Throws:
RepositoryFacade.RepositoryFacadeException - if something bad happened

createEmptyVersionMap

public RepositoryFacade.VersionMap createEmptyVersionMap()
Creates an empty version map.

Returns:
an empty version map

updateFrame

public Frame updateFrame(java.io.File srcxmi,
                         Frame orig,
                         RepositoryFacade.VersionMap vm)
                  throws RepositoryFacade.RepositoryFacadeException
Updates the given frame according to info obtained from the xmi file - WARNING: it can return a different instance.

Parameters:
srcxmi - xmi with new info
orig - original object to be updated
vm - version map for translating entities without given version
Returns:
updated object
Throws:
RepositoryFacade.RepositoryFacadeException - if something bad happened

updateArchitecture

public Architecture updateArchitecture(java.io.File srcxmi,
                                       Architecture orig,
                                       RepositoryFacade.VersionMap vm)
                                throws RepositoryFacade.RepositoryFacadeException
Updates the given architecture according to info obtained from the xmi file - WARNING: it can return a different instance.

Parameters:
srcxmi - xmi with new info
orig - original object to be updated
vm - version map for translating entities without given version
Returns:
updated object
Throws:
RepositoryFacade.RepositoryFacadeException - if something bad happened

updateAssembly

public AssemblyDescriptor updateAssembly(java.io.File srcxmi,
                                         AssemblyDescriptor orig,
                                         RepositoryFacade.VersionMap vm)
                                  throws RepositoryFacade.RepositoryFacadeException
Updates the given assembly descriptor according to info obtained from the xmi file - WARNING: it can return a different instance.

Parameters:
srcxmi - xmi with new info
orig - original object to be updated
vm - version map for translating entities without given version
Returns:
updated object
Throws:
RepositoryFacade.RepositoryFacadeException - if something bad happened

updateStandaloneCodeBundle

public CodeBundle updateStandaloneCodeBundle(java.io.File srcxmi,
                                             CodeBundle orig,
                                             RepositoryFacade.VersionMap vm)
                                      throws RepositoryFacade.RepositoryFacadeException
Updates the given standalone code bundle according to info obtained from the xmi file - WARNING: it can return a different instance.

Parameters:
srcxmi - xmi with new info
orig - original object to be updated
vm - version map for translating entities without given version
Returns:
updated object
Throws:
RepositoryFacade.RepositoryFacadeException - if something bad happened