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>
portservers2
The 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.URI
convertUri(java.lang.String pid)
Convert the publish id to uri.static java.io.File
getFile(java.lang.ClassLoader cl, java.lang.String path)
java.lang.Object
getHttpServer(java.net.URI uri, PublishInfo info)
Get or start an api to the http server.static java.io.InputStream
getInputStream(java.io.File f)
PathHandler
getPathHandler(java.net.URI uri, PublishInfo info)
Get or start an api to the http server.static java.net.URL
getURL(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.void
start()
void
stop()
-
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:
getHttpServer
in 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:
publishResources
in interfaceIWebPublishService
- Overrides:
publishResources
in 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:
convertUri
in classExternalRestPublishService
-
-