Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Sonatype Nexus (TM) Open Source Version
   * Copyright (c) 2007-2014 Sonatype, Inc.
   * All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
   *
   * This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
   * which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
   *
   * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
  * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
  * Eclipse Foundation. All other trademarks are the property of their respective owners.
  */
 package org.sonatype.nexus.plugins.capabilities;
 
 import java.util.Map;
 
 
 import static com.google.common.base.Preconditions.checkNotNull;

Capability related events.

Since:
capabilities 2.0
 
 public class CapabilityEvent
 {
 
   private final CapabilityReference reference;
 
   public CapabilityEvent(final CapabilityRegistry capabilityRegistry,
                          final CapabilityReference reference)
   {
     super(checkNotNull(capabilityRegistry));
     this. = checkNotNull(reference);
   }
 
     return ;
   }
 
   @Override
   public String toString() {
     return getReference().toString();
   }

  
Event fired after a capability was activated.

Since:
capabilities 2.0
 
   public static class AfterActivated
       extends CapabilityEvent
   {
 
     public AfterActivated(final CapabilityRegistry capabilityRegistry,
                           final CapabilityReference reference)
     {
       super(capabilityRegistryreference);
     }
 
     @Override
     public String toString() {
       return "Activated " + super.toString();
     }
 
   }

  
Event fired before a capability is passivated.

Since:
capabilities 2.0
 
   public static class BeforePassivated
       extends CapabilityEvent
   {
 
     public BeforePassivated(final CapabilityRegistry capabilityRegistry,
                             final CapabilityReference reference)
     {
       super(capabilityRegistryreference);
     }
 
     @Override
     public String toString() {
       return "Passivated " + super.toString();
     }
 
   }

  
Event fired before a capability is updated.

Since:
capabilities 2.0
 
   public static class BeforeUpdate
       extends CapabilityEvent
   {
    private final Map<StringStringproperties;
    private final Map<StringStringpreviousProperties;
    public BeforeUpdate(final CapabilityRegistry capabilityRegistry,
                        final CapabilityReference reference,
                        final Map<StringStringproperties,
                        final Map<StringStringpreviousProperties)
    {
      super(capabilityRegistryreference);
      this. = checkNotNull(properties);
      this. = checkNotNull(previousProperties);
    }
    @Override
    public String toString() {
      return "Before update of " + super.toString();
    }
    public Map<StringStringproperties() {
      return ;
    }
    public Map<StringStringpreviousProperties() {
      return ;
    }
  }

  
Event fired after a capability was updated.

Since:
capabilities 2.0
  public static class AfterUpdate
      extends CapabilityEvent
  {
    private final Map<StringStringproperties;
    private final Map<StringStringpreviousProperties;
    public AfterUpdate(final CapabilityRegistry capabilityRegistry,
                       final CapabilityReference reference,
                       final Map<StringStringproperties,
                       final Map<StringStringpreviousProperties)
    {
      super(capabilityRegistryreference);
      this. = checkNotNull(properties);
      this. = checkNotNull(previousProperties);
    }
    @Override
    public String toString() {
      return "After update of " + super.toString();
    }
    public Map<StringStringproperties() {
      return ;
    }
    public Map<StringStringpreviousProperties() {
      return ;
    }
  }

  
Event fired when a capability is created (added to registry).

Called before Capability.onCreate(java.util.Map) / Capability.onLoad(java.util.Map) are called.

Since:
capabilities 2.0
  public static class Created
      extends CapabilityEvent
  {
    public Created(final CapabilityRegistry capabilityRegistry,
                   final CapabilityReference reference)
    {
      super(capabilityRegistryreference);
    }
    @Override
    public String toString() {
      return "Created " + super.toString();
    }
  }

  
Event fired when a capability is removed from registry.

Called after Capability.onRemove() is called.

Since:
capabilities 2.0
  public static class AfterRemove
      extends CapabilityEvent
  {
    public AfterRemove(final CapabilityRegistry capabilityRegistry,
                       final CapabilityReference reference)
    {
      super(capabilityRegistryreference);
    }
    @Override
    public String toString() {
      return "After remove of " + super.toString();
    }
  }

  
Event fired when an exception occurred during a lifecycle callback method (create/load/update/activate/passivate).

Since:
2.7
  public static class CallbackFailure
      extends CapabilityEvent
  {
    private String failingAction;
    private Exception failure;
    public CallbackFailure(final CapabilityRegistry capabilityRegistry,
                           final CapabilityReference reference,
                           final String failingAction,
                           final Exception failure)
    {
      super(capabilityRegistryreference);
      this. = checkNotNull(failingAction"failingAction");
      this. = checkNotNull(failure"failure");
    }
    @Override
    public String toString() {
      return  + " Failed " + super.toString();
    }
    public Exception failure() {
      return ;
    }
    public String failingAction() {
      return ;
    }
  }

  
Event fired when an capability failure has been cleared.

Since:
2.7
  public static class CallbackFailureCleared
      extends CapabilityEvent
  {
    public CallbackFailureCleared(final CapabilityRegistry capabilityRegistry,
                                  final CapabilityReference reference)
    {
      super(capabilityRegistryreference);
    }
    @Override
    public String toString() {
      return "Error cleared " + super.toString();
    }
  }
New to GrepCode? Check out our FAQ X