当前位置: 首页>>代码示例>>Java>>正文


Java EZIDException类代码示例

本文整理汇总了Java中edu.ucsb.nceas.ezid.EZIDException的典型用法代码示例。如果您正苦于以下问题:Java EZIDException类的具体用法?Java EZIDException怎么用?Java EZIDException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EZIDException类属于edu.ucsb.nceas.ezid包,在下文中一共展示了EZIDException类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createIdentifier

import edu.ucsb.nceas.ezid.EZIDException; //导入依赖的package包/类
public String createIdentifier(Dataset dataset) {
    String retString = "";
    String identifier = getIdentifierFromDataset(dataset);
    HashMap metadata = getMetadataFromStudyForCreateIndicator(dataset);
    metadata.put("_status", "reserved");;       
    try {
        retString = ezidService.createIdentifier(identifier, metadata);
        logger.log(Level.FINE, "create DOI identifier retString : " + retString);
    } catch (EZIDException e) {
        logger.log(Level.INFO, "Identifier not created: create failed");
        logger.log(Level.INFO, "String " + e.toString());
        logger.log(Level.INFO, "localized message " + e.getLocalizedMessage());
        logger.log(Level.INFO, "cause " + e.getCause());
        logger.log(Level.INFO, "message " + e.getMessage());
        return "Identifier not created "  +  e.getLocalizedMessage();
    }
    return retString;
}
 
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:19,代码来源:DOIEZIdServiceBean.java

示例2: getMoreEzids

import edu.ucsb.nceas.ezid.EZIDException; //导入依赖的package包/类
private void getMoreEzids() {
      replenishingCache=true;
      EZIDClient client = new EZIDClient(serviceUrl);
      boolean shouldRetry;
      int retryCounter = 0;
do {
          retryCounter++;
          log.debug("Minting ids from " + serviceUrl);
          try {
              client.login(userName, userPassword);
              for (Integer i = 1; !ezids.containsKey(i) && i <= maxStoreSize; i++) {
                  ezids.put(i, client.mintIdentifier(idPrefix,null));
              }
          } catch (EZIDException e) {//thrown by client.mintIdentifier()
              log.error("Could not mint EZID for shoulder " + idPrefix, e.getMessage());
          } finally {
              client.shutdown();
              replenishingCache = false;
          }

          shouldRetry = ((retryCounter < maxRetryAttempts) && (ezids.size() == 0));
	//WAIT FOR 5 SECS BEFORE RE-TRYING TO OVERCOME TEMPORARY NETWORK FAILURES
	//OR THE EZID SERVER BEING BUSY SERVICING ANOTHER REQUEST.
	if(shouldRetry){
		try{
			Thread.sleep(RETRY_WAIT_TIME);
		}catch(InterruptedException ie){
			log.error("Wait interrupted in retry loop", ie);
		}
          }

      } while (shouldRetry);
  }
 
开发者ID:rmap-project,项目名称:rmap,代码行数:34,代码来源:HttpArkIdService.java

示例3: getIdentifierMetadata

import edu.ucsb.nceas.ezid.EZIDException; //导入依赖的package包/类
public HashMap getIdentifierMetadata(Dataset dataset){
    String identifier = getIdentifierFromDataset(dataset);        
    HashMap metadata = new HashMap();
   try {
          metadata = ezidService.getMetadata(identifier);
        }  catch (EZIDException e){                
        logger.log(Level.INFO, "getIdentifierMetadata failed");
        logger.log(Level.INFO, "String " + e.toString() );
        logger.log(Level.INFO, "localized message " + e.getLocalizedMessage());
        logger.log(Level.INFO, "cause " + e.getCause());
        logger.log(Level.INFO, "message " + e.getMessage());    
        return metadata;
    }         
   return metadata;
}
 
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:16,代码来源:DOIEZIdServiceBean.java

示例4: lookupMetadataFromIdentifier

import edu.ucsb.nceas.ezid.EZIDException; //导入依赖的package包/类
public HashMap lookupMetadataFromIdentifier(String protocol, String authority, String separator, String identifier){
    String identifierOut = getIdentifierForLookup( protocol,  authority, separator, identifier);        
    HashMap metadata = new HashMap();
   try {
          metadata = ezidService.getMetadata(identifierOut);
        }  catch (EZIDException e){                
        logger.log(Level.FINE, "None existing so we can use this identifier");
        logger.log(Level.FINE, "identifier: " + identifierOut);
        return metadata;
    }         
   return metadata;
}
 
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:13,代码来源:DOIEZIdServiceBean.java

示例5: modifyIdentifier

import edu.ucsb.nceas.ezid.EZIDException; //导入依赖的package包/类
public String modifyIdentifier(Dataset dataset, HashMap metadata ){
   String identifier = getIdentifierFromDataset(dataset);
   try {
           ezidService.setMetadata(identifier, metadata);
           return identifier;
        }  catch (EZIDException e){                
        logger.log(Level.INFO, "modifyMetadata failed");
        logger.log(Level.INFO, "String " + e.toString() );
        logger.log(Level.INFO, "localized message " + e.getLocalizedMessage());
        logger.log(Level.INFO, "cause " + e.getCause());
        logger.log(Level.INFO, "message " + e.getMessage());    
    } 
   return null;
}
 
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:15,代码来源:DOIEZIdServiceBean.java

示例6: updateIdentifierStatus

import edu.ucsb.nceas.ezid.EZIDException; //导入依赖的package包/类
private void updateIdentifierStatus(Dataset dataset, String statusIn){
    String identifier = getIdentifierFromDataset(dataset);
    HashMap metadata = getUpdateMetadataFromDataset(dataset);
    metadata.put("_status", statusIn);
   try {
           ezidService.setMetadata(identifier, metadata);
        }  catch (EZIDException e){                
        logger.log(Level.INFO, "modifyMetadata failed");
        logger.log(Level.INFO, "String " + e.toString() );
        logger.log(Level.INFO, "localized message " + e.getLocalizedMessage());
        logger.log(Level.INFO, "cause " + e.getCause());
        logger.log(Level.INFO, "message " + e.getMessage());    
    }
    
}
 
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:16,代码来源:DOIEZIdServiceBean.java


注:本文中的edu.ucsb.nceas.ezid.EZIDException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。