예제 #1
0
  @Override
  public List<RequestedHost> getRequests() {
    List<RequestedHost> requests = Lists.newArrayList();

    requests.addAll(requestDataService.getAll());

    return requests;
  }
예제 #2
0
  protected void checkManagement(RequestedHost requestedHost) {
    try {
      if (requestedHost.getStatus() == ResourceHostRegistrationStatus.REQUESTED
          && containsManagementContainer(requestedHost.getHostInfos())) {
        boolean managementAlreadyApproved = false;

        for (RequestedHostImpl requestedHostImpl : requestDataService.getAll()) {
          if (requestedHostImpl.getStatus() == ResourceHostRegistrationStatus.APPROVED
              && containsManagementContainer(requestedHostImpl.getHostInfos())) {
            managementAlreadyApproved = true;
            break;
          }
        }

        if (!managementAlreadyApproved) {
          approveRequest(requestedHost.getId());
        }
      }
    } catch (Exception e) {
      // ignore
    }
  }