Commit d17ef622 authored by Jay Jay Billings's avatar Jay Jay Billings
Browse files

Updated the ECF configuration in the core. Updated launch file too.


Signed-off-by: default avatarJay Jay Billings <billingsjj@ornl.gov>
parent 51358f7d
......@@ -19,10 +19,10 @@
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dorg.osgi.service.http.port=8082 -Dice.projectLocation=/home/bkj/ICEFiles -Dcom.sun.jersey.config.property.packages=org.eclipse.ice.core.iCore -Dorg.osgi.framework.bundle.parent=ext; -Declipse.log.level=INFO"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dorg.osgi.service.http.port=8082 -Dice.projectLocation=/home/bkj/ICEFiles -Dcom.sun.jersey.config.property.packages=org.eclipse.ice.core.iCore -Dorg.osgi.framework.bundle.parent=ext; -Declipse.log.level=INFO -DverboseRemoteServiceAdmin=true"/>
<stringAttribute key="pde.version" value="3.3"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="target_bundles" value="bcpkix@default:default,bcprov@default:default,ca.odell.glazedlists@default:default,ch.ethz.iks.r_osgi.remote@default:default,ch.qos.logback.classic@default:default,ch.qos.logback.core@default:default,ch.qos.logback.slf4j@default:false,com.google.gson@default:default,com.google.guava@default:default,com.google.inject.multibindings@default:false,com.google.inject@default:default,com.ibm.icu@default:default,com.jcraft.jsch@default:default,com.spotify.docker-client.shaded@default:default,com.sun.jersey@default:default,com.sun.syndication@default:default,gov.lbnl.visit.swt@default:default,javax.activation@default:default,javax.el@default:default,javax.inject@default:default,javax.servlet.jsp@default:default,javax.servlet@default:default,javax.ws.rs@default:default,javax.xml@default:default,org.antlr.runtime*3.2.0.v201101311130@default:default,org.antlr.runtime*4.3.0.v201502022030@default:default,org.apache.ant@default:default,org.apache.batik.css*1.7.0.v201011041433@default:default,org.apache.batik.util*1.7.0.v201011041433@default:default,org.apache.batik.util.gui*1.7.0.v200903091627@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.codec@default:default,org.apache.commons.collections@default:default,org.apache.commons.io@default:default,org.apache.commons.jxpath@default:default,org.apache.commons.logging*1.0.4.v201101211617@default:default,org.apache.commons.logging*1.1.1.v201101211721@default:default,org.apache.commons.math@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.log4j@default:default,org.apache.lucene.analysis@default:default,org.apache.lucene.core@default:default,org.eclipse.ant.core@default:default,org.eclipse.cdt.core.linux.x86_64@default:false,org.eclipse.cdt.core.linux@default:false,org.eclipse.cdt.core.native@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.core.net@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.debug.core@default:default,org.eclipse.draw2d@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.e4.core.di.annotations@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.e4.emf.xpath@default:default,org.eclipse.e4.ui.bindings@default:default,org.eclipse.e4.ui.css.core@default:default,org.eclipse.e4.ui.css.swt.theme@default:default,org.eclipse.e4.ui.css.swt@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.e4.ui.swt.gtk@default:false,org.eclipse.e4.ui.widgets@default:default,org.eclipse.e4.ui.workbench.addons.swt@default:default,org.eclipse.e4.ui.workbench.renderers.swt@default:default,org.eclipse.e4.ui.workbench.swt@default:default,org.eclipse.e4.ui.workbench3@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.eavp.geometry.view.model@default:default,org.eclipse.eavp.viz.datastructures@default:default,org.eclipse.eavp.viz.modeling@default:default,org.eclipse.eavp.viz.service.mesh@default:default,org.eclipse.eavp.viz.service.visit@default:default,org.eclipse.eavp.viz.service@default:default,org.eclipse.eavp.viz@default:default,org.eclipse.ecf.discovery@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.osgi.services.distribution@default:default,org.eclipse.ecf.osgi.services.remoteserviceadmin.proxy@default:default,org.eclipse.ecf.osgi.services.remoteserviceadmin@default:default,org.eclipse.ecf.provider.discovery@default:default,org.eclipse.ecf.provider.filetransfer.httpclient4.ssl@default:false,org.eclipse.ecf.provider.filetransfer.httpclient4@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ecf.provider.r_osgi@default:default,org.eclipse.ecf.provider.remoteservice@default:default,org.eclipse.ecf.provider@default:default,org.eclipse.ecf.remoteservice.asyncproxy*1.0.100.v20150702-1411@default:default,org.eclipse.ecf.remoteservice.asyncproxy*2.0.100.v20150702-1411@default:default,org.eclipse.ecf.remoteservice.rest.synd@default:default,org.eclipse.ecf.remoteservice.rest@default:default,org.eclipse.ecf.remoteservice.servlet@default:default,org.eclipse.ecf.remoteservice.soap@default:default,org.eclipse.ecf.remoteservice@default:default,org.eclipse.ecf.sharedobject@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.bidi@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@default:true,org.eclipse.equinox.event@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.http.servletbridge@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.transport.ecf@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.region@default:false,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security@default:default,org.eclipse.equinox.servletbridge@default:default,org.eclipse.equinox.transforms.hook@default:false,org.eclipse.equinox.util@default:default,org.eclipse.equinox.weaving.hook@default:false,org.eclipse.fx.osgi@default:false,org.eclipse.help.base@default:default,org.eclipse.help.ui@default:default,org.eclipse.help@default:default,org.eclipse.january.geometry.model@default:default,org.eclipse.january.geometry.xtext.obj@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.jsch.core@default:default,org.eclipse.nebula.visualization.widgets@default:default,org.eclipse.nebula.visualization.xygraph@default:default,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi.services.remoteserviceadmin@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.platform@default:default,org.eclipse.remote.core@default:default,org.eclipse.remote.jsch.core@default:default,org.eclipse.remote.ui@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.swtbot.ant.junit@default:false,org.eclipse.text@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.ui.console@default:default,org.eclipse.ui.editors@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.intro@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.ui.trace@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.eclipse.wst.jsdt.nashorn.extension@default:false,org.eclipse.xsd@default:default,org.eclipse.xtend.lib.macro@default:default,org.eclipse.xtend.lib@default:default,org.eclipse.xtext.smap@default:default,org.eclipse.xtext.util@default:default,org.eclipse.xtext.xbase.lib@default:default,org.eclipse.xtext@default:default,org.hamcrest.core@default:default,org.jdom@default:default,org.junit@default:default,org.objectweb.asm@default:default,org.slf4j.api@default:default,org.slf4j.impl.log4j12@default:false,org.tukaani.xz@default:default,org.w3c.css.sac@default:default,org.w3c.dom.events@default:default,org.w3c.dom.smil*1.0.1.v200903091627@default:default,org.w3c.dom.svg@default:default"/>
<stringAttribute key="target_bundles" value="bcpkix@default:default,bcprov@default:default,ca.odell.glazedlists@default:default,ch.ethz.iks.r_osgi.remote@default:default,com.google.gson@default:default,com.google.guava@default:default,com.google.inject.multibindings@default:false,com.google.inject@default:default,com.ibm.icu@default:default,com.jcraft.jsch@default:default,com.spotify.docker-client.shaded@default:default,com.sun.jersey@default:default,com.sun.syndication@default:default,gov.lbnl.visit.swt@default:default,javax.activation@default:default,javax.el@default:default,javax.inject@default:default,javax.servlet.jsp@default:default,javax.servlet@default:default,javax.ws.rs@default:default,javax.xml@default:default,org.antlr.runtime*3.2.0.v201101311130@default:default,org.antlr.runtime*4.3.0.v201502022030@default:default,org.apache.ant@default:default,org.apache.batik.css*1.7.0.v201011041433@default:default,org.apache.batik.util*1.7.0.v201011041433@default:default,org.apache.batik.util.gui*1.7.0.v200903091627@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.codec@default:default,org.apache.commons.collections@default:default,org.apache.commons.io@default:default,org.apache.commons.jxpath@default:default,org.apache.commons.logging*1.0.4.v201101211617@default:default,org.apache.commons.logging*1.1.1.v201101211721@default:default,org.apache.commons.math@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.log4j@default:default,org.apache.lucene.analysis@default:default,org.apache.lucene.core@default:default,org.eclipse.ant.core@default:default,org.eclipse.cdt.core.linux.x86_64@default:false,org.eclipse.cdt.core.linux@default:false,org.eclipse.cdt.core.native@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.core.net@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.debug.core@default:default,org.eclipse.draw2d@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.e4.core.di.annotations@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.e4.emf.xpath@default:default,org.eclipse.e4.ui.bindings@default:default,org.eclipse.e4.ui.css.core@default:default,org.eclipse.e4.ui.css.swt.theme@default:default,org.eclipse.e4.ui.css.swt@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.e4.ui.swt.gtk@default:false,org.eclipse.e4.ui.widgets@default:default,org.eclipse.e4.ui.workbench.addons.swt@default:default,org.eclipse.e4.ui.workbench.renderers.swt@default:default,org.eclipse.e4.ui.workbench.swt@default:default,org.eclipse.e4.ui.workbench3@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.eavp.geometry.view.model@default:default,org.eclipse.eavp.viz.datastructures@default:default,org.eclipse.eavp.viz.modeling@default:default,org.eclipse.eavp.viz.service.mesh@default:default,org.eclipse.eavp.viz.service.visit@default:default,org.eclipse.eavp.viz.service@default:default,org.eclipse.eavp.viz@default:default,org.eclipse.ecf.discovery@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.osgi.services.distribution@default:default,org.eclipse.ecf.osgi.services.remoteserviceadmin.proxy@default:default,org.eclipse.ecf.osgi.services.remoteserviceadmin@default:default,org.eclipse.ecf.provider.discovery@default:default,org.eclipse.ecf.provider.filetransfer.httpclient4.ssl@default:false,org.eclipse.ecf.provider.filetransfer.httpclient4@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ecf.provider.r_osgi@default:default,org.eclipse.ecf.provider.remoteservice@default:default,org.eclipse.ecf.provider@default:default,org.eclipse.ecf.remoteservice.asyncproxy*1.0.100.v20150702-1411@default:default,org.eclipse.ecf.remoteservice.asyncproxy*2.0.100.v20150702-1411@default:default,org.eclipse.ecf.remoteservice.rest.synd@default:default,org.eclipse.ecf.remoteservice.rest@default:default,org.eclipse.ecf.remoteservice.servlet@default:default,org.eclipse.ecf.remoteservice.soap@default:default,org.eclipse.ecf.remoteservice@default:default,org.eclipse.ecf.sharedobject@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.bidi@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@default:true,org.eclipse.equinox.event@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.http.servletbridge@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.transport.ecf@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.region@default:false,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security@default:default,org.eclipse.equinox.servletbridge@default:default,org.eclipse.equinox.transforms.hook@default:false,org.eclipse.equinox.util@default:default,org.eclipse.equinox.weaving.hook@default:false,org.eclipse.fx.osgi@default:false,org.eclipse.help.base@default:default,org.eclipse.help.ui@default:default,org.eclipse.help@default:default,org.eclipse.january.geometry.model@default:default,org.eclipse.january.geometry.xtext.obj@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.jsch.core@default:default,org.eclipse.nebula.visualization.widgets@default:default,org.eclipse.nebula.visualization.xygraph@default:default,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi.services.remoteserviceadmin@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.platform@default:default,org.eclipse.remote.core@default:default,org.eclipse.remote.jsch.core@default:default,org.eclipse.remote.ui@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.swtbot.ant.junit@default:false,org.eclipse.text@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.ui.console@default:default,org.eclipse.ui.editors@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.intro@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.ui.trace@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.eclipse.wst.jsdt.nashorn.extension@default:false,org.eclipse.xsd@default:default,org.eclipse.xtend.lib.macro@default:default,org.eclipse.xtend.lib@default:default,org.eclipse.xtext.smap@default:default,org.eclipse.xtext.util@default:default,org.eclipse.xtext.xbase.lib@default:default,org.eclipse.xtext@default:default,org.hamcrest.core@default:default,org.jdom@default:default,org.junit@default:default,org.objectweb.asm@default:default,org.slf4j.api@default:default,org.slf4j.impl.log4j12@default:false,org.tukaani.xz@default:default,org.w3c.css.sac@default:default,org.w3c.dom.events@default:default,org.w3c.dom.smil*1.0.1.v200903091627@default:default,org.w3c.dom.svg@default:default"/>
<stringAttribute key="timestamp" value="1342815545071"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
......
......@@ -155,6 +155,12 @@ public class Core extends Application implements ICore, BundleActivator {
*/
private ServiceRegistration<ICore> registration;
/**
* This constant is used by ECF to register the exported interfaces for the
* remote OSGI service.
*/
private static final String OSGI_SERVICE_EXPORTED_INTERFACES = "service.exported.interfaces";
/**
* An alternative constructor that allows the Core to be constructed with a
* particular ItemManager. This is used for testing.
......@@ -170,8 +176,7 @@ public class Core extends Application implements ICore, BundleActivator {
// Set the project location
if (!setupProjectLocation()) {
throw new RuntimeException(
"ICore Message: Unable to load workspace!");
throw new RuntimeException("ICore Message: Unable to load workspace!");
}
// Set the update lock
......@@ -192,8 +197,7 @@ public class Core extends Application implements ICore, BundleActivator {
// Set the project location
if (!setupProjectLocation()) {
throw new RuntimeException(
"ICore Message: Unable to load workspace!");
throw new RuntimeException("ICore Message: Unable to load workspace!");
}
// Set the update lock
......@@ -246,18 +250,23 @@ public class Core extends Application implements ICore, BundleActivator {
itemManager.loadItems(itemDBProject);
// Start the webservice!
startHttpService();
//startHttpService();
// Configure the remote service properties
Dictionary<String, String> props = new Hashtable<>();
// OSGi Standard Property - indicates which of the interfaces of the
// service will be exported. '*' means 'all'.
props.put("service.exported.interfaces", "*");
// OSGi Standard Property (optional) - indicates which provider
// config(s) will be used to export the service
// (If not explicitly given here, the provider is free to choose a
// default configuration for the service)
Dictionary<String, Object> props = new Hashtable<>();
// Add OSGi required remote service properties
props.put(OSGI_SERVICE_EXPORTED_INTERFACES, System.getProperty(OSGI_SERVICE_EXPORTED_INTERFACES, "*"));
// Use ECF generic server config.
props.put("service.exported.configs", "ecf.generic.server");
// Setup hostname config (default:localhost)
String hostname = System.getProperty("ecf.generic.server.hostname");
if (hostname != null) {
props.put("ecf.generic.server.hostname", hostname);
}
// Setup port config (default:-1)
props.put("ecf.generic.server.port", new Integer(System.getProperty("ecf.generic.server.port", "-1")));
// Setup IRaspberryPiAsync as async remote service
props.put("ecf.exported.async.interfaces", "*");
// Register this class as a service with the framework.
if (context != null) {
......@@ -274,11 +283,9 @@ public class Core extends Application implements ICore, BundleActivator {
if (bundleContext != null) {
// Grab the service interface
matDBServiceRef = bundleContext
.getServiceReference(IMaterialsDatabase.class);
matDBServiceRef = bundleContext.getServiceReference(IMaterialsDatabase.class);
// Get the service
IMaterialsDatabase database = bundleContext
.getService(matDBServiceRef);
IMaterialsDatabase database = bundleContext.getService(matDBServiceRef);
// This should probably be delegated through the ItemManager.
AbstractModelBuilder.setMaterialsDatabase(database);
}
......@@ -321,8 +328,7 @@ public class Core extends Application implements ICore, BundleActivator {
// Register the builder with the ItemManager so long as it is not null
if (itemBuilder != null) {
logger.info("ICore Message: Item " + itemBuilder.getItemName()
+ " registered with Core.");
logger.info("ICore Message: Item " + itemBuilder.getItemName() + " registered with Core.");
itemManager.registerBuilder(itemBuilder);
}
......@@ -339,8 +345,7 @@ public class Core extends Application implements ICore, BundleActivator {
// Register the builder with the ItemManager so long as it is not null
if (builder != null) {
logger.info("ICore Message: Composite Item " + builder.getItemName()
+ " registered with Core.");
logger.info("ICore Message: Composite Item " + builder.getItemName() + " registered with Core.");
itemManager.registerCompositeBuilder(builder);
}
......@@ -364,8 +369,7 @@ public class Core extends Application implements ICore, BundleActivator {
@Override
public String createItem(String itemType) {
// This operation retrieves the default "itemDB
IProject project = ResourcesPlugin.getWorkspace().getRoot()
.getProject("itemDB");
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("itemDB");
return createItem(itemType, project);
}
......@@ -387,8 +391,7 @@ public class Core extends Application implements ICore, BundleActivator {
if (itemType != null && project != null) {
newItemId = itemManager.createItem(itemType, project);
} else {
logger.error("Unable to create Item in the core! Type = " + itemType
+ " , project = " + project);
logger.error("Unable to create Item in the core! Type = " + itemType + " , project = " + project);
}
return String.valueOf(newItemId);
......@@ -476,8 +479,7 @@ public class Core extends Application implements ICore, BundleActivator {
* @see ICore#processItem(int itemId, String actionName, int uniqueClientId)
*/
@Override
public FormStatus processItem(int itemId, String actionName,
int uniqueClientId) {
public FormStatus processItem(int itemId, String actionName, int uniqueClientId) {
// Local Declarations
FormStatus status = FormStatus.InfoError;
......@@ -582,18 +584,15 @@ public class Core extends Application implements ICore, BundleActivator {
// Grab PSF or XML file
if (filename.endsWith(".psf") | filename.endsWith(".xml")) {
// Get the file
file = project.getFile(
currentResource.getProjectRelativePath());
file = project.getFile(currentResource.getProjectRelativePath());
try {
// Load the SerializedItemBuilder
builder = new SerializedItemBuilder(
file.getContents());
builder = new SerializedItemBuilder(file.getContents());
// Register the builder
itemManager.registerBuilder(builder);
} catch (IOException e) {
// TODO Auto-generated catch block
logger.error(getClass().getName() + " Exception!",
e);
logger.error(getClass().getName() + " Exception!", e);
status = false;
}
}
......@@ -632,8 +631,7 @@ public class Core extends Application implements ICore, BundleActivator {
// are no longer using Declarative Services.
if (bundleContext != null) {
// Grab the service reference and the service
httpServiceRef = bundleContext
.getServiceReference(HttpService.class);
httpServiceRef = bundleContext.getServiceReference(HttpService.class);
// If it is good to go, start up the webserver
if (httpServiceRef != null) {
......@@ -645,8 +643,7 @@ public class Core extends Application implements ICore, BundleActivator {
httpService = bundleContext.getService(httpServiceRef);
// Set the parameters
servletParams.put("javax.ws.rs.Application",
Core.class.getName());
servletParams.put("javax.ws.rs.Application", Core.class.getName());
// Register the service
try {
......@@ -655,8 +652,7 @@ public class Core extends Application implements ICore, BundleActivator {
bundle = bundleContext.getBundle();
// Make sure we got a valid bundle
if (bundle == null) {
logger.info(
"ICE Core Bundle was null! No web service started.");
logger.info("ICE Core Bundle was null! No web service started.");
return;
}
......@@ -666,14 +662,10 @@ public class Core extends Application implements ICore, BundleActivator {
// Resolve the URLs to be absolute
resourceURL = FileLocator.resolve(resourceURL);
configFileURL = FileLocator.resolve(configFileURL);
HttpContext httpContext = new BasicAuthSecuredContext(
resourceURL, configFileURL,
HttpContext httpContext = new BasicAuthSecuredContext(resourceURL, configFileURL,
"ICE Core Server Configuration");
httpService.registerServlet("/ice",
new ServletContainer(this), servletParams,
httpContext);
} catch (ServletException | NamespaceException
| IOException e) {
httpService.registerServlet("/ice", new ServletContainer(this), servletParams, httpContext);
} catch (ServletException | NamespaceException | IOException e) {
logger.error(getClass().getName() + " Exception!", e);
}
logger.info("ICE Core Server loaded and web service started!");
......@@ -734,8 +726,7 @@ public class Core extends Application implements ICore, BundleActivator {
// If the project does not exist, create it
if (!project.exists()) {
// Create the project description
IProjectDescription desc = ResourcesPlugin.getWorkspace()
.newProjectDescription(defaultProjectName);
IProjectDescription desc = ResourcesPlugin.getWorkspace().newProjectDescription(defaultProjectName);
// Create the project
project.create(desc, null);
}
......@@ -839,13 +830,11 @@ public class Core extends Application implements ICore, BundleActivator {
JsonObject messageJsonObject = messageJson.getAsJsonObject();
// Get the Item id from the json
JsonPrimitive itemIdJson = messageJsonObject
.getAsJsonPrimitive("item_id");
JsonPrimitive itemIdJson = messageJsonObject.getAsJsonPrimitive("item_id");
int itemId = itemIdJson.getAsInt();
// Get the array of posts from the message
JsonArray jsonMessagesList = messageJsonObject
.getAsJsonArray("posts");
JsonArray jsonMessagesList = messageJsonObject.getAsJsonArray("posts");
// Load the list
for (int i = 0; i < jsonMessagesList.size(); i++) {
......@@ -862,8 +851,7 @@ public class Core extends Application implements ICore, BundleActivator {
}
} catch (JsonParseException e) {
// Log the message
String err = "Core Message: " + "JSON parsing failed for message "
+ messageString;
String err = "Core Message: " + "JSON parsing failed for message " + messageString;
logger.error(getClass().getName() + " Exception!", e);
logger.error(err);
}
......@@ -887,8 +875,7 @@ public class Core extends Application implements ICore, BundleActivator {
// Print the message if debugging is enabled
// if (debuggingEnabled) {
logger.info(
"Core Message: " + "Update received with message: " + message);
logger.info("Core Message: " + "Update received with message: " + message);
// }
// Only process the message if it exists and is not empty
......@@ -898,8 +885,7 @@ public class Core extends Application implements ICore, BundleActivator {
String[] messageParts = message.split("=");
if (messageParts.length > 1) {
// Get the message object.
ArrayList<Message> msgList = buildMessagesFromString(
messageParts[1]);
ArrayList<Message> msgList = buildMessagesFromString(messageParts[1]);
// Post the messages if there are any. Fail otherwise.
if (!msgList.isEmpty()) {
for (int i = 0; i < msgList.size(); i++) {
......@@ -933,8 +919,7 @@ public class Core extends Application implements ICore, BundleActivator {
* java.lang.String, org.eclipse.core.resources.IProject)
*/
@Override
public String importFileAsItem(URI file, String itemType,
IProject project) {
public String importFileAsItem(URI file, String itemType, IProject project) {
// Local Declarations
int newItemId = -1;
......@@ -945,8 +930,7 @@ public class Core extends Application implements ICore, BundleActivator {
importFile(file, project);
// Get the name of the file. This is only created to get the short
// name of the file. Then create the Item
newItemId = itemManager.createItem(new File(file).getName(),
itemType, project);
newItemId = itemManager.createItem(new File(file).getName(), itemType, project);
}
return String.valueOf(newItemId);
......@@ -963,8 +947,7 @@ public class Core extends Application implements ICore, BundleActivator {
// This is an IFile, meaning it came from an existing
// IProject, call importFileAsItem with the file URI and its
// corresponding IProject
return importFileAsItem(file.getLocationURI(), itemType,
file.getProject());
return importFileAsItem(file.getLocationURI(), itemType, file.getProject());
}
/**
......@@ -974,11 +957,9 @@ public class Core extends Application implements ICore, BundleActivator {
* java.lang.String, java.lang.String)
*/
@Override
public String importFileAsItem(URI file, String itemType,
String projectName) {
public String importFileAsItem(URI file, String itemType, String projectName) {
// Get the project associated with the project name
IProject project = ResourcesPlugin.getWorkspace().getRoot()
.getProject(projectName);
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
// Import it as normal
return importFileAsItem(file, itemType, project);
......@@ -1007,13 +988,12 @@ public class Core extends Application implements ICore, BundleActivator {
@Override
public void importFile(URI file, String projectName) {
// Local Declarations
IProject project = ResourcesPlugin.getWorkspace().getRoot()
.getProject(projectName);
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if (project != null) {
importFile(file, project);
} else {
logger.info("File could not be imported into project " + projectName
+ " because the project does not exist.");
logger.info(
"File could not be imported into project " + projectName + " because the project does not exist.");
}
}
......@@ -1033,8 +1013,7 @@ public class Core extends Application implements ICore, BundleActivator {
IFile fileInProject = project.getFile(path.lastSegment());
// Get the paths and convert them to strings
IPath fullPathInProject = fileInProject.getLocation();
String path1 = path.toString(),
path2 = fullPathInProject.toString();
String path1 = path.toString(), path2 = fullPathInProject.toString();
// Remove devices ids and other such things from the path strings
path1 = path1.substring(path1.lastIndexOf(":") + 1);
path2 = path2.substring(path2.lastIndexOf(":") + 1);
......@@ -1050,16 +1029,14 @@ public class Core extends Application implements ICore, BundleActivator {
fileInProject.delete(true, null);
} catch (CoreException e) {
// Complain and don't do anything else.
logger.info(
"Core Message: " + "Unable to import file.");
logger.info("Core Message: " + "Unable to import file.");
logger.error(getClass().getName() + " Exception!", e);
return;
}
}
try {
// Open a stream of the file
FileInputStream fileStream = new FileInputStream(
new File(file));
FileInputStream fileStream = new FileInputStream(new File(file));
// Import the file
fileInProject.create(fileStream, true, null);
} catch (FileNotFoundException e) {
......@@ -1079,12 +1056,10 @@ public class Core extends Application implements ICore, BundleActivator {
// Drop some debug info.
if (System.getProperty("DebugICE") != null) {
logger.info(
"Core Message: " + "Imported file " + file.toString());
logger.info("Core Message: " + "Imported file " + file.toString());
}
} else {
logger.info(
"File could not be imported into project because the File URI was not valid.");
logger.info("File could not be imported into project because the File URI was not valid.");
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment