L2p Service Migration v0.6 to v0.7 - rwth-acis/las2peer-template-project GitHub Wiki
Service bundles
-
Service dependencies should be bundles into the service jar. The core does not handle dependencies anymore to circumvent security and compatibility issues. Please update your build script according to the template project.
-
One service, one jar. No two services in one jar are allowed anymore.
Java API
- The API lives now in its own package
i5.las2peer.api
. The service may only access this package, the RESTMapper packagei5.las2peer.restMapper
and some JDK packages. Access to all other classes is restricted, except they are bundles in the service bundle.
Quick refactoring hints
A brief overview of renamed classes is given in the following. Some features changed significally, please refer to the API documentation for more information.
-
rename i5.las2peer.webConnector.WebConnector.properties files to i5.las2peer.connectors.webConnector.WebConnector.properties
-
organise imports, some classes/interfaces moved to api package
-
remove
L2pSecurityException
-
replace
L2pServiceException
withInternalServiceException
or remove it -
replace
Event
withMonitoringEvent
-
replace
AgentNotKnownException
withAgentNotFoundException
-
replace
Service.getContext()
withContext.get()
-
replace
fetchEnvelope
withrequestEnvelope
-
replace
ArtifactNotFoundException
withEnvelopeNotFoundException
-
replace
Agent.getId()
withAgent.getIdentifier()
-
replace
Agent.unlockPrivateKey()
withAgent.unlock()
-
replace
Context.get().getAgent(long)
withContext.get().requestAgent(String)
, the retrieved agent is automatically unlocked using the current main agent -
replace
createEnvelope(identifier, content, owner)
withcreateEnvelope(identifier, owner)
andsetContent(content)
call on the returned envelope instance usual update or create structure looks like this:Envelope env; try { env = Context.get().requestEnvelope(identifier); } catch (EnvelopeNotFoundException e) { logger.info("Envelope (" + identifier + ") not found. Creating new one. " + e.toString()); env = Context.get().createEnvelope(identifier, owner); } // update envelope content env.setContent(file); // store envelope with new content Context.get().storeEnvelope(env, owner);