Java Code Examples for javax.naming.spi.ResolveResult#getResolvedObj()

The following examples show how to use javax.naming.spi.ResolveResult#getResolvedObj() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GenericURLContext.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void rename(String oldName, String newName) throws NamingException {
    String oldPrefix = getURLPrefix(oldName);
    String newPrefix = getURLPrefix(newName);
    if (!urlEquals(oldPrefix, newPrefix)) {
        throw new OperationNotSupportedException(
            "Renaming using different URL prefixes not supported : " +
            oldName + " " + newName);
    }

    ResolveResult res = getRootURLContext(oldName, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        ctx.rename(res.getRemainingName(), getURLSuffix(newPrefix, newName));
    } finally {
        ctx.close();
    }
}
 
Example 2
Source File: GenericURLContext.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Object lookupLink(String name) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        return ctx.lookupLink(res.getRemainingName());
    } finally {
        ctx.close();
    }
}
 
Example 3
Source File: GenericURLDirContext.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void bind(String name, Object obj, Attributes attrs)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            ctx.bind(res.getRemainingName(), obj, attrs);
        } finally {
            ctx.close();
        }
}
 
Example 4
Source File: GenericURLContext.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void unbind(String name) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        ctx.unbind(res.getRemainingName());
    } finally {
        ctx.close();
    }
}
 
Example 5
Source File: GenericURLDirContext.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public DirContext createSubcontext(String name, Attributes attrs)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return ctx.createSubcontext(res.getRemainingName(), attrs);
        } finally {
            ctx.close();
        }
}
 
Example 6
Source File: GenericURLContext.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void bind(String name, Object obj) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        ctx.bind(res.getRemainingName(), obj);
    } finally {
        ctx.close();
    }
}
 
Example 7
Source File: GenericURLDirContext.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Attributes getAttributes(String name) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    DirContext ctx = (DirContext)res.getResolvedObj();
    try {
        return ctx.getAttributes(res.getRemainingName());
    } finally {
        ctx.close();
    }
}
 
Example 8
Source File: GenericURLDirContext.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void bind(String name, Object obj, Attributes attrs)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            ctx.bind(res.getRemainingName(), obj, attrs);
        } finally {
            ctx.close();
        }
}
 
Example 9
Source File: GenericURLDirContext.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public NamingEnumeration<SearchResult> search(String name,
    String filter,
    SearchControls cons)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return ctx.search(res.getRemainingName(), filter, cons);
        } finally {
            ctx.close();
        }
}
 
Example 10
Source File: GenericURLContext.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void rebind(String name, Object obj) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        ctx.rebind(res.getRemainingName(), obj);
    } finally {
        ctx.close();
    }
}
 
Example 11
Source File: GenericURLContext.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void unbind(String name) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        ctx.unbind(res.getRemainingName());
    } finally {
        ctx.close();
    }
}
 
Example 12
Source File: GenericURLDirContext.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public DirContext getSchemaClassDefinition(String name)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return ctx.getSchemaClassDefinition(res.getRemainingName());
        } finally {
            ctx.close();
        }
}
 
Example 13
Source File: ldapURLContext.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private NamingEnumeration<SearchResult> searchUsingURL(String name)
    throws NamingException {

    LdapURL url = new LdapURL(name);

    ResolveResult res = getRootURLContext(name, myEnv);
    DirContext ctx = (DirContext)res.getResolvedObj();
    try {
        return ctx.search(res.getRemainingName(),
                          setFilterUsingURL(url),
                          setSearchControlsUsingURL(url));
    } finally {
        ctx.close();
    }
}
 
Example 14
Source File: GenericURLContext.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public NamingEnumeration<NameClassPair> list(String name)   throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        return ctx.list(res.getRemainingName());
    } finally {
        ctx.close();
    }
}
 
Example 15
Source File: GenericURLContext.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public NamingEnumeration<Binding> listBindings(String name)
    throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        return ctx.listBindings(res.getRemainingName());
    } finally {
        ctx.close();
    }
}
 
Example 16
Source File: GenericURLDirContext.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public NamingEnumeration<SearchResult> search(String name,
    String filter,
    SearchControls cons)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return ctx.search(res.getRemainingName(), filter, cons);
        } finally {
            ctx.close();
        }
}
 
Example 17
Source File: GenericURLDirContext.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public NamingEnumeration<SearchResult> search(String name,
    Attributes matchingAttributes)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return ctx.search(res.getRemainingName(), matchingAttributes);
        } finally {
            ctx.close();
        }
}
 
Example 18
Source File: GenericURLDirContext.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void modifyAttributes(String name, int mod_op, Attributes attrs)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            ctx.modifyAttributes(res.getRemainingName(), mod_op, attrs);
        } finally {
            ctx.close();
        }
}
 
Example 19
Source File: GenericURLContext.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void destroySubcontext(String name) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        ctx.destroySubcontext(res.getRemainingName());
    } finally {
        ctx.close();
    }
}
 
Example 20
Source File: GenericURLDirContext.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public Attributes getAttributes(String name) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    DirContext ctx = (DirContext)res.getResolvedObj();
    try {
        return ctx.getAttributes(res.getRemainingName());
    } finally {
        ctx.close();
    }
}