Class EiffelEvent
- java.lang.Object
-
- com.axis.jenkins.plugins.eiffel.eiffelbroadcaster.eiffel.EiffelEvent
-
- Direct Known Subclasses:
EiffelActivityCanceledEvent
,EiffelActivityFinishedEvent
,EiffelActivityStartedEvent
,EiffelActivityTriggeredEvent
,EiffelArtifactCreatedEvent
,EiffelArtifactPublishedEvent
,GenericEiffelEvent
public class EiffelEvent extends Object
A base class for Eiffel events that defines the common event attributes (meta
andlinks
) and makes it easy for subclasses to add an event-specificdata
attribute. See the Eiffel event documentation for each concrete event type for more on the meaning of the attributes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EiffelEvent.Link
static class
EiffelEvent.Meta
-
Constructor Summary
Constructors Constructor Description EiffelEvent(String type, String version)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
List<EiffelEvent.Link>
getLinks()
EiffelEvent.Meta
getMeta()
int
hashCode()
static void
setSourceProvider(SourceProvider provider)
Provide aSourceProvider
instance that will be request to provide aEiffelEvent.Meta.Source
object for each event created after that point.void
sign(PrivateKey key, String identity, HashAlgorithm hashAlg)
Signs the current event in place using the given signing key, identity, and hash algorithm.String
toJSON()
String
toString()
-
-
-
Method Detail
-
sign
public void sign(@NonNull PrivateKey key, @NonNull String identity, @NonNull HashAlgorithm hashAlg) throws InvalidKeyException, JsonCanonicalizationException, NoSuchAlgorithmException, SignatureException, UnsupportedAlgorithmException
Signs the current event in place using the given signing key, identity, and hash algorithm.- Parameters:
key
- the private key to use when producing the signatureidentity
- the distinguished name (DN) that identifies the author of the eventhashAlg
- the hash algorithm to use when hashing the serialized form of the event- Throws:
InvalidKeyException
- if the given private key was invalidJsonCanonicalizationException
- if there was an error serializing the event to canonical JSON formNoSuchAlgorithmException
- if the selected algorithm isn't supported by the available cryptography providersSignatureException
- if there's a general problem in the signing processUnsupportedAlgorithmException
- if the credential's signature algorithm isn't supported by this implementation of the Eiffel protocol or the available cryptography provider
-
getLinks
public List<EiffelEvent.Link> getLinks()
-
getMeta
public EiffelEvent.Meta getMeta()
-
setSourceProvider
public static void setSourceProvider(SourceProvider provider)
Provide aSourceProvider
instance that will be request to provide aEiffelEvent.Meta.Source
object for each event created after that point.
-
toJSON
public String toJSON() throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
-