Package org.wijiscommons.ssaf.process.solr

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


                  if ( (pointerItem.getPointerBase64Value() != null) ||
                      (pointerItem.getPointerHexValue() != null) ||
                          (pointerItem.getPointerUriValue() != null)
                     )
                  {
                    throw new SSAFSolrException();
                  }
                }
               
              }
            }
 
        } else {
          SSAFSolrException ssafException =  new SSAFSolrException();
          ssafException.setFatalError(SSAFSolrErrorCodes.MISSING_DATA_ERROR);
          throw ssafException;
        }
        docs.add(doc);
     
     
      // Add Docs to Server & Commit
      // Records will not be stored into Index until commit is performed.
      server.add(docs);
      server.commit();
    }
    catch (Exception e)
    {
      SSAFSolrException ssafException =  new SSAFSolrException();
      ssafException.setFatalError(SSAFSolrErrorCodes.UNABLE_TO_STASH);
      throw ssafException;
    }
  }
View Full Code Here


                        }
                    }
                );
            } catch (org.xml.sax.SAXException se) {
                se.printStackTrace();
          SSAFSolrException ssafException =  new SSAFSolrException();
          ssafException.setFatalError(SSAFSolrErrorCodes.XML_VALIDATION_ERROR);
          throw ssafException;
            }
           
            // Get Pointer from Document
            pointer = (Pointer) u.unmarshal(document);

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

                            return true;
                        }
                    }
                );
            } catch (org.xml.sax.SAXException se) {
          SSAFSolrException ssafException =  new SSAFSolrException();
          ssafException.setFatalError(SSAFSolrErrorCodes.XML_VALIDATION_ERROR);
          throw ssafException;
            }
           
            // Get Pointer Object
            pointer = (Pointer) u.unmarshal(new File(filePath));

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

        searchResult.setSearchItems(searchItems);
       
        // Return Document
        return getDocument(searchResult);
      } else {
        SSAFSolrException ssafException =  new SSAFSolrException();
        ssafException.setFatalError(SSAFSolrErrorCodes.NO_RECORDS_FOUND);
        throw ssafException;
      }
    } else {
      SSAFSolrException ssafException =  new SSAFSolrException();
      ssafException.setFatalError(SSAFSolrErrorCodes.NO_RECORDS_FOUND);
      throw ssafException;
    }
  }
View Full Code Here

      return document;
     
    }
    catch (Exception e)
    {
      SSAFSolrException ssafException =  new SSAFSolrException();
      ssafException.setFatalError(SSAFSolrErrorCodes.UNABLE_TO_CONVERT_TO_DOCUMENT);
      throw ssafException;
    }
  }
View Full Code Here

            queryString.append(value.toLowerCase().replace(' ', '_'));
          }
          recordCounter++;
        }
      } else {
        SSAFSolrException ssafException =  new SSAFSolrException();
        ssafException.setFatalError(SSAFSolrErrorCodes.NO_RECORDS_FOUND);
        throw ssafException;
      }
     
    }
   
View Full Code Here

        // If size is greater than MaxSearchResultRecords
        // then throw Exception else add to Pointer FilePath
       
        if (size == 0)
        {
          SSAFSolrException ssafException =  new SSAFSolrException();
          ssafException.setFatalError(SSAFSolrErrorCodes.NO_RECORDS_FOUND);
          throw ssafException;
        }
       
        if (size > getMaxSearchResultRecords())
        {
          SSAFSolrException ssafException =  new SSAFSolrException();
          ssafException.setFatalError(SSAFSolrErrorCodes.EXCEEDS_MAX_RETURN_RECORDS);
          throw ssafException;
        }
        else
        {
          for (int i = 0; i < docs.size(); i++)
          {
            SolrDocument doc = docs.get(i);
            String pointerPath = (String) doc.getFieldValue("pointer-filepath");
            result.add(pointerPath);
          }
        }
       
        // Return
        return result;
   
    }
    catch (SolrServerException se)
    {
      SSAFSolrException ssafException =  new SSAFSolrException();
      ssafException.setFatalError(SSAFSolrErrorCodes.EXCEEDS_MAX_RETURN_RECORDS);
      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;
            }
           
            // UnMarshall Document to SearchRequest Object
            searchRequest = (SearchRequest) u.unmarshal(document);

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

                            return true;
                        }
                    }
                );
            } catch (org.xml.sax.SAXException se) {
          SSAFSolrException ssafException =  new SSAFSolrException();
          ssafException.setFatalError(SSAFSolrErrorCodes.XML_VALIDATION_ERROR);
          throw ssafException;
            }
           
            // UnMarshall Pointer from File
            pointer = (Pointer) u.unmarshal(new File( filePath ));

    } catch( JAXBException je ) {
      je.printStackTrace();
      SSAFSolrException ssafException =  new SSAFSolrException();
      ssafException.setFatalError(SSAFSolrErrorCodes.XML_UNMARSHALL_ERROR);
      throw ssafException;
        }
   
    // Return Pointer
    return pointer;
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.