OpenIdData openIdData = new OpenIdData();
try {
User user = MetaProjectManager.getManager().getMetaProject().getUser(name);
Collection<PropertyValue> propColl = user.getPropertyValues();
for (Iterator<PropertyValue> iterator = propColl.iterator(); iterator.hasNext();) {
PropertyValue propertyValue = iterator.next();
if (propertyValue.getPropertyName().startsWith(OpenIdConstants.OPENID_PROPERTY_PREFIX)
&& propertyValue.getPropertyName().endsWith(OpenIdConstants.OPENID_PROPERTY_URL_SUFFIX)) {
String openIdAccNamePropName = propertyValue.getPropertyName().replace(
OpenIdConstants.OPENID_PROPERTY_URL_SUFFIX, OpenIdConstants.OPENID_PROPERTY_ID_SUFFIX);
String openIdProvdNamePropName = propertyValue.getPropertyName()
.replace(OpenIdConstants.OPENID_PROPERTY_URL_SUFFIX, OpenIdConstants.OPENID_PROPERTY_PROVIDER_SUFFIX);
String openIdAccNamePropValue = user.getPropertyValue(openIdAccNamePropName);
String openIdProvdNamePropValue = user.getPropertyValue(openIdProvdNamePropName);
if (propertyValue.getPropertyValue().trim().equalsIgnoreCase(opnId)) {
user.removePropertyValue(propertyValue.getPropertyName(), propertyValue.getPropertyValue());
user.removePropertyValue(openIdAccNamePropName, openIdAccNamePropValue);
user.removePropertyValue(openIdProvdNamePropName, openIdProvdNamePropValue);
}
}
}