Package javax.naming

Examples of javax.naming.CommunicationException


        LdapMessage message = null;
        try {
            message = client.doOperation(op, requestControls);
        } catch (IOException e) {
            CommunicationException ex = new CommunicationException(e
                    .getMessage());
            ex.setRootCause(e);
            if (op.getSearchResult() == null || op.getSearchResult().isEmpty()) {
                throw ex;
            }
            op.getSearchResult().setException(ex);
            // occurs errors, just return, doesn't deal with referral and
View Full Code Here


                client = LdapClient.newInstance(address, port, env);
                try {
                    doBindOperation(connCtls);
                } catch (IOException e) {
                    CommunicationException ex = new CommunicationException();
                    ex.setRootCause(e);
                    throw ex;
                }
            } else {

                reconnect(connCtls);
View Full Code Here

    protected void doBasicOperation(LdapOperation op) throws NamingException {
        LdapMessage message = null;
        try {
            message = client.doOperation(op, requestControls);
        } catch (IOException e) {
            CommunicationException ex = new CommunicationException();
            ex.setRootCause(e);
            // operation failed, clear responseControls
            responseControls = null;
            throw ex;
        }
View Full Code Here

        });

        try {
            return client.addPersistentSearch(op);
        } catch (IOException e) {
            CommunicationException ex = new CommunicationException();
            ex.setRootCause(e);
            throw ex;
        }
    }
View Full Code Here

        try {
            for (Integer id : idList) {
                client.removePersistentSearch(id.intValue(), requestControls);
            }
        } catch (IOException e) {
            CommunicationException ex = new CommunicationException();
            ex.setRootCause(e);
        }
    }
View Full Code Here

        initial(client, environment, dn);

        try {
            doBindOperation(connCtls);
        } catch (IOException e) {
            CommunicationException ex = new CommunicationException();
            ex.setRootCause(e);
            throw ex;
        }
    }
View Full Code Here

    public void reconnect(Control[] ac) throws NamingException {
        connCtls = ac;
        try {
            doBindOperation(connCtls);
        } catch (IOException e) {
            CommunicationException ex = new CommunicationException();
            ex.setRootCause(e);
            throw ex;
        }
    }
View Full Code Here

            search = new SearchOp("", searchControls, filter);

            try {
                client.doOperation(search, requestControls);
            } catch (IOException e) {
                CommunicationException ex = new CommunicationException(e
                        .getMessage());
                ex.setRootCause(e);
                if (search.getSearchResult().isEmpty()) {
                    throw ex;
                }
                search.getSearchResult().setException(ex);
            }

            sre = search.getSearchResult();
            names = sre.getEntries();

            keyset = names.keySet();
            schemaRoot: for (Iterator<String> iterator = keyset.iterator(); iterator
                    .hasNext();) {
                String key = iterator.next();
                Attributes as = names.get(key);
                NamingEnumeration<String> ids = as.getIDs();
                while (ids.hasMore()) {
                    String id = ids.next();
                    if (id.equalsIgnoreCase("subschemasubentry")) {
                        subschemasubentry = (String) as.get(id).get();
                        break schemaRoot;
                    }
                }
            }
        }

        searchControls.setSearchScope(SearchControls.OBJECT_SCOPE);
        searchControls.setReturningAttributes(new String[] { "objectclasses",
                "attributetypes", "matchingrules", "ldapsyntaxes" });
        searchControls.setReturningObjFlag(true);
        filterParser = new FilterParser("(objectClass=subschema)");
        try {
            filter = filterParser.parse();
        } catch (ParseException e) {
            InvalidSearchFilterException ex = new InvalidSearchFilterException(
                    Messages.getString("ldap.29")); //$NON-NLS-1$
            ex.setRootCause(e);
            throw ex;
        }
        search = new SearchOp(subschemasubentry, searchControls, filter);

        try {
            client.doOperation(search, requestControls);
        } catch (IOException e) {
            CommunicationException ex = new CommunicationException(e
                    .getMessage());
            ex.setRootCause(e);
            if (search.getSearchResult().isEmpty()) {
                throw ex;
            }
            search.getSearchResult().setException(ex);
        }
View Full Code Here

        String n = "urn:eda:rmi:" + (String) i.next();
        org.apache.oodt.commons.Service server = (org.apache.oodt.commons.Service) lookup(n);
        try {
          return new NameClassPair(n, server.getServerInterfaceName());
        } catch (RemoteException ex) {
          throw new CommunicationException(ex.getMessage());
        }
      }
      public boolean hasMoreElements() {
        return hasMore();
      }
View Full Code Here

        try {
            namespace = createNamespace(_provider.getNameParser());
        } catch (NamingException exception) {
            throw exception;
        } catch (Exception exception) {
            throw new CommunicationException(exception.toString());
        }

        environment.put(RemoteContext.NAMING_PROVIDER, _provider);
        environment.put(RemoteContext.NAMESPACE, namespace);
View Full Code Here

TOP

Related Classes of javax.naming.CommunicationException

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.