Examples of CapabilityReference


Examples of org.sonatype.nexus.capability.CapabilityReference

    final YumHosted yum = mock(YumHosted.class);
    when(yumRegistry.get(RELEASES)).thenReturn(yum);
    when(yum.getVersion(EXISTING_ALIAS)).thenReturn(TRUNK_VERSION);
    when(yum.getVersion(ALIAS_TO_CREATE)).thenReturn(VERSION_TO_CREATE);

    final CapabilityReference reference = mock(CapabilityReference.class);
    final Collection<CapabilityReference> references = Lists.newArrayList();
    references.add(reference);
    final GenerateMetadataCapability yumRepositoryCapability = mock(GenerateMetadataCapability.class);
    final CapabilityContext capabilityContext = mock(CapabilityContext.class);
    when(reference.context()).thenReturn(capabilityContext);
    when(capabilityContext.id()).thenReturn(CapabilityIdentity.capabilityIdentity("ID"));
    when(capabilityContext.isEnabled()).thenReturn(true);
    when(capabilityContext.notes()).thenReturn("Notes");
    when(reference.capabilityAs(GenerateMetadataCapability.class)).thenReturn(yumRepositoryCapability);
    Map<String, String> aliases = Maps.newHashMap();
    aliases.put("foo", "bar");
    when(yumRepositoryCapability.getConfig()).thenReturn(
        new GenerateMetadataCapabilityConfiguration(RELEASES, aliases, true, 1, "/comps.xml")
    );
View Full Code Here

Examples of org.sonatype.nexus.capability.CapabilityReference

  @Path("/{id}")
  @Produces({APPLICATION_XML, APPLICATION_JSON})
  @RequiresPermissions(CapabilitiesPlugin.PERMISSION_PREFIX + "read")
  public CapabilityXO get(final @PathParam("id") String id) {
    final CapabilityIdentity capabilityId = capabilityIdentity(id);
    final CapabilityReference reference = capabilityRegistry.get(capabilityId);
    if (reference == null) {
      throw new CapabilityNotFoundException(capabilityId);
    }
    return asCapability(reference);
  }
View Full Code Here

Examples of org.sonatype.nexus.capability.CapabilityReference

  @Path("/{id}/status")
  @Produces({APPLICATION_XML, APPLICATION_JSON})
  @RequiresPermissions(CapabilitiesPlugin.PERMISSION_PREFIX + "read")
  public CapabilityStatusXO getInfo(final @PathParam("id") String id) {
    final CapabilityIdentity capabilityId = capabilityIdentity(id);
    final CapabilityReference reference = capabilityRegistry.get(capabilityId);
    if (reference == null) {
      throw new CapabilityNotFoundException(capabilityId);
    }
    return asCapabilityStatus(reference);
  }
View Full Code Here

Examples of org.sonatype.nexus.plugins.capabilities.CapabilityReference

  private ConfigEntry configEntry() {

    final CapabilityIdentity capaId = new CapabilityIdentity(configId());

    final CapabilityReference reference = capaRegistry.get(capaId);

    final ConfigEntry entry = reference
        .capabilityAs(ConfigCapability.class);

    return entry;

  }
View Full Code Here

Examples of org.sonatype.nexus.plugins.capabilities.CapabilityReference

      return;
    }

    final CapabilityIdentity capaId = new CapabilityIdentity(configId());

    final CapabilityReference reference = capaRegistry.get(capaId);

    final ConfigEntry entry = reference
        .capabilityAs(ConfigCapability.class);

    final String comboId = entry.comboId();

    final AmazonService amazonService = entry.amazonService();
View Full Code Here

Examples of org.sonatype.nexus.plugins.capabilities.CapabilityReference

  }

  public static boolean hasNoReference(final CapabilityRegistry registry,
      final CapabilityType type) {

    final CapabilityReference reference = referenceFrom(registry, type);

    return reference == null;

  }
View Full Code Here

Examples of org.sonatype.nexus.plugins.capabilities.CapabilityReference

  private ConfigEntry configEntry() {

    final CapabilityIdentity capaId = new CapabilityIdentity(configId());

    final CapabilityReference reference = capaRegistry.get(capaId);

    final ConfigEntry entry = reference
        .capabilityAs(ConfigCapability.class);

    return entry;

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.