Examples of ResolveResult


Examples of javax.naming.spi.ResolveResult

   *     if object did not supply all mandatory attributes
   * @throws  NamingException if a naming exception is encountered
   */
  public void rebind(String name, Object obj) throws NamingException {
    // Retrieve the correct context for this name
    ResolveResult r = findContextFor(name);
    Context ctx = (Context) r.getResolvedObj();
    String rname = r.getRemainingName().toString();

    // Rebind the name in its proper context
    ctx.rebind(rname, obj);
  }
View Full Code Here

Examples of javax.naming.spi.ResolveResult

   * @throws  NameNotFoundException if an intermediate context does not exist
   * @throws  NamingException if a naming exception is encountered
   */
  public void unbind(String name) throws NamingException {
    // Retrieve the correct context for this name
    ResolveResult r = findContextFor(name);
    Context ctx = (Context) r.getResolvedObj();
    String rname = r.getRemainingName().toString();

    // Unbind the name in its proper context
    ctx.unbind(rname);
  }
View Full Code Here

Examples of javax.naming.spi.ResolveResult

   *    enumeration is of type NameClassPair.
   * @throws  NamingException if a naming exception is encountered
   */
  public NamingEnumeration list(String name) throws NamingException {
    // Retrieve the correct context to resolve the reminding name
    ResolveResult r = findContextFor(name);
    Context ctx = (Context) r.getResolvedObj();
    String rname = r.getRemainingName().toString();

    // List the correct Context
    return ctx.list(rname);
  }
View Full Code Here

Examples of javax.naming.spi.ResolveResult

   *    Binding.
   * @throws  NamingException if a naming exception is encountered
   */
  public NamingEnumeration listBindings(String name) throws NamingException {
    // Retrieve the correct context to resolve the reminding name
    ResolveResult r = findContextFor(name);
    Context ctx = (Context) r.getResolvedObj();
    String rname = r.getRemainingName().toString();

    // List the correct Context
    return ctx.listBindings(rname);
  }
View Full Code Here

Examples of javax.naming.spi.ResolveResult

   *    mandatory attributes
   * @throws  NamingException if a naming exception is encountered
   */
  public Context createSubcontext(String name) throws NamingException {
    // Retrieve the correct context to resolve the reminding name
    ResolveResult r = findContextFor(name);
    Context ctx = (Context) r.getResolvedObj();
    String rname = r.getRemainingName().toString();
   
    // create subcontext
    return ctx.createSubcontext(rname);
  }
View Full Code Here

Examples of javax.naming.spi.ResolveResult

    if (name.equals("")) {
      return new hascnURLContext(myEnv);
    }

    // Retrieve the correct context to resolve the reminding name
    ResolveResult r = findContextFor(name);
    Context ctx = (Context) r.getResolvedObj();
    String rname = r.getRemainingName().toString();

    // Resolve the name in its proper context
    return ctx.lookupLink(rname);
  }
View Full Code Here

Examples of javax.naming.spi.ResolveResult

        // rest is the INS name
        // Return the parsed form to prevent subsequent lookup
        // from parsing the string as a composite name
        // The caller should be aware that a toString() of the name
        // will yield its INS syntax, rather than a composite syntax
        return new ResolveResult(ctx, parser.parse(rest));
    }
View Full Code Here

Examples of javax.naming.spi.ResolveResult

                result = continuationContext.lookup(cpe.getRemainingName());
            }
        }

        if (result instanceof ResolveResult) {
            final ResolveResult resolveResult = (ResolveResult) result;
            final Object resolvedObject = resolveResult.getResolvedObj();

            Object context;
            if (resolvedObject instanceof Context){
                context = resolvedObject;
            } else if (resolvedObject instanceof LinkRef) {
                context = resolveLink(resolvedObject,dereference);
            } else {
                context = getObjectInstance(resolvedObject, absoluteName, environment);
            }
            if (!(context instanceof Context)) {
                throw notAContextException(absoluteName.getPrefix(absoluteName.size() - resolveResult.getRemainingName().size()));
            }
            final Context namingContext = (Context) context;
            if (namingContext instanceof NamingContext) {
                return ((NamingContext)namingContext).lookup(resolveResult.getRemainingName(), dereference);
            } else {
                return namingContext.lookup(resolveResult.getRemainingName());
            }
        } else if (result instanceof LinkRef) {
            result = resolveLink(result,dereference);
        } else if (result instanceof Reference) {
            result = getObjectInstance(result, absoluteName, environment);
View Full Code Here

Examples of javax.naming.spi.ResolveResult

        protected Object foundReferenceInsteadOfContext(final BindingNode bindingNode) throws NamingException {
            final Name remainingName = targetName.getSuffix(bindingNode.fullName.size());
            final Object boundObject = bindingNode.binding.getObject();
            checkReferenceForContinuation(remainingName, boundObject);
            return new ResolveResult(boundObject, remainingName);
        }
View Full Code Here

Examples of javax.naming.spi.ResolveResult

    public void testGetRootURLContext() throws Exception {
        MockLdapURLContext context = new MockLdapURLContext();
        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_BIND_RESPONSE, new BindResponse(), null) });

        ResolveResult result = context.getRootURLContext(server.getURL(), null);

        assertEquals("", result.getRemainingName().toString());
        assertTrue(result.getResolvedObj() instanceof LdapContextImpl);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.