Example #1
0
 @Override
 public OnmsNode load(Integer id) {
   OnmsNode node = new OnmsNode();
   node.setId(777);
   node.setLabel("p-brane");
   return node;
 }
 private OnmsResource getNodeResource(int nodeId) {
   final NodeResourceType nodeResourceType = new NodeResourceType(m_resourceDao, m_nodeDao);
   OnmsNode node = new OnmsNode();
   node.setId(nodeId);
   node.setLabel("Node" + nodeId);
   return nodeResourceType.createResourceForNode(node);
 }
 private OnmsResource getNodeResource(String fs, String fid) {
   NodeResourceType nodeSourceResourceType = new NodeResourceType(m_resourceDao, m_nodeDao);
   OnmsNode node = new OnmsNode();
   node.setId(0);
   node.setLabel("Node");
   node.setForeignSource(fs);
   node.setForeignId(fid);
   return nodeSourceResourceType.createResourceForNode(node);
 }
Example #4
0
  @Override
  public List<OnmsNode> findAll() {

    List<OnmsNode> nodeList = new LinkedList<OnmsNode>();

    OnmsNode node = new OnmsNode();
    node.setId(777);
    node.setLabel("p-brane");

    nodeList.add(node);
    return nodeList;
  }
Example #5
0
  @Before
  public void setUp() throws Exception {
    m_mockNetwork.createStandardNetwork();

    m_eventdIpcMgr.setEventWriter(m_database);

    // Insert some empty nodes to avoid foreign-key violations on subsequent events/alarms
    final OnmsNode node = new OnmsNode();
    node.setId(1);
    node.setLabel("node1");
    m_nodeDao.save(node);

    m_northbounder = new MockNorthbounder();
    m_registry.register(m_northbounder, Northbounder.class);
  }
 /**
  * Constructor for AbstractSaveOrUpdateOperation.
  *
  * @param nodeId a {@link java.lang.Integer} object.
  * @param foreignSource a {@link java.lang.String} object.
  * @param foreignId a {@link java.lang.String} object.
  * @param nodeLabel a {@link java.lang.String} object.
  * @param building a {@link java.lang.String} object.
  * @param city a {@link java.lang.String} object.
  */
 public AbstractSaveOrUpdateOperation(
     final Integer nodeId,
     final String foreignSource,
     final String foreignId,
     final String nodeLabel,
     final String building,
     final String city) {
   m_node = new OnmsNode();
   m_node.setId(nodeId);
   m_node.setLabel(nodeLabel);
   m_node.setLabelSource(NodeLabelSource.USER);
   m_node.setType(NodeType.ACTIVE);
   m_node.setForeignSource(foreignSource);
   m_node.setForeignId(foreignId);
   m_node.getAssetRecord().setBuilding(building);
   m_node.getAssetRecord().setCity(city);
 }
Example #7
0
 public OnmsNode(final OnmsDistPoller distPoller, final String label) {
   this(distPoller);
   setLabel(label);
 }
Example #8
0
 /**
  * Constructor for OnmsNode.
  *
  * @param label The node label
  */
 public OnmsNode(final String label) {
   // Set the label
   setLabel(label);
 }