public virtual ConnectorAttribute NormalizeAttribute(ObjectClass oclass, ConnectorAttribute attribute) { if (ConnectorAttributeUtil.NamesEqual(attribute.Name, Uid.NAME)) { return(new Uid(ConnectorAttributeUtil.GetStringValue(attribute).ToLower())); } return(attribute); }
public ConnectorAttribute NormalizeAttribute(ObjectClass oclass, ConnectorAttribute attribute) { if (attribute.Is("foo")) { String val = ConnectorAttributeUtil.GetStringValue(attribute); return(ConnectorAttributeBuilder.Build("foo", val.Trim())); } else { return(attribute); } }
private static IDictionary <String, Object> CreateFilter(String operation, AttributeFilter filter, bool not) { IDictionary <String, Object> dic = new Dictionary <String, Object>(); var name = filter.GetAttribute().Name; var value = ConnectorAttributeUtil.GetStringValue(filter.GetAttribute()); if (StringUtil.IsBlank(value)) { return(null); } dic.Add(Not, not); dic.Add(Operation, operation); dic.Add(Left, name); dic.Add(Right, value); return(dic); }
public virtual Uid Create(ObjectClass objectClass, ICollection <ConnectorAttribute> createAttributes, OperationOptions options) { if (ObjectClass.ACCOUNT.Equals(objectClass) || ObjectClass.GROUP.Equals(objectClass)) { Name name = ConnectorAttributeUtil.GetNameFromAttributes(createAttributes); if (name != null) { // do real create here return(new Uid(ConnectorAttributeUtil.GetStringValue(name).ToLower())); } throw new InvalidAttributeValueException("Name attribute is required"); } Trace.TraceWarning("Delete of type {0} is not supported", _configuration.ConnectorMessages.Format(objectClass.GetDisplayNameKey(), objectClass.GetObjectClassValue())); throw new NotSupportedException("Delete of type" + objectClass.GetObjectClassValue() + " is not supported"); }