Tabnine Logo
LogSchema.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.kaaproject.kaa.server.common.dao.model.sql.LogSchema
constructor

Best Java code snippets using org.kaaproject.kaa.server.common.dao.model.sql.LogSchema.<init> (Showing top 4 results out of 315)

origin: kaaproject/kaa

@Override
protected GenericModel<LogSchemaDto> newInstance(Long id) {
 return new LogSchema(id);
}
origin: kaaproject/kaa

 @Test
 public void basicLogSchemaTest() {
  LogSchema logSchema = new LogSchema(TEST_ID);
  Assert.assertEquals((Long) TEST_ID, logSchema.getId());
 }
}
origin: kaaproject/kaa

@Override
public LogSchemaDto saveLogSchema(LogSchemaDto logSchemaDto) {
 String id = logSchemaDto.getId();
 if (StringUtils.isBlank(id)) {
  LogSchema logSchema = logSchemaDao.findLatestLogSchemaByAppId(
      logSchemaDto.getApplicationId());
  int version = 0;
  if (logSchema != null) {
   version = logSchema.getVersion();
  }
  logSchemaDto.setId(null);
  logSchemaDto.setVersion(++version);
  logSchemaDto.setCreatedTime(System.currentTimeMillis());
 } else {
  LogSchemaDto oldLogSchemaDto = getDto(logSchemaDao.findById(id));
  if (oldLogSchemaDto != null) {
   oldLogSchemaDto.editFields(logSchemaDto);
   logSchemaDto = oldLogSchemaDto;
  } else {
   LOG.error("Can't find log schema with given id [{}].", id);
   throw new IncorrectParameterException("Invalid log schema id: " + id);
  }
 }
 LogSchemaDto savedSchema = getDto(logSchemaDao.save(new LogSchema(logSchemaDto)));
 if (savedSchema == null) {
  throw new RuntimeException("Can't save log schema");
 }
 return savedSchema;
}
origin: kaaproject/kaa

protected List<LogSchema> generateLogSchema(Tenant tenant, int ctlVersion, Application application, int count) {
 List<LogSchema> schemas = Collections.emptyList();
 try {
  if (application == null) {
   application = generateApplication(tenant);
  }
  CtlSchema ctlSchema = generateCTLSchema(DEFAULT_FQN, ctlVersion, application.getTenant(), null);
  LogSchema schema;
  schemas = new ArrayList<>(count);
  for (int i = 0; i < count; i++) {
   schema = new LogSchema();
   schema.setApplication(application);
   schema.setCtlSchema(ctlSchema);
   schema.setCreatedUsername("Test User");
   schema.setName("Test Name");
   schema = logSchemaDao.save(schema);
   Assert.assertNotNull(schema);
   schemas.add(schema);
  }
 } catch (Exception ex) {
  LOG.error("Can't generate log schemas {}", ex);
  Assert.fail("Can't generate log schemas.");
 }
 return schemas;
}
org.kaaproject.kaa.server.common.dao.model.sqlLogSchema<init>

Popular methods of LogSchema

  • getStringId
  • getVersion
  • getApplication
  • getId
  • setApplication
  • setCreatedUsername
  • setCtlSchema
  • setName
  • toVersionDto

Popular in Java

  • Creating JSON documents from java classes using gson
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • startActivity (Activity)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now