@Test public void testDelete() { MetaClass metaClass = server.getRepository(CMSPriority.NEUTRAL, RAPTOR_PAAS).getMetadataService() .getMetaClass(APPLICATION_SERVICE); Date date = new Date(456); JsonEntity jsonEntity = new JsonEntity(metaClass, "{ \"name\": \"cmsserver-test-entity-create\", \"_createtime\": " + date.getTime() + " } "); jsonEntity.setBranchId(BRANCH_MAIN); entityContext.setComment("newlycreate"); String newId = server.create(CMSPriority.NEUTRAL, jsonEntity, entityContext); MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl(); IEntity qEntity = buildQueryEntity(CMSPriority.NEUTRAL, RAPTOR_PAAS, BRANCH_MAIN, APPLICATION_SERVICE, newId); IEntity getEntity = server.get(CMSPriority.NEUTRAL, qEntity, queryParams, entityContext); Assert.assertNotNull(getEntity); server.delete(CMSPriority.NEUTRAL, qEntity, entityContext); getEntity = server.get(CMSPriority.NEUTRAL, qEntity, queryParams, entityContext); Assert.assertNull(getEntity); entityContext.setComment(null); }
public void delete(CMSPriority p, IEntity queryEntity, EntityContext context) { logger.info("cms delete: {}, {}, {}", new Object[] { queryEntity.getType(), queryEntity.getId(), context.getSourceIp() }); checkServerState(p, true); setupEntityContext(context); EntityDeleteOperation operation = new EntityDeleteOperation(p, entityService, queryEntity, null, null, context, cmsState, requestId.getNext(), monitor); operation.perform(); }
CMSServer { public void delete(CMSPriority p, IEntity queryEntity, EntityContext context) { logger.info("cms delete: {}, {}, {}", new Object[] { queryEntity.getType(), queryEntity.getId(), context.getSourceIp() }); checkServerState(p, true); setupEntityContext(context); EntityDeleteOperation operation = new EntityDeleteOperation(p, entityService, queryEntity, null, null, context, cmsState, requestId.getNext(), monitor); operation.perform(); } }
CMSServer { public void delete(CMSPriority p, IEntity queryEntity, EntityContext context) { logger.info("cms delete: {}, {}, {}", new Object[] { queryEntity.getType(), queryEntity.getId(), context.getSourceIp() }); checkServerState(p, true); setupEntityContext(context); EntityDeleteOperation operation = new EntityDeleteOperation(p, entityService, queryEntity, null, null, context, cmsState, requestId.getNext(), monitor); operation.perform(); } private  CMSServer(ICMSConfig config); }
CMSServer { public void delete(CMSPriority p, IEntity queryEntity, EntityContext context) { logger.info("cms delete: {}, {}, {}", new Object[] { queryEntity.getType(), queryEntity.getId(), context.getSourceIp() }); checkServerState(p, true); setupEntityContext(context); EntityDeleteOperation operation = new EntityDeleteOperation(p, entityService, queryEntity, null, null, context, cmsState, requestId.getNext(), monitor); operation.perform(); } private  CMSServer(ICMSConfig config); Registration getDalImplementation(String id); void addWriteRequest(int value, long timestamp, Object detail, boolean isSuccess); MonitorStatisticsManager getMonitorStatisticsManager(); CMSDBConfig getDBConfig(); void start(); void pause(); void resume(); void shutdown(); IBranch createBranch(CMSPriority p, IBranch branch, EntityContext context); IBranch getBranch(CMSPriority p, String repoName, String branchId, EntityContext context); List<IBranch> getMainBranches(CMSPriority p, String repoName, EntityContext context); Map<String, IManagementServices.ServiceStatus> getServiceStatuses(); IManagementServices.ServiceStatus getServiceStatus(String serviceName); void setServiceStatus(String serviceName, IManagementServices.ServiceStatus status); Map<String, Object> getStatistics(); Map<String, Object> getStatistics(String metricName); CMSState.State getState(); List<Repository> getRepositories(CMSPriority p, MetadataContext context); Repository getRepository(CMSPriority p, String repoName); Repository createRepository(CMSPriority p, Repository repo); void updateRepository(CMSPriority p, Repository repo); void deleteRepository(CMSPriority p, String repoName); List<MetaClass> getMetaClasses(CMSPriority p, String repoName, MetadataContext context); MetaClass getMetaClass(CMSPriority p, String repoName, String metaclassName); Map<String, List<String>> getMetaClassHierarchy(CMSPriority p, String repoName, String metaclassName, MetadataContext context); MetaClass getMetaClass(CMSPriority p, String repoName, String metaclassName, int version); void addIndex(CMSPriority p, String repoName, String metaclassName, List<IndexInfo> index,
			MetadataContext context); void deleteIndex(CMSPriority p, String repoName, String metaclassName, String indexName,
			MetadataContext context); List<IEntity> getMetaHistory(CMSPriority p, String repositoryId, String metaType, MetadataContext context); List<MetaClass> batchUpsert(CMSPriority p, String repoName, List<MetaClass> metas, MetadataContext context); MetaClass updateMetaField(CMSPriority p, String repoName, MetaClass meta, String fieldName,
			MetadataContext context); void deleteMetadata(CMSPriority p, String repoName, String metaclassName, MetadataContext context); void validateMetadata(CMSPriority p, String repoName, String metaclassName, MetadataContext context); void deleteMetaField(CMSPriority p, String repoName, String metaclassName, String fieldName,
			MetadataContext context); IEntity get(CMSPriority p, IEntity queryEntity, Map<String, List<String>> params, EntityContext context); void delete(CMSPriority p, IEntity queryEntity, EntityContext context); String create(CMSPriority p, IEntity entity, EntityContext context); List<String> batchCreate(CMSPriority p, List<IEntity> entities, EntityContext context, List<String> parseFails); List<String> batchUpdate(CMSPriority p, List<IEntity> entities, EntityContext context, List<String> parseFails); List<String> batchDelete(CMSPriority p, List<IEntity> entities, EntityContext context, List<String> parseFails); IQueryResult batchGet(CMSPriority p, String metadata, Map<String, List<String>> params, QueryContext context); void replace(CMSPriority p, IEntity queryEntity, IEntity entity, EntityContext context); void modify(CMSPriority p, IEntity queryEntity, IEntity entity, EntityContext context); void modifyField(CMSPriority p, IEntity queryEntity, IEntity entity, String fieldName, EntityContext context); void casModifyField(CMSPriority p, IEntity queryEntity, IEntity entity, String fieldName, Object oldValue,
			EntityContext context); void deleteField(CMSPriority p, IEntity queryEntity, String fieldName, EntityContext context); IQueryResult query(CMSPriority p, String query, QueryContext context); Map<String, MetaClass> getQueryMetaClass(CMSPriority priority, String query, QueryContext context); void registerEvent(IEventListener listener); boolean removeEvent(IEventListener listener); static synchronized CMSServer getCMSServer(); static synchronized CMSServer getCMSServer(Map<String, String> configs); void setEntityOperationCallback(IEntityOperationCallback callback); Map<String, Object> getCurrentConfigurations(); Set<String> getConfigNames(); void config(Map<String, Object> configs); ConsistentPolicy parsePolicy(String policy); PaginationMode parsePaginationMode(String mode); void pullField(CMSPriority p, IEntity queryEntity,
            IEntity entity, String fieldName, EntityContext context); int getThrottlingLevel(); void setThrottlingLevel(int throttlingLevel); MongoDataSource getDataSource(); }
CMSServer { public void delete(CMSPriority p, IEntity queryEntity, EntityContext context) { logger.info("cms delete: {}, {}, {}", new Object[] { queryEntity.getType(), queryEntity.getId(), context.getSourceIp() }); checkServerState(p, true); setupEntityContext(context); EntityDeleteOperation operation = new EntityDeleteOperation(p, entityService, queryEntity, null, null, context, cmsState, requestId.getNext(), monitor); operation.perform(); } private  CMSServer(ICMSConfig config); Registration getDalImplementation(String id); void addWriteRequest(int value, long timestamp, Object detail, boolean isSuccess); MonitorStatisticsManager getMonitorStatisticsManager(); CMSDBConfig getDBConfig(); void start(); void pause(); void resume(); void shutdown(); IBranch createBranch(CMSPriority p, IBranch branch, EntityContext context); IBranch getBranch(CMSPriority p, String repoName, String branchId, EntityContext context); List<IBranch> getMainBranches(CMSPriority p, String repoName, EntityContext context); Map<String, IManagementServices.ServiceStatus> getServiceStatuses(); IManagementServices.ServiceStatus getServiceStatus(String serviceName); void setServiceStatus(String serviceName, IManagementServices.ServiceStatus status); Map<String, Object> getStatistics(); Map<String, Object> getStatistics(String metricName); CMSState.State getState(); List<Repository> getRepositories(CMSPriority p, MetadataContext context); Repository getRepository(CMSPriority p, String repoName); Repository createRepository(CMSPriority p, Repository repo); void updateRepository(CMSPriority p, Repository repo); void deleteRepository(CMSPriority p, String repoName); List<MetaClass> getMetaClasses(CMSPriority p, String repoName, MetadataContext context); MetaClass getMetaClass(CMSPriority p, String repoName, String metaclassName); Map<String, List<String>> getMetaClassHierarchy(CMSPriority p, String repoName, String metaclassName, MetadataContext context); MetaClass getMetaClass(CMSPriority p, String repoName, String metaclassName, int version); void addIndex(CMSPriority p, String repoName, String metaclassName, List<IndexInfo> index,
			MetadataContext context); void deleteIndex(CMSPriority p, String repoName, String metaclassName, String indexName,
			MetadataContext context); List<IEntity> getMetaHistory(CMSPriority p, String repositoryId, String metaType, MetadataContext context); List<MetaClass> batchUpsert(CMSPriority p, String repoName, List<MetaClass> metas, MetadataContext context); MetaClass updateMetaField(CMSPriority p, String repoName, MetaClass meta, String fieldName,
			MetadataContext context); void deleteMetadata(CMSPriority p, String repoName, String metaclassName, MetadataContext context); void validateMetadata(CMSPriority p, String repoName, String metaclassName, MetadataContext context); void deleteMetaField(CMSPriority p, String repoName, String metaclassName, String fieldName,
			MetadataContext context); IEntity get(CMSPriority p, IEntity queryEntity, Map<String, List<String>> params, EntityContext context); void delete(CMSPriority p, IEntity queryEntity, EntityContext context); String create(CMSPriority p, IEntity entity, EntityContext context); List<String> batchCreate(CMSPriority p, List<IEntity> entities, EntityContext context, List<String> parseFails); List<String> batchUpdate(CMSPriority p, List<IEntity> entities, EntityContext context, List<String> parseFails); List<String> batchDelete(CMSPriority p, List<IEntity> entities, EntityContext context, List<String> parseFails); IQueryResult batchGet(CMSPriority p, String metadata, Map<String, List<String>> params, QueryContext context); void replace(CMSPriority p, IEntity queryEntity, IEntity entity, EntityContext context); void modify(CMSPriority p, IEntity queryEntity, IEntity entity, EntityContext context); void modifyField(CMSPriority p, IEntity queryEntity, IEntity entity, String fieldName, EntityContext context); void casModifyField(CMSPriority p, IEntity queryEntity, IEntity entity, String fieldName, Object oldValue,
			EntityContext context); void deleteField(CMSPriority p, IEntity queryEntity, String fieldName, EntityContext context); IQueryResult query(CMSPriority p, String query, QueryContext context); Map<String, MetaClass> getQueryMetaClass(CMSPriority priority, String query, QueryContext context); void registerEvent(IEventListener listener); boolean removeEvent(IEventListener listener); static synchronized CMSServer getCMSServer(); static synchronized CMSServer getCMSServer(Map<String, String> configs); void setEntityOperationCallback(IEntityOperationCallback callback); Map<String, Object> getCurrentConfigurations(); Set<String> getConfigNames(); void config(Map<String, Object> configs); ConsistentPolicy parsePolicy(String policy); PaginationMode parsePaginationMode(String mode); void pullField(CMSPriority p, IEntity queryEntity,
            IEntity entity, String fieldName, EntityContext context); int getThrottlingLevel(); void setThrottlingLevel(int throttlingLevel); MongoDataSource getDataSource(); static final String MONITOR_SERVICE; static final String HEALTHY_SERVICE; static final String THROTTLING_SERVICE; static final List<DalErrCodeEnum> CMS_FAILURE_ERROR_CODES; }