Esempio n. 1
0
  /**
   * Save the virtual machine, create and save a node virtual image with the virtual image / machine
   * relation.
   */
  public void createVirtualImageNode(VirtualimageHB vImage, VirtualMachine vMachine)
      throws PersistenceException {
    VirtualmachineHB vMachineHb = vMachine.toPojoHB();

    createVirtualMachine(vMachineHb);

    createNodeVirtualImage(vImage, vMachineHb);
  }
Esempio n. 2
0
  @Override
  public NodeVirtualImageHB toPojoHB() {
    NodeHB nodeHB = super.toPojoHB();
    NodeVirtualImageHB nodeVirtualImageHB = new NodeVirtualImageHB(nodeHB);

    // Adding NodeVirtualImage's fields
    nodeVirtualImageHB.setVirtualImageHB(virtualImage.toPojoHB());
    if (virtualMachine != null) {
      nodeVirtualImageHB.setVirtualMachineHB(virtualMachine.toPojoHB());
    } else {
      nodeVirtualImageHB.setVirtualMachineHB(null);
    }

    return nodeVirtualImageHB;
  }