objects.py revision 36ff035d193caeb42752394debc9f78aeaef2206
36ff035d193caeb42752394debc9f78aeaef2206gary.williams#!/usr/bin/python
36ff035d193caeb42752394debc9f78aeaef2206gary.williams
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# CDDL HEADER START
36ff035d193caeb42752394debc9f78aeaef2206gary.williams#
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# The contents of this file are subject to the terms of the
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# Common Development and Distribution License, Version 1.0 only
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# (the "License"). You may not use this file except in compliance
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# with the License.
36ff035d193caeb42752394debc9f78aeaef2206gary.williams#
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# You can obtain a copy of the license at
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# trunk/opends/resource/legal-notices/CDDLv1_0.txt
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# or http://forgerock.org/license/CDDLv1.0.html.
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# See the License for the specific language governing permissions
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# and limitations under the License.
36ff035d193caeb42752394debc9f78aeaef2206gary.williams#
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# When distributing Covered Code, include this CDDL HEADER in each
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# file and include the License file at
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# trunk/opends/resource/legal-notices/CDDLv1_0.txt. If applicable,
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# add the following below this CDDL HEADER, with the fields enclosed
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# by brackets "[]" replaced with your own identifying information:
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# Portions Copyright [yyyy] [name of copyright owner]
36ff035d193caeb42752394debc9f78aeaef2206gary.williams#
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# CDDL HEADER END
36ff035d193caeb42752394debc9f78aeaef2206gary.williams#
36ff035d193caeb42752394debc9f78aeaef2206gary.williams# Copyright 2011 ForgeRock AS.
36ff035d193caeb42752394debc9f78aeaef2206gary.williams
36ff035d193caeb42752394debc9f78aeaef2206gary.williamsclass person_entry:
36ff035d193caeb42752394debc9f78aeaef2206gary.williams def __init__(self, rdn, suffix):
36ff035d193caeb42752394debc9f78aeaef2206gary.williams self.userDn = '%s,ou=People,%s' \
36ff035d193caeb42752394debc9f78aeaef2206gary.williams % (rdn, suffix)
36ff035d193caeb42752394debc9f78aeaef2206gary.williams self.suffix = suffix
36ff035d193caeb42752394debc9f78aeaef2206gary.williams self.listAttr = []
36ff035d193caeb42752394debc9f78aeaef2206gary.williams self.listAttr.append('objectclass:top')
36ff035d193caeb42752394debc9f78aeaef2206gary.williams self.listAttr.append('objectclass:organizationalperson')
36ff035d193caeb42752394debc9f78aeaef2206gary.williams self.listAttr.append('objectclass:inetorgperson')
36ff035d193caeb42752394debc9f78aeaef2206gary.williams self.listAttr.append('objectclass:person')
36ff035d193caeb42752394debc9f78aeaef2206gary.williams def getDn(self):
36ff035d193caeb42752394debc9f78aeaef2206gary.williams return self.userDn
36ff035d193caeb42752394debc9f78aeaef2206gary.williams def getSuffix(self):
36ff035d193caeb42752394debc9f78aeaef2206gary.williams return self.suffix
36ff035d193caeb42752394debc9f78aeaef2206gary.williams def getAttrList(self):
36ff035d193caeb42752394debc9f78aeaef2206gary.williams return self.listAttr
36ff035d193caeb42752394debc9f78aeaef2206gary.williams def addAttr(self, attrType, attrValue):
36ff035d193caeb42752394debc9f78aeaef2206gary.williams self.listAttr.append('%s:%s' % (attrType, attrValue))
36ff035d193caeb42752394debc9f78aeaef2206gary.williams