org.axway.grapes.server.db
Class ModelMapper

java.lang.Object
  extended by org.axway.grapes.server.db.ModelMapper

public class ModelMapper
extends Object

Model Mapper

Model mapper maps the client/server model and the database model.

Author:
jdcoffre

Constructor Summary
ModelMapper(RepositoryHandler repoHandler)
           
 
Method Summary
 Artifact getArtifact(DbArtifact dbArtifact)
          Transform an artifact from database model to client/server model
 DbArtifact getDbArtifact(Artifact artifact)
          Transform an artifact from client/server model to database model WARNING: This transformation does not take licenses into account!!!
 DbLicense getDbLicense(License license)
          Transform a license from client/server model to database model
 DbModule getDbModule(Module module)
          Transform a module from client/server model to database model
 DbOrganization getDbOrganization(Organization organization)
          Transform an organization from client/server model to database model
 Dependency getDependency(DbDependency dbDependency, String sourceName, String sourceVersion)
          Transform a dependency from database model to client/server model
 License getLicense(DbLicense dbLicense)
          Transform a license from database model to client/server model
 Module getModule(DbModule dbModule)
          Transform a module from database model to client/server model
 Organization getOrganization(DbOrganization dbOrganization)
          Transform an organization from database model to client/server model
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelMapper

public ModelMapper(RepositoryHandler repoHandler)
Method Detail

getDbOrganization

public DbOrganization getDbOrganization(Organization organization)
Transform an organization from client/server model to database model

Parameters:
organization - Organization
Returns:
DbOrganization

getOrganization

public Organization getOrganization(DbOrganization dbOrganization)
Transform an organization from database model to client/server model

Parameters:
dbOrganization - DbOrganization
Returns:
Organization

getDbLicense

public DbLicense getDbLicense(License license)
Transform a license from client/server model to database model

Parameters:
license - the license to transform
Returns:
DbLicense return a license in database model

getLicense

public License getLicense(DbLicense dbLicense)
Transform a license from database model to client/server model

Parameters:
dbLicense - DbLicense the license to transform
Returns:
License return a license in database model

getDbArtifact

public DbArtifact getDbArtifact(Artifact artifact)
Transform an artifact from client/server model to database model WARNING: This transformation does not take licenses into account!!!

Parameters:
artifact - the artifact to transform
Returns:
DbArtifact

getArtifact

public Artifact getArtifact(DbArtifact dbArtifact)
Transform an artifact from database model to client/server model

Parameters:
dbArtifact - the artifact to transform
Returns:
Artifact return a license in database model

getDbModule

public DbModule getDbModule(Module module)
Transform a module from client/server model to database model

Parameters:
module - the module to transform
Returns:
DbModule

getModule

public Module getModule(DbModule dbModule)
Transform a module from database model to client/server model

Parameters:
dbModule - DbModule
Returns:
Module

getDependency

public Dependency getDependency(DbDependency dbDependency,
                                String sourceName,
                                String sourceVersion)
Transform a dependency from database model to client/server model

Parameters:
dbDependency - DbDependency
Returns:
Dependency


Copyright © 2014. All Rights Reserved.