Package org.platformlayer.core.model

Examples of org.platformlayer.core.model.ManagedItemState


    this.allowStates = allowStates;
  }

  @Override
  public <T extends ItemBase> boolean matchesItem(T item) {
    ManagedItemState itemState = item.getState();

    if (itemState == null) {
      throw new IllegalStateException();
    }
View Full Code Here


      final String sql = "INSERT INTO items (service, model, project, state, data, key, secret) VALUES (?, ?, ?, ?, ?, ?, ?)";

      PreparedStatement ps = getJdbcConnection().prepareStatement(sql, new String[] { "id" });
      ResultSet rs = null;
      try {
        ManagedItemState managedItemState = item.state;

        setAtom(ps, 1, ServiceType.class);
        setAtom(ps, 2, ItemType.class);
        setAtom(ps, 3, ProjectId.class);
        ps.setInt(4, managedItemState.getCode());
        ps.setBytes(5, data);
        ps.setString(6, item.getId());
        ps.setBytes(7, secretData);

        int updateCount = ps.executeUpdate();
View Full Code Here

            opsContext.recurseOperation(scope, controller);

            // TODO: Should we run a verify operation before -> ACTIVE??
            // (we need to fix the states as well)

            ManagedItemState newState = finishAction(action, scope);
            if (newState != null) {
              repository.changeState(targetItemKey, newState);
              item.state = newState;
            }

            log.info("Job finished with SUCCESS");
            activeJob.setState(JobState.SUCCESS);
            return null;
          }

          private ManagedItemState finishAction(Action action, BindingScope scope) throws OpsException {
            ManagedItemState newState = null;
            if (action instanceof ConfigureAction) {
              newState = ManagedItemState.ACTIVE;
            }

            if (action instanceof ValidateAction) {
View Full Code Here

      } catch (InterruptedException e) {
        throw new IllegalStateException("Interrupted", e);
      }

      T latest = client.getItem(item.getKey(), itemClass);
      ManagedItemState state = latest.getState();
      if (exitStates.contains(state)) {
        System.out.println("Exiting; state=" + state);
        return latest;
      }
View Full Code Here

    return this.machine;
  }

  @Override
  public boolean isTerminated() {
    ManagedItemState state = machine.getState();
    log.debug("isTerminated? State=" + state);
    switch (state) {
    case DELETE_REQUESTED:
      // TODO: Not sure if this is right
      log.warn("isTerminated mapping DELETE_REQUESTED => isTerminated=true");
View Full Code Here

TOP

Related Classes of org.platformlayer.core.model.ManagedItemState

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.