📄 lazydncollection.java
字号:
/*
* OPIAM Suite
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package opiam.admin.faare.persistence;
import opiam.admin.faare.service.UserContext;
import org.apache.log4j.Logger;
import java.util.ArrayList;
/**
* Lazy loading for dname attributes which are not business beans.
*/
public class LazyDnCollection extends LazyStringCollection
{
/** Log4J. */
private static Logger _logger = Logger.getLogger(LazyDnCollection.class.getName());
/**
* Creates a new LazyDnCollection object.
*
* @param enclosing Dname of entry containing attribute to load.
* @param atts Attribute to load.
* @param auserContext Connected user context.
*/
public LazyDnCollection(String enclosing, ArrayList atts,
UserContext auserContext)
{
super(enclosing, atts, auserContext);
}
/**
* Loads values.
*/
protected void lazyLoad()
{
try
{
ArrayList temp = (ArrayList) PersistenceLDAP.loadAttribute(getDn(), getAtt(),
getUserContext());
ArrayList dvalues = new ArrayList();
for (int i = 0; i < temp.size(); i++)
{
_logger.debug("LAZY LOAD temp.get(i) : " + temp.get(i));
if (temp.get(i) != null)
{
dvalues.add(LdapUtil.formatDN((String) temp.get(i)));
}
_logger.debug("LAZY LOAD dn format : " +
LdapUtil.formatDN((String) temp.get(i)));
}
setLoaded(true);
setValues(dvalues);
}
catch (Exception e)
{
if (_logger.isDebugEnabled())
{
_logger.debug("Trace", e);
}
throw new RuntimeException(
"PersistenceException for lazy loaded object\n" + e);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -