Tabnine Logo
ImexCentralFault.getFaultCode
Code IndexAdd Tabnine to your IDE (free)

How to use
getFaultCode
method
in
edu.ucla.mbi.imex.central.ws.v20.ImexCentralFault

Best Java code snippets using edu.ucla.mbi.imex.central.ws.v20.ImexCentralFault.getFaultCode (Showing top 10 results out of 315)

origin: psidev.psi.mi.jami.bridges/jami-imexcentral

public psidev.psi.mi.jami.model.Publication fetchByIdentifier(String identifier, String source) throws BridgeFailedException {
  if(identifier == null)
    throw new IllegalArgumentException("Cannot fetch null identifier");
  if(source == null)
    throw new IllegalArgumentException("Cannot fetch null source. Cane be IMEX, DOI or PUBMED");
  try {
    Publication pub = port.getPublicationById(buildIdentifier(identifier, source));
    if (pub != null){
      return new ImexPublication(pub);
    }
  } catch ( IcentralFault f ) {
    switch( f.getFaultInfo().getFaultCode() ) {
      case NO_RECORD:
        // simply no data found, return null
        return null;
    }
    throw new BridgeFailedException("Impossible to find the publication " + identifier, f);
  }
  return null;
}
origin: uk.ac.ebi.intact.dataexchange.imex/imex-id-update

private void processImexCentralException(String publication, Exception e, IcentralFault f, ImexCentralManager imexCentralManager) {
  if( f.getFaultInfo().getFaultCode() == ImexCentralClient.USER_NOT_AUTHORIZED ) {
    ImexErrorEvent errorEvt = new ImexErrorEvent(this, ImexErrorType.user_not_authorized, publication, null, null, null, "missing/unknown user and/or missing/invalid password provided : " + e.getMessage());
    imexCentralManager.fireOnImexError(errorEvt);
  else if( f.getFaultInfo().getFaultCode() == ImexCentralClient.OPERATION_NOT_VALID ) {
    ImexErrorEvent errorEvt = new ImexErrorEvent(this, ImexErrorType.operation_not_valid, publication, null, null, null, "invalid operation : " + e.getMessage());
    imexCentralManager.fireOnImexError(errorEvt);
  else if( f.getFaultInfo().getFaultCode() == ImexCentralClient.IDENTIFIER_MISSING ) {
    ImexErrorEvent errorEvt = new ImexErrorEvent(this, ImexErrorType.identifier_missing, publication, null, null, null, "missing identifier : " + e.getMessage());
    imexCentralManager.fireOnImexError(errorEvt);
  else if( f.getFaultInfo().getFaultCode() == ImexCentralClient.IDENTIFIER_UNKNOWN ) {
    ImexErrorEvent errorEvt = new ImexErrorEvent(this, ImexErrorType.identifier_unknown, publication, null, null, null, "unrecognized identifier : " + e.getMessage());
    imexCentralManager.fireOnImexError(errorEvt);
  else if( f.getFaultInfo().getFaultCode() == ImexCentralClient.NO_RECORD ) {
    ImexErrorEvent errorEvt = new ImexErrorEvent(this, ImexErrorType.no_record, publication, null, null, null, "query returned no records : " + e.getMessage());
    imexCentralManager.fireOnImexError(errorEvt);
  else if( f.getFaultInfo().getFaultCode() == ImexCentralClient.NO_RECORD_CREATED ) {
    ImexErrorEvent errorEvt = new ImexErrorEvent(this, ImexErrorType.no_record_created, publication, null, null, null, "requested records were not created : " + e.getMessage());
    imexCentralManager.fireOnImexError(errorEvt);
  else if( f.getFaultInfo().getFaultCode() == ImexCentralClient.STATUS_UNKNOWN ) {
    ImexErrorEvent errorEvt = new ImexErrorEvent(this, ImexErrorType.status_unknown, publication, null, null, null, "unknown status : " + e.getMessage());
    imexCentralManager.fireOnImexError(errorEvt);
  else if( f.getFaultInfo().getFaultCode() == ImexCentralClient.NO_IMEX_ID ) {
origin: psidev.psi.mi.jami.bridges/jami-imexcentral

public List<psidev.psi.mi.jami.model.Publication> fetchPublicationsByStatus(String status, int first, int max) throws BridgeFailedException {
  try {
    // create holders for publication and last record
    Holder<PublicationList> pubList = new Holder<PublicationList>();
    Holder<Long> number = new Holder<Long>();
    port.getPublicationByStatus( status, first, max, pubList, number );
    if( pubList.value != null) {
      List<Publication> pubs = pubList.value.getPublication();
      List<psidev.psi.mi.jami.model.Publication> publications = new ArrayList<psidev.psi.mi.jami.model.Publication>(pubs.size());
      for (Publication pub : pubs){
        if (pub != null){
          publications.add(new ImexPublication(pub));
        }
      }
      return publications;
    }
    return Collections.EMPTY_LIST;
  } catch ( IcentralFault f ) {
    switch( f.getFaultInfo().getFaultCode() ) {
      case NO_RECORD:
        // simply no data found, return empty list
        return Collections.EMPTY_LIST;
    }
    throw new BridgeFailedException( "Error while getting publications by status: " + status, f );
  }
}
origin: uk.ac.ebi.intact.bridges/intact-imexcentral

/**
 *
 * @param identifier
 * @return the publication or null if not found.
 * @throws ImexCentralException
 */
public Publication getPublicationById( String identifier ) throws ImexCentralException {
  try {
    final Publication pub = port.getPublicationById(buildIdentifier(identifier));
    return pub;
  } catch ( IcentralFault f ) {
    switch( f.getFaultInfo().getFaultCode() ) {
      case NO_RECORD:
        // simply no data found, return null
        return null;
    }
    throw new ImexCentralException("Impossible to find the publication " + identifier, f);
  }
}
origin: psidev.psi.mi.jami.bridges/jami-imexcentral

public List<psidev.psi.mi.jami.model.Publication> fetchPublicationsByOwner(String owner, int first, int max) throws BridgeFailedException {
  try {
    // create holders for publication and last record
    Holder<PublicationList> pubList = new Holder<PublicationList>();
    Holder<Long> number = new Holder<Long>();
    port.getPublicationByOwner( owner, first, max, pubList, number );
    if( pubList.value != null) {
      List<Publication> pubs = pubList.value.getPublication();
      List<psidev.psi.mi.jami.model.Publication> publications = new ArrayList<psidev.psi.mi.jami.model.Publication>(pubs.size());
      for (Publication pub : pubs){
        if (pub != null){
          publications.add(new ImexPublication(pub));
        }
      }
      return publications;
    }
    return Collections.EMPTY_LIST;
  } catch ( IcentralFault f ) {
    switch( f.getFaultInfo().getFaultCode() ) {
      case NO_RECORD:
        // simply no data found, return empty list
        return Collections.EMPTY_LIST;
    }
    throw new BridgeFailedException( "Error while getting publications by owner: " + owner, f );
  }
}
origin: uk.ac.ebi.intact.bridges/intact-imexcentral

e.printStackTrace(  );
final int code = ( ( IcentralFault ) e.getCause() ).getFaultInfo().getFaultCode();
final String msg = ( ( IcentralFault ) e.getCause() ).getFaultInfo().getMessage();
System.out.println( "\n\n" + code + " - " + msg );
origin: uk.ac.ebi.intact.dataexchange.imex/imex-id-update

    } catch ( BridgeFailedException e ) {
      IcentralFault f = (IcentralFault) e.getCause();
      if( f.getFaultInfo().getFaultCode() == ImexCentralClient.UNKNOWN_GROUP ) {
      else if (f.getFaultInfo().getFaultCode() != ImexCentralClient.OPERATION_NOT_VALID) {
        throw e;
  if( f.getFaultInfo().getFaultCode() == ImexCentralClient.UNKNOWN_GROUP
      || f.getFaultInfo().getFaultCode() == ImexCentralClient.OPERATION_NOT_VALID ) {
    if (f.getFaultInfo().getFaultCode() == ImexCentralClient.UNKNOWN_GROUP){
      log.warn("The institution " + institution + " is not recognized in IMEx central so we will add INTACT admin group.");
      } catch ( BridgeFailedException e2 ) {
        IcentralFault f2 = (IcentralFault) e2.getCause();
        if( f2.getFaultInfo().getFaultCode() == ImexCentralClient.UNKNOWN_GROUP) {
        else if (f2.getFaultInfo().getFaultCode() != ImexCentralClient.OPERATION_NOT_VALID){
          throw e;
} catch ( BridgeFailedException e ) {
  IcentralFault f = (IcentralFault) e.getCause();
  if( f.getFaultInfo().getFaultCode() == ImexCentralClient.UNKNOWN_GROUP ) {
  else if (f.getFaultInfo().getFaultCode() != ImexCentralClient.OPERATION_NOT_VALID) {
    throw e;
origin: uk.ac.ebi.intact.bridges/intact-imexcentral

public List<Publication> getPublicationByOwner( String owner, int first, int max) throws ImexCentralException {
  try {
    // create holders for publication and last record
    Holder<PublicationList> pubList = new Holder<PublicationList>();
    Holder<Long> number = new Holder<Long>();
    port.getPublicationByOwner( owner, first, max, pubList, number );
    if( pubList.value != null) {
      return pubList.value.getPublication();
    }
    return Collections.EMPTY_LIST;
  } catch ( IcentralFault f ) {
    switch( f.getFaultInfo().getFaultCode() ) {
      case NO_RECORD:
        // simply no data found, return empty list
        return Collections.EMPTY_LIST;
    }
    throw new ImexCentralException( "Error while getting publications by owner: " + owner, f );
  }
}
origin: uk.ac.ebi.intact.bridges/intact-imexcentral

public List<Publication> getPublicationByStatus( String status, int first, int max) throws ImexCentralException {
  try {
    // create holders for publication and last record
    Holder<PublicationList> pubList = new Holder<PublicationList>();
    Holder<Long> number = new Holder<Long>();
    port.getPublicationByStatus( status, first, max, pubList, number );
    if( pubList.value != null) {
      return pubList.value.getPublication();
    }
    return Collections.EMPTY_LIST;
  } catch ( IcentralFault f ) {
    switch( f.getFaultInfo().getFaultCode() ) {
      case NO_RECORD:
        // simply no data found, return empty list
        return Collections.EMPTY_LIST;
    }
    throw new ImexCentralException( "Error while getting publications by status: " + status, f );
  }
}
origin: uk.ac.ebi.intact.dataexchange.imex/imex-id-update

if( f.getFaultInfo().getFaultCode() == ImexCentralClient.UNKNOWN_USER && !containsAdminUser(adminUserList, PHANTOM_CURATOR)) {
edu.ucla.mbi.imex.central.ws.v20ImexCentralFaultgetFaultCode

Popular methods of ImexCentralFault

  • <init>
  • setFaultCode
  • getMessage

Popular in Java

  • Running tasks concurrently on multiple threads
  • getResourceAsStream (ClassLoader)
  • getExternalFilesDir (Context)
  • getSharedPreferences (Context)
  • String (java.lang)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now