Skip to content

Commit

Permalink
Added useConfigurationRawSchema field to support client that use Kaa …
Browse files Browse the repository at this point in the history
…SDK 0.9.0
  • Loading branch information
Kirill380 committed Jul 13, 2016
1 parent 6064e31 commit 8b61c73
Show file tree
Hide file tree
Showing 25 changed files with 375 additions and 512 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ private void sendConnect() throws Exception {
byte[] requestBodyEncoded = encDec.encodeData(body); byte[] requestBodyEncoded = encDec.encodeData(body);
byte[] sessionKey = encDec.getEncodedSessionKey(); byte[] sessionKey = encDec.getEncodedSessionKey();
byte[] signature = encDec.sign(sessionKey); byte[] signature = encDec.sign(sessionKey);
sendFrame(new Connect(CHANNEL_TIMEOUT, Constants.KAA_PLATFORM_PROTOCOL_AVRO_ID, sessionKey, requestBodyEncoded, signature)); sendFrame(new Connect(CHANNEL_TIMEOUT, Constants.KAA_PLATFORM_PROTOCOL_AVRO_ID_V2, sessionKey, requestBodyEncoded, signature));
} }


private synchronized void closeConnection() { private synchronized void closeConnection() {
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@


package org.kaaproject.kaa.client.channel.impl.channels; package org.kaaproject.kaa.client.channel.impl.channels;


import java.nio.ByteBuffer;
import java.security.GeneralSecurityException; import java.security.GeneralSecurityException;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;


import org.kaaproject.kaa.common.Constants;
import org.kaaproject.kaa.common.endpoint.CommonEPConstans; import org.kaaproject.kaa.common.endpoint.CommonEPConstans;
import org.kaaproject.kaa.common.endpoint.security.MessageEncoderDecoder; import org.kaaproject.kaa.common.endpoint.security.MessageEncoderDecoder;
import org.slf4j.Logger; import org.slf4j.Logger;
Expand All @@ -44,6 +46,7 @@ static LinkedHashMap<String, byte[]> createHttpRequest(byte [] body, MessageEnco
if (body != null && messageEncDec != null) { if (body != null && messageEncDec != null) {
byte[] requestKeyEncoded = messageEncDec.getEncodedSessionKey(); byte[] requestKeyEncoded = messageEncDec.getEncodedSessionKey();
byte[] requestBodyEncoded = messageEncDec.encodeData(body); byte[] requestBodyEncoded = messageEncDec.encodeData(body);
byte[] nextProtocol = ByteBuffer.allocate(4).putInt(Constants.KAA_PLATFORM_PROTOCOL_AVRO_ID_V2).array();
byte[] signature = null; byte[] signature = null;
if(sign){ if(sign){
signature = messageEncDec.sign(requestKeyEncoded); signature = messageEncDec.sign(requestKeyEncoded);
Expand All @@ -61,13 +64,12 @@ static LinkedHashMap<String, byte[]> createHttpRequest(byte [] body, MessageEnco
} }
LinkedHashMap<String, byte[]> requestEntity = new LinkedHashMap<String, byte[]>(); //NOSONAR LinkedHashMap<String, byte[]> requestEntity = new LinkedHashMap<String, byte[]>(); //NOSONAR
if(sign){ if(sign){
requestEntity.put(CommonEPConstans.REQUEST_SIGNATURE_ATTR_NAME, requestEntity.put(CommonEPConstans.REQUEST_SIGNATURE_ATTR_NAME, signature);
signature);
} }
requestEntity.put(CommonEPConstans.REQUEST_KEY_ATTR_NAME, requestEntity.put(CommonEPConstans.REQUEST_KEY_ATTR_NAME, requestKeyEncoded);
requestKeyEncoded); requestEntity.put(CommonEPConstans.REQUEST_DATA_ATTR_NAME, requestBodyEncoded);
requestEntity.put(CommonEPConstans.REQUEST_DATA_ATTR_NAME, requestEntity.put(CommonEPConstans.NEXT_PROTOCOL_ATTR_NAME, nextProtocol);
requestBodyEncoded);
return requestEntity; return requestEntity;
} }
return null; return null;
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,44 +20,38 @@
* Common Kaa project Constants. * Common Kaa project Constants.
*/ */
public interface Constants { //NOSONAR public interface Constants { //NOSONAR
/**
* Used URI delimiter. String URI_DELIM = "/"; //NOSONAR
*/
public static final String URI_DELIM = "/"; //NOSONAR


/** /**
* HTTP response content-type. * HTTP response content-type.
*/ */
public static final String RESPONSE_CONTENT_TYPE = "\"application/x-kaa\""; //NOSONAR String RESPONSE_CONTENT_TYPE = "\"application/x-kaa\""; //NOSONAR


/** /**
* HTTP response custom header for set RSA Signature encoded in base64 * HTTP response custom header for set RSA Signature encoded in base64
*/ */
public static final String SIGNATURE_HEADER_NAME = "X-SIGNATURE"; //NOSONAR String SIGNATURE_HEADER_NAME = "X-SIGNATURE"; //NOSONAR


/**
* The identifier for the Avro platform protocol
*/
public static final int KAA_PLATFORM_PROTOCOL_AVRO_ID = 0xf291f2d4;


/** //The identifier for the Avro platform protocol
* The identifier for the Binary platform protocol int KAA_PLATFORM_PROTOCOL_AVRO_ID = 0xf291f2d4;
*/
public static final int KAA_PLATFORM_PROTOCOL_BINARY_ID = 0x3553c66f;


/** //cvc32 of AvroEncDecUseRawChema
* The size of sdk token int KAA_PLATFORM_PROTOCOL_AVRO_ID_V2 = 0xe0c0c178;
*/
public static final int SDK_TOKEN_SIZE = 27;


/**
* The size of application token
*/
public static final int APP_TOKEN_SIZE = 20;


/** //The identifier for the Binary platform protocol
* The size of user verifier token int KAA_PLATFORM_PROTOCOL_BINARY_ID = 0x3553c66f;
*/
public static final int USER_VERIFIER_TOKEN_SIZE = 20; //cvc32 of BinaryEncDecUseRawSchema
int KAA_PLATFORM_PROTOCOL_BINARY_ID_V2 = 0x0231ad61;


int SDK_TOKEN_SIZE = 27;

int APP_TOKEN_SIZE = 20;

int USER_VERIFIER_TOKEN_SIZE = 20;


} }
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -85,12 +85,16 @@ public class EndpointServiceImpl implements EndpointService {


@Autowired @Autowired
private EndpointGroupDao<EndpointGroup> endpointGroupDao; private EndpointGroupDao<EndpointGroup> endpointGroupDao;

@Autowired @Autowired
private HistoryService historyService; private HistoryService historyService;

@Autowired @Autowired
private ServerProfileService serverProfileService; private ServerProfileService serverProfileService;

@Autowired @Autowired
private CTLService ctlService; private CTLService ctlService;

@Autowired @Autowired
private TopicDao<Topic> topicDao; private TopicDao<Topic> topicDao;


Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public class EndpointProfileDto implements HasId, HasVersion, Serializable {
private String serverHash; private String serverHash;
private String sdkToken; private String sdkToken;
private Long version; private Long version;
private boolean useConfigurationRawSchema;


@Override @Override
public String getId() { public String getId() {
Expand Down Expand Up @@ -283,6 +284,15 @@ public void setVersion(Long version) {
this.version = version; this.version = version;
} }



public boolean isUseConfigurationRawSchema() {
return useConfigurationRawSchema;
}

public void setUseConfigurationRawSchema(boolean useConfigurationRawSchema) {
this.useConfigurationRawSchema = useConfigurationRawSchema;
}

@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) { if (this == o) {
Expand Down Expand Up @@ -349,6 +359,10 @@ public boolean equals(Object o) {
return false; return false;
} }


if (useConfigurationRawSchema != that.useConfigurationRawSchema) {
return false;
}

return true; return true;
} }


Expand All @@ -371,9 +385,11 @@ public int hashCode() {
result = 31 * result + systemNfVersion; result = 31 * result + systemNfVersion;
result = 31 * result + userNfVersion; result = 31 * result + userNfVersion;
result = 31 * result + (sdkToken != null ? sdkToken.hashCode() : 0); result = 31 * result + (sdkToken != null ? sdkToken.hashCode() : 0);
result = 31 * result + (useConfigurationRawSchema ? 1 : 0);
return result; return result;
} }



@Override @Override
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
Expand Down Expand Up @@ -423,6 +439,8 @@ public String toString() {
builder.append(serverHash); builder.append(serverHash);
builder.append(", sdkToken="); builder.append(", sdkToken=");
builder.append(sdkToken); builder.append(sdkToken);
builder.append(", useRawSchema=");
builder.append(useConfigurationRawSchema);
builder.append("]"); builder.append("]");
return builder.toString(); return builder.toString();
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,33 +21,7 @@
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.CassandraDaoUtil.convertECFVersionDtoToModelList; import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.CassandraDaoUtil.convertECFVersionDtoToModelList;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.CassandraDaoUtil.getByteBuffer; import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.CassandraDaoUtil.getByteBuffer;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.CassandraDaoUtil.getBytes; import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.CassandraDaoUtil.getBytes;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_ACCESS_TOKEN_PROPERTY; import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.*;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_APP_ID_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_COLUMN_FAMILY_NAME;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_CONFIGURATION_VERSION_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_CONFIG_HASH_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_ECF_VERSION_STATE_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_ENDPOINT_ID_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_EP_KEY_HASH_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_EP_KEY_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_GROUP_STATE_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_LOG_SCHEMA_VERSION_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_NOTIFICATION_VERSION_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_PROFILE_HASH_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_PROFILE_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_PROFILE_VERSION_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_SDK_TOKEN_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_SEQUENCE_NUMBER_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_SERVER_HASH_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_SERVER_PROFILE_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_SERVER_PROFILE_VERSION_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_SIMPLE_TOPIC_HASH_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_SUBSCRIPTIONS_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_SYSTEM_NOTIFICATION_VERSION_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_TOPIC_HASH_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_USER_CONFIG_HASH_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_USER_ID_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.cassandra.dao.model.CassandraModelConstants.EP_USER_NOTIFICATION_VERSION_PROPERTY;


import java.io.Serializable; import java.io.Serializable;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
Expand Down Expand Up @@ -126,7 +100,11 @@ public final class CassandraEndpointProfile implements EndpointProfile, Serializ
@Column(name = EP_SDK_TOKEN_PROPERTY) @Column(name = EP_SDK_TOKEN_PROPERTY)
private String sdkToken; private String sdkToken;
@Column(name = EP_SERVER_PROFILE_PROPERTY) @Column(name = EP_SERVER_PROFILE_PROPERTY)
private String serverProfile; private String serverProfile;

@Column(name = EP_USE_RAW_SCHEMA)
private Boolean useConfigurationRawSchema;

@Column(name = OPT_LOCK) @Column(name = OPT_LOCK)
private Long version; private Long version;


Expand Down Expand Up @@ -160,6 +138,7 @@ public CassandraEndpointProfile(EndpointProfileDto dto) {
this.serverHash = dto.getServerHash(); this.serverHash = dto.getServerHash();
this.sdkToken = dto.getSdkToken(); this.sdkToken = dto.getSdkToken();
this.serverProfile = dto.getServerProfileBody(); this.serverProfile = dto.getServerProfileBody();
this.useConfigurationRawSchema = dto.isUseConfigurationRawSchema();
this.version = dto.getVersion(); this.version = dto.getVersion();
} }


Expand Down Expand Up @@ -376,7 +355,15 @@ public void setSdkToken(String sdkToken) {
public void setApplicationId(String applicationId) { public void setApplicationId(String applicationId) {
this.applicationId = applicationId; this.applicationId = applicationId;
} }


public Boolean getUseConfigurationRawSchema() {
return useConfigurationRawSchema;
}

public void setUseConfigurationRawSchema(Boolean useConfigurationRawSchema) {
this.useConfigurationRawSchema = useConfigurationRawSchema;
}

@Override @Override
public Long getVersion() { public Long getVersion() {
return version; return version;
Expand Down Expand Up @@ -420,6 +407,9 @@ public boolean equals(Object o) {
if (ecfVersionStates != null ? !ecfVersionStates.equals(that.ecfVersionStates) : that.ecfVersionStates != null) return false; if (ecfVersionStates != null ? !ecfVersionStates.equals(that.ecfVersionStates) : that.ecfVersionStates != null) return false;
if (serverHash != null ? !serverHash.equals(that.serverHash) : that.serverHash != null) return false; if (serverHash != null ? !serverHash.equals(that.serverHash) : that.serverHash != null) return false;
if (sdkToken != null ? !sdkToken.equals(that.sdkToken) : that.sdkToken != null) return false; if (sdkToken != null ? !sdkToken.equals(that.sdkToken) : that.sdkToken != null) return false;
if (useConfigurationRawSchema != null ? !useConfigurationRawSchema.equals(that.useConfigurationRawSchema) : that.useConfigurationRawSchema != null) {
return false;
}
return serverProfile != null ? serverProfile.equals(that.serverProfile) : that.serverProfile == null; return serverProfile != null ? serverProfile.equals(that.serverProfile) : that.serverProfile == null;


} }
Expand Down Expand Up @@ -450,6 +440,7 @@ public int hashCode() {
result = 31 * result + (ecfVersionStates != null ? ecfVersionStates.hashCode() : 0); result = 31 * result + (ecfVersionStates != null ? ecfVersionStates.hashCode() : 0);
result = 31 * result + (serverHash != null ? serverHash.hashCode() : 0); result = 31 * result + (serverHash != null ? serverHash.hashCode() : 0);
result = 31 * result + (sdkToken != null ? sdkToken.hashCode() : 0); result = 31 * result + (sdkToken != null ? sdkToken.hashCode() : 0);
result = 31 * result + (useConfigurationRawSchema != null ? useConfigurationRawSchema.hashCode() : 0);
result = 31 * result + (serverProfile != null ? serverProfile.hashCode() : 0); result = 31 * result + (serverProfile != null ? serverProfile.hashCode() : 0);
return result; return result;
} }
Expand Down Expand Up @@ -482,6 +473,7 @@ public String toString() {
", ecfVersionStates=" + ecfVersionStates + ", ecfVersionStates=" + ecfVersionStates +
", serverHash='" + serverHash + '\'' + ", serverHash='" + serverHash + '\'' +
", sdkToken='" + sdkToken + '\'' + ", sdkToken='" + sdkToken + '\'' +
", useRawSchema=" + useConfigurationRawSchema +
", serverProfile='" + serverProfile + '\'' + ", serverProfile='" + serverProfile + '\'' +
'}'; '}';
} }
Expand Down Expand Up @@ -515,6 +507,7 @@ public EndpointProfileDto toDto() {
dto.setServerHash(serverHash); dto.setServerHash(serverHash);
dto.setSdkToken(sdkToken); dto.setSdkToken(sdkToken);
dto.setServerProfileBody(serverProfile); dto.setServerProfileBody(serverProfile);
dto.setUseConfigurationRawSchema(useConfigurationRawSchema);
dto.setVersion(version); dto.setVersion(version);
return dto; return dto;
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ private CassandraModelConstants() {
public static final String EP_ECF_VERSION_STATE_PROPERTY = "ecf_ver_state"; public static final String EP_ECF_VERSION_STATE_PROPERTY = "ecf_ver_state";
public static final String EP_SERVER_HASH_PROPERTY = "server_hash"; public static final String EP_SERVER_HASH_PROPERTY = "server_hash";
public static final String EP_SDK_TOKEN_PROPERTY = SDK_TOKEN_PROPERTY; public static final String EP_SDK_TOKEN_PROPERTY = SDK_TOKEN_PROPERTY;
public static final String EP_USE_RAW_SCHEMA = "use_raw_schema";
public static final String EP_SERVER_PROFILE_PROPERTY = "srv_pf"; public static final String EP_SERVER_PROFILE_PROPERTY = "srv_pf";


/** /**
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ CREATE TABLE IF NOT EXISTS kaa.ep_profile (
server_hash text, server_hash text,
sdk_token text, sdk_token text,
srv_pf text, srv_pf text,
use_raw_schema boolean,
opt_lock bigint opt_lock bigint
); );


Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,18 +39,7 @@


import static org.kaaproject.kaa.server.common.dao.DaoConstants.OPT_LOCK; import static org.kaaproject.kaa.server.common.dao.DaoConstants.OPT_LOCK;
import static org.kaaproject.kaa.server.common.dao.impl.DaoUtil.convertDtoList; import static org.kaaproject.kaa.server.common.dao.impl.DaoUtil.convertDtoList;
import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.ENDPOINT_GROUP_ID; import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.*;
import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.ENDPOINT_PROFILE;
import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.EP_ACCESS_TOKEN;
import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.EP_APPLICATION_ID;
import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.EP_ENDPOINT_KEY_HASH;
import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.EP_GROUP_STATE;
import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.EP_PROFILE_VERSION;
import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.EP_SDK_TOKEN;
import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.EP_SERVER_PROFILE_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.EP_SERVER_PROFILE_VERSION_PROPERTY;
import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.EP_USER_ID;
import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoModelConstants.ID;
import static org.springframework.data.mongodb.core.query.Criteria.where; import static org.springframework.data.mongodb.core.query.Criteria.where;
import static org.springframework.data.mongodb.core.query.Query.query; import static org.springframework.data.mongodb.core.query.Query.query;
import static org.springframework.data.mongodb.core.query.Update.update; import static org.springframework.data.mongodb.core.query.Update.update;
Expand Down Expand Up @@ -103,7 +92,7 @@ public EndpointProfilesBodyDto findBodyByEndpointGroupId(PageLinkDto pageLink) {
where(EP_GROUP_STATE + "." + ENDPOINT_GROUP_ID).is(pageLink.getEndpointGroupId()))); where(EP_GROUP_STATE + "." + ENDPOINT_GROUP_ID).is(pageLink.getEndpointGroupId())));
query.skip(offs).limit(lim + 1); query.skip(offs).limit(lim + 1);
query.fields().include(DaoConstants.PROFILE).include(EP_SERVER_PROFILE_PROPERTY).include(EP_ENDPOINT_KEY_HASH).include(EP_APPLICATION_ID) query.fields().include(DaoConstants.PROFILE).include(EP_SERVER_PROFILE_PROPERTY).include(EP_ENDPOINT_KEY_HASH).include(EP_APPLICATION_ID)
.include(EP_PROFILE_VERSION).include(EP_SERVER_PROFILE_VERSION_PROPERTY); .include(EP_PROFILE_VERSION).include(EP_SERVER_PROFILE_VERSION_PROPERTY).include(EP_USE_RAW_SCHEMA);
List<EndpointProfileDto> endpointProfileDtoList = convertDtoList(mongoTemplate.find(query, getDocumentClass())); List<EndpointProfileDto> endpointProfileDtoList = convertDtoList(mongoTemplate.find(query, getDocumentClass()));
if (endpointProfileDtoList.size() == (lim + 1)) { if (endpointProfileDtoList.size() == (lim + 1)) {
String offset = Integer.toString(lim + offs); String offset = Integer.toString(lim + offs);
Expand Down Expand Up @@ -149,7 +138,7 @@ public EndpointProfileBodyDto findBodyByKeyHash(byte[] endpointKeyHash) {
EndpointProfileBodyDto endpointProfileBodyDto = null; EndpointProfileBodyDto endpointProfileBodyDto = null;
Query query = Query.query(where(EP_ENDPOINT_KEY_HASH).is(endpointKeyHash)); Query query = Query.query(where(EP_ENDPOINT_KEY_HASH).is(endpointKeyHash));
query.fields().include(DaoConstants.PROFILE).include(EP_SERVER_PROFILE_PROPERTY).include(EP_APPLICATION_ID) query.fields().include(DaoConstants.PROFILE).include(EP_SERVER_PROFILE_PROPERTY).include(EP_APPLICATION_ID)
.include(EP_PROFILE_VERSION).include(EP_SERVER_PROFILE_VERSION_PROPERTY); .include(EP_PROFILE_VERSION).include(EP_SERVER_PROFILE_VERSION_PROPERTY).include(EP_USE_RAW_SCHEMA);
EndpointProfileDto pf = mongoTemplate.findOne(query, getDocumentClass()).toDto(); EndpointProfileDto pf = mongoTemplate.findOne(query, getDocumentClass()).toDto();
if (pf != null) { if (pf != null) {
endpointProfileBodyDto = new EndpointProfileBodyDto(endpointKeyHash, pf.getClientProfileBody(), pf.getServerProfileBody(), endpointProfileBodyDto = new EndpointProfileBodyDto(endpointKeyHash, pf.getClientProfileBody(), pf.getServerProfileBody(),
Expand Down
Loading

0 comments on commit 8b61c73

Please sign in to comment.