Skip to content

Commit

Permalink
Fixes #7634: Make NodeInfo more dependant on Node
Browse files Browse the repository at this point in the history
  • Loading branch information
VinceMacBuche committed Jan 12, 2016
1 parent ba2fb94 commit a22b054
Show file tree
Hide file tree
Showing 11 changed files with 297 additions and 288 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
*************************************************************************************
*
* This file is part of Rudder.
*
*
* Rudder is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* In accordance with the terms of section 7 (7. Additional Terms.) of
* the GNU General Public License version 3, the copyright holders add
* the following Additional permissions:
Expand All @@ -22,12 +22,12 @@
* documentation that, without modification of the Source Code, enables
* supplementary functions or services in addition to those offered by
* the Software.
*
*
* Rudder is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with Rudder. If not, see <http://www.gnu.org/licenses/>.
Expand All @@ -47,12 +47,10 @@ import com.normation.rudder.domain.nodes.Node
import com.normation.rudder.domain.nodes.NodeInfo
import com.normation.rudder.domain.Constants


/**
* Accept/refuse new server
*/


final case class InventoryLogDetails(
nodeId : NodeId
, inventoryVersion: DateTime
Expand Down Expand Up @@ -87,7 +85,6 @@ object InventoryEventLog {
}
}


final case class AcceptNodeEventLog (
override val eventDetails : EventLogDetails
) extends InventoryEventLog with HashcodeCaching {
Expand All @@ -100,7 +97,6 @@ object AcceptNodeEventLog extends EventLogFilter {

override def apply(x : (EventLogType, EventLogDetails)) : AcceptNodeEventLog = AcceptNodeEventLog(x._2)


def fromInventoryLogDetails(
id : Option[Int] = None
, principal : EventActor
Expand Down Expand Up @@ -129,7 +125,6 @@ object RefuseNodeEventLog extends EventLogFilter {

override def apply(x : (EventLogType, EventLogDetails)) : RefuseNodeEventLog = RefuseNodeEventLog(x._2)


def fromInventoryLogDetails(
id : Option[Int] = None
, principal : EventActor
Expand All @@ -146,8 +141,6 @@ object RefuseNodeEventLog extends EventLogFilter {
}
}



// Accepted node part

final case class NodeLogDetails(
Expand Down Expand Up @@ -191,7 +184,6 @@ object NodeEventLog {
}
}


final case class DeleteNodeEventLog (
override val eventDetails : EventLogDetails
) extends InventoryEventLog with HashcodeCaching {
Expand All @@ -204,8 +196,6 @@ object DeleteNodeEventLog extends EventLogFilter {

override def apply(x : (EventLogType, EventLogDetails)) : DeleteNodeEventLog = DeleteNodeEventLog(x._2)



def fromInventoryLogDetails(
id : Option[Int] = None
, principal : EventActor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
*************************************************************************************
*
* This file is part of Rudder.
*
*
* Rudder is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* In accordance with the terms of section 7 (7. Additional Terms.) of
* the GNU General Public License version 3, the copyright holders add
* the following Additional permissions:
Expand All @@ -22,12 +22,12 @@
* documentation that, without modification of the Source Code, enables
* supplementary functions or services in addition to those offered by
* the Software.
*
*
* Rudder is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with Rudder. If not, see <http://www.gnu.org/licenses/>.
Expand All @@ -40,11 +40,17 @@ package com.normation.rudder.domain.nodes
import com.normation.inventory.domain.NodeId
import com.normation.utils.HashcodeCaching


/**
* The entry point for a REGISTERED node in Rudder.
*
* This is independant from inventory, and can exist without one.
*
*/
case class Node(id:NodeId, name:String, description:String, isBroken : Boolean, isSystem : Boolean, isPolicyServer: Boolean) extends HashcodeCaching
case class Node(
id:NodeId
, name:String
, description:String
, isBroken : Boolean
, isSystem : Boolean
, isPolicyServer: Boolean
) extends HashcodeCaching
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
*************************************************************************************
*
* This file is part of Rudder.
*
*
* Rudder is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* In accordance with the terms of section 7 (7. Additional Terms.) of
* the GNU General Public License version 3, the copyright holders add
* the following Additional permissions:
Expand All @@ -22,12 +22,12 @@
* documentation that, without modification of the Source Code, enables
* supplementary functions or services in addition to those offered by
* the Software.
*
*
* Rudder is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with Rudder. If not, see <http://www.gnu.org/licenses/>.
Expand All @@ -48,9 +48,7 @@ import com.normation.inventory.domain.ServerRole
* always useful about a node
*/
case class NodeInfo(
id : NodeId
, name : String
, description : String
node : Node
, hostname : String
, machineType : String
, osName : String
Expand All @@ -63,12 +61,18 @@ case class NodeInfo(
, policyServerId: NodeId
, localAdministratorAccountName: String
, creationDate : DateTime
, isBroken : Boolean
, isSystem : Boolean
, isPolicyServer: Boolean
//for now, isPolicyServer and server role ARE NOT
//dependant. So EXPECTS inconsistencies.
//TODO: remove isPolicyServer, and pattern match on
// on role everywhere.
, serverRoles : Set[ServerRole]
) extends HashcodeCaching
) extends HashcodeCaching {

val id = node.id
val name = node.name
val description = node.description
val isBroken = node.isBroken
val isSystem = node.isSystem
val isPolicyServer = node.isPolicyServer

}
Loading

0 comments on commit a22b054

Please sign in to comment.