Esempio n. 1
0
 @Override
 public AffinityGroup getAffinityGroupById(int affinityGroupId) throws RuntimeException {
   try {
     return SerialUtility.prepare(
         affinityGroupManager.getById(getSessionSubject(), affinityGroupId),
         "TopologyGWTServiceImpl.getAffinityGroupById");
   } catch (Throwable t) {
     throw getExceptionToThrowToClient(t);
   }
 }
Esempio n. 2
0
 @Override
 public PageList<Agent> findAgentsByCriteria(AgentCriteria criteria) throws RuntimeException {
   try {
     return SerialUtility.prepare(
         agentManager.findAgentsByCriteria(getSessionSubject(), criteria),
         "TopologyGWTServiceImpl.findAgentsByCriteria");
   } catch (Throwable t) {
     throw getExceptionToThrowToClient(t);
   }
 }
Esempio n. 3
0
 @Override
 public List<FailoverListDetails> getFailoverListDetailsByAgentId(int agentId, PageControl pc)
     throws RuntimeException {
   try {
     return SerialUtility.prepare(
         topologyManager.getFailoverListDetailsByAgentId(getSessionSubject(), agentId, pc),
         "TopologyGWTServiceImpl.getFailoverListDetailsByAgentId");
   } catch (Throwable t) {
     throw getExceptionToThrowToClient(t);
   }
 }
Esempio n. 4
0
 @Override
 public PageList<ServerWithAgentCountComposite> getServers(PageControl pc)
     throws RuntimeException {
   try {
     return SerialUtility.prepare(
         topologyManager.getServerComposites(getSessionSubject(), pc),
         "TopologyGWTServiceImpl.getServers");
   } catch (Throwable t) {
     throw getExceptionToThrowToClient(t);
   }
 }
Esempio n. 5
0
 @Override
 public PageList<AffinityGroupCountComposite> getAffinityGroupCountComposites(
     PageControl pageControl) throws RuntimeException {
   try {
     return SerialUtility.prepare(
         affinityGroupManager.getComposites(getSessionSubject(), pageControl),
         "TopologyGWTServiceImpl.getAffinityGroupCountComposites");
   } catch (Throwable t) {
     throw getExceptionToThrowToClient(t);
   }
 }
 @Override
 public AlertDefinition updateGroupAlertDefinitions(
     AlertDefinition groupAlertDefinition, boolean purgeInternals) throws RuntimeException {
   try {
     AlertDefinition results =
         groupAlertDefManager.updateGroupAlertDefinitions(
             getSessionSubject(), groupAlertDefinition, purgeInternals);
     return SerialUtility.prepare(results, "updateGroupAlertDefinitions");
   } catch (Throwable t) {
     throw getExceptionToThrowToClient(t);
   }
 }
Esempio n. 7
0
 @Override
 public PageList<PartitionEventDetails> getPartitionEventDetails(
     int partitionEventId, PageControl pageControl) throws RuntimeException {
   try {
     return SerialUtility.prepare(
         partitionEventManager.getPartitionEventDetails(
             getSessionSubject(), partitionEventId, pageControl),
         "TopologyGWTServiceImpl.getPartitionEventDetails");
   } catch (Throwable t) {
     throw getExceptionToThrowToClient(t);
   }
 }
  @Override
  public Set<Map<String, String>> findAvailableGroupsStatus() throws RuntimeException {
    try {
      // add permissions check
      Set<Permission> globalPermissions =
          authorizationManager.getExplicitGlobalPermissions(getSessionSubject());
      Boolean accessGranted = globalPermissions.contains(Permission.MANAGE_SECURITY);

      Set<Map<String, String>> results = null;
      if (accessGranted) {
        results = ldapManager.findAvailableGroupsStatus();
      } else {
        String message =
            "User '"
                + getSessionSubject().getName()
                + "' does not have sufficient permissions to query the status of available LDAP groups request.";
        log.debug(message);
        throw new PermissionException(message);
      }
      return SerialUtility.prepare(results, "findAvailableGroups");
    } catch (Throwable t) {
      throw getExceptionToThrowToClient(t);
    }
  }
  public PageList<LdapGroup> findLdapGroupsAssignedToRole(int roleId) throws RuntimeException {
    try {
      // add permissions check
      Set<Permission> globalPermissions =
          authorizationManager.getExplicitGlobalPermissions(getSessionSubject());
      Boolean accessGranted = globalPermissions.contains(Permission.MANAGE_SECURITY);

      PageList<LdapGroup> allAssignedLdapGroups = null;
      if (accessGranted) {
        allAssignedLdapGroups =
            ldapManager.findLdapGroupsByRole(roleId, PageControl.getUnlimitedInstance());
      } else {
        String message =
            "User '"
                + getSessionSubject().getName()
                + "' does not have permissions to query LDAP group by role.";
        log.debug(message);
        throw new PermissionException(message);
      }
      return SerialUtility.prepare(allAssignedLdapGroups, "findLdapGroupsAssignedToRole");
    } catch (Throwable t) {
      throw getExceptionToThrowToClient(t);
    }
  }