Package org.sonatype.nexus.capability

Examples of org.sonatype.nexus.capability.Capability


  public static CapabilityStatusXO asCapabilityStatus(final CapabilityReference reference) {
    checkNotNull(reference);

    CapabilityDescriptor descriptor = reference.context().descriptor();
    Capability capability = reference.capability();

    final CapabilityStatusXO capabilityStatus = new CapabilityStatusXO()
        .withCapability(asCapability(reference))
        .withTypeName(descriptor.name())
        .withActive(reference.context().isActive())
        .withError(reference.context().hasFailure());

    try {
      capabilityStatus.setDescription(capability.description());
    }
    catch (Throwable e) {
      log.warn(
          "Failed to render description of capability '{}/{}' due to {}/{}",
          reference.context().type(), reference.context().id(),
          e.getClass().getName(), e.getMessage(), log.isDebugEnabled() ? e : null
      );
      capabilityStatus.setDescription(null);
    }

    try {
      capabilityStatus.setStatus(capability.status());
    }
    catch (Throwable e) {
      log.warn(
          "Failed to render status of capability '{}/{}' due to {}/{}",
          reference.context().type(), reference.context().id(),
View Full Code Here


    final CapabilityFactory factory = capabilityFactoryRegistry.get(type);
    if (factory == null) {
      throw new RuntimeException(format("No factory found for a capability of type %s", type));
    }

    final Capability capability = factory.create();

    final DefaultCapabilityReference reference = createReference(id, type, descriptor, capability);

    references.put(id, reference);
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.capability.Capability

Copyright © 2018 www.massapicom. 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.