Reads a group based on its name.<p>

@param dbc the current database context
@param groupname the name of the group that is to be read

@return the requested group

@throws CmsDataAccessException if operation was not successful
18311
public CmsGroup readGroup(CmsDbContext dbc, String groupname) throws CmsDataAccessException {

        CmsGroup group = null;
        // try to read group from cache
        group = m_monitor.getCachedGroup(groupname);
        if (group == null) {
            group = getUserDriver(dbc).readGroup(dbc, groupname);
            m_monitor.cacheGroup(group);
        }
        return group;
    }
199960
public void readLocks(CmsDbContext dbc) throws CmsException {

        if (OpenCms.getRunLevel() > OpenCms.RUNLEVEL_3_SHELL_ACCESS) {
            // read the locks only if the wizard is not enabled
            Map<String, CmsLock> lockCache = new HashMap<String, CmsLock>();
            List<CmsLock> locks = m_driverManager.getProjectDriver(dbc).readLocks(dbc);
            Iterator<CmsLock> itLocks = locks.iterator();
            while (itLocks.hasNext()) {
                CmsLock lock = itLocks.next();
                internalLockResource(lock, lockCache);
            }
            OpenCms.getMemoryMonitor().flushLocks(lockCache);
            m_runningInServlet = true;
        }
    }
539715
public static aaagroup_aaauser_binding[] get(nitro_service service, String groupname) throws Exception{
		aaagroup_aaauser_binding obj = new aaagroup_aaauser_binding();
		obj.set_groupname(groupname);
		aaagroup_aaauser_binding response[] = (aaagroup_aaauser_binding[]) obj.get_resources(service);
		return response;
	}
959882
public String group(String groupName) {
        int idx = groupIndex(groupName);
        if (idx < 0) {
          throw new IndexOutOfBoundsException("No group \"" + groupName + "\"");
        }
        return group(idx);
    }
38958
private String getGroupKey() {
        EntityIdentifier[] groups = null;
        try {
            groups =
                    GroupService.searchForGroups(
                            groupName, IGroupConstants.SearchMethod.DISCRETE, IPerson.class);
        } catch (GroupsException e1) {
            throw new RuntimeException(
                    "An exception occurred searching for " + "the group " + groupName + ".", e1);
        }
        if (groups == null || groups.length == 0)
            throw new RuntimeException(
                    "Group with name '"
                            + groupName
                            + "' not found for "
                            + this.getClass().getName()
                            + ". All evaluations will return false.");

        return groups[0].getKey();
    }
419980
public I_CmsGroupNameTranslation getGroupNameTranslation() {

        if (m_groupNameTranslation != null) {
            return m_groupNameTranslation;
        }
        if (m_groupTranslationClass != null) {
            try {
                m_groupNameTranslation = (I_CmsGroupNameTranslation)Class.forName(
                    m_groupTranslationClass).newInstance();
                return m_groupNameTranslation;
            } catch (ClassNotFoundException e) {
                LOG.error(e.getLocalizedMessage(), e);
            } catch (IllegalAccessException e) {
                LOG.error(e.getLocalizedMessage(), e);
            } catch (InstantiationException e) {
                LOG.error(e.getLocalizedMessage(), e);
            } catch (ClassCastException e) {
                LOG.error(e.getLocalizedMessage(), e);
            }
            m_groupNameTranslation = getDefaultGroupNameTranslation();
            return m_groupNameTranslation;
        } else {
            m_groupNameTranslation = getDefaultGroupNameTranslation();
            return m_groupNameTranslation;
        }
    }
1348348
public CmsGroup readGroupOfProject(CmsUUID project) throws Exception {

        return m_cms.readGroup(m_cms.readProject(project));
    }
1316867
public static aaagroup_auditsyslogpolicy_binding[] get(nitro_service service, String groupname) throws Exception{
		aaagroup_auditsyslogpolicy_binding obj = new aaagroup_auditsyslogpolicy_binding();
		obj.set_groupname(groupname);
		aaagroup_auditsyslogpolicy_binding response[] = (aaagroup_auditsyslogpolicy_binding[]) obj.get_resources(service);
		return response;
	}
406764
public void addUserToGroup(String username, String groupname) throws CmsException {

        m_securityManager.addUserToGroup(m_context, username, groupname, false);
    }
1286184
public Observable<Page<DatabaseAccountInner>> listByResourceGroupAsync(String resourceGroupName) {
        return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1<ServiceResponse<List<DatabaseAccountInner>>, Page<DatabaseAccountInner>>() {
            @Override
            public Page<DatabaseAccountInner> call(ServiceResponse<List<DatabaseAccountInner>> response) {
                PageImpl<DatabaseAccountInner> page = new PageImpl<>();
                page.setItems(response.body());
                return page;
            }
        });
    }
872536
public OvhInstanceGroup project_serviceName_instance_group_groupId_GET(String serviceName, String groupId, String region) throws IOException {
		String qPath = "/cloud/project/{serviceName}/instance/group/{groupId}";
		StringBuilder sb = path(qPath, serviceName, groupId);
		query(sb, "region", region);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhInstanceGroup.class);
	}
510941
@Override
    public Iterator findEntitiesForGroup(IEntityGroup group) throws GroupsException {
        Collection entities = new ArrayList();
        Connection conn = null;
        String groupID = group.getLocalKey();
        Class cls = group.getLeafType();

        try {
            conn = RDBMServices.getConnection();
            Statement stmnt = conn.createStatement();
            try {

                String query =
                        "SELECT "
                                + MEMBER_MEMBER_KEY_COLUMN
                                + " FROM "
                                + MEMBER_TABLE
                                + " WHERE "
                                + MEMBER_GROUP_ID_COLUMN
                                + " = '"
                                + groupID
                                + "' AND "
                                + MEMBER_IS_GROUP_COLUMN
                                + " = '"
                                + MEMBER_IS_ENTITY
                                + "'";

                ResultSet rs = stmnt.executeQuery(query);
                try {
                    while (rs.next()) {
                        String key = rs.getString(1);
                        IEntity e = newEntity(cls, key);
                        entities.add(e);
                    }
                } finally {
                    rs.close();
                }
            } finally {
                stmnt.close();
            }
        } catch (SQLException sqle) {
            LOG.error("Problem retrieving Entities for Group: " + group, sqle);
            throw new GroupsException("Problem retrieving Entities for Group", sqle);
        } finally {
            RDBMServices.releaseConnection(conn);
        }

        return entities.iterator();
    }
1143324
protected void internalUpdateRoleGroup(CmsDbContext dbc, String groupName, CmsRole role)
    throws CmsDataAccessException {

        if (LOG.isDebugEnabled()) {
            LOG.debug(
                Messages.get().getBundle().key(Messages.LOG_DBG_UPDATE_ROLEGROUP_2, role.getRoleName(), groupName));
        }

        CmsGroup group = readGroup(dbc, groupName);
        if ((CmsRole.valueOf(group) == null) || !CmsRole.valueOf(group).equals(role)) {
            CmsGroup roleGroup = readGroup(dbc, role.getGroupName());

            if (LOG.isDebugEnabled()) {
                LOG.debug(Messages.get().getBundle().key(Messages.LOG_DBG_UPDATE_ROLEGROUP_1, roleGroup));
            }

            // copy all users from the group to the role
            Iterator<CmsUser> it;
            try {
                // read all users, also indirect assigned
                it = m_driverManager.getUsersOfGroup(dbc, groupName, false, false, false).iterator();
            } catch (CmsException e) {
                // should never happen
                LOG.error(e.getLocalizedMessage(), e);
                // read only direct assigned users
                it = readUsersOfGroup(dbc, groupName, false).iterator();
            }
            while (it.hasNext()) {
                CmsUser user = it.next();

                if (LOG.isDebugEnabled()) {
                    LOG.debug(Messages.get().getBundle().key(Messages.LOG_DBG_UPDATE_ROLEGROUP_USER_1, user));
                }
                createUserInGroup(dbc, user.getId(), roleGroup.getId());
            }
            // set the right flags
            group.setFlags(role.getVirtualGroupFlags());
            try {
                writeGroup(dbc, group);
            } catch (Exception e) {
                LOG.error("Could not write group flags in internalUpdateRoleGroup: " + e.getLocalizedMessage(), e);
            }
        }
    }
512608
public GroupEntity getGroup(String groupName) {
		return restClient.get("groups/" + groupName, GroupEntity.class, new HashMap<String, String>());
	}
388498
public Group<E> group(String name) {
        for (Group<E> group : this.groups()) {
            if (group.expr instanceof Expression.NamedGroup<?>) {
                Expression.NamedGroup<E> namedGroup = (Expression.NamedGroup<E>) group.expr;
                if (namedGroup.name.equals(name)) {
                    return group;
                }
            }
        }

        return null;
    }
55705
protected List<CmsGroup> getGroups() throws CmsException {

        List<CmsGroup> groups = new ArrayList<CmsGroup>();
        if (getParamUser() != null) {
            groups.addAll(getCms().getGroupsOfUser(getParamUser(), false));
        } else {
            groups.addAll(OpenCms.getRoleManager().getManageableGroups(getCms(), "", true));
        }
        if (getParamFlags() != null) {
            int flags = Integer.parseInt(getParamFlags());
            CmsPrincipal.filterFlag(groups, flags);
        }
        if ((getParamOufqn() != null) && !getParamOufqn().equals("null")) {
            Iterator<CmsGroup> groupsIter = groups.iterator();
            while (groupsIter.hasNext()) {
                CmsGroup group = groupsIter.next();
                if (!group.getOuFqn().startsWith(getParamOufqn())) {
                    groupsIter.remove();
                }
            }
        }
        return groups;
    }
105875
public synchronized CounterGroup getGroup(String groupName) {
    CounterGroup grp = groups.get(groupName);
    if (grp == null) {
      grp = new CounterGroup(groupName);
      groups.put(groupName, grp);
    }
    return grp;
  }