use of org.eclipse.ecf.bulletinboard.IMemberGroup in project ecf by eclipse.
the class AbstractParser method parseMemberGroups.
public Map<ID, IMemberGroup> parseMemberGroups(final CharSequence seq) throws BBException {
Matcher m = getMemberGroupContainerPattern().matcher(seq);
if (m.find()) {
// TODO is stripHTMLTrim needed? GenericParser doesn't do it
Map<ID, IBBObject> objects = genericParser.parseMultiIdName(getMemberGroupPattern(), m.group(0), getMemberGroupFactory(), true);
Map<ID, IMemberGroup> members = new LinkedHashMap<ID, IMemberGroup>(objects.size());
for (IBBObject obj : objects.values()) {
members.put(obj.getID(), (IMemberGroup) obj);
}
return members;
} else {
throwException("Could not find member groups.", seq);
}
return Collections.emptyMap();
}
use of org.eclipse.ecf.bulletinboard.IMemberGroup in project ecf by eclipse.
the class AbstractBulletinBoard method getMemberGroups.
public Collection<IMemberGroup> getMemberGroups() throws BBException {
if (cachedMemberGroups.isEmpty()) {
final WebRequest request = createMemberGroupListRequest();
try {
request.execute();
final String str = request.getResponseBodyAsString();
request.releaseConnection();
cachedMemberGroups = parser.parseMemberGroups(str);
for (final IMemberGroup grp : cachedMemberGroups.values()) {
((AbstractBBObject) grp).setBulletinBoard(this);
}
} catch (final IOException e) {
// log.error(e);
}
}
return new HashSet<IMemberGroup>(cachedMemberGroups.values());
}
Aggregations