/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: PCMappingTable.java,v 1.3 2009/01/28 05:34:50 ww203982 Exp $
*
* Portions Copyrighted 2011-2015 ForgeRock AS.
*/
/**
* Package class to manage the mapping table between user and people container
* of an organization. Right now, we store the mapping table as an entry right
* under the organization.
*/
}
/**
* Gets the PCMappingTable associated with the given organization
*
* @param org
* organization to be managed
* @return PCMappingTable associated with the given organization
* @exception UMSException
* Failure
*/
throws UMSException {
null);
if (results.hasMoreElements()) {
} else {
// Create an entry to store the mapping table if it is
// not already existed.
// Right now, we store the mapping table as an entry right under
// the organization.
po = new PersistentObject();
"extensibleobject" }));
// po.save( org.getPrincipal(), "ou", org.getGuid() );
}
return mt;
}
/**
* Gets People Container associated with the user
*
* @param user
* user object to look up
* @return guid identifying People Container associated with the user, null
* if no match found and default has not been set
* @exception UMSException
* Failure
*/
}
while (e1.hasMoreElements()) {
// loop through filterAttrSet and compare each one to the
// user's AttrSet
while (e2.hasMoreElements()) {
.getStringValues();
return guid;
}
}
}
}
}
}
return defaultPC;
}
/**
* Adds rule for determining which People Container the user is supposed to
* be in.
*
* @param filter
* filter representation of the rule
* @param guid
* guid of the People Container which the rule is applied to
* @exception UMSException
* Failure
*/
}
/**
* Removes the rule with the given filter string applying to the given
* People Container guid.
*
* @param filter
* filter string of the rule to be removed
* @param guid
* guid of which the rule applies to
* @exception UMSException
* Failure
*/
}
/**
* Sets the default People Container.
*
* @param guid
* guid of the default People Container
* @exception UMSException
* Failure
*/
}
/**
* Gets the default People Container from the given attribute set.
*
* @param attrSet
* attribute set to get from
* @return guid identifing the default People Container from the given
* attribute set.
*/
}
return null;
}
/**
* Gets the attribute set correspondent to the filter string. Only accepts
* filter string with the following format:
*
* <PRE>
*
* <filter> ::= <and> | <item> <and> ::= '(' '&'
* <itemlist> ')' <itemlist> ::= <item> | <item>
* <itemlist> <item> ::= '(' <attr> '=' <value> ')'
*
* </PRE>
*
* @param filter
* filter string to parse
* @return the attribute set correspondent to the filter string
*/
f.trim();
}
// TODO: should throw an exception: invalid pc filter
return null;
}
if (f.startsWith("&")) {
int level = 0;
int start = 0;
int end = 0;
for (int i = 0; i < f.length(); i++) {
if (f.charAt(i) == '(') {
if (level == 0) {
start = i;
}
level++;
}
if (f.charAt(i) == ')') {
level--;
if (level == 0) {
end = i;
}
if (idx == -1) {
return null;
}
}
}
}
} else {
if (idx == -1) {
return null;
}
}
return attrSet;
}
"default" };
}