@ -15,16 +15,18 @@
* /
* /
package org.thingsboard.server.common.data.security ;
package org.thingsboard.server.common.data.security ;
import io.swagger.annotations.ApiModel ;
import io.swagger.annotations.ApiModelProperty ;
import lombok.EqualsAndHashCode ;
import lombok.EqualsAndHashCode ;
import org.thingsboard.server.common.data.BaseData ;
import org.thingsboard.server.common.data.BaseData ;
import org.thingsboard.server.common.data.id.DeviceCredentialsId ;
import org.thingsboard.server.common.data.id.DeviceCredentialsId ;
import org.thingsboard.server.common.data.id.DeviceId ;
import org.thingsboard.server.common.data.id.DeviceId ;
@EqualsAndHashCode ( callSuper = true )
@EqualsAndHashCode ( callSuper = true )
@ApiModel
public class DeviceCredentials extends BaseData < DeviceCredentialsId > implements DeviceCredentialsFilter {
public class DeviceCredentials extends BaseData < DeviceCredentialsId > implements DeviceCredentialsFilter {
private static final long serialVersionUID = - 7869261127032877765L ;
private static final long serialVersionUID = - 7869261127032877765L ;
private DeviceId deviceId ;
private DeviceId deviceId ;
private DeviceCredentialsType credentialsType ;
private DeviceCredentialsType credentialsType ;
private String credentialsId ;
private String credentialsId ;
@ -46,6 +48,19 @@ public class DeviceCredentials extends BaseData<DeviceCredentialsId> implements
this . credentialsValue = deviceCredentials . getCredentialsValue ( ) ;
this . credentialsValue = deviceCredentials . getCredentialsValue ( ) ;
}
}
@ApiModelProperty ( position = 1 , required = true , value = "string" , example = "784f394c-42b6-435a-983c-b7beff2784f9" )
@Override
public DeviceCredentialsId getId ( ) {
return super . getId ( ) ;
}
@ApiModelProperty ( position = 2 , value = "long" , example = "1609459200000" )
@Override
public long getCreatedTime ( ) {
return super . getCreatedTime ( ) ;
}
@ApiModelProperty ( position = 3 , required = true )
public DeviceId getDeviceId ( ) {
public DeviceId getDeviceId ( ) {
return deviceId ;
return deviceId ;
}
}
@ -54,6 +69,7 @@ public class DeviceCredentials extends BaseData<DeviceCredentialsId> implements
this . deviceId = deviceId ;
this . deviceId = deviceId ;
}
}
@ApiModelProperty ( position = 4 , value = "string" , allowableValues = "ACCESS_TOKEN, X509_CERTIFICATE, MQTT_BASIC, LWM2M_CREDENTIALS" )
@Override
@Override
public DeviceCredentialsType getCredentialsType ( ) {
public DeviceCredentialsType getCredentialsType ( ) {
return credentialsType ;
return credentialsType ;
@ -63,6 +79,7 @@ public class DeviceCredentials extends BaseData<DeviceCredentialsId> implements
this . credentialsType = credentialsType ;
this . credentialsType = credentialsType ;
}
}
@ApiModelProperty ( position = 5 , required = true , value = "string" , example = "By default, new access token for your device. Depends on the credentialsType." )
@Override
@Override
public String getCredentialsId ( ) {
public String getCredentialsId ( ) {
return credentialsId ;
return credentialsId ;
@ -72,6 +89,7 @@ public class DeviceCredentials extends BaseData<DeviceCredentialsId> implements
this . credentialsId = credentialsId ;
this . credentialsId = credentialsId ;
}
}
@ApiModelProperty ( position = 6 , required = false , value = "string" , example = "Null in case of ACCESS_TOKEN, Depends on the credentialsType." )
public String getCredentialsValue ( ) {
public String getCredentialsValue ( ) {
return credentialsValue ;
return credentialsValue ;
}
}