Package org.platformlayer.ops

Examples of org.platformlayer.ops.OpsException


    List<EndpointInfo> endpoints = EndpointInfo.findEndpoints(ldapService.getTags(), port);

    EndpointInfo ldapEndpoint = EndpointChooser.preferIpv4().choose(endpoints);

    if (ldapEndpoint == null) {
      throw new OpsException("Cannot find suitable LDAP endpoint");
    }

    // TODO: Maybe we should just reference an LdapGroup

    // TODO: It sucks that we're logging in here as the Manager account
View Full Code Here


          publicPortCluster = Lists.newArrayList();
          publicPortCluster.add(publicPort);
        }

        if (!publicPortCluster.contains(publicPort)) {
          throw new OpsException("Port set specified, but public port not in the set");
        }

        assignPublicAddress.poolProvider = directCloudHelpers.getPublicAddressPool4(publicPort, publicPortCluster);
      }
    }
View Full Code Here

    }
    final ItemType sameItemType;
    if (hostPolicy.scoreSameItemType != 0) {
      PlatformLayerKey owner = findOwner(newInstance);
      if (owner == null) {
        throw new OpsException();
      }

      sameItemType = owner.getItemType();
    } else {
      sameItemType = null;
View Full Code Here

      bootstrap.instanceDir = instanceDir;

      try {
        bootstrap.sshPublicKey = OpenSshUtils.readSshPublicKey(model.sshPublicKey);
      } catch (IOException e) {
        throw new OpsException("Error deserializing SSH key", e);
      }

      bootstrap.hostname = model.hostname;

      instance.addChild(bootstrap);
View Full Code Here

        String type = element.getAttribute("xsi:type");

        if (type != null && type.endsWith(":" + xmlElementName)) {
          // OK
        } else {
          throw new OpsException("Incorrect element type: " + xmlElementName + " vs " + nodeName);
        }
      }

      T object = jaxbHelper.unmarshal(element, itemClass);

      if (!(object.getClass().isAssignableFrom(itemClass))) {
        System.out.println("XML = " + ((UntypedItemXml) untypedItem).serialize());
      }

      typedItem = Casts.checkedCast(object, itemClass);
    } catch (JAXBException e) {
      throw new OpsException("Error deserializing item", e);
    }

    return typedItem;
  }
View Full Code Here

        break;
      }
    }

    if (required) {
      throw new OpsException("Unable to assign value from pool: " + toString());
    }
    return null;
  }
View Full Code Here

    }
    if (keys.size() == 1) {
      return adapter.toItem(keys.get(0));
    }

    throw new OpsException("Found multiple assignments to: " + holder);
  }
View Full Code Here

      List<Assignment> assignments = findAssignments(resource);

      String key = adapter.toKey(item);
      Assignment assigned = Assignment.find(assignments, key, subkey);
      if (assigned == null) {
        throw new OpsException("Resource not assigned");
      }

      if (!assigned.item.equals(owner.getUrl())) {
        throw new OpsException("Resource not held");
      }

      Tag assignmentTag = assigned.asTag();

      TagChanges tagChanges = new TagChanges();
View Full Code Here

        AddressModel addressModel = addressProvider.get();
        InetAddress address = addressModel.getInetAddress();
        if (InetAddressUtils.isIpv6(address)) {
          String hostPrimaryInterface = getHostPrimaryInterface();
          if (Strings.isNullOrEmpty(hostPrimaryInterface)) {
            throw new OpsException("primaryInterface not specified");
          }

          Command command = Command.build("ip neigh add proxy {0} dev {1}", address, hostPrimaryInterface);
          sb.add(command);
        }
View Full Code Here

        log.warn("Error updating machine: " + machine, e);
      }
    }

    if (failed) {
      throw new OpsException("Could not update all servers").setRetry(TimeSpan.ONE_MINUTE);
    }

  }
View Full Code Here

TOP

Related Classes of org.platformlayer.ops.OpsException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.