Class ComponentRepositoryImpl

java.lang.Object
com.zfabrik.components.provider.util.AbstractExtComponentRepository<com.zfabrik.components.provider.util.FSCRDBComponent,DB>
com.zfabrik.components.provider.util.AbstractComponentRepository<com.zfabrik.hubcr.RemoteComponentRepositoryDB>
com.zfabrik.impl.hubcr.ComponentRepositoryImpl
All Implemented Interfaces:
com.zfabrik.components.provider.IComponentsRepository, com.zfabrik.util.sync.ISynchronizer

public class ComponentRepositoryImpl extends com.zfabrik.components.provider.util.AbstractComponentRepository<com.zfabrik.hubcr.RemoteComponentRepositoryDB>
A remote repository hub component repository. This repository connects to a Z2 hosted remote repository that provides optimized repository content in the sense that no local compilation is required anymore and that no source code will be transmitted over the wire. Typically the hub repository is the only one used aside from the local pre-built core repository.

Component properties that have a meaning:

hubcr.urlThe URL to the source repo. Typically this is of the form http://<server>:<port>/z_hubcr
hubcr.timeoutConnection timeout in ms for connecting to the providing side (defaults to 10000)
hubcr.userThe remote user to use (optional but required by default)
hubcr.passwordThe remote user's password
hubcr.priorityThe priority of the repository (defaults to 500)

In addition there is a system property com.zfabrik.hubcr.mode that if set to relaxed (as opposed to the default of strict) supports relaxed behavior if remote database updates do not succeed. If relaxed, the repository will continue with the latest known database. Assuming component resources have been fetched previously, this allows to survive short outages gracefully.

Author:
hb
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.zfabrik.components.provider.util.AbstractExtComponentRepository

    com.zfabrik.components.provider.util.AbstractExtComponentRepository.Repo, com.zfabrik.components.provider.util.AbstractExtComponentRepository.RepoMBean
  • Field Summary

    Fields inherited from class com.zfabrik.components.provider.util.AbstractExtComponentRepository

    ALL

    Fields inherited from interface com.zfabrik.components.provider.IComponentsRepository

    COMPONENT_REPO_IMPLEMENTATION, COMPONENT_REPO_MODE, COMPONENT_REPO_MODE_RELAXED, COMPONENT_REPO_MODE_STRICT

    Fields inherited from interface com.zfabrik.util.sync.ISynchronizer

    PRIO, TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    download(com.zfabrik.components.provider.util.FSCRDBComponent component, File folder)
    Download resources of a single component into the given folder
    com.zfabrik.hubcr.RemoteComponentRepositoryDB
    scan(com.zfabrik.hubcr.RemoteComponentRepositoryDB current)
    Provide an updated DB.
     

    Methods inherited from class com.zfabrik.components.provider.util.AbstractExtComponentRepository

    as, checkOfflineMode, complete, configure, configure, configure, findComponents, getCacheRoot, getComponent, getContext, getDB, getExpectedConfiguration, getModules, getName, getRevision, getRevision, getURL, has, isRelaxedMode, preInvalidation, preInvalidation, retrieve, setEvictionDelay, start, stop, test_setContext, test_setDb, test_setInited

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.zfabrik.components.provider.IComponentsRepository

    findComponents, getComponent, getModules, getRevision, retrieve
  • Constructor Details

    • ComponentRepositoryImpl

      public ComponentRepositoryImpl(String name, Properties properties)
  • Method Details

    • download

      public void download(com.zfabrik.components.provider.util.FSCRDBComponent component, File folder)
      Description copied from class: com.zfabrik.components.provider.util.AbstractExtComponentRepository
      Download resources of a single component into the given folder
      Specified by:
      download in class com.zfabrik.components.provider.util.AbstractExtComponentRepository<com.zfabrik.components.provider.util.FSCRDBComponent,com.zfabrik.hubcr.RemoteComponentRepositoryDB>
    • scan

      public com.zfabrik.hubcr.RemoteComponentRepositoryDB scan(com.zfabrik.hubcr.RemoteComponentRepositoryDB current)
      Description copied from class: com.zfabrik.components.provider.util.AbstractExtComponentRepository
      Provide an updated DB. This DB will be used to compute invalidations on synchronization and it will be used to serve component meta-data. If the repository implementation needs to attach additional meta-data to the DB, it should overwrite the DB class to do so, as the result of a scan potentially will be discarded.
      Specified by:
      scan in class com.zfabrik.components.provider.util.AbstractExtComponentRepository<com.zfabrik.components.provider.util.FSCRDBComponent,com.zfabrik.hubcr.RemoteComponentRepositoryDB>
    • toString

      public String toString()
      Overrides:
      toString in class com.zfabrik.components.provider.util.AbstractExtComponentRepository<com.zfabrik.components.provider.util.FSCRDBComponent,com.zfabrik.hubcr.RemoteComponentRepositoryDB>