use of org.sonatype.nexus.orient.entity.AttachedEntityMetadata in project nexus-public by sonatype.
the class OrientHttpClientConfigurationEntityAdapter method newEvent.
@Nullable
@Override
public EntityEvent newEvent(final ODocument document, final EventKind eventKind) {
EntityMetadata metadata = new AttachedEntityMetadata(this, document);
log.debug("Emitted {} event with metadata {}", eventKind, metadata);
switch(eventKind) {
case CREATE:
return new OrientHttpClientConfigurationCreatedEvent(metadata);
case UPDATE:
return new OrientHttpClientConfigurationUpdatedEvent(metadata);
case DELETE:
return new OrientHttpClientConfigurationDeletedEvent(metadata);
default:
return null;
}
}
use of org.sonatype.nexus.orient.entity.AttachedEntityMetadata in project nexus-public by sonatype.
the class OrientConfigurationEntityAdapter method newEvent.
@Nullable
@Override
public EntityEvent newEvent(final ODocument document, final EventKind eventKind) {
final EntityMetadata metadata = new AttachedEntityMetadata(this, document);
final String repositoryName = document.field(P_REPOSITORY_NAME);
log.trace("newEvent: eventKind: {}, repositoryName: {}, metadata: {}", eventKind, repositoryName, metadata);
switch(eventKind) {
case CREATE:
return new OrientConfigurationCreatedEvent(metadata, repositoryName);
case UPDATE:
return new OrientConfigurationUpdatedEvent(metadata, repositoryName);
case DELETE:
return new OrientConfigurationDeletedEvent(metadata, repositoryName);
default:
return null;
}
}
use of org.sonatype.nexus.orient.entity.AttachedEntityMetadata in project nexus-public by sonatype.
the class OrientBlobStoreConfigurationEntityAdapter method newEvent.
@Nullable
@Override
public EntityEvent newEvent(final ODocument document, final EventKind eventKind) {
final EntityMetadata metadata = new AttachedEntityMetadata(this, document);
final String name = document.field(P_NAME);
log.trace("newEvent: eventKind: {}, name: {}, metadata: {}", eventKind, name, metadata);
switch(eventKind) {
case CREATE:
return new OrientBlobStoreConfigurationCreatedEvent(metadata, name);
case UPDATE:
return new OrientBlobStoreConfigurationUpdatedEvent(metadata, name);
case DELETE:
return new OrientBlobStoreConfigurationDeletedEvent(metadata, name);
default:
return null;
}
}
use of org.sonatype.nexus.orient.entity.AttachedEntityMetadata in project nexus-public by sonatype.
the class AssetEntityAdapter method newEvent.
@Override
public EntityEvent newEvent(final ODocument document, final EventKind eventKind) {
EntityMetadata metadata = new AttachedEntityMetadata(this, document);
String repositoryName = ((ODocument) document.field(P_BUCKET)).field(P_REPOSITORY_NAME);
ORID rid = document.field(P_COMPONENT, ORID.class);
EntityId componentId = rid != null ? new AttachedEntityId(componentEntityAdapter, rid) : null;
switch(eventKind) {
case CREATE:
return new AssetCreatedEvent(metadata, repositoryName, componentId);
case UPDATE:
return new AssetUpdatedEvent(metadata, repositoryName, componentId);
case DELETE:
return new AssetDeletedEvent(metadata, repositoryName, componentId);
default:
return null;
}
}
use of org.sonatype.nexus.orient.entity.AttachedEntityMetadata in project nexus-public by sonatype.
the class BucketEntityAdapter method newEvent.
@Nullable
@Override
public EntityEvent newEvent(final ODocument document, final EventKind eventKind) {
final EntityMetadata metadata = new AttachedEntityMetadata(this, document);
final String repositoryName = document.field(P_REPOSITORY_NAME);
log.debug("newEvent: eventKind: {}, repositoryName: {}, metadata: {}", eventKind, repositoryName, metadata);
switch(eventKind) {
case CREATE:
return new BucketCreatedEvent(metadata, repositoryName);
case UPDATE:
return new BucketUpdatedEvent(metadata, repositoryName);
case DELETE:
return new BucketDeletedEvent(metadata, repositoryName);
default:
return null;
}
}
Aggregations