當前位置: 首頁>>代碼示例>>Java>>正文


Java RemoteResourcePropertyRetrievalException類代碼示例

本文整理匯總了Java中gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException的典型用法代碼示例。如果您正苦於以下問題:Java RemoteResourcePropertyRetrievalException類的具體用法?Java RemoteResourcePropertyRetrievalException怎麽用?Java RemoteResourcePropertyRetrievalException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RemoteResourcePropertyRetrievalException類屬於gov.nih.nci.cagrid.metadata.exceptions包,在下文中一共展示了RemoteResourcePropertyRetrievalException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getCaGridVersion

import gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException; //導入依賴的package包/類
public static CaGridVersion getCaGridVersion(EndpointReferenceType serviceEPR) throws InvalidResourcePropertyException, 
    RemoteResourcePropertyRetrievalException, ResourcePropertyRetrievalException {
    CaGridVersion result = null;
    try {
        Element resourceProperty = ResourcePropertyHelper.getResourceProperty(serviceEPR,
            MetadataConstants.CAGRID_VERSION_QNAME);
        result = deserializeCaGridVersion(new StringReader(XmlUtils.toString(resourceProperty)));
    } catch (InvalidResourcePropertyException e) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Resource property for CaGridVersion not found on " + serviceEPR.getAddress().toString());
            LOG.debug("Assuming the service is from an older version of caGrid which doesn' have this property");
            LOG.debug(e);
        }
    } catch (Exception ex) {
        throw new ResourcePropertyRetrievalException("Unable to deserailize CaGridVersion: " + ex.getMessage(), ex);
    }
    return result;
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:19,代碼來源:MetadataUtils.java

示例2: isDataService

import gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException; //導入依賴的package包/類
/**
 * Determines if the given service is a data service
 * 
 * @param serviceEPR
 * @return true iff the service is a data service
 * @throws RemoteResourcePropertyRetrievalException
 * @throws ResourcePropertyRetrievalException
 */
