本文整理汇总了Java中gov.nih.nci.system.client.ApplicationServiceProvider.getApplicationServiceFromUrl方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationServiceProvider.getApplicationServiceFromUrl方法的具体用法?Java ApplicationServiceProvider.getApplicationServiceFromUrl怎么用?Java ApplicationServiceProvider.getApplicationServiceFromUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nih.nci.system.client.ApplicationServiceProvider
的用法示例。
在下文中一共展示了ApplicationServiceProvider.getApplicationServiceFromUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import gov.nih.nci.system.client.ApplicationServiceProvider; //导入方法依赖的package包/类
public static void main(String[] args) {
try {
ApplicationService appService = ApplicationServiceProvider
.getApplicationServiceFromUrl("http://cadsrapi.nci.nih.gov/cadsrapi40/");
List rList = appService.search(Project.class, new Project());
for (Iterator resultsIterator = rList.iterator(); resultsIterator.hasNext();) {
Project project = (Project) resultsIterator.next();
System.out.println(project.getShortName());
System.out.println(project.getVersion());
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
示例2: createLexBIGService
import gov.nih.nci.system.client.ApplicationServiceProvider; //导入方法依赖的package包/类
/**
* Establish a remote LexBIG connection.
*/
public static EVSApplicationService createLexBIGService() {
EVSApplicationService lbSvc = null;
try {
System.out.println("Service URL: " + _serviceUrl);
System.out.flush();
lbSvc = (EVSApplicationService) ApplicationServiceProvider
.getApplicationServiceFromUrl(_serviceUrl, _serviceInfo);
return lbSvc;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
示例3: resolveValueSetDefinition
import gov.nih.nci.system.client.ApplicationServiceProvider; //导入方法依赖的package包/类
public static ResolvedValueSetDefinition resolveValueSetDefinition(ValueSetDefinition vsDef,
AbsoluteCodingSchemeVersionReferenceList csVersionList,
String versionTag,
HashMap<String, ValueSetDefinition> referencedVSDs,
SortOptionList sortOptionList) throws LBException {
try {
String URL = "http://ncias-q541-v.nci.nih.gov:29080/lexevsapi60";
URL = "http://localhost:8080/lexevsapi60";
LexEVSDistributed distributed =
(LexEVSDistributed)
ApplicationServiceProvider.getApplicationServiceFromUrl(URL, "EvsServiceInfo");
LexEVSValueSetDefinitionServices vds = distributed.getLexEVSValueSetDefinitionServices();
return vds.resolveValueSetDefinition(vsDef,csVersionList,versionTag,referencedVSDs,sortOptionList);
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
示例4: main
import gov.nih.nci.system.client.ApplicationServiceProvider; //导入方法依赖的package包/类
public static void main(String[] args) {
try {
JFrame f = new JFrame();
f.setVisible(true);
JFileChooser fc = new JFileChooser(".");
fc.showOpenDialog(f);
File selectedFile = fc.getSelectedFile();
ServiceMetadata model = MetadataUtils.deserializeServiceMetadata(new FileReader(selectedFile));
ApplicationService appService = ApplicationServiceProvider
.getApplicationServiceFromUrl("http://cadsrapi-prod2.nci.nih.gov/cadsrapi40/");
ServiceMetadataAnnotator anno = new ServiceMetadataAnnotator(null, appService);
anno.annotateServiceMetadata(model);
File result = new File(".", selectedFile.getName() + "_annotated");
MetadataUtils.serializeServiceMetadata(model, new FileWriter(result));
System.exit(0);
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
}
示例5: createLexBIGService
import gov.nih.nci.system.client.ApplicationServiceProvider; //导入方法依赖的package包/类
public static LexBIGService createLexBIGService(String serviceUrl)
{
try{
_logger.debug(Util.SEPARATOR);
if (serviceUrl == null || serviceUrl.compareTo("") == 0)
{
_logger.debug("LexBIGService(local): new LexBIGServiceImpl();");
_logger.debug("LG_CONFIG_FILE: " + System.getProperty("LG_CONFIG_FILE"));
LexBIGService lbSvc = new LexBIGServiceImpl();
return lbSvc;
}
_logger.debug("LexBIGService(remote): " + serviceUrl);
// try {
// throw new Exception("Not an exception. Used to trace where this method was called.");
// } catch (Exception e) {
// e.printStackTrace();
// }
EVSApplicationService appService = (EVSApplicationService) ApplicationServiceProvider.getApplicationServiceFromUrl(serviceUrl, _serviceInfo);
return (LexBIGService) appService;
}
catch (Exception e)
{
e.printStackTrace();
}
return null;
}
示例6: retrieveCaDsrApplicationService
import gov.nih.nci.system.client.ApplicationServiceProvider; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
public ApplicationService retrieveCaDsrApplicationService(String caDsrUrl) throws ConnectionException {
try {
return ApplicationServiceProvider.getApplicationServiceFromUrl(caDsrUrl, CADSR_SERVICE);
} catch (Exception e) {
throw new ConnectionException("Error occurred when trying to create caDSR Application Service.", e);
}
}
示例7: getValueSetDefinitionURI2VSD_map
import gov.nih.nci.system.client.ApplicationServiceProvider; //导入方法依赖的package包/类
public static HashMap getValueSetDefinitionURI2VSD_map() {
if (_valueSetDefinitionURI2VSD_map != null) {
return _valueSetDefinitionURI2VSD_map;
}
_valueSetDefinitionURI2VSD_map = new HashMap();
try {
String URL = "http://ncias-d488-v.nci.nih.gov:29080/lexevsapi60";
LexEVSDistributed distributed =
(LexEVSDistributed)
ApplicationServiceProvider.getApplicationServiceFromUrl(URL, "EvsServiceInfo");
LexEVSValueSetDefinitionServices vsd_service = distributed.getLexEVSValueSetDefinitionServices();
/*
String URL = "http://ncias-d488-v.nci.nih.gov:29080/lexevsapi60";
LexEVSValueSetDefinitionServices vsd_service = RemoteServerUtil.getLexEVSValueSetDefinitionServices(URL);
*/
String valueSetDefinitionRevisionId = null;
List list = vsd_service.listValueSetDefinitionURIs();
for (int i=0; i<list.size(); i++) {
String uri = (String) list.get(i);
ValueSetDefinition vsd = vsd_service.getValueSetDefinition(new URI(uri), valueSetDefinitionRevisionId);
System.out.println(uri + " -- active? " + vsd.isIsActive());
_valueSetDefinitionURI2VSD_map.put(uri, vsd);
}
return _valueSetDefinitionURI2VSD_map;
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
示例8: listValueSetsWithEntityCode
import gov.nih.nci.system.client.ApplicationServiceProvider; //导入方法依赖的package包/类
public static void listValueSetsWithEntityCode(String matchText) {
try {
String URL = "http://ncias-d488-v.nci.nih.gov:29080/lexevsapi60";
LexEVSDistributed distributed =
(LexEVSDistributed)
ApplicationServiceProvider.getApplicationServiceFromUrl(URL, "EvsServiceInfo");
LexEVSValueSetDefinitionServices vsd_service = distributed.getLexEVSValueSetDefinitionServices();
AbsoluteCodingSchemeVersionReferenceList csVersionList = getAbsoluteCodingSchemeVersionReferenceList();
String versionTag = "PRODUCTION";
List list = vsd_service.listValueSetsWithEntityCode(matchText, null, csVersionList, versionTag);
if (list != null) {
System.out.println("listValueSetsWithEntityCode returns " + list.size() + " VSD URIs.");
for (int j=0; j<list.size(); j++) {
String uri = (String) list.get(j);
System.out.println(uri);
}
}
} catch (Exception ex) {
System.out.println("(*) Exception thrown by listValueSetsWithEntityCode");
ex.printStackTrace();
}
}
示例9: findCaCoreAPIService
import gov.nih.nci.system.client.ApplicationServiceProvider; //导入方法依赖的package包/类
public ApplicationService findCaCoreAPIService() throws ServiceLocatorException {
if (cabioAppService == null){
try{
cabioAppService = ApplicationServiceProvider.getApplicationServiceFromUrl(UMLBrowserParams.getInstance().getCadsrURL());
//ApplicationServiceProvider.getRemoteInstance(UMLBrowserParams.getInstance().getCadsrURL());
}catch(Exception e){
e.printStackTrace();
}
}
return cabioAppService;
}
示例10: getModelUtil
import gov.nih.nci.system.client.ApplicationServiceProvider; //导入方法依赖的package包/类
private ModelProblemsUtil getModelUtil() throws Exception {
if (modelUtil == null) {
ApplicationService appservice = ApplicationServiceProvider
.getApplicationServiceFromUrl(getCadsrApplicationUrl());
modelUtil = new ModelProblemsUtil(appservice);
}
return modelUtil;
}
示例11: reloadProjects
import gov.nih.nci.system.client.ApplicationServiceProvider; //导入方法依赖的package包/类
public void reloadProjects() throws Exception {
getProjectsComboBox().removeAllItems();
ApplicationService appservice = ApplicationServiceProvider
.getApplicationServiceFromUrl(getCadsrApplicationUrl());
Project proj = new Project();
List projects = appservice.search(Project.class, proj);
Comparator projectSorter = new Comparator() {
public int compare(Object o1, Object o2) {
String val1 = null;
String val2 = null;
if (o1 instanceof Project) {
val1 = projectAsString((Project) o1).toLowerCase();
} else {
val1 = o1.toString();
}
if (o2 instanceof Project) {
val2 = projectAsString((Project) o2).toLowerCase();
} else {
val2 = o2.toString();
}
return val1.compareTo(val2);
}
};
Collections.sort(projects, projectSorter);
for (Object p : projects) {
getProjectsComboBox().addItem(p);
}
}
示例12: main
import gov.nih.nci.system.client.ApplicationServiceProvider; //导入方法依赖的package包/类
public static void main(String[] args) {
String appUrl = DEFAULT_CADSR_APPLICATION_URL;
String modelName = "NCIA_Model";
String modelVersion = "3";
if (args.length == 2) {
modelName = args[0];
modelVersion = args[1];
}
try {
ModelProblemsUtil util = new ModelProblemsUtil(ApplicationServiceProvider
.getApplicationServiceFromUrl(appUrl));
List<ModelProblem> problems = util.findProblems(modelName, modelVersion);
if (problems.size() == 0) {
System.out.println("No errors found");
} else {
System.out.println("Problems in model:");
for (ModelProblem problem : problems) {
System.out.println(problem.toString());
}
}
} catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
}
}
示例13: getApplicationService
import gov.nih.nci.system.client.ApplicationServiceProvider; //导入方法依赖的package包/类
private ApplicationService getApplicationService() throws QueryProcessingException {
ApplicationService service = null;
boolean useLocal = useLocalApplicationService();
boolean useLogin = useServiceLogin();
boolean useStaticLogin = useStaticLogin();
try {
String username = null;
String passwd = null;
if (useLogin) {
if (useStaticLogin) {
username = getConfiguredParameters().getProperty(PROPERTY_STATIC_LOGIN_USERNAME);
passwd = username = getConfiguredParameters().getProperty(PROPERTY_STATIC_LOGIN_PASSWORD);
} else {
SecurityManager securityManager = SecurityManager.getManager();
username = securityManager.getCaller();
passwd = EMPTY_PASSWORD;
}
}
if (useLocal) {
if (useLogin) {
service = ApplicationServiceProvider.getApplicationService(username, passwd);
} else {
service = ApplicationServiceProvider.getApplicationService();
}
} else {
String url = getRemoteApplicationUrl();
if (useLogin) {
service = ApplicationServiceProvider.getApplicationServiceFromUrl(url, username, passwd);
} else {
service = ApplicationServiceProvider.getApplicationServiceFromUrl(url);
}
}
} catch (Exception ex) {
throw new QueryProcessingException("Error obtaining application service instance: " + ex.getMessage(), ex);
}
return service;
}
示例14: getApplicationService
import gov.nih.nci.system.client.ApplicationServiceProvider; //导入方法依赖的package包/类
private ApplicationService getApplicationService()
throws QueryProcessingException {
ApplicationService service = null;
boolean useLocal = useLocalApplicationService();
boolean useLogin = useServiceLogin();
boolean useStaticLogin = useStaticLogin();
try {
String username = null;
String passwd = null;
if (useLogin) {
if (useStaticLogin) {
username = getConfiguredParameters().getProperty(
PROPERTY_STATIC_LOGIN_USERNAME);
passwd = username = getConfiguredParameters().getProperty(
PROPERTY_STATIC_LOGIN_PASSWORD);
} else {
SecurityManager securityManager = SecurityManager
.getManager();
username = securityManager.getCaller();
// TODO: password?
}
}
if (useLocal) {
if (useLogin) {
service = ApplicationServiceProvider.getApplicationService(
username, passwd);
} else {
service = ApplicationServiceProvider
.getApplicationService();
}
} else {
String url = getRemoteApplicationUrl();
if (useLogin) {
service = ApplicationServiceProvider
.getApplicationServiceFromUrl(url, username, passwd);
} else {
service = ApplicationServiceProvider
.getApplicationServiceFromUrl(url);
}
}
} catch (Exception ex) {
throw new QueryProcessingException(
"Error obtaining application service instance: "
+ ex.getMessage(), ex);
}
return service;
}
示例15: run2
import gov.nih.nci.system.client.ApplicationServiceProvider; //导入方法依赖的package包/类
public static void run2() {
try {
String URL = "http://ncias-q541-v.nci.nih.gov:29080/lexevsapi60";
LexEVSDistributed distributed =
(LexEVSDistributed)
ApplicationServiceProvider.getApplicationServiceFromUrl(URL, "EvsServiceInfo");
LexEVSValueSetDefinitionServices vds = distributed.getLexEVSValueSetDefinitionServices();
ValueSetDefinition def = new ValueSetDefinition();
def.setDefaultCodingScheme("NCI_Thesaurus");
def.setValueSetDefinitionName("testName");
def.setValueSetDefinitionURI("testUri");
EntityReference ref1 = new EntityReference();
ref1.setEntityCode("C12727");
ref1.setTransitiveClosure(false);
ref1.setLeafOnly(false);
ref1.setTargetToSource(true);
EntityReference ref2 = new EntityReference();
ref2.setEntityCode("C82547");
ref2.setTransitiveClosure(true);
ref2.setReferenceAssociation("subClassOf");
ref2.setLeafOnly(false);
ref2.setTargetToSource(false);
DefinitionEntry entry = new DefinitionEntry();
entry.setOperator(DefinitionOperator.OR);
entry.setEntityReference(ref1);
entry.setEntityReference(ref2);
def.addDefinitionEntry(entry);
AbsoluteCodingSchemeVersionReferenceList csvList = new AbsoluteCodingSchemeVersionReferenceList();
csvList.addAbsoluteCodingSchemeVersionReference(Constructors.createAbsoluteCodingSchemeVersionReference("http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#", "10.08e"));
ResolvedValueSetDefinition rvsd = vds.resolveValueSetDefinition(def, csvList, null, null);
ResolvedConceptReferencesIterator itr = rvsd.getResolvedConceptReferenceIterator();
while(itr.hasNext()){
PrintUtility.print(itr.next());
}
} catch (Exception ex) {
ex.printStackTrace();
}
}