public ConnectorObject(ObjectClass objectClass, ICollection<ConnectorAttribute> attrs)
{
if (objectClass == null)
{
throw new ArgumentException("ObjectClass may not be null");
}
if (ObjectClass.ALL.Equals(objectClass))
{
throw new System.ArgumentException("Connector object class can not be type of __ALL__");
}
if (attrs == null || attrs.Count == 0)
{
throw new ArgumentException("attrs cannot be empty or null.");
}
_objectClass = objectClass;
_attrs =
CollectionUtil.NewReadOnlyDictionary(attrs,
value => { return value.Name; });
if (!_attrs.ContainsKey(Uid.NAME))
{
const String MSG = "The ConnectorAttribute set must contain a Uid.";
throw new ArgumentException(MSG);
}
if (!_attrs.ContainsKey(Name.NAME))
{
const string MSG = "The ConnectorAttribute set must contain a Name.";
throw new ArgumentException(MSG);
}
}