本文整理汇总了Java中gov.nih.nci.cagrid.syncgts.core.SyncGTS类的典型用法代码示例。如果您正苦于以下问题:Java SyncGTS类的具体用法?Java SyncGTS怎么用?Java SyncGTS使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SyncGTS类属于gov.nih.nci.cagrid.syncgts.core包,在下文中一共展示了SyncGTS类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: synchronizeOnce
import gov.nih.nci.cagrid.syncgts.core.SyncGTS; //导入依赖的package包/类
public static boolean synchronizeOnce(String syncDescriptionFile)
{
boolean success = false;
try
{
// Load Sync Description
String pathToSyncDescription = syncDescriptionFile;
SyncDescription description = (SyncDescription) Utils
.deserializeDocument(pathToSyncDescription,
SyncDescription.class);
// Sync with the Trust Fabric Once
SyncGTS.getInstance().syncOnce(description);
success = true;
}
catch (Exception e)
{
e.printStackTrace();
}
return success;
}
示例2: synchronizePeriodic
import gov.nih.nci.cagrid.syncgts.core.SyncGTS; //导入依赖的package包/类
private static boolean synchronizePeriodic(String syncDescriptionFile)
{
boolean success = false;
try
{
// Load Sync Description
String pathToSyncDescription = syncDescriptionFile; // "conf/training/sync-description.xml";
SyncDescription description = (SyncDescription) Utils
.deserializeDocument(pathToSyncDescription,
SyncDescription.class);
// Sync with the Trust Fabric Once
SyncGTS.getInstance().syncAndResync(description, success);
success = true;
}
catch (Exception e)
{
e.printStackTrace();
}
return success;
}
示例3: testSyncGTS
import gov.nih.nci.cagrid.syncgts.core.SyncGTS; //导入依赖的package包/类
public static void testSyncGTS(){
try
{
if ("yes".equalsIgnoreCase(getSTartAutoSyncGTS()))
{
String pathToSyncDescription = FileHelper.getFileAsURL("sync-description.xml").getPath();
//Load Sync Description
SyncDescription description = (SyncDescription) Utils.deserializeDocument(pathToSyncDescription,SyncDescription.class);
// Sync with the Trust Fabric Once
SyncGTS.getInstance().syncAndResyncInBackground(description, false);
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
示例4: init
import gov.nih.nci.cagrid.syncgts.core.SyncGTS; //导入依赖的package包/类
@Override
public void init(ServletConfig config) throws ServletException {
try {
String isSyncGtsAuto = config.getInitParameter("start-auto-syncgts");
log.debug("isSyncGtsAuto "+isSyncGtsAuto);
if (isSyncGtsAuto.equals("true")) {
ServletContextResource contextResource=new ServletContextResource(config.getServletContext(), "/WEB-INF/sync-description.xml");
InputStream inputStream = contextResource.getInputStream();
final InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
SyncDescription description = (SyncDescription) Utils.deserializeObject(inputStreamReader,SyncDescription.class);
inputStreamReader.close();
SyncGTS.getInstance().syncAndResyncInBackground(description, false);
}
} catch (Exception e) {
log.error("Unable to Start Sync GTS Service." + FaultUtil.printFaultToString(e));
throw new ServletException(e);
}
super.init(config);
}
示例5: init
import gov.nih.nci.cagrid.syncgts.core.SyncGTS; //导入依赖的package包/类
@Override
public void init(ServletConfig config) throws ServletException{
try{
WebApplicationContext ctx =
WebApplicationContextUtils.getRequiredWebApplicationContext(config.getServletContext());
WebSSOProperties webSSOProperties = (WebSSOProperties)ctx.getBean(WebSSOConstants.WEBSSO_PROPERTIES);
WebSSOServerInformation webSSOServerInformation = webSSOProperties.getWebSSOServerInformation();
if ("yes".equalsIgnoreCase(webSSOServerInformation.getStartAutoSyncGTS())){
Resource syncdesc = (Resource)ctx.getBean(WebSSOConstants.SYNC_DESC_RESOURCE);
//Load Sync Description
final InputStreamReader inputStreamReader = new InputStreamReader(syncdesc.getInputStream());
SyncDescription description = Utils.deserializeObject(inputStreamReader,SyncDescription.class);
inputStreamReader.close();
// Sync with the Trust Fabric Once
SyncGTS.getInstance().syncAndResyncInBackground(description, false);
}
} catch (Exception e) {
throw new ServletException("Unable to Start Sync GTS Service: " + e.getMessage(), e);
}
super.init(config);
}
示例6: SyncGTSImpl
import gov.nih.nci.cagrid.syncgts.core.SyncGTS; //导入依赖的package包/类
public SyncGTSImpl() throws RemoteException {
try {
this.configuration = SyncGTSConfiguration.getConfiguration();
SyncGTSDefault.setServiceSyncDescriptionLocation(SyncGTSConfiguration.getConfiguration().getSyncDescription());
SyncDescription description = SyncGTSDefault.getSyncDescription();
try {
SyncGTS sync = SyncGTS.getInstance();
if ((this.configuration.getPerformFirstSync() != null)
&& (this.configuration.getPerformFirstSync().equalsIgnoreCase("true"))) {
sync.syncOnce(description);
}
sync.syncAndResyncInBackground(description, true);
} catch (Exception e) {
e.printStackTrace();
}
} catch (Exception ex) {
ex.printStackTrace();
throw new RemoteException("Error Starting SyncGTS Service: " + ex.getMessage());
}
}
示例7: configureGlobusCertificates
import gov.nih.nci.cagrid.syncgts.core.SyncGTS; //导入依赖的package包/类
private void configureGlobusCertificates() throws Exception {
File globusCertificateDir = Utils.getTrustedCerificatesDirectory();
File gridTargetCertsDir = new File(gaardsConfigurationDirectory, targetGrid + File.separator + "certificates");
Utils.copyDirectory(gridTargetCertsDir, globusCertificateDir);
SyncGTSDefault.setServiceSyncDescriptionLocation(gaardsConfigurationDirectory.getAbsolutePath()
+ File.separator + targetGrid + File.separator
+ "sync-description.xml");
SyncDescription description = SyncGTSDefault.getSyncDescription();
SyncGTS sync = SyncGTS.getInstance();
sync.syncOnce(description);
}
示例8: setDefaultGrid
import gov.nih.nci.cagrid.syncgts.core.SyncGTS; //导入依赖的package包/类
private void setDefaultGrid() {
try {
File targetGridDirectory = new File(GAARDSApplication.getGAARDSConfigurationDirectory(), grid.getSystemName());
File gridSyncGTDCertsDir = Utils.getTrustedCerificatesDirectory();
File gridTargetCertsDir = new File(targetGridDirectory, "certificates");
Utils.copyDirectory(gridTargetCertsDir, gridSyncGTDCertsDir);
// sync with trust fabric
SyncGTSDefault
.setServiceSyncDescriptionLocation(targetGridDirectory.getAbsolutePath()
+ File.separator + "sync-description.xml");
SyncDescription description = SyncGTSDefault.getSyncDescription();
SyncGTS sync = SyncGTS.getInstance();
sync.syncOnce(description);
// reload
GAARDSApplication.getContext().getConfigurationManager()
.setActiveConfiguration(grid.getSystemName());
GAARDSApplication.getContext().getConfigurationManager().reload();
ServicesManager.getInstance().syncWithUpdatedConfiguration();
GAARDSApplication.setTargetGrid(grid.getSystemName());
} catch (Exception e) {
ErrorDialog.showError(e);
FaultUtil.logFault(log, e);
}
}