Package xregistry

Examples of xregistry.XregistryException


            while(results.next()){
                String userID = results.getString(USERID);
                users.add(userID);
            }
        }catch(SQLException e){
            throw new XregistryException(e);
        }finally{
            context.closeConnection(connection);
        }
        return Utils.toStrListToArray(users);
    }
View Full Code Here


            while(results.next()){
                String groupId = results.getString(GROUPID);
                groups.add(groupId);
            }
        }catch(SQLException e){
            throw new XregistryException(e);
        }finally{
            context.closeConnection(connection);
        }
        return Utils.toStrListToArray(groups);
    }
View Full Code Here

            while(results.next()){
                String groupId = results.getString(GROUPID);
                groups.add(groupId);
            }
        } catch (SQLException e) {
            throw new XregistryException(e);
        }finally{
            context.closeConnection(connection);
        }
        return Utils.toStrListToArray(groups);
    }
View Full Code Here

                actor.setIsUser(false);
                actorList.add(actor);
            }
           
        } catch (SQLException e) {
            throw new XregistryException(e);
        }finally{
            context.closeConnection(connection);
        }
        return actorList.toArray(new Actor[0]);       
    }
View Full Code Here

                        if(gssCredntial instanceof GlobusGSSCredentialImpl){
                            GlobusCredential globusCred = ((GlobusGSSCredentialImpl)gssCredntial).getGlobusCredential();
                            TrustedCertificates tc = TrustedCertificates.getDefaultTrustedCertificates();
                            if (tc == null)
                            {
                                throw new XregistryException("Trusted certificates is null");
                            }
                            X509Certificate[] certs = tc.getCertificates();
                            ctx.setTrustedCertificates(certs);
                            ctx.setCredential(globusCred);
                        }else{
                            throw new XregistryException("Can not find the credantial to start a secure server");
                        }
                    } catch (RuntimeException e) {
                        throw new XregistryException("Secuirty is enabled, but no credentials found");
                    }
                }

            }
            //This is to provide rest support
//            HttpBasedServices httpServices;
//            XregistryXmlBeansWrapper xregistryXmlBeansWrapper = new XregistryXmlBeansWrapper(globalContext);
//            if(ctx != null){
//                ServerSocketFactory secureSocketFactory = new PuretlsServerSocketFactory(port, ctx);
//                httpServices = new XregistryHttpbasedServices(secureSocketFactory,xregistryXmlBeansWrapper.getRegistryImpl());
//            }else{
//                httpServices = new XregistryHttpbasedServices(port,xregistryXmlBeansWrapper.getRegistryImpl());
//            }
//            String cwsdlLoc = Thread.currentThread().getContextClassLoader().getResource("xregistry.wsdl").toString();
//           
//
//            ExtendedXbeanBasedService service = new ExtendedXbeanBasedService("xregistry", cwsdlLoc,
//                    xregistryXmlBeansWrapper);
//            cmsvc = httpServices.addService(service);
//            service.addHandler(new xsul.xhandler_context.ServerContextAccessHandler("service-context"));
//            //service.startService();
//            service.initManagmentAgent();
           
            XregistryXmlBeansWrapper xregistryXmlBeansWrapper = new XregistryXmlBeansWrapper(globalContext);
            HttpBasedServices httpServices;
            if(ctx != null){
                ServerSocketFactory secureSocketFactory = new PuretlsServerSocketFactory(port, ctx);
                httpServices = new XregistryHttpbasedServices(secureSocketFactory,xregistryXmlBeansWrapper.getRegistryImpl());
            }else{
                httpServices = new XregistryHttpbasedServices(port,xregistryXmlBeansWrapper.getRegistryImpl());
            }
            String cwsdlLoc = Thread.currentThread().getContextClassLoader().getResource("xregistry.wsdl").toString();
           
           
            XmlBeansBasedService xbeanBasedService = new XmlBeansBasedService("xregistry", cwsdlLoc,
                    xregistryXmlBeansWrapper);
            cmsvc = httpServices.addService(xbeanBasedService)
            .addHandler(new xsul.xhandler_context.ServerContextAccessHandler("service-context"));
           
            System.out.println("Server started on "+httpServices.getServer().getLocation());
        } catch (HttpServerException e) {
            throw new XregistryException(e);
        } catch (DynamicInfosetProcessorException e) {
            throw new XregistryException(e);
        } catch (FileNotFoundException e) {
            throw new XregistryException(e);
        } catch (IOException e) {
            throw new XregistryException(e);
        } catch (GeneralSecurityException e) {
            throw new XregistryException(e);
        }
    }
View Full Code Here

            AbstractShell shell;
            if (args.length > 0) {
                shell = new AdminShell(args[0]);
                shell.runTheShell();
            } else {
                throw new XregistryException(
                        "initialization Command DocumentRegistryShell <registry-shell-wsdl-url>");
            }
        } catch (XregistryException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here

            AbstractShell shell;
            if (args.length > 0) {
                shell = new DocumentRegistryShell(args[0]);
                shell.runTheShell();
            } else {
                throw new XregistryException(
                        "initialization Command DocumentRegistryShell <registry-shell-wsdl-url>");
            }
        } catch (XregistryException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here

                    Class.forName(jdbcDriver);
                    Connection connection;
                            connection = DriverManager.getConnection(jdbcUrl);
                    return connection;
                } catch (ClassNotFoundException e) {
                    throw new XregistryException(e);                   
                } catch (SQLException e) {
                    throw new XregistryException(e);
                }
}
View Full Code Here

                        break;
                    case Long:
                        statement.setLong(i + 1, Long.parseLong(param.getValue()));
                        break;
                    default:
                        throw new XregistryException("Unknown SQL param type " + param.getType());
                    }
                }
                statement.executeUpdate();
                log.info("Execuate SQL " + statement);
                connection.commit();
                return resourceID;
            } catch (Throwable e) {
                connection.rollback();
                throw new XregistryException(e);
            } finally {
               try {
              statement.close();
              connection.setAutoCommit(true);
                     globalContext.closeConnection(connection);
            } catch (SQLException e) {
               throw new XregistryException(e);
            }
            }
        } catch (SQLException e) {
            throw new XregistryException(e);
        }
    }
View Full Code Here

            if (results.next()) {
                docToReturn = results.getString(returnedRow);
            }
            return docToReturn;
        } catch (SQLException e) {
            throw new XregistryException(e);
        } finally {
           try {
               results.close();
             statement.close();
           connection.setAutoCommit(true);
                globalContext.closeConnection(connection);
         } catch (SQLException e) {
            throw new XregistryException(e);
         }
        }
    }
View Full Code Here

TOP

Related Classes of xregistry.XregistryException

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.