Codota Logo
SdkProfile.<init>
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
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

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • onCreateOptionsMenu (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • BoxLayout (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now