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

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

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

origin: kaaproject/kaa

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

protected SdkProfile generateSdkProfile(Application application, String token) {
 SdkProfile entity = new SdkProfile();
 if (application == null) {
  application = this.generateApplication(null);
 }
 entity.setApplication(application);
 if (token == null) {
  token = "token";
 }
 entity.setToken(token);
 return sdkProfileDao.save(entity);
}
origin: kaaproject/kaa

@Override
public SdkProfileDto saveSdkProfile(SdkProfileDto sdkProfileDto) {
 SdkProfileDto saved = null;
 if (Validator.isValidSqlObject(sdkProfileDto)) {
  if (StringUtils.isNotBlank(sdkProfileDto.getId())) {
   throw new IncorrectParameterException("Update of existing SDK profile is prohibited.");
  } else {
   applicationDao.findById(sdkProfileDto.getApplicationId());
   SdkTokenGenerator.generateSdkToken(sdkProfileDto);
   SdkProfile entity = new SdkProfile(sdkProfileDto);
   SdkProfile loaded = sdkProfileDao.findSdkProfileByToken(entity.getToken());
   if (loaded == null) {
    saved = DaoUtil.getDto(sdkProfileDao.save(entity));
   } else {
    throw new IncorrectParameterException("An SDK profile with token ["
                       + entity.getToken() + "] already exists.");
   }
  }
 }
 return saved;
}
origin: kaaproject/kaa

@Test
public void constructorTest() {
 SdkProfileDto sdkProfileDto1 = generateSdkProfileDto("1234", "token1234");
 SdkProfileDto sdkProfileDto2 = generateSdkProfileDto("1234", "token1234");
 SdkProfileDto sdkProfileDto3 = generateSdkProfileDto("1235", "token1235");
 SdkProfile sdkProfile1 = new SdkProfile(sdkProfileDto1);
 SdkProfile sdkProfile2 = new SdkProfile(sdkProfileDto2);
 SdkProfile sdkProfile3 = new SdkProfile(sdkProfileDto3);
 Assert.assertEquals(sdkProfile1.toDto(), sdkProfile2.toDto());
 Assert.assertEquals(sdkProfile1.getToken(), sdkProfile2.getToken());
 Assert.assertNotEquals(sdkProfile1.toDto(), sdkProfile3.toDto());
 Assert.assertNotEquals(sdkProfile1.getToken(), sdkProfile3.getToken());
 Assert.assertEquals(SDK_TOKEN_SIZE, sdkProfile1.getToken().length());
 for (int i = 0; i < 100000; i++) {
  SdkProfileDto tmp = generateSdkProfileDto("1235" + i, "token1235" + i);
  Assert.assertEquals(SDK_TOKEN_SIZE, tmp.getToken().length(), SDK_TOKEN_SIZE);
 }
}
org.kaaproject.kaa.server.common.dao.model.sqlSdkProfile<init>

Javadoc

Instantiates a new Sdk profile with uniq identifier.

Popular methods of SdkProfile

  • getToken
  • createDto
  • getApplication
  • getId
  • getStringId
  • setApplication
  • setToken
  • toDto

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • setScale (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • From CI to AI: The AI layer in your organization
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