Skip to content

Commit

Permalink
Fix about 70 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Serega290696 authored and sbeltser committed Oct 4, 2016
1 parent 14bc620 commit 33db477
Show file tree
Hide file tree
Showing 47 changed files with 407 additions and 134 deletions.
Expand Up @@ -77,7 +77,11 @@ public interface EventClassService {
* @param eventClassFamilyVersion the event class family version
* @param createdUsername the created username
*/
void addEventClassFamilyVersion(String eventClassFamilyId, EventClassFamilyVersionDto eventClassFamilyVersion, String createdUsername);
void addEventClassFamilyVersion(
String eventClassFamilyId,
EventClassFamilyVersionDto eventClassFamilyVersion,
String createdUsername
);

/**
* Find event classes by event class family Id and version.
Expand All @@ -87,7 +91,11 @@ public interface EventClassService {
* @param type the type
* @return the list of found event classes
*/
List<EventClassDto> findEventClassesByFamilyIdVersionAndType(String ecfId, int version, EventClassType type);
List<EventClassDto> findEventClassesByFamilyIdVersionAndType(
String ecfId,
int version,
EventClassType type
);

/**
* Check passed FQNs if they are present in event class family.
Expand All @@ -97,7 +105,10 @@ public interface EventClassService {
* @param fqns list of fqns to check against family fqns
* @return true is fqns are unique
*/
boolean validateEventClassFamilyFqns(String ecfId, List<String> fqns);
boolean validateEventClassFamilyFqns(
String ecfId,
List<String> fqns
);

/**
* Find event class family by tenant id and name.
Expand All @@ -106,7 +117,10 @@ public interface EventClassService {
* @param name the event class family name
* @return the event class family
*/
EventClassFamilyDto findEventClassFamilyByTenantIdAndName(String tenantId, String name);
EventClassFamilyDto findEventClassFamilyByTenantIdAndName(
String tenantId,
String name
);

/**
* Find event class by tenant id and fqn.
Expand All @@ -115,7 +129,7 @@ public interface EventClassService {
* @param fqn the event class fqn
* @return the event class
*/
List<EventClassDto> findEventClassByTenantIdAndFQN(String tenantId, String fqn);
List<EventClassDto> findEventClassByTenantIdAndFqn(String tenantId, String fqn);


/**
Expand All @@ -126,7 +140,7 @@ public interface EventClassService {
* @param version the schema version
* @return the event class dto
*/
EventClassDto findEventClassByTenantIdAndFQNAndVersion(String tenantId, String fqn, int version);
EventClassDto findEventClassByTenantIdAndFqnAndVersion(String tenantId, String fqn, int version);

/**
* Find event class by id.
Expand All @@ -143,13 +157,13 @@ public interface EventClassService {
* @param ecfList the list of AefMapInfoDto
* @return the event class dto
*/
boolean isValidECFListInSdkProfile(List<AefMapInfoDto> ecfList);
boolean isValidEcfListInSdkProfile(List<AefMapInfoDto> ecfList);

/**
* Get list of all events class FQNs in event class family.
*
* @param ecfId string of the event class family id
* @return list of all FQNs
*/
Set<String> getFqnSetForECF(String ecfId);
Set<String> getFqnSetForEcf(String ecfId);
}
Expand Up @@ -25,7 +25,7 @@
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import org.kaaproject.kaa.server.common.dao.impl.CtlSchemaMetaInfoDao;
import org.kaaproject.kaa.server.common.dao.model.sql.CTLSchemaMetaInfo;
import org.kaaproject.kaa.server.common.dao.model.sql.CtlSchemaMetaInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;
Expand All @@ -38,29 +38,29 @@
import java.util.List;

