congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CtlSchemaMetaInfoDao
Code IndexAdd Tabnine to your IDE (free)

How to use
CtlSchemaMetaInfoDao
in
org.kaaproject.kaa.server.common.dao.impl

Best Java code snippets using org.kaaproject.kaa.server.common.dao.impl.CtlSchemaMetaInfoDao (Showing top 6 results out of 315)

origin: kaaproject/kaa

@Override
public CtlSchemaMetaInfoDto updateCtlSchemaMetaInfoScope(CtlSchemaMetaInfoDto ctlSchemaMetaInfo) {
 validateObject(ctlSchemaMetaInfo, "Incorrect ctl schema meta info object");
 LOG.debug("Update ctl schema meta info scope with id [{}]", ctlSchemaMetaInfo.getId());
 CtlSchemaMetaInfo schemaMetaInfo = ctlSchemaMetaInfoDao.findById(ctlSchemaMetaInfo.getId());
 if (schemaMetaInfo
   != null) {
  synchronized (this) {
   ctlSchemaMetaInfoDao.lockRequest(lockOptions).setScope(true).lock(schemaMetaInfo);
   if (checkScopeUpdate(ctlSchemaMetaInfo, schemaMetaInfo.toDto())) {
    List<CtlSchemaMetaInfo> others = ctlSchemaMetaInfoDao.findOthersByFqnAndTenantId(
        ctlSchemaMetaInfo.getFqn(), ctlSchemaMetaInfo.getTenantId(), ctlSchemaMetaInfo
            .getId());
    if (others != null && !others.isEmpty()) {
     throw new DatabaseProcessingException("Can't update scope of the common type due to "
                        + "an FQN conflict.");
    }
    schemaMetaInfo = ctlSchemaMetaInfoDao.updateScope(
        new CtlSchemaMetaInfo(ctlSchemaMetaInfo));
   }
   return DaoUtil.getDto(schemaMetaInfo);
  }
 } else {
  throw new DatabaseProcessingException("Can't find common type by id.");
 }
}
origin: kaaproject/kaa

@Override
public List<CtlSchemaMetaInfoDto> findSiblingsByFqnTenantIdAndApplicationId(String fqn, String
    tenantId, String applicationId) {
 if (isBlank(fqn)) {
  throw new IncorrectParameterException("Incorrect parameters for ctl schema request.");
 }
 LOG.debug("Find sibling ctl schemas by fqn {}, tenant id {} and application id {}", fqn,
     tenantId, applicationId);
 return convertDtoList(ctlSchemaMetaInfoDao.findSiblingsByFqnTenantIdAndApplicationId(fqn,
     tenantId, applicationId));
}
origin: kaaproject/kaa

CTLSchemaDto dto;
synchronized (this) {
 List<CtlSchemaMetaInfo> existingFqns = ctlSchemaMetaInfoDao.findExistingFqns(metaInfo
     .getFqn(), metaInfo.getTenantId(), metaInfo.getApplicationId());
 if (existingFqns != null && !existingFqns.isEmpty()) {
 CtlSchemaMetaInfo uniqueMetaInfo = ctlSchemaMetaInfoDao.save(
     new CtlSchemaMetaInfo(metaInfo));
 ctlSchemaMetaInfoDao.lockRequest(lockOptions).setScope(true).lock(uniqueMetaInfo);
 CtlSchema ctlSchema = new CtlSchema(unSavedSchema);
 ctlSchema.setMetaInfo(uniqueMetaInfo);
 ctlSchema.setCreatedTime(System.currentTimeMillis());
 ctlSchemaMetaInfoDao.refresh(uniqueMetaInfo);
 try {
  dto = getDto(ctlSchemaDao.save(ctlSchema, true));
origin: kaaproject/kaa

synchronized (this) {
 CtlSchemaMetaInfo metaInfo = ctlSchema.getMetaInfo();
 ctlSchemaMetaInfoDao.lockRequest(lockOptions).setScope(true).lock(metaInfo);
 try {
  ctlSchemaDao.removeById(ctlSchema.getStringId());
  List<CtlSchema> schemas = ctlSchemaDao.findAllByMetaInfoId(metaInfo.getStringId());
  if (schemas == null || schemas.isEmpty()) {
   ctlSchemaMetaInfoDao.removeById(metaInfo.getStringId());
origin: kaaproject/kaa

protected CtlSchema generateCTLSchema(String fqn, int version, Tenant tenant, CTLSchemaScopeDto scope) {
 if (scope == null) {
  if (tenant == null) {
   scope = CTLSchemaScopeDto.SYSTEM;
  } else {
   scope = CTLSchemaScopeDto.TENANT;
  }
 }
 CtlSchemaMetaInfo metaInfo = new CtlSchemaMetaInfo();
 metaInfo.setFqn(fqn);
 metaInfo.setTenant(tenant);
 metaInfo = ctlSchemaMetaInfoDao.save(metaInfo);
 CtlSchema ctlSchema = new CtlSchema();
 ctlSchema.setMetaInfo(metaInfo);
 ctlSchema.setVersion(version);
 ctlSchema.setBody(UUID.randomUUID().toString());
 ctlSchema.setDependencySet(new HashSet<CtlSchema>());
 ctlSchema = ctlSchemaDao.save(ctlSchema);
 return ctlSchema;
}
origin: kaaproject/kaa

@Override
public CTLSchemaDto updateCtlSchema(CTLSchemaDto ctlSchema) {
 validateCtlSchemaObject(ctlSchema);
 LOG.debug("Update ctl schema with id [{}]", ctlSchema.getId());
 CtlSchema schema = ctlSchemaDao.findById(ctlSchema.getId());
 if (schema != null) {
  synchronized (this) {
   if (ctlSchema.getVersion()
     != schema.getVersion()) {
    throw new DatabaseProcessingException("Can't change version of existing common type "
                       + "version.");
   }
   CtlSchemaMetaInfo metaInfo = schema.getMetaInfo();
   if (!ctlSchema.getMetaInfo().equals(metaInfo.toDto())) {
    throw new DatabaseProcessingException("Can't update scope of existing common type "
                       + "version within update procedure.");
   }
   ctlSchemaMetaInfoDao.lockRequest(lockOptions).setScope(true).lock(metaInfo);
   schema.update(ctlSchema);
   return DaoUtil.getDto(ctlSchemaDao.save(schema, true));
  }
 } else {
  throw new DatabaseProcessingException("Can't find common type version by id.");
 }
}
org.kaaproject.kaa.server.common.dao.implCtlSchemaMetaInfoDao

Javadoc

The interface CTL schema meta information dao.

Most used methods

  • save
  • findById
  • findExistingFqns
    Find a list of CTL schema meta infos of the given fully qualified name which is not in specified ten
  • findOthersByFqnAndTenantId
    Find others CTL schema meta infos with the given fully qualified name and tenant, excluding meta inf
  • findSiblingsByFqnTenantIdAndApplicationId
    Find CTL schema meta infos which are the application level siblings to the CTL of the given fully qu
  • lockRequest
  • refresh
  • removeById
  • updateScope
    Update scope of the given CTL schema meta information.

Popular in Java

  • Reactive rest calls using spring rest template
  • setContentView (Activity)
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Github Copilot 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