/** * Create an HTTPS restlet Server instance matching the given parameters. * * @param port * @param address * @param keystorePath * @param keystorePassword * @param keyPassword */ protected void setupServer(int port, String address, String keystorePath, String keystorePassword, String keyPassword) { Server server = new Server(Protocol.HTTPS,address,port,null); component.getServers().add(server); server.getContext().getParameters().add("keystorePath", keystorePath); server.getContext().getParameters().add("keystorePassword", keystorePassword); server.getContext().getParameters().add("keyPassword", keyPassword); }
public void start() throws Exception { _component.getServers().add(Protocol.HTTP, Integer.parseInt(_config.getControllerPort())); _component.getClients().add(Protocol.FILE); _component.getClients().add(Protocol.JAR);
public static void main(String[] args) throws Exception { // Create a new Restlet component and add a HTTP server connector to it Component component = new Component(); component.getServers().add(Protocol.HTTP, 8111); // Then attach it to the local host component.getDefaultHost().attach("/trace", Part05_RestletComponents.class); // Now, let's start the component! // Note that the HTTP server connector is also automatically started. component.start(); }
public static void main(String[] args) throws Exception { Component component = new Component(); component.getDefaultHost().attachDefault(CachingServerResource.class); component.getServers().add(Protocol.HTTP, 8111); component.start(); }
public static void main(String[] args) throws Exception { // Create a new Component. Component component = new Component(); // Add a new HTTP server listening on port 8111. component.getServers().add(Protocol.HTTP, 8111); component.getDefaultHost().attach("/firstResource", new FirstResourceApplication()); // Start the component. component.start(); }
public static void main(String[] args) throws Exception { Component c = new Component(); c.getServers().add(Protocol.HTTP, 8182); c.getDefaultHost().attach(new QueryRouterApplication()); c.start(); }
public static void main(String[] args) throws Exception { // Create a new Component. Component component = new Component(); // Add a new HTTP server listening on port 8111. component.getServers().add(Protocol.HTTP, 8111); // Attach the sample application. component.getDefaultHost().attach("/firstSteps", new FirstStepsApplication()); // Start the component. component.start(); } }
public static void main(String[] args) throws Exception { // Create a new Component. Component component = new Component(); // Add a new HTTP server listening on port 8111. component.getServers().add(Protocol.HTTP, 8111); component.getDefaultHost().attach("/firstResource", new FirstResourceApplication()); // Start the component. component.start(); }
public static void main(String[] args) throws Exception { Component c = new Component(); c.getServers().add(Protocol.HTTP, 8182); c.getDefaultHost().attach(new FileUploadApplication()); c.start(); }
public static void main(String[] args) throws Exception { // Create a component Component component = new Component(); component.getServers().add(Protocol.HTTP, 8111); // Create an application Application application = new SearchRedirector(); // Attach the application to the component and start it component.getDefaultHost().attachDefault(application); component.start(); }
/** * Launches the application with an HTTP server. * * @param args * The arguments. * @throws Exception */ public static void main(String[] args) throws Exception { Component mailServer = new Component(); mailServer.getServers().add(Protocol.HTTP, 8111); mailServer.getDefaultHost().attach(new MailServerApplication()); mailServer.start(); }
public void start() throws Exception { Injector injector = RestletGuice.createInjector(modules); Application instance = injector.getInstance(application); Component component = new Component(); component.getServers().add(Protocol.HTTP, port); component.getClients().add(Protocol.FILE); component.getClients().add(Protocol.CLAP); component.getDefaultHost().attach(instance); component.start(); }
public static void main(String[] args) throws Exception { Component server = new Component() ; server.getServers().add(Protocol.HTTP, 8080) ; server.getDefaultHost().attach(new CartServer()) ; server.start() ; CartAPI.generateOrders() ; }
public static void main(String[] args) throws Exception { Component c = new Component(); // server listening on pport 8182 c.getServers().add(Protocol.HTTP, 8182); // client connector required by the Directory. c.getClients().add(Protocol.FILE); c.getDefaultHost().attach(new AuthenticationApplication()); c.start(); }
public static void main(String[] args) throws Exception { Component component = new Component(); component.getServers().add(Protocol.HTTP, 8111); component.getClients().add(Protocol.FILE); component.getDefaultHost().attach(new MergeSitesServicesApplication()); component.start(); }
public static void main(String[] args) throws Exception { Component c = new Component(); // server listening on pport 8182 c.getServers().add(Protocol.HTTP, 8182); // client connector required by the Directory. c.getClients().add(Protocol.FILE); c.getDefaultHost().attach(new HttpDigestAuthenticationApplication()); c.start(); }
@Inject public RestComponent(@Hello Application helloApp, @Car Application carApp, Verifier authTokenVerifier) { getClients().add(Protocol.HTTPS); Server secureServer = getServers().add(Protocol.HTTPS, 8043); Series<Parameter> parameters = secureServer.getContext().getParameters(); parameters.add("sslContextFactory", "org.restlet.engine.ssl.DefaultSslContextFactory"); parameters.add("keyStorePath", System.getProperty("javax.net.ssl.keyStorePath")); getDefaultHost().attach("/api/hello", secure(helloApp, authTokenVerifier, "ame")); getDefaultHost().attach("/api/cars", secure(carApp, authTokenVerifier, "ame")); replaceConverter(JacksonConverter.class, new JacksonCustomConverter()); }
public static void main(String[] args) throws Exception { // Setup Restlet Component component = new Component(); component.getClients().add(Protocol.HTTP); component.getClients().add(Protocol.HTTPS); component.getServers().add(Protocol.HTTP, 8888); component.getDefaultHost().attach("/sample", new SampleApplication()); component.start(); } }
@Override public void startServer() throws Exception { configuration.refresh(); component = new Component(); component.getServers().add( Protocol.HTTP, configuration.get().port().get() ); RestApplication application = module.newObject( RestApplication.class, component.getContext() ); component.getDefaultHost().attach( application ); component.start(); }
public static void main(String... args) throws Exception { // Create a component with an HTTP server connector final Component component = new Component(); component.getServers().add(Protocol.HTTP, 8585); component.getClients().add(Protocol.FILE); component.getClients().add(Protocol.CLAP); component.getClients().add(Protocol.HTTP); // Attach the application to the default host and start it component.getDefaultHost().attach("/foaf", new Application()); component.start(); }