Package jadex.extension.rs.publish
Class NanoRestPublishService
- java.lang.Object
-
- jadex.extension.rs.publish.AbstractRestPublishService
-
- jadex.extension.rs.publish.ExternalRestPublishService
-
- jadex.extension.rs.publish.NanoRestPublishService
-
- All Implemented Interfaces:
IPublishService,IWebPublishService,IRequestHandlerService
public class NanoRestPublishService extends ExternalRestPublishService
Publish service using Nano.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jadex.extension.rs.publish.AbstractRestPublishService
AbstractRestPublishService.MappingInfo, AbstractRestPublishService.RequestInfo
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.Integer,NanoWebsocketServer>portservers2The servers per port.-
Fields inherited from class jadex.extension.rs.publish.ExternalRestPublishService
DEFAULT_APP, DEFAULT_COMPLETECONTEXT, DEFAULT_HOST, DEFAULT_PORT, inited, portservers, sidservers
-
Fields inherited from class jadex.extension.rs.publish.AbstractRestPublishService
ASYNC_CONTEXT_INFO, component, converters, FINISHED, HEADER_JADEX_CALLFINISHED, HEADER_JADEX_CALLID, HEADER_JADEX_CLIENTTIMEOUT, HEADER_JADEX_TERMINATE, PARAMETER_MEDIATYPES, requestinfos, requestspercall
-
Fields inherited from interface jadex.bridge.service.types.publish.IPublishService
DEFAULT_RSPUBLISH_COMPONENTS, PUBLISH_RS, PUBLISH_WS
-
-
Constructor Summary
Constructors Constructor Description NanoRestPublishService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.URIconvertUri(java.lang.String pid)Convert the publish id to uri.static java.io.FilegetFile(java.lang.ClassLoader cl, java.lang.String path)java.lang.ObjectgetHttpServer(java.net.URI uri, PublishInfo info)Get or start an api to the http server.static java.io.InputStreamgetInputStream(java.io.File f)PathHandlergetPathHandler(java.net.URI uri, PublishInfo info)Get or start an api to the http server.static java.net.URLgetURL(java.lang.ClassLoader cl, java.lang.String path)IFuture<java.lang.Void>publishResources(java.lang.String pid, java.lang.String rootpath)Publish file resources from the classpath.voidstart()voidstop()-
Methods inherited from class jadex.extension.rs.publish.ExternalRestPublishService
getServicesInfo, handleRequest, init, isSupported, mirrorHttpServer, publishExternal, publishHMTLPage, publishRedirect, publishService, shutdownHttpServer, unpublish, unpublishService
-
Methods inherited from class jadex.extension.rs.publish.AbstractRestPublishService
addConverter, addEntry, complete, convertJsonValue, convertParameter, convertParameter, evaluateMapping, extractCallerValues, getAsyncContext, getCleanPublishId, getParameterInfos, getRequestTimeout, getServiceInfo, getServletHost, getServletUrl, guessRestType, handleRequest, hasStringConvertableParameters, isComplete, loadFunctionJS, loadStyleCSS, main, mapParameters, mapResult, parseMimetypes, removeConverter, saveRequestContext, splitQueryString, writeResponse, writeResponse, writeResponseContent, writeResponseHeader
-
-
-
-
Field Detail
-
portservers2
protected java.util.Map<java.lang.Integer,NanoWebsocketServer> portservers2
The servers per port.
-
-
Method Detail
-
start
public void start()
-
stop
public void stop()
-
getHttpServer
public java.lang.Object getHttpServer(java.net.URI uri, PublishInfo info)Get or start an api to the http server.- Overrides:
getHttpServerin classExternalRestPublishService
-
getPathHandler
public PathHandler getPathHandler(java.net.URI uri, PublishInfo info)
Get or start an api to the http server.
-
publishResources
public IFuture<java.lang.Void> publishResources(java.lang.String pid, java.lang.String rootpath)
Publish file resources from the classpath.- Specified by:
publishResourcesin interfaceIWebPublishService- Overrides:
publishResourcesin classExternalRestPublishService- Parameters:
pid- The publish url.rootpath- The classpath root path where to look for the reources.
-
getFile
public static java.io.File getFile(java.lang.ClassLoader cl, java.lang.String path) throws java.io.IOException- Throws:
java.io.IOException
-
getInputStream
public static java.io.InputStream getInputStream(java.io.File f) throws java.io.IOException- Throws:
java.io.IOException
-
getURL
public static java.net.URL getURL(java.lang.ClassLoader cl, java.lang.String path)
-
convertUri
public java.net.URI convertUri(java.lang.String pid)
Convert the publish id to uri.- Overrides:
convertUriin classExternalRestPublishService
-
-