/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2008-2010 Sun Microsystems, Inc.
*/
/**
* This class provides a dynamic group implementation, in which
* membership is determined dynamically based on criteria provided
* in the form of one or more LDAP URLs. All dynamic groups should
* contain the groupOfURLs object class, with the memberURL attribute
* specifying the membership criteria.
*/
public class DynamicGroup
extends Group<DynamicGroupImplementationCfg>
{
/**
* The tracer object for the debug logger.
*/
// The DN of the entry that holds the definition for this group.
// The set of the LDAP URLs that define the membership criteria.
/**
* Creates a new, uninitialized dynamic group instance. This is intended for
* internal use only.
*/
public DynamicGroup()
{
super();
// No initialization is required here.
}
/**
* Creates a new dynamic group instance with the provided information.
*
* @param groupEntryDN The DN of the entry that holds the definition for
* this group. It must not be {@code null}.
* @param memberURLs The set of LDAP URLs that define the membership
* criteria for this group. It must not be
* {@code null}.
*/
{
super();
this.groupEntryDN = groupEntryDN;
this.memberURLs = memberURLs;
}
/**
* {@inheritDoc}
*/
@Override()
public void initializeGroupImplementation(
{
// No additional initialization is required.
}
/**
* {@inheritDoc}
*/
@Override()
throws DirectoryException
{
// Get the memberURL attribute from the entry, if there is one, and parse
// out the LDAP URLs that it contains.
{
{
for (AttributeValue v : a)
{
try
{
}
catch (DirectoryException de)
{
if (debugEnabled())
{
}
de.getMessageObject());
}
}
}
}
}
/**
* {@inheritDoc}
*/
@Override()
throws DirectoryException
{
// FIXME -- This needs to exclude enhanced groups once we have support for
// them.
OC_GROUP_OF_URLS + ")");
}
/**
* {@inheritDoc}
*/
@Override()
{
// FIXME -- This needs to exclude enhanced groups once we have support for
//them.
}
/**
* {@inheritDoc}
*/
@Override()
{
return groupEntryDN;
}
/**
* {@inheritDoc}
*/
{
}
/**
* Retrieves the set of member URLs for this dynamic group. The returned set
* must not be altered by the caller.
*
* @return The set of member URLs for this dynamic group.
*/
{
return memberURLs;
}
/**
* {@inheritDoc}
*/
@Override()
public boolean supportsNestedGroups()
{
// Dynamic groups don't support nesting.
return false;
}
/**
* {@inheritDoc}
*/
@Override()
{
// Dynamic groups don't support nesting.
}
/**
* {@inheritDoc}
*/
@Override()
{
// Dynamic groups don't support nesting.
}
/**
* {@inheritDoc}
*/
@Override()
{
// Dynamic groups don't support nesting.
}
/**
* {@inheritDoc}
*/
@Override()
throws DirectoryException
{
{
return false;
}
{
return false;
}
else
{
}
}
/**
* {@inheritDoc}
*/
@Override()
throws DirectoryException
{
{
return false;
}
{
{
return true;
}
}
return false;
}
/**
* {@inheritDoc}
*/
@Override()
throws DirectoryException
{
}
/**
* {@inheritDoc}
*/
@Override()
throws DirectoryException
{
{
}
else
{
filter);
}
}
/**
* {@inheritDoc}
*/
@Override()
public boolean mayAlterMemberList()
{
return false;
}
/**
* {@inheritDoc}
*/
@Override()
{
// Dynamic groups don't support altering the member list.
}
/**
* {@inheritDoc}
*/
@Override()
{
// Dynamic groups don't support altering the member list.
}
/**
* {@inheritDoc}
*/
@Override()
{
if (! memberURLs.isEmpty())
{
{
}
}
}
}