public AuditMessage(long time, EntityId entityId, String user, AuditType type, AuditPayload payload) { this(time, entityId.toMetadataEntity(), user, type, payload); }
public AuditMessage(long time, EntityId entityId, String user, AuditType type, AuditPayload payload) { this(time, entityId.toMetadataEntity(), user, type, payload); }
@Override public void publish(EntityId entityId, AuditType auditType, AuditPayload auditPayload) { publish(entityId.toMetadataEntity(), auditType, auditPayload); }
/** * @param id the entity for which to add metadata properties * @param properties the metadata properties */ public void addProperties(EntityId id, Map<String, String> properties) throws BadRequestException, UnauthenticatedException, IOException, UnauthorizedException { addProperties(id.toMetadataEntity(), properties); }
/** * @param id the entity for which to remove a metadata property * @param property the property to remove */ public void removeProperty(EntityId id, String property) throws BadRequestException, UnauthenticatedException, IOException, UnauthorizedException { removeProperty(id.toMetadataEntity(), property); }
/** * @param id the entity for which to remove metadata */ public void removeMetadata(EntityId id) throws BadRequestException, UnauthenticatedException, IOException, UnauthorizedException { removeMetadata(id.toMetadataEntity()); }
/** * @param id the entity for which to remove a metadata tag * @param tag the tag to remove */ public void removeTag(EntityId id, String tag) throws BadRequestException, UnauthenticatedException, IOException, UnauthorizedException { removeTag(id.toMetadataEntity(), tag); }
/** * @param id the entity for which to add metadata tags * @param tags the metadata tags */ public void addTags(EntityId id, Set<String> tags) throws BadRequestException, UnauthenticatedException, IOException, UnauthorizedException { addTags(id.toMetadataEntity(), tags); }
/** * @param id the entity for which to remove metadata tags */ public void removeTags(EntityId id) throws BadRequestException, UnauthenticatedException, IOException, UnauthorizedException { removeTags(id.toMetadataEntity()); }
/** * Publish audit information using {@link AuditPublisher}. * * @param publisher audit publisher, if null no audit information is published * @param entityId entity id for which audit information is being published * @param auditType audit type * @param auditPayload audit payload */ public static void publishAudit(@Nullable AuditPublisher publisher, EntityId entityId, AuditType auditType, AuditPayload auditPayload) { publishAudit(publisher, entityId.toMetadataEntity(), auditType, auditPayload); }
/** * @param id the entity for which to retrieve metadata properties * @param scope the {@link MetadataScope} to retrieve the properties from. If null, this method retrieves * properties from both {@link MetadataScope#SYSTEM} and {@link MetadataScope#USER} * @return The metadata properties for the entity. */ public Map<String, String> getProperties(EntityId id, @Nullable MetadataScope scope) throws BadRequestException, UnauthenticatedException, IOException, UnauthorizedException { return getProperties(id.toMetadataEntity(), scope); }
/** * @param id the entity for which to retrieve metadata tags * @param scope the {@link MetadataScope} to retrieve the tags from. If null, this method retrieves * tags from both {@link MetadataScope#SYSTEM} and {@link MetadataScope#USER} * @return The metadata tags for the entity. */ public Set<String> getTags(EntityId id, @Nullable MetadataScope scope) throws NotFoundException, BadRequestException, UnauthenticatedException, IOException, UnauthorizedException { return getTags(id.toMetadataEntity(), scope); }
/** * @param id the entity for which to remove metadata properties */ public void removeProperties(EntityId id) throws BadRequestException, UnauthenticatedException, IOException, UnauthorizedException { removeProperties(id.toMetadataEntity()); }
/** * Publish audit information using {@link AuditPublisher}. * * @param publisher audit publisher, if null no audit information is published * @param entityId entity id for which audit information is being published * @param auditType audit type * @param auditPayload audit payload */ public static void publishAudit(@Nullable AuditPublisher publisher, EntityId entityId, AuditType auditType, AuditPayload auditPayload) { publishAudit(publisher, entityId.toMetadataEntity(), auditType, auditPayload); }
@Override public void publish(EntityId entityId, AuditType auditType, AuditPayload auditPayload) { publish(entityId.toMetadataEntity(), auditType, auditPayload); }
@Override public void publish(EntityId entityId, AuditType auditType, AuditPayload auditPayload) { publish(entityId.toMetadataEntity(), auditType, auditPayload); }
@Override public void publish(EntityId entityId, AuditType auditType, AuditPayload auditPayload) { publish(entityId.toMetadataEntity(), auditType, auditPayload); }
/** * @param entityId the {@link EntityId} for which to retrieve metadata * @param scope the {@link MetadataScope} to retrieve the metadata from. If null, this method retrieves * metadata from both {@link MetadataScope#SYSTEM} and {@link MetadataScope#USER} * @return The metadata for the entity. */ public Set<MetadataRecord> getMetadata(EntityId entityId, @Nullable MetadataScope scope) throws BadRequestException, UnauthenticatedException, IOException, UnauthorizedException { // for old getMetadata which takes EntityId we want to do any aggregation of metadata for runId for backward // compatibility CDAP-13721 HttpResponse response = getMetadataHelper(entityId.toMetadataEntity(), scope, false, true); return GSON.fromJson(response.getResponseBodyAsString(), SET_METADATA_RECORD_TYPE); }
/** * Converts a CLI friendly string representation of MetadataEntity to MetadataEntity. For more details see * documentation for {@link #toCliString(MetadataEntity)} * * @param cliString the cli friendly string representation * @return {@link MetadataEntity} */ public static MetadataEntity toMetadataEntity(String cliString) { MetadataEntity metadataEntity; try { // For backward compatibility we support entityId.toString representation from CLI for metadata for example // dataset representation look likes dataset:namespaceName.datasetName. Try to parse it as CDAP entity if it // fails then take the representation to be MetadataEntity which was introduced in CDAP 5.0 metadataEntity = EntityId.fromString(cliString).toMetadataEntity(); } catch (IllegalArgumentException e) { metadataEntity = fromCliString(cliString); } return metadataEntity; }
protected Map<String, String> getMetadataProperties(EntityId entityId) throws Exception { return metadataClient.getProperties(entityId.toMetadataEntity()); }