Class EntityResource<T extends EntityInterface,K extends EntityRepository<T>>
java.lang.Object
org.openmetadata.service.resources.EntityResource<T,K>
- Direct Known Subclasses:
AppMarketPlaceResource,AppResource,BotResource,ChartResource,ClassificationResource,ContainerResource,DashboardDataModelResource,DashboardResource,DatabaseResource,DatabaseSchemaResource,DataInsightChartResource,DataProductResource,DocStoreResource,DomainResource,EventSubscriptionResource,GlossaryResource,GlossaryTermResource,IngestionPipelineResource,KpiResource,MetricsResource,MlModelResource,PersonaResource,PipelineResource,PolicyResource,QueryResource,ReportResource,RoleResource,SearchIndexResource,ServiceEntityResource,StoredProcedureResource,TableResource,TagResource,TeamResource,TestCaseResource,TestConnectionDefinitionResource,TestDefinitionResource,TestSuiteResource,TopicResource,TypeResource,UserResource,WebAnalyticEventResource,WorkflowResource
public abstract class EntityResource<T extends EntityInterface,K extends EntityRepository<T>>
extends Object
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Authorizerprotected final Stringprotected final Map<String,MetadataOperation> protected final Kprotected static final MetadataOperation[]protected static final MetadataOperation[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal ResultList<T>addHref(javax.ws.rs.core.UriInfo uriInfo, ResultList<T> list) protected Tprotected voidaddViewOperation(String fieldsParam, MetadataOperation operation) javax.ws.rs.core.Responsecreate(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, T entity) javax.ws.rs.core.ResponsecreateOrUpdate(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, T entity) javax.ws.rs.core.Responsedelete(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, UUID id, boolean recursive, boolean hardDelete) javax.ws.rs.core.ResponsedeleteByName(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, String name, boolean recursive, boolean hardDelete) exportCsvInternal(javax.ws.rs.core.SecurityContext securityContext, String name) getByNameInternal(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, String name, String fieldsParam, Include include) getByNameInternal(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, String name, EntityUtil.Fields fields, Include include, OperationContext operationContext, ResourceContextInterface resourceContext) protected EntityReferencegetEntityReference(String entityType, String fqn) protected static List<EntityReference>getEntityReferences(String entityType, List<String> fqns) protected List<MetadataOperation>final EntityUtil.FieldsgetInternal(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, UUID id, String fieldsParam, Include include) getInternal(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, UUID id, EntityUtil.Fields fields, Include include, OperationContext operationContext, ResourceContextInterface resourceContext) protected ResourceContext<T>protected ResourceContext<T>protected ResourceContext<T>getVersionInternal(javax.ws.rs.core.SecurityContext securityContext, UUID id, String version) getVersionInternal(javax.ws.rs.core.SecurityContext securityContext, UUID id, String version, OperationContext operationContext, ResourceContextInterface resourceContext) protected CsvImportResultimportCsvInternal(javax.ws.rs.core.SecurityContext securityContext, String name, String csv, boolean dryRun) voidMethod used for initializing a resource, such as creating default policies, roles, etc.listInternal(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, String fieldsParam, ListFilter filter, int limitParam, String before, String after) listInternal(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, EntityUtil.Fields fields, ListFilter filter, int limitParam, String before, String after, OperationContext operationContext, ResourceContextInterface resourceContext) protected EntityHistorylistVersionsInternal(javax.ws.rs.core.SecurityContext securityContext, UUID id) protected EntityHistorylistVersionsInternal(javax.ws.rs.core.SecurityContext securityContext, UUID id, OperationContext operationContext, ResourceContextInterface resourceContext) javax.ws.rs.core.ResponsepatchInternal(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, UUID id, javax.json.JsonPatch patch) javax.ws.rs.core.ResponserestoreEntity(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, UUID id) voidupgrade()Method used for upgrading a resource such as adding new fields to entities, etc.
-
Field Details
-
entityClass
-
entityType
-
allowedFields
-
repository
-
authorizer
-
fieldsToViewOperations
-
VIEW_ALL_OPERATIONS
-
VIEW_BASIC_OPERATIONS
-
-
Constructor Details
-
EntityResource
-
-
Method Details
-
initialize
Method used for initializing a resource, such as creating default policies, roles, etc.- Throws:
IOException
-
upgrade
public void upgrade()Method used for upgrading a resource such as adding new fields to entities, etc. that can't be done in bootstrap migrate -
getFields
-
addHref
-
getEntitySpecificOperations
-
addHref
-
listInternal
public ResultList<T> listInternal(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, String fieldsParam, ListFilter filter, int limitParam, String before, String after) -
listInternal
public ResultList<T> listInternal(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, EntityUtil.Fields fields, ListFilter filter, int limitParam, String before, String after, OperationContext operationContext, ResourceContextInterface resourceContext) -
getInternal
-
getInternal
public T getInternal(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, UUID id, EntityUtil.Fields fields, Include include, OperationContext operationContext, ResourceContextInterface resourceContext) -
getVersionInternal
-
getVersionInternal
public T getVersionInternal(javax.ws.rs.core.SecurityContext securityContext, UUID id, String version, OperationContext operationContext, ResourceContextInterface resourceContext) -
listVersionsInternal
protected EntityHistory listVersionsInternal(javax.ws.rs.core.SecurityContext securityContext, UUID id) -
listVersionsInternal
protected EntityHistory listVersionsInternal(javax.ws.rs.core.SecurityContext securityContext, UUID id, OperationContext operationContext, ResourceContextInterface resourceContext) -
getByNameInternal
-
getByNameInternal
public T getByNameInternal(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, String name, EntityUtil.Fields fields, Include include, OperationContext operationContext, ResourceContextInterface resourceContext) -
create
public javax.ws.rs.core.Response create(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, T entity) -
createOrUpdate
public javax.ws.rs.core.Response createOrUpdate(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, T entity) -
patchInternal
public javax.ws.rs.core.Response patchInternal(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, UUID id, javax.json.JsonPatch patch) -
delete
public javax.ws.rs.core.Response delete(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, UUID id, boolean recursive, boolean hardDelete) -
deleteByName
public javax.ws.rs.core.Response deleteByName(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, String name, boolean recursive, boolean hardDelete) -
restoreEntity
public javax.ws.rs.core.Response restoreEntity(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, UUID id) -
exportCsvInternal
public String exportCsvInternal(javax.ws.rs.core.SecurityContext securityContext, String name) throws IOException - Throws:
IOException
-
importCsvInternal
protected CsvImportResult importCsvInternal(javax.ws.rs.core.SecurityContext securityContext, String name, String csv, boolean dryRun) throws IOException - Throws:
IOException
-
getResourceContext
-
getResourceContextById
-
getResourceContextByName
-
getEntityReference
-
getEntityReferences
-
addViewOperation
-