@Repository
public class HibernateCtlSchemaMetaInfoDao extends HibernateAbstractDao<CTLSchemaMetaInfo>
implements CtlSchemaMetaInfoDao<CTLSchemaMetaInfo> {
public class HibernateCtlSchemaMetaInfoDao extends HibernateAbstractDao<CtlSchemaMetaInfo>
implements CtlSchemaMetaInfoDao<CtlSchemaMetaInfo> {

private static final Logger LOG = LoggerFactory.getLogger(HibernateCtlSchemaMetaInfoDao.class);

public HibernateCtlSchemaMetaInfoDao() {
}

@Override
protected Class<CTLSchemaMetaInfo> getEntityClass() {
return CTLSchemaMetaInfo.class;
protected Class<CtlSchemaMetaInfo> getEntityClass() {
return CtlSchemaMetaInfo.class;
}

@Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public CTLSchemaMetaInfo save(CTLSchemaMetaInfo object) {
public CtlSchemaMetaInfo save(CtlSchemaMetaInfo object) {
String tenantId = object.getTenant() != null ? object.getTenant().getStringId() : null;
String applicationId = object.getApplication()
!= null ? object.getApplication().getStringId() : null;
LOG.debug("Try to save or find meta info with fqn [{}], tenantId [{}] and applicationId [{}]",
object.getFqn(),
tenantId, applicationId);
CTLSchemaMetaInfo uniqueMetaInfo = findByFqnTenantIdAndApplicationId(
CtlSchemaMetaInfo uniqueMetaInfo = findByFqnTenantIdAndApplicationId(
object.getFqn(), tenantId, applicationId);
if (uniqueMetaInfo == null) {
uniqueMetaInfo = super.save(object, true);
Expand Down Expand Up @@ -91,11 +91,11 @@ private Criterion buildSearchCriterion(String fqn, String tenantId, String appli

@Override
@Transactional(propagation = Propagation.REQUIRED)
public CTLSchemaMetaInfo findByFqnTenantIdAndApplicationId(String fqn, String tenantId,
public CtlSchemaMetaInfo findByFqnTenantIdAndApplicationId(String fqn, String tenantId,
String applicationId) {
LOG.debug("Searching ctl metadata by fqn [{}], tenantId [{}] and applicationId [{}]",
fqn, tenantId, applicationId);
CTLSchemaMetaInfo ctlSchemaMetaInfo = findOneByCriterion(buildSearchCriterion(
CtlSchemaMetaInfo ctlSchemaMetaInfo = findOneByCriterion(buildSearchCriterion(
fqn, tenantId, applicationId));
if (LOG.isTraceEnabled()) {
LOG.trace("[{},{},{}] Search result: {}.", fqn, tenantId, applicationId, ctlSchemaMetaInfo);
Expand All @@ -107,11 +107,11 @@ public CTLSchemaMetaInfo findByFqnTenantIdAndApplicationId(String fqn, String te
}

@Override
public List<CTLSchemaMetaInfo> findSiblingsByFqnTenantIdAndApplicationId(
public List<CtlSchemaMetaInfo> findSiblingsByFqnTenantIdAndApplicationId(
String fqn, String tenantId, String applicationId) {
LOG.debug("Searching siblings of ctl by fqn [{}], tenantId [{}] and applicationId [{}]",
fqn, tenantId, applicationId);
List<CTLSchemaMetaInfo> ctlSchemaMetaInfos;
List<CtlSchemaMetaInfo> ctlSchemaMetaInfos;
if (isNotBlank(fqn) && isNotBlank(tenantId) && isNotBlank(applicationId)) {
ctlSchemaMetaInfos = findListByCriterion(
Restrictions.and(
Expand Down Expand Up @@ -156,12 +156,12 @@ private Criterion buildExludingSearchCriterion(
}

@Override
public List<CTLSchemaMetaInfo> findExistingFqns(
public List<CtlSchemaMetaInfo> findExistingFqns(
String fqn, String excludingTenantId, String excludingApplicationId) {
LOG.debug("Searching ctl metadata by fqn [{}], excludingTenantId [{}] "
+ "and excludingApplicationId [{}]",
fqn, excludingTenantId, excludingApplicationId);
List<CTLSchemaMetaInfo> ctlSchemasMetaInfos = findListByCriterion(buildExludingSearchCriterion(
List<CtlSchemaMetaInfo> ctlSchemasMetaInfos = findListByCriterion(buildExludingSearchCriterion(
fqn, excludingTenantId, excludingApplicationId));
if (LOG.isTraceEnabled()) {
LOG.trace("[{},{},{}] Search result: {}.", fqn, excludingTenantId, excludingApplicationId,
Expand All @@ -174,11 +174,11 @@ public List<CTLSchemaMetaInfo> findExistingFqns(
}

@Override
public List<CTLSchemaMetaInfo> findOthersByFqnAndTenantId(
public List<CtlSchemaMetaInfo> findOthersByFqnAndTenantId(
String fqn, String tenantId, String excludingId) {
LOG.debug("Searching other ctl schema meta infos by fqn [{}], "
+ "tenant id [{}] and excluding id [{}]", fqn, tenantId, excludingId);
List<CTLSchemaMetaInfo> availableSchemas = findListByCriterion(
List<CtlSchemaMetaInfo> availableSchemas = findListByCriterion(
Restrictions.and(Restrictions.ne(ID_PROPERTY, Long.valueOf(excludingId)),
Restrictions.eq(CTL_SCHEMA_META_INFO_FQN, fqn),
Restrictions.or(
Expand All @@ -195,9 +195,9 @@ public List<CTLSchemaMetaInfo> findOthersByFqnAndTenantId(
}

@Override
public CTLSchemaMetaInfo updateScope(CTLSchemaMetaInfo ctlSchemaMetaInfo) {
public CtlSchemaMetaInfo updateScope(CtlSchemaMetaInfo ctlSchemaMetaInfo) {
LOG.debug("Updating ctl meta info scope {}", ctlSchemaMetaInfo);
CTLSchemaMetaInfo metaInfo = findById(ctlSchemaMetaInfo.getStringId());
CtlSchemaMetaInfo metaInfo = findById(ctlSchemaMetaInfo.getStringId());
if (metaInfo != null) {
metaInfo.setTenant(ctlSchemaMetaInfo.getTenant());
metaInfo.setApplication(ctlSchemaMetaInfo.getApplication());
Expand Down
Expand Up @@ -55,7 +55,8 @@
@Entity
@Table(name = ABSTRACT_STRUCTURE_TABLE_NAME)
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class AbstractStructure<T extends AbstractStructureDto> extends GenericModel<T> implements Serializable {
public abstract class AbstractStructure<T extends AbstractStructureDto>
extends GenericModel<T> implements Serializable {

private static final long serialVersionUID = 5871567091169424733L;

Expand Down Expand Up @@ -117,6 +118,11 @@ public AbstractStructure(Long id) {
this.id = id;
}

/**
* 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);
Expand Down
Expand Up @@ -39,7 +39,7 @@

@Entity
@Table(name = APPLICATION_TABLE_NAME, uniqueConstraints = {
@UniqueConstraint(columnNames = {APPLICATION_TENANT_ID, APPLICATION_NAME})})
@UniqueConstraint(columnNames = {APPLICATION_TENANT_ID, APPLICATION_NAME})})
public class Application extends GenericModel<ApplicationDto> implements Serializable {

private static final long serialVersionUID = 3402917989585810543L;
Expand Down Expand Up @@ -68,6 +68,11 @@ public Application(Long id) {
this.id = id;
}

/**
* Create new instance of <code>Application</code>.
* @param dto data transfer object contain data that
* assign on fields of new instance
*/
public Application(ApplicationDto dto) {
if (dto != null) {
this.id = getLongId(dto);
Expand Down Expand Up @@ -128,8 +133,12 @@ public int incrementSequenceNumber() {

@Override
public String toString() {
return "Application [id=" + id + ", applicationToken=" + applicationToken + ", name=" + name + ", sequenceNumber=" + sequenceNumber
+ ", tenant=" + tenant + ", credentialsServiceName=" + credentialsServiceName + "]";
return "Application [id=" + id
+ ", applicationToken=" + applicationToken
+ ", name=" + name
+ ", sequenceNumber=" + sequenceNumber
+ ", tenant=" + tenant
+ ", credentialsServiceName=" + credentialsServiceName + "]";
}

@Override
Expand Down
Expand Up @@ -63,7 +63,7 @@ public class CtlSchema extends GenericModel<CTLSchemaDto> implements Serializabl
@ManyToOne(optional = true, fetch = FetchType.EAGER)
@JoinColumn(nullable = false, name = CTL_SCHEMA_META_INFO_ID,
foreignKey = @ForeignKey(name = CTL_SCHEMA_META_INFO_FK))
private CTLSchemaMetaInfo metaInfo;
private CtlSchemaMetaInfo metaInfo;
@Column(name = CTL_SCHEMA_VERSION)
private Integer version;
@Lob
Expand Down Expand Up @@ -94,7 +94,7 @@ public CtlSchema(Long id) {

public CtlSchema(CTLSchemaDto dto) {
this.id = getLongId(dto.getId());
this.metaInfo = new CTLSchemaMetaInfo(dto.getMetaInfo());
this.metaInfo = new CtlSchemaMetaInfo(dto.getMetaInfo());
this.version = dto.getVersion();
this.createdUsername = dto.getCreatedUsername();
this.createdTime = dto.getCreatedTime();
Expand All @@ -112,11 +112,11 @@ public void update(CTLSchemaDto dto) {
}
}

public CTLSchemaMetaInfo getMetaInfo() {
public CtlSchemaMetaInfo getMetaInfo() {
return metaInfo;
}

public void setMetaInfo(CTLSchemaMetaInfo metaInfo) {
public void setMetaInfo(CtlSchemaMetaInfo metaInfo) {
this.metaInfo = metaInfo;
}

Expand Down

0 comments on commit 33db477

Please sign in to comment.