AbstractOSGiResolver
Date: 2014-12-13

org.apache.ivy.osgi.repo

## Class AbstractOSGiResolver

- java.lang.Object
- - org.apache.ivy.plugins.resolver.AbstractResolver
  - - org.apache.ivy.plugins.resolver.BasicResolver
    - - org.apache.ivy.osgi.repo.AbstractOSGiResolver

- All Implemented Interfaces:
    Validatable, DependencyResolver, HasLatestStrategy
  Direct Known Subclasses:
    AggregatedOSGiResolver, OBRResolver, UpdateSiteResolver

      public abstract class AbstractOSGiResolver
      extends BasicResolver

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AbstractOSGiResolver.RequirementStrategy`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static RepoDescriptor` | `FAILING_REPO_DESCRIPTOR`

    - ### Fields inherited from class org.apache.ivy.plugins.resolver.BasicResolver

      `DATE_FORMAT, DESCRIPTOR_OPTIONAL, DESCRIPTOR_REQUIRED`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractOSGiResolver()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkModuleDescriptorRevision(ModuleDescriptor systemMd, ModuleRevisionId systemMrid)`
    `protected void` | `ensureInit()`
    `protected java.util.Collection` | `filterNames(java.util.Collection names)` Filters names before returning them in the findXXXNames or findTokenValues method.
    `ResolvedResource` | `findArtifactRef(Artifact artifact, java.util.Date date)`
    `ResolvedResource[]` | `findBundle(DependencyDescriptor dd, ResolveData data, java.util.Collection<ModuleDescriptor> mds)`
    `ResolvedResource[]` | `findCapability(DependencyDescriptor dd, ResolveData data, java.util.Collection<ModuleDescriptor> mds)`
    `ResolvedResource` | `findIvyFileRef(DependencyDescriptor dd, ResolveData data)` Finds the module descriptor for the specified `DependencyDescriptor`.
    `protected java.util.Collection` | `findNames(java.util.Map tokenValues, java.lang.String token)`
    `ResolvedResource` | `findResource(ResolvedResource[] rress, ResourceMDParser rmdparser, ModuleRevisionId mrid, java.util.Date date)` When the resolver has many choices, this function helps choosing one
    `protected long` | `get(Resource resource, java.io.File dest)`
    `RepoDescriptor` | `getRepoDescriptor()`
    `URLRepository` | `getRepository()`
    `protected Resource` | `getResource(java.lang.String source)`
    `protected abstract void` | `init()`
    `boolean` | `isAllownomd()`
    `java.util.Map[]` | `listTokenValues(java.lang.String[] tokens, java.util.Map criteria)` Same as `DependencyResolver.listTokenValues(String, Map)` but more generic.
    `void` | `publish(Artifact artifact, java.io.File src, boolean overwrite)`
    `protected void` | `setRepoDescriptor(RepoDescriptor repoDescriptor)`
    `void` | `setRequirementStrategy(AbstractOSGiResolver.RequirementStrategy importPackageStrategy)`
    `void` | `setRequirementStrategy(java.lang.String strategy)`

    - ### Methods inherited from class org.apache.ivy.plugins.resolver.BasicResolver

      `acceptLatest, clearArtifactAttempts, clearIvyAttempts, doFindArtifactRef, download, download, exists, findFirstArtifactRef, getAndCheck, getArtifactRef, getChecksumAlgorithms, getDefaultRMDParser, getDependency, getPublicationDate, getRMDParser, getWorkspaceName, isCheckconsistency, isEnvDependent, isForce, listModules, listOrganisations, listRevisions, listTokenValues, locate, logArtifactAttempt, logAttempt, logIvyAttempt, parse, reportFailure, reportFailure, setAllownomd, setCheckconsistency, setChecksums, setDescriptor, setEnvDependent, setForce, setWorkspaceName, shouldReturnResolvedModule, toString`

    - ### Methods inherited from class org.apache.ivy.plugins.resolver.AbstractResolver

      `abortPublishTransaction, beginPublishTransaction, checkInterrupted, checkLatest, commitPublishTransaction, doValidate, dumpSettings, findModuleInCache, findModuleInCache, fromSystem, fromSystem, getCacheDownloadOptions, getCacheOptions, getChangingMatcherName, getChangingPattern, getDownloadOptions, getEventManager, getLatest, getLatestStrategy, getName, getNamespace, getParserSettings, getRepositoryCacheManager, getSettings, getSystemNode, getTypeName, hidePassword, isAfter, isValidate, saveModuleRevisionIfNeeded, setCache, setChangingMatcher, setChangingPattern, setCheckmodified, setEventManager, setLatest, setLatestStrategy, setName, setNamespace, setRepositoryCacheManager, setSettings, setValidate, toSystem, toSystem, toSystem, toSystem, toSystem, toSystem, validate`

    - ### Methods inherited from class java.lang.Object

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

- - ### Field Detail

    - #### FAILING_REPO_DESCRIPTOR

          protected static final RepoDescriptor FAILING_REPO_DESCRIPTOR

  - ### Constructor Detail

    - #### AbstractOSGiResolver

          public AbstractOSGiResolver()

  - ### Method Detail

    - #### setRequirementStrategy

          public void setRequirementStrategy(AbstractOSGiResolver.RequirementStrategy importPackageStrategy)

    - #### setRequirementStrategy

          public void setRequirementStrategy(java.lang.String strategy)

    - #### setRepoDescriptor

          protected void setRepoDescriptor(RepoDescriptor repoDescriptor)

    - #### getRepository

          public URLRepository getRepository()

    - #### ensureInit

          protected void ensureInit()

    - #### init

          protected abstract void init()

    - #### getRepoDescriptor

          public RepoDescriptor getRepoDescriptor()

    - #### isAllownomd

          public boolean isAllownomd()

      Overrides:
        `isAllownomd` in class `BasicResolver`

    - #### findIvyFileRef

          public ResolvedResource findIvyFileRef(DependencyDescriptor dd,
                                        ResolveData data)

      Description copied from interface: `DependencyResolver`
      Finds the module descriptor for the specified `DependencyDescriptor`. If this resolver can't find the module descriptor, `null` is returned.
      Parameters:
        `dd` - the dependency descriptor
        `data` - the resolve data
      Returns:
        the module descriptor, or `null`

    - #### findBundle

          public ResolvedResource[] findBundle(DependencyDescriptor dd,
                                      ResolveData data,
                                      java.util.Collection<ModuleDescriptor> mds)

    - #### findCapability

          public ResolvedResource[] findCapability(DependencyDescriptor dd,
                                          ResolveData data,
                                          java.util.Collection<ModuleDescriptor> mds)

    - #### findResource

          public ResolvedResource findResource(ResolvedResource[] rress,
                                      ResourceMDParser rmdparser,
                                      ModuleRevisionId mrid,
                                      java.util.Date date)

      Description copied from class: `BasicResolver`
      When the resolver has many choices, this function helps choosing one
      Overrides:
        `findResource` in class `BasicResolver`
      Parameters:
        `rress` - the list of resolved resource which the resolver found to fit the requirement
        `rmdparser` - the parser of module descriptor
        `mrid` - the module being resolved
        `date` - the current date
      Returns:
        the selected resource

    - #### findArtifactRef

          public ResolvedResource findArtifactRef(Artifact artifact,
                                         java.util.Date date)

      Specified by:
        `findArtifactRef` in class `BasicResolver`

    - #### checkModuleDescriptorRevision

          protected void checkModuleDescriptorRevision(ModuleDescriptor systemMd,
                                           ModuleRevisionId systemMrid)

      Overrides:
        `checkModuleDescriptorRevision` in class `BasicResolver`

    - #### filterNames

          protected java.util.Collection filterNames(java.util.Collection names)

      Description copied from class: `BasicResolver`
      Filters names before returning them in the findXXXNames or findTokenValues method.

      Remember to call the super implementation when overriding this method.

      Overrides:
        `filterNames` in class `BasicResolver`
      Parameters:
        `names` - the list to filter.
      Returns:
        the filtered list

    - #### findNames

          protected java.util.Collection findNames(java.util.Map tokenValues,
                                       java.lang.String token)

      Specified by:
        `findNames` in class `BasicResolver`

    - #### listTokenValues

          public java.util.Map[] listTokenValues(java.lang.String[] tokens,
                                        java.util.Map criteria)

      Description copied from interface: `DependencyResolver`
      Same as `DependencyResolver.listTokenValues(String, Map)` but more generic.
      Specified by:
        `listTokenValues` in interface `DependencyResolver`
      Overrides:
        `listTokenValues` in class `AbstractResolver`
      Parameters:
        `tokens` - the tokens of the query
        `criteria` - the token which have values
      Returns:
        the list of token values (Map[]), must not be `null`

    - #### get

          protected long get(Resource resource,
                 java.io.File dest)
                      throws java.io.IOException

      Specified by:
        `get` in class `BasicResolver`
      Throws:
        `java.io.IOException`

    - #### getResource

          protected Resource getResource(java.lang.String source)
                                  throws java.io.IOException

      Specified by:
        `getResource` in class `BasicResolver`
      Throws:
        `java.io.IOException`

    - #### publish

          public void publish(Artifact artifact,
                     java.io.File src,
                     boolean overwrite)
                       throws java.io.IOException

      Throws:
        `java.io.IOException`