Skip to content

Commit c176c32

Browse files
authored
Merge pull request #16 from delphi-hub/feature/renameattributes
Renamed attributes of Instance class
2 parents d679ee9 + 48637f9 commit c176c32

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/main/scala/de/upb/cs/swt/delphi/instanceregistry/Server.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ object Server extends HttpApp with JsonSupport with AppLogging {
5050
0L
5151
}
5252
else{
53-
(instances map( instance => instance.iD.get) max) + 1L
53+
(instances map( instance => instance.id.get) max) + 1L
5454
}
5555
}
5656

57-
val instanceToRegister = Instance(iD = Some(newID), host = paramInstance.host, portnumber = paramInstance.portnumber, name = paramInstance.name, componentType = paramInstance.componentType)
57+
val instanceToRegister = Instance(id = Some(newID), host = paramInstance.host, portNumber = paramInstance.portNumber, name = paramInstance.name, componentType = paramInstance.componentType)
5858

5959
instances += instanceToRegister
6060
log.info(s"Instance with name $name registered, ID $newID assigned.")
@@ -71,7 +71,7 @@ object Server extends HttpApp with JsonSupport with AppLogging {
7171
post {
7272
log.debug(s"POST /deregister?Id=$Id has been called")
7373

74-
val instanceToRemove = instances find(instance => instance.iD.get == Id)
74+
val instanceToRemove = instances find(instance => instance.id.get == Id)
7575

7676
if(instanceToRemove.isEmpty){
7777
log.warning(s"Cannot remove instance with id $Id, that id is not present on the server")

src/main/scala/de/upb/cs/swt/delphi/instanceregistry/io/swagger/client/model/Instance.scala

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ trait JsonSupport extends SprayJsonSupport with DefaultJsonProtocol {
2525
}
2626

2727
final case class Instance (
28-
iD: Option[Long],
28+
id: Option[Long],
2929
host: String,
30-
portnumber: Long,
31-
name: String,
32-
/* Component Type */
33-
componentType: InstanceEnums.ComponentType
30+
portNumber: Long,
31+
name: String,
32+
/* Component Type */
33+
componentType: InstanceEnums.ComponentType
3434
)
3535

3636
object InstanceEnums {

0 commit comments

Comments
 (0)