@Override protected GenericModel<ApplicationDto> newInstance(Long id) { return new Application(id); }
/** * Update fields <code>tenant</code> and <code>application</code>, * create new instances by using ids in parameters. * @param tenantId is tenant id * @param applicationId is application id */ public void updateScope(String tenantId, String applicationId) { Long tenId = getLongId(tenantId); this.tenant = tenId != null ? new Tenant(tenId) : null; Long appId = getLongId(applicationId); this.application = appId != null ? new Application(appId) : null; }
/** * Create new instance of CTL schema meta info. * @param fqn is full qualified name * @param tenantId is tenant id, it used for creating * <code>Tenant</code> with corresponding id and * set it on field <code>tenant</code> * @param applicationId is application id, it used for creating * <code>Application</code> with corresponding id and * set it on field <code>application</code> */ public CtlSchemaMetaInfo(String fqn, String tenantId, String applicationId) { this.fqn = fqn; Long tenId = getLongId(tenantId); this.tenant = tenId != null ? new Tenant(tenId) : null; Long appId = getLongId(applicationId); this.application = appId != null ? new Application(appId) : null; }
protected Application generateApplication(Tenant tenant) { LOG.debug("Generate application..."); if (tenant == null) { tenant = generateTenant(); } Application app = new Application(); app.setName("Test app name" + UUID.randomUUID().toString()); app.setTenant(tenant); app.setApplicationToken(UUID.randomUUID().toString()); app.setSequenceNumber(RANDOM.nextInt()); app = applicationDao.save(app); LOG.debug("Generated application {}", app); return app; }
/** * Create new instance of <code>ApplicationEventFamilyMap</code>. * * @param dto data transfer object */ public ApplicationEventFamilyMap(ApplicationEventFamilyMapDto dto) { this.id = getLongId(dto.getId()); Long applicationId = getLongId(dto.getApplicationId()); if (applicationId != null) { this.application = new Application(applicationId); } Long ecfId = getLongId(dto.getEcfId()); if (ecfId != null) { this.ecf = new EventClassFamily(ecfId); } this.version = dto.getVersion(); this.createdUsername = dto.getCreatedUsername(); this.createdTime = dto.getCreatedTime(); if (dto.getEventMaps() != null) { this.eventMaps = new ArrayList<>(dto.getEventMaps().size()); for (ApplicationEventMapDto eventMap : dto.getEventMaps()) { this.eventMaps.add(new ApplicationEventMap(eventMap)); } } }
return getDto(applicationDao.save(new Application(applicationDto))); applicationDto.setApplicationToken(appToken); Application application = new Application(applicationDto); appDto = getDto(applicationDao.save(application));
/** * Create new instance of <code>History</code>. * @param dto data transfer object contain data that * assign on fields of new instance */ public History(HistoryDto dto) { if (dto != null) { this.id = getLongId(dto); this.sequenceNumber = dto.getSequenceNumber(); this.change = new Change(dto.getChange()); this.lastModifyTime = dto.getLastModifyTime(); Long applicationId = getLongId(dto.getApplicationId()); if (applicationId != null) { this.application = new Application(applicationId); } } }
/** * Create new instance of CTL schema meta info. * * @param dto data transfer object that used for creating new instance, * it hold id, full qualified name, tenant id and application id * of new instance */ public CtlSchemaMetaInfo(CtlSchemaMetaInfoDto dto) { this.id = ModelUtils.getLongId(dto.getId()); this.fqn = dto.getFqn(); Long tenantId = getLongId(dto.getTenantId()); this.tenant = tenantId != null ? new Tenant(tenantId) : null; Long appId = getLongId(dto.getApplicationId()); this.application = appId != null ? new Application(appId) : null; }
this.application = (applicationId != null) ? new Application(applicationId) : null;
/** * Instantiates new topic. */ public Topic(TopicDto dto) { if (dto != null) { this.id = getLongId(dto); this.name = dto.getName(); this.description = dto.getDescription(); this.createdUsername = dto.getCreatedUsername(); this.createdTime = dto.getCreatedTime(); this.sequenceNumber = dto.getSecNum(); this.type = dto.getType(); Long appId = getLongId(dto.getApplicationId()); this.application = appId != null ? new Application(appId) : null; } }
/** * Create instance of <code>EndpointGroup</code>. * * @param dto data transfer object */ public EndpointGroup(EndpointGroupDto dto) { if (dto != null) { this.id = getLongId(dto); this.name = dto.getName(); this.sequenceNumber = dto.getSequenceNumber(); this.weight = dto.getWeight(); this.description = dto.getDescription(); this.createdUsername = dto.getCreatedUsername(); this.createdTime = dto.getCreatedTime(); Long appId = getLongId(dto.getApplicationId()); this.application = appId != null ? new Application(appId) : null; this.topics = getTopic(dto.getTopics()); } }
/** * Create new instance of <code>Plugin</code>. * * @param dto data transfer object contain data that assign on fields of new instance */ public Plugin(PluginDto dto) { if (dto != null) { this.id = getLongId(dto); this.name = dto.getName(); this.description = dto.getDescription(); this.createdUsername = dto.getCreatedUsername(); this.createdTime = dto.getCreatedTime(); Long appId = getLongId(dto.getApplicationId()); this.application = appId != null ? new Application(appId) : null; this.pluginTypeName = dto.getPluginTypeName(); this.pluginClassName = dto.getPluginClassName(); this.rawConfiguration = dto.getRawConfiguration(); } }
/** * Create new instance of <code>Schema</code>. * * @param dto data transfer object contain data that assign on fields of new instance */ public Schema(T dto) { if (dto != null) { this.id = getLongId(dto); Long appId = getLongId(dto.getApplicationId()); this.application = appId != null ? new Application(appId) : null; this.version = dto.getVersion(); this.schema = dto.getSchema(); this.name = dto.getName(); this.description = dto.getDescription(); this.createdUsername = dto.getCreatedUsername(); this.createdTime = dto.getCreatedTime(); this.endpointCount = dto.getEndpointCount(); } }
/** * Instantiates a new Base schema. * * @param dto data transfare object that used to create instance */ public BaseSchema(T dto) { if (dto != null) { this.id = getLongId(dto); this.version = dto.getVersion(); Long appId = getLongId(dto.getApplicationId()); this.application = appId != null ? new Application(appId) : null; Long ctlSchemaId = getLongId(dto.getCtlSchemaId()); this.ctlSchema = ctlSchemaId != null ? new CtlSchema(ctlSchemaId) : null; this.name = dto.getName(); this.description = dto.getDescription(); this.createdUsername = dto.getCreatedUsername(); this.createdTime = dto.getCreatedTime(); } }
/** * Create new instace of <code>AbstractStructure</code>. * @param dto data transfer object contain data that * assign on fields of new instance */ public AbstractStructure(AbstractStructureDto dto) { if (dto != null) { this.id = getLongId(dto); this.sequenceNumber = dto.getSequenceNumber(); this.description = dto.getDescription(); this.createdTime = dto.getCreatedTime(); this.lastModifyTime = dto.getLastModifyTime(); this.activatedTime = dto.getActivatedTime(); this.deactivatedTime = dto.getDeactivatedTime(); this.createdUsername = dto.getCreatedUsername(); this.modifiedUsername = dto.getModifiedUsername(); this.activatedUsername = dto.getActivatedUsername(); this.deactivatedUsername = dto.getDeactivatedUsername(); this.status = dto.getStatus(); this.endpointCount = dto.getEndpointCount(); Long appId = getLongId(dto.getApplicationId()); this.application = appId != null ? new Application(appId) : null; Long groupId = getLongId(dto.getEndpointGroupId()); this.endpointGroup = groupId != null ? new EndpointGroup(groupId) : null; this.version = dto.getVersion(); } }