public static boolean isDataService(EndpointReferenceType serviceEPR) throws InvalidResourcePropertyException,
    RemoteResourcePropertyRetrievalException, ResourcePropertyRetrievalException {

    DomainModel domainModel = null;
    ServiceMetadata serviceMetadata = null;
    try {
        domainModel = getDomainModel(serviceEPR);
        serviceMetadata = getServiceMetadata(serviceEPR);
    } catch (InvalidResourcePropertyException e) {
        // if it complains about not having the necessary metadata, its not
        // a data service
        return false;
    }

    return domainModel != null && serviceMetadata != null;
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:25,代碼來源:MetadataUtils.java

示例3: handleException

import gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException; //導入依賴的package包/類
private void handleException(Exception e) throws InvalidResourceException,
		GenericException {
	if (e instanceof RemoteResourcePropertyRetrievalException) {
		log.info(e);
	} else if (e instanceof MalformedURLException) {
		log.error(e);
		throw new InvalidResourceException("malformed URL has occurred ("
				+ e.getMessage() + ")", e);
	} else if (e instanceof ResourcePropertyRetrievalException) {
		log.error(e);
		throw new InvalidResourceException(
				"error occured retrieving resource property "
						+ e.getMessage(), e);
	} else if (e instanceof RemoteException) {
		log.error(e);
		throw new GenericException(
				"communication-related exception occured " + e.getMessage(), e);
	} else {
		log.error(e);
		throw new GenericException("error occured " + e.getMessage(), e);
	}
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:23,代碼來源:AuthenticationProfileServiceManager.java

示例4: discoverByFilter

import gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException; //導入依賴的package包/類
/**
 * Applies the specified predicate to the common path in the Index Service's
 * Resource Properties to return registered services' EPRs that match the
 * predicate.
 * 
 * @param xpathPredicate
 *            predicate to apply to the "Entry" in Index Service
 * @return EndpointReferenceType[] of matching services @
 * @throws ResourcePropertyRetrievalException
 * @throws QueryInvalidException
 * @throws RemoteResourcePropertyRetrievalException
 */
protected EndpointReferenceType[] discoverByFilter(String xpathPredicate)
    throws RemoteResourcePropertyRetrievalException, QueryInvalidException, ResourcePropertyRetrievalException {
    EndpointReferenceType[] results = null;

    // query the service and deser the results
    MessageElement[] elements = ResourcePropertyHelper.queryResourceProperties(this.indexEPR,
        translateXPath(xpathPredicate));
    Object[] objects = null;
    try {
        objects = ObjectDeserializer.toObject(elements, EndpointReferenceType.class);
    } catch (DeserializationException e) {
        throw new ResourcePropertyRetrievalException("Unable to deserialize results to EPRs!", e);
    }

    // if we got results, cast them into what we are expected to return
    if (objects != null) {
        results = new EndpointReferenceType[objects.length];
        System.arraycopy(objects, 0, results, 0, objects.length);
    }

    return results;

}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:36,代碼來源:DiscoveryClient.java

示例5: getUmlClassesFromService

import gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException; //導入依賴的package包/類
protected UMLClass[] getUmlClassesFromService() throws MalformedURIException, InvalidResourcePropertyException, RemoteResourcePropertyRetrievalException, ResourcePropertyRetrievalException {

      if (umlClassList == null) {
         EndpointReferenceType epr = new EndpointReferenceType();
         AttributedURI uri = new AttributedURI(getServiceUrl());
         epr.setAddress(uri);

         DomainModel domainModel = MetadataUtils.getDomainModel(epr);
         DomainModelExposedUMLClassCollection classCollection = domainModel.getExposedUMLClassCollection();
         umlClassList = classCollection.getUMLClass();

      }
      return umlClassList;
   }
 
開發者ID:NCIP,項目名稱:common-biorepository-model,代碼行數:15,代碼來源:CbmTest.java

示例6: getServiceMetadata

import gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException; //導入依賴的package包/類
/**
 * Obtain the service metadata from the specified service.
 * 
 * @param serviceEPR
 * @return The service metadata from the targeted service
 * @throws InvalidResourcePropertyException
 * @throws RemoteResourcePropertyRetrievalException
 * @throws ResourcePropertyRetrievalException
 */
public static ServiceMetadata getServiceMetadata(EndpointReferenceType serviceEPR)
    throws InvalidResourcePropertyException, RemoteResourcePropertyRetrievalException,
    ResourcePropertyRetrievalException {
    Element resourceProperty = ResourcePropertyHelper.getResourceProperty(serviceEPR,
        MetadataConstants.CAGRID_MD_QNAME);
    ServiceMetadata result;
    try {
        result = deserializeServiceMetadata(new StringReader(XmlUtils.toString(resourceProperty)));
    } catch (Exception e) {
        throw new ResourcePropertyRetrievalException("Unable to deserailize ServiceMetadata: " + e.getMessage(), e);
    }
    return result;
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:23,代碼來源:MetadataUtils.java

示例7: getDomainModel

import gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException; //導入依賴的package包/類
/**
 * Obtain the data service metadata from the specified service.
 * 
 * @param serviceEPR
 * @return The domain model from the targeted data service
 * @throws InvalidResourcePropertyException
 * @throws RemoteResourcePropertyRetrievalException
 * @throws ResourcePropertyRetrievalException
 */
public static DomainModel getDomainModel(EndpointReferenceType serviceEPR) throws InvalidResourcePropertyException,
    RemoteResourcePropertyRetrievalException, ResourcePropertyRetrievalException {
    Element resourceProperty = ResourcePropertyHelper.getResourceProperty(serviceEPR,
        MetadataConstants.CAGRID_DATA_MD_QNAME);

    DomainModel result;
    try {
        result = deserializeDomainModel(new StringReader(XmlUtils.toString(resourceProperty)));
    } catch (Exception e) {
        throw new ResourcePropertyRetrievalException("Unable to deserailize DomainModel: " + e.getMessage(), e);
    }
    return result;
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:23,代碼來源:MetadataUtils.java

示例8: main

import gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException; //導入依賴的package包/類
public static void main(String[] args) throws RemoteResourcePropertyRetrievalException, QueryInvalidException,
    ResourcePropertyRetrievalException, InvalidConfigurationException, InterruptedException, IOException {

    for (int i = 0; i < args.length; i++) {
        String sourceURL = args[i];

        DiscoveryClient sourceClient = new DiscoveryClient(sourceURL);
        EndpointReferenceType[] allServices = sourceClient.getAllServices(true);
        System.out.println("Found " + allServices.length + " services in Index Service:" + sourceURL);

        for (EndpointReferenceType epr : allServices) {
            System.out.println("Processing service: " + epr.getAddress());

            try {
                File registrationFile = new File("resources/registrationTemplate.xml");
                if (registrationFile.exists() && registrationFile.canRead()) {

                    ServiceGroupRegistrationParameters params = ServiceGroupRegistrationClient
                        .readParams(registrationFile.getAbsolutePath());

                    params.setRegistrantEPR(epr);

                    for (int j = 0; j < MULTIPLIER; j++) {
                        // System.out.println("Registering for the " + (j+1)
                        // + " time.");
                        AdvertisementClient registrationClient = new AdvertisementClient(params);
                        registrationClient.register();
                    }

                    Thread.sleep((long) (1000 + (1000 * (10 * Math.random()))));

                } else {
                    System.out.println("Unable to read registration file:" + registrationFile);
                }
            } catch (Exception e) {
                System.err.println("Exception when trying to register service (" + epr + "): " + e.getMessage());
            }

        }
    }

    System.out.println("Type 'exit' to quit, and unregister services:");
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String line = br.readLine();
    while (line != null) {
        if (line.equals("exit")) {
            System.out.println("Exiting.");
            System.exit(0);
        }
        line = br.readLine();
    }
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:53,代碼來源:MassRegistration.java

示例9: queryResourceProperties

import gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException; //導入依賴的package包/類
public static MessageElement[] queryResourceProperties(EndpointReferenceType endpoint, String queryExpression)
    throws RemoteResourcePropertyRetrievalException, QueryInvalidException {
    return queryResourceProperties(endpoint, queryExpression, null);
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:5,代碼來源:ResourcePropertyHelper.java

示例10: getResourceProperties

import gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException; //導入依賴的package包/類
public static Element getResourceProperties(EndpointReferenceType endpoint)
    throws ResourcePropertyRetrievalException, RemoteResourcePropertyRetrievalException, QueryInvalidException {
    return getResourceProperties(endpoint, (InputStream) null);
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:5,代碼來源:ResourcePropertyHelper.java

示例11: getResourceProperty

import gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException; //導入依賴的package包/類
public static Element getResourceProperty(EndpointReferenceType endpoint, QName rpName)
    throws ResourcePropertyRetrievalException, RemoteResourcePropertyRetrievalException,
    InvalidResourcePropertyException {
    return getResourceProperty(endpoint, rpName, null);
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:6,代碼來源:ResourcePropertyHelper.java

示例12: getAllServices

import gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException; //導入依賴的package包/類
/**
 * Query the registry for all registered services
 * 
 * @param requireMetadataCompliance
 *            if true, only services providing the standard metadata will be
 *            returned. Otherwise, all services registered will be returned,
 *            regardless of whether or not any metadata has been aggregated.
 * @return EndpointReferenceType[] contain all registered services
 * @throws ResourcePropertyRetrievalException
 * @throws QueryInvalidException
 * @throws RemoteResourcePropertyRetrievalException
 */
public EndpointReferenceType[] getAllServices(boolean requireMetadataCompliance)
    throws RemoteResourcePropertyRetrievalException, QueryInvalidException, ResourcePropertyRetrievalException {
    if (!requireMetadataCompliance) {
        return discoverByFilter("*");
    } else {
        return discoverByFilter(MD_PATH);
    }

}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:22,代碼來源:DiscoveryClient.java

示例13: discoverServicesByPointOfContact

import gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException; //導入依賴的package包/類
/**
 * Searches to find services that have the given point of contact associated
 * with them. Any fields set on the point of contact are checked for a
 * match. For example, you can set only the lastName, and only it will be
 * checked, or you can specify several feilds and they all must be equal.
 * 
 * @param contact
 *            point of contact
 * @return EndpointReferenceType[] matching the criteria
 * @throws ResourcePropertyRetrievalException
 * @throws QueryInvalidException
 * @throws RemoteResourcePropertyRetrievalException
 */
public EndpointReferenceType[] discoverServicesByPointOfContact(PointOfContact contact)
    throws RemoteResourcePropertyRetrievalException, QueryInvalidException, ResourcePropertyRetrievalException {
    String pocPredicate = buildPOCPredicate(contact);

    return discoverByFilter(MD_PATH + "[" + cagrid + ":hostingResearchCenter/" + com + ":ResearchCenter/" + com
        + ":pointOfContactCollection/" + com + ":PointOfContact[" + pocPredicate + "] or " + cagrid
        + ":serviceDescription/" + serv + ":Service/" + serv + ":pointOfContactCollection/" + com
        + ":PointOfContact[" + pocPredicate + "]]");
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:23,代碼來源:DiscoveryClient.java

示例14: discoverServicesByOperationInput

import gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException; //導入依賴的package包/類
/**
 * Searches to find services that have an operation defined that takes the
 * given UMLClass as input. Any fields set on the UMLClass are checked for a
 * match. For example, you can set only the packageName, and only it will be
 * checked, or you can specify several feilds and they all must be equal.
 * NOTE: Only attributes of the UMLClass are examined (associated objects
 * (e.g. UMLAttributeCollection and SemanticMetadataCollection) are
 * ignored).
 * 
 * @param clazzPrototype
 *            The protype UMLClass
 * @return EndpointReferenceType[] matching the criteria
 * @throws ResourcePropertyRetrievalException
 * @throws QueryInvalidException
 * @throws RemoteResourcePropertyRetrievalException
 */
public EndpointReferenceType[] discoverServicesByOperationInput(UMLClass clazzPrototype)
    throws RemoteResourcePropertyRetrievalException, QueryInvalidException, ResourcePropertyRetrievalException {
    String umlClassPredicate = buildUMLClassPredicate(clazzPrototype);

    return discoverByFilter(OPER_PATH + "/" + serv + ":inputParameterCollection/" + serv + ":InputParameter/" + com
        + ":UMLClass[" + umlClassPredicate + "]");
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:24,代碼來源:DiscoveryClient.java

示例15: discoverServicesByOperationOutput

import gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException; //導入依賴的package包/類
/**
 * Searches to find services that have an operation defined that produces
 * the given UMLClass. Any fields set on the UMLClass are checked for a
 * match. For example, you can set only the packageName, and only it will be
 * checked, or you can specify several feilds and they all must be equal.
 * NOTE: Only attributes of the UMLClass are examined (associated objects
 * (e.g. UMLAttributeCollection and SemanticMetadataCollection) are
 * ignored).
 * 
 * @param clazzPrototype
 *            The protype UMLClass
 * @return EndpointReferenceType[] matching the criteria
 * @throws ResourcePropertyRetrievalException
 * @throws QueryInvalidException
 * @throws RemoteResourcePropertyRetrievalException
 */
public EndpointReferenceType[] discoverServicesByOperationOutput(UMLClass clazzPrototype)
    throws RemoteResourcePropertyRetrievalException, QueryInvalidException, ResourcePropertyRetrievalException {
    String umlClassPredicate = buildUMLClassPredicate(clazzPrototype);

    return discoverByFilter(OPER_PATH + "/" + serv + ":Output/" + com + ":UMLClass[" + umlClassPredicate + "]");
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:23,代碼來源:DiscoveryClient.java


注:本文中的gov.nih.nci.cagrid.metadata.exceptions.RemoteResourcePropertyRetrievalException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。