本文整理了Java中cz.metacentrum.perun.core.api.Group.getDescription()
方法的一些代码示例,展示了Group.getDescription()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Group.getDescription()
方法的具体详情如下:
包路径:cz.metacentrum.perun.core.api.Group
类名称:Group
方法名:getDescription
暂无
代码示例来源:origin: CESNET/perun
@Override
public String serializeToString() {
StringBuilder str = new StringBuilder();
return str.append(this.getClass().getSimpleName()).append(":[").append(
"id=<").append(getId()).append(">").append(
", parentGroupId=<").append(getParentGroupId() == null ? "\\0" : getParentGroupId()).append(">").append(
", name=<").append(getName() == null ? "\\0" : BeansUtils.createEscaping(getName())).append(">").append(
", shortName=<").append(getShortName() == null ? "\\0" : BeansUtils.createEscaping(getShortName())).append(">").append(
", description=<").append(getDescription() == null ? "\\0" : BeansUtils.createEscaping(getDescription())).append(">").append(
", voId=<").append(getVoId()).append(">").append(
']').toString();
}
代码示例来源:origin: CESNET/perun
/**
* VOOTGroup represents group encoded according to the OpenSocial Social Data Specification using in VOOT protocol.
*
* @param group group
* @param voShortName short name of vo
* @param voot_membership_role membership role of person in group
*/
public VOOTGroup(Group group, String voShortName, String voot_membership_role) throws VOOTException{
//group must be in vo
if(voShortName == null) throw new VOOTException("internal_error_exception");
this.id = voShortName.concat(":").concat(group.getName());
this.title = group.getName();
this.description = group.getDescription();
this.voot_membership_role = voot_membership_role;
}
代码示例来源:origin: CESNET/perun
/**
* Update basic group attributes (name and description) in LDAP
*
* @param group group after update
*
* @throws InternalErrorException
*/
private void updateGroup(Group group) throws InternalErrorException {
Map<LdapOperation, List<Pair<String,String>>> attributes = new HashMap<>();
List<Pair<String,String>> listAttributesToBeRemoved = new ArrayList<>();
List<Pair<String,String>> listAttributesToBeReplaced = new ArrayList<>();
//change name
listAttributesToBeReplaced.add(new Pair(ldapAttrCommonName,this.group.getName()));
listAttributesToBeReplaced.add(new Pair(ldapAttrPerunUniqueGroupName, ldapConnector.getVoShortName(this.group.getVoId()) + ":" + this.group.getName()));
//change description (or remove it if there is none)
if(group.getDescription() != null && !group.getDescription().isEmpty()) {
listAttributesToBeReplaced.add(new Pair(ldapAttrDescription, this.group.getDescription()));
} else {
if(ldapConnector.groupAttributeExist(group, ldapAttrDescription)) {
listAttributesToBeRemoved.add(new Pair(ldapAttrDescription, null));
}
}
//Add all attributes which will be replaced for the group (that also mean added if not exists yet)
attributes.put(LdapOperation.REPLACE_ATTRIBUTE, listAttributesToBeReplaced);
//Add all attributes (if any) which will be removed for group
if(!listAttributesToBeReplaced.isEmpty()) attributes.put(LdapOperation.REMOVE_ATTRIBUTE, listAttributesToBeRemoved);
//update attributes in LDAP for group
updateGroupAttributes(attributes, group);
}
代码示例来源:origin: CESNET/perun
public void addGroup(Group group) throws InternalErrorException {
// Create a set of attributes
Attributes attributes = new BasicAttributes();
// Create the objectclass to add
Attribute objClasses = new BasicAttribute(EventProcessorImpl.ldapAttrObjectClass);
objClasses.add(EventProcessorImpl.objectClassTop);
objClasses.add(EventProcessorImpl.objectClassPerunGroup);
// Add attributes
attributes.put(objClasses);
attributes.put(EventProcessorImpl.ldapAttrCommonName, group.getName());
attributes.put(EventProcessorImpl.ldapAttrPerunGroupId, String.valueOf(group.getId()));
attributes.put(EventProcessorImpl.ldapAttrPerunUniqueGroupName, new String(this.getVoShortName(group.getVoId()) + ":" + group.getName()));
attributes.put(EventProcessorImpl.ldapAttrPerunVoId, String.valueOf(group.getVoId()));
if(group.getDescription() != null && !group.getDescription().isEmpty()) attributes.put(EventProcessorImpl.ldapAttrDescription, group.getDescription());
if(group.getParentGroupId() != null) {
attributes.put(EventProcessorImpl.ldapAttrPerunParentGroup, EventProcessorImpl.ldapAttrPerunGroupId + "=" + group.getParentGroupId().toString() + "," + EventProcessorImpl.ldapAttrPerunVoId + "=" + group.getVoId() + "," + ldapProperties.getLdapBase());
attributes.put(EventProcessorImpl.ldapAttrPerunParentGroupId, group.getParentGroupId().toString());
}
// Create the entry
try {
ldapTemplate.bind(getGroupDN(String.valueOf(group.getVoId()), String.valueOf(group.getId())), null, attributes);
log.debug("New entry created in LDAP: Group {} in Vo with Id=" + group.getVoId() + ".", group);
} catch (NameNotFoundException e) {
throw new InternalErrorException(e);
}
}
代码示例来源:origin: CESNET/perun
String descriptionValue = group.getDescription();
if(descriptionValue != null) {
if(descriptionValue.matches("^\\s*$")) descriptionValue = null;
代码示例来源:origin: CESNET/perun
public RichGroup(Group group, List<Attribute> attrs) {
super(group.getId(), group.getName(), group.getDescription(),
group.getCreatedAt(), group.getCreatedBy(),
group.getModifiedAt(), group.getModifiedBy(),
group.getParentGroupId(), group.getCreatedByUid(),
group.getModifiedByUid());
this.setVoId(group.getVoId());
this.groupAttributes = attrs;
}
内容来源于网络,如有侵权,请联系作者删除!