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 Details

  • Constructor Details

    • EntityResource

      protected EntityResource(String entityType, Authorizer authorizer)
  • Method Details

    • initialize

      public void initialize(OpenMetadataApplicationConfig config) throws IOException
      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

      public final EntityUtil.Fields getFields(String fields)
    • addHref

      protected T addHref(javax.ws.rs.core.UriInfo uriInfo, T entity)
    • getEntitySpecificOperations

      protected List<MetadataOperation> getEntitySpecificOperations()
    • addHref

      public final ResultList<T> addHref(javax.ws.rs.core.UriInfo uriInfo, ResultList<T> list)
    • 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

      public T getInternal(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, UUID id, String fieldsParam, Include include)
    • 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

      public T getVersionInternal(javax.ws.rs.core.SecurityContext securityContext, UUID id, String version)
    • 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

      public T getByNameInternal(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.SecurityContext securityContext, String name, String fieldsParam, Include include)
    • 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

      protected ResourceContext<T> getResourceContext()
    • getResourceContextById

      protected ResourceContext<T> getResourceContextById(UUID id)
    • getResourceContextByName

      protected ResourceContext<T> getResourceContextByName(String name)
    • getEntityReference

      protected EntityReference getEntityReference(String entityType, String fqn)
    • getEntityReferences

      protected static List<EntityReference> getEntityReferences(String entityType, List<String> fqns)
    • addViewOperation

      protected void addViewOperation(String fieldsParam, MetadataOperation operation)