Package javax.naming.spi.DirStateFactory

Examples of javax.naming.spi.DirStateFactory.Result


        if (obj == null) {
            createSubcontext(name, attributes);
            return;
        }

        Result result = DirectoryManager.getStateToBind(obj, name, this, env,
                attributes);
        Object o = result.getObject();

        Attributes attrs = null;

        if (o instanceof Reference) {
            attrs = convertRefToAttribute((Reference) o);
        } else if (o instanceof Referenceable) {
            attrs = convertRefToAttribute(((Referenceable) o).getReference());
        } else if (o instanceof Serializable) {
            attrs = convertSerialToAttribute((Serializable) o);
        } else if (o instanceof DirContext) {
            DirContext cxt = (DirContext) o;
            attrs = cxt.getAttributes("");
        } else {
            throw new IllegalArgumentException(Messages.getString("ldap.24")); //$NON-NLS-1$
        }

        NamingEnumeration<? extends Attribute> enu = attrs.getAll();
        if (result.getAttributes() != null) {
            Attributes resultAttributes = result.getAttributes();

            while (enu.hasMore()) {
                Attribute element = enu.next();
                if (element.getID().equalsIgnoreCase("objectClass")) {
                    element = mergeAttribute(resultAttributes
View Full Code Here


            } catch (Exception e) {
                continue;
            }
            if (factory instanceof DirStateFactory) {
                // try obtain state using the DirStateFactory
                Result r = ((DirStateFactory) factory).getStateToBind(o, n, c, h, a);
                // if the result is not null, return it
                if (null != r) {
                    return r;
                }
            } else {
                // try obtain state using the StateFactory
                Object state = factory.getStateToBind(o, n, c, h);
                // if a state obtained successfully, return it
                if (null != state) {
                    return new Result(state, a);
                }
            }
        }

        // all factories failed, return the input argument o
        return new Result(o, a);
    }
View Full Code Here

            } catch (Exception e) {
                continue;
            }
            if (factory instanceof DirStateFactory) {
                // try obtain state using the DirStateFactory
                Result r = ((DirStateFactory) factory).getStateToBind(o, n, c,
                        h, a);
                // if the result is not null, return it
                if (null != r) {
                    return r;
                }
            } else {
                // try obtain state using the StateFactory
                Object state = factory.getStateToBind(o, n, c, h);
                // if a state obtained successfully, return it
                if (null != state) {
                    return new Result(state, a);
                }
            }
        }

        // all factories failed, return the input argument o
        return new Result(o, a);
    }
View Full Code Here

            } catch (Exception e) {
                continue;
            }
            if (factory instanceof DirStateFactory) {
                // try obtain state using the DirStateFactory
                Result r = ((DirStateFactory) factory).getStateToBind(o, n, c,
                        h, a);
                // if the result is not null, return it
                if (null != r) {
                    return r;
                }
            } else {
                // try obtain state using the StateFactory
                Object state = factory.getStateToBind(o, n, c, h);
                // if a state obtained successfully, return it
                if (null != state) {
                    return new Result(state, a);
                }
            }
        }

        // all factories failed, return the input argument o
        return new Result(o, a);
    }
View Full Code Here

        if (obj == null) {
            createSubcontext(name, attributes);
            return;
        }

        Result result = DirectoryManager.getStateToBind(obj, name, this, env,
                attributes);
        Object o = result.getObject();

        Attributes attrs = null;

        if (o instanceof Reference) {
            attrs = convertRefToAttribute((Reference) o);
        } else if (o instanceof Referenceable) {
            attrs = convertRefToAttribute(((Referenceable) o).getReference());
        } else if (o instanceof Serializable) {
            attrs = convertSerialToAttribute((Serializable) o);
        } else if (o instanceof DirContext) {
            DirContext cxt = (DirContext) o;
            attrs = cxt.getAttributes("");
        } else {
            throw new IllegalArgumentException(Messages.getString("ldap.24")); //$NON-NLS-1$
        }

        NamingEnumeration<? extends Attribute> enu = attrs.getAll();
        if (result.getAttributes() != null) {
            Attributes resultAttributes = result.getAttributes();

            while (enu.hasMore()) {
                Attribute element = enu.next();
                if (element.getID().equalsIgnoreCase("objectClass")) {
                    element = mergeAttribute(resultAttributes
View Full Code Here

        if (obj == null) {
            createSubcontext(name, attributes);
            return;
        }

        Result result = DirectoryManager.getStateToBind(obj, name, this, env,
                attributes);
        Object o = result.getObject();

        Attributes attrs = null;

        if (o instanceof Reference) {
            attrs = convertRefToAttribute((Reference) o);
        } else if (o instanceof Referenceable) {
            attrs = convertRefToAttribute(((Referenceable) o).getReference());
        } else if (o instanceof Serializable) {
            attrs = convertSerialToAttribute((Serializable) o);
        } else if (o instanceof DirContext) {
            DirContext cxt = (DirContext) o;
            attrs = cxt.getAttributes("");
        } else {
            throw new IllegalArgumentException(Messages.getString("ldap.24")); //$NON-NLS-1$
        }

        NamingEnumeration<? extends Attribute> enu = attrs.getAll();
        if (result.getAttributes() != null) {
            Attributes resultAttributes = result.getAttributes();

            while (enu.hasMore()) {
                Attribute element = enu.next();
                if (element.getID().equalsIgnoreCase("objectClass")) {
                    element = mergeAttribute(resultAttributes
View Full Code Here

TOP

Related Classes of javax.naming.spi.DirStateFactory.Result

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.