Beispiel #1
0
 /** Creates the list with link instances necessary for the query list. */
 private void createQueryMixins() {
   IPNetworkInterface.generateAttributeList();
   if (ipNetworkInterface == null) {
     HashSet<Mixin> related = new HashSet<Mixin>();
     try {
       related.add(
           new Mixin(
               null,
               "ipnetwork",
               "ipnetwork",
               "http://schemas.ogf.org/occi/core#link",
               IPNetworkInterface.attributes));
       ipNetworkInterface =
           new IPNetworkInterface(
               related,
               "ipnetwork",
               "ipnetwork",
               "http://schemas.ogf.org/occi/infrastructure/network#",
               IPNetworkInterface.attributes);
     } catch (SchemaViolationException e) {
       e.printStackTrace();
     } catch (URISyntaxException e) {
       e.printStackTrace();
     }
   }
 }
Beispiel #2
0
  /** Creates the list with link instances necessary for the query list. */
  private void createQueryLinks() {
    NetworkInterface.generateAttributeList();
    StorageLink.generateAttributeList();
    try {
      Link storageLink = new Link(null, null);
      Set<Kind> storageRelated = new HashSet<Kind>();
      storageRelated.add(
          new Kind(
              null,
              null,
              null,
              null,
              "storagelink",
              "storagelink",
              "http://schemas.ogf.org/occi/infrastructure#link",
              StorageLink.attributes));
      storageLink.setKind(
          new Kind(
              null,
              storageRelated,
              null,
              null,
              "storagelink",
              "storagelink",
              "http://schemas.ogf.org/occi/infrastructure#",
              StorageLink.attributes));
      queryLinks.add(storageLink);

      Set<Kind> networkInterfaceRelated = new HashSet<Kind>();
      networkInterfaceRelated.add(
          new Kind(
              null,
              null,
              null,
              null,
              "networkinterface",
              "networkinterface",
              "http://schemas.ogf.org/occi/infrastructure#link",
              NetworkInterface.getAttributes()));
      Link networkInterface = new Link(null, null);
      networkInterface.setKind(
          new Kind(
              null,
              networkInterfaceRelated,
              null,
              null,
              "networkinterface",
              "networkinterface",
              "http://schemas.ogf.org/occi/infrastructure#",
              NetworkInterface.getAttributes()));
      queryLinks.add(networkInterface);
    } catch (SchemaViolationException e) {
      e.printStackTrace();
    } catch (URISyntaxException e) {
      e.printStackTrace();
    }
  }