/*
* 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 legal-notices/CDDLv1_0.txt
* 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 legal-notices/CDDLv1_0.txt.
* 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.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* This class provides a virtual static group implementation, in which
* membership is based on membership of another group.
*/
public class VirtualStaticGroup
extends Group<VirtualStaticGroupImplementationCfg>
{
/** The DN of the entry that holds the definition for this group. */
/** The DN of the target group that will provide membership information. */
/**
* Creates a new, uninitialized virtual static group instance. This is
* intended for internal use only.
*/
public VirtualStaticGroup()
{
super();
// No initialization is required here.
}
/**
* Creates a new virtual static 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 targetGroupDN The DN of the target group that will provide
* membership information. It must not be
* {@code null}.
*/
{
super();
this.groupEntryDN = groupEntryDN;
this.targetGroupDN = targetGroupDN;
}
/** {@inheritDoc} */
public void initializeGroupImplementation(
{
// No additional initialization is required.
}
/** {@inheritDoc} */
throws DirectoryException
{
// Get the target group DN attribute from the entry, if there is one.
{
{
for (ByteString v : a)
{
{
}
try
{
}
catch (DirectoryException de)
{
}
}
}
}
{
}
}
/** {@inheritDoc} */
throws DirectoryException
{
// FIXME -- This needs to exclude enhanced groups once we have support for
// them.
OC_VIRTUAL_STATIC_GROUP + ")");
}
/** {@inheritDoc} */
{
// FIXME -- This needs to exclude enhanced groups once we have support for
//them.
}
/** {@inheritDoc} */
{
return groupEntryDN;
}
/** {@inheritDoc} */
{
}
/**
* Retrieves the DN of the target group for this virtual static group.
*
* @return The DN of the target group for this virtual static group.
*/
{
return targetGroupDN;
}
/** {@inheritDoc} */
public boolean supportsNestedGroups()
{
// Virtual static groups don't support nesting.
return false;
}
/** {@inheritDoc} */
{
// Virtual static groups don't support nesting.
}
/** {@inheritDoc} */
{
// Virtual static groups don't support nesting.
}
/** {@inheritDoc} */
{
// Virtual static groups don't support nesting.
}
/** {@inheritDoc} */
throws DirectoryException
{
{
return false;
}
if (targetGroup == null)
{
LocalizableMessage message = ERR_VIRTUAL_STATIC_GROUP_NO_TARGET_GROUP.get(targetGroupDN, groupEntryDN);
}
else if (targetGroup instanceof VirtualStaticGroup)
{
LocalizableMessage message = ERR_VIRTUAL_STATIC_GROUP_TARGET_CANNOT_BE_VIRTUAL.get(groupEntryDN, targetGroupDN);
}
else
{
}
}
/** {@inheritDoc} */
throws DirectoryException
{
{
return false;
}
if (targetGroup == null)
{
LocalizableMessage message = ERR_VIRTUAL_STATIC_GROUP_NO_TARGET_GROUP.get(targetGroupDN, groupEntryDN);
}
else if (targetGroup instanceof VirtualStaticGroup)
{
LocalizableMessage message = ERR_VIRTUAL_STATIC_GROUP_TARGET_CANNOT_BE_VIRTUAL.get(groupEntryDN, targetGroupDN);
}
else
{
}
}
/** {@inheritDoc} */
throws DirectoryException
{
if (targetGroup == null)
{
LocalizableMessage message = ERR_VIRTUAL_STATIC_GROUP_NO_TARGET_GROUP.get(targetGroupDN, groupEntryDN);
}
else if (targetGroup instanceof VirtualStaticGroup)
{
LocalizableMessage message = ERR_VIRTUAL_STATIC_GROUP_TARGET_CANNOT_BE_VIRTUAL.get(groupEntryDN, targetGroupDN);
}
else
{
return targetGroup.getMembers();
}
}
/** {@inheritDoc} */
throws DirectoryException
{
if (targetGroup == null)
{
LocalizableMessage message = ERR_VIRTUAL_STATIC_GROUP_NO_TARGET_GROUP.get(targetGroupDN, groupEntryDN);
}
else if (targetGroup instanceof VirtualStaticGroup)
{
LocalizableMessage message = ERR_VIRTUAL_STATIC_GROUP_TARGET_CANNOT_BE_VIRTUAL.get(groupEntryDN, targetGroupDN);
}
else
{
}
}
/** {@inheritDoc} */
public boolean mayAlterMemberList()
{
return false;
}
/** {@inheritDoc} */
{
// Virtual static groups don't support altering the member list.
LocalizableMessage message = ERR_VIRTUAL_STATIC_GROUP_ALTERING_MEMBERS_NOT_SUPPORTED.get(groupEntryDN);
}
/** {@inheritDoc} */
{
// Virtual static groups don't support altering the member list.
LocalizableMessage message = ERR_VIRTUAL_STATIC_GROUP_ALTERING_MEMBERS_NOT_SUPPORTED.get(groupEntryDN);
}
/** {@inheritDoc} */
{
}
}