Package org.wijiscommons.ssaf.process.solr

Examples of org.wijiscommons.ssaf.process.solr.SSAFSolrException


            recordRetrievalRequest =
                (RecordRetrievalRequest) unmarshaller.unmarshal(document);

    } catch( JAXBException je ) {
      je.printStackTrace();
      SSAFSolrException ssafException =
                new SSAFSolrException(SSAFSolrErrorCodes.XML_UNMARSHALL_ERROR,
                        SSAFErrorTypes.REQUEST_INVALID);
      throw ssafException;
        }
    return recordRetrievalRequest;
  }
View Full Code Here


                        result = (String) doc.getFieldValue("stash_filepath");
                    }
          }
          else if (docs.size() > 1)
          {
              SSAFSolrException ssafException =
                        new SSAFSolrException(
                                "Multiple records found which violates the unique constraint on record-uri.",
                                SSAFErrorTypes.NONLOGIC);
                    throw ssafException;
          }
        }
        // Return result
        return result;
     
    }
    catch (SolrServerException se)
    {
      se.printStackTrace();
      SSAFSolrException ssafException =
                new SSAFSolrException(SSAFSolrErrorCodes.UNABLE_TO_FETCH,
                        SSAFErrorTypes.NONLOGIC);
      throw ssafException;
    }
  }
View Full Code Here

            // return document
            return doc;
    }
    catch( JAXBException je ) {
      je.printStackTrace();
      SSAFSolrException ssafException =
                new SSAFSolrException(SSAFSolrErrorCodes.XML_MARSHALL_ERROR,
                        SSAFErrorTypes.NONLOGIC);
      throw ssafException;
        }
    catch (Exception e) {
      e.printStackTrace();
      SSAFSolrException ssafException =
                new SSAFSolrException(SSAFSolrErrorCodes.XML_MARSHALL_ERROR,
                        SSAFErrorTypes.NONLOGIC);
      throw ssafException;
      }
  }
View Full Code Here

           
            return returnValueNode;
           
        } catch (XPathExpressionException e) {
          e.printStackTrace();
          SSAFSolrException ssafException =
                new SSAFSolrException(
                        SSAFSolrErrorCodes.INVALID_XPATH_EXPRESSION,
                        SSAFErrorTypes.NONLOGIC);
      throw ssafException;
        }
       
View Full Code Here

                            return true;
                        }
                    }
                );
            } catch (org.xml.sax.SAXException se) {
          SSAFSolrException ssafException =  new SSAFSolrException();
          ssafException.setFatalError(SSAFSolrErrorCodes.XML_VALIDATION_ERROR);
          throw ssafException;
            }
           
            // create RecordRetrievalReequest Object
            recordRetrievalRequest = (RecordRetrievalRequest) u.unmarshal(document);

    } catch( JAXBException je ) {
      SSAFSolrException ssafException =  new SSAFSolrException();
      ssafException.setFatalError(SSAFSolrErrorCodes.XML_UNMARSHALL_ERROR);
      throw ssafException;
        }
    return recordRetrievalRequest;
  }
View Full Code Here

       
        // If doc size is greater than 1 then throw Exception
        if (docs != null) {
          if (docs.size() > 1)
          {
            SSAFSolrException ssafException =  new SSAFSolrException();
            ssafException.setFatalError(SSAFSolrErrorCodes.NO_RECORDS_FOUND);
            throw ssafException;
          }
          else
          {
            // Get the first record
            SolrDocument doc = docs.get(0);
            if ( doc != null)
              result = (String) doc.getFieldValue("stash-filepath");
          }
        } else {
          SSAFSolrException ssafException =  new SSAFSolrException();
          ssafException.setFatalError(SSAFSolrErrorCodes.NO_RECORDS_FOUND);
          throw ssafException;
        }
       
        // Return result
        return result;
     
    }
    catch (SolrServerException se)
    {
      SSAFSolrException ssafException =  new SSAFSolrException();
      ssafException.setFatalError(SSAFSolrErrorCodes.UNABLE_TO_FETCH);
      throw ssafException;
    }
  }
View Full Code Here

           
            // return document
            return doc;
    }
    catch( JAXBException je ) {
      SSAFSolrException ssafException =  new SSAFSolrException();
      ssafException.setFatalError(SSAFSolrErrorCodes.XML_MARSHALL_ERROR);
      throw ssafException;
        }
    catch (Exception e) {
      SSAFSolrException ssafException =  new SSAFSolrException();
      ssafException.setFatalError(SSAFSolrErrorCodes.XML_MARSHALL_ERROR);
      throw ssafException;
      }
  }
View Full Code Here

        InputStream inputStream = new FileInputStream(new File(fileName));
        org.w3c.dom.Document doc = documentBuilderFactory.newDocumentBuilder().parse(inputStream);
        return doc;
      }
      catch (Exception e) {
        SSAFSolrException ssafException =  new SSAFSolrException();
      ssafException.setFatalError(SSAFSolrErrorCodes.UNABLE_TO_CONVERT_TO_DOCUMENT);
      throw ssafException;
      }
    }
View Full Code Here

            }
           
            return returnValueNode;
           
        } catch (XPathExpressionException e) {
          SSAFSolrException ssafException =  new SSAFSolrException();
      ssafException.setFatalError(SSAFSolrErrorCodes.INVALID_XPATH_EXPRESSION);
      throw ssafException;
        }

       
       
View Full Code Here

      try {
        this.server = new CommonsHttpSolrServer( url );
      }
      catch (MalformedURLException e)
      {
        SSAFSolrException ssafException =  new SSAFSolrException();
        ssafException.setFatalError(SSAFSolrErrorCodes.ERROR_CONNECTING_SERVER);
        throw ssafException;
      }
    }
    return server;
  }
View Full Code Here

TOP

Related Classes of org.wijiscommons.ssaf.process.solr.SSAFSolrException

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.