Presents a {@link DenominatorDApi REST api} to users, by default listening on port 8080.
346634
public static void main(final String... args) throws IOException {
    checkArgument(args.length > 0, SYNTAX);
    setupLogging();

    String portOverride = System.getenv("DENOMINATORD_PORT");
    int port = portOverride != null ? Integer.parseInt(portOverride) : 8080;
    Provider provider = Providers.getByName(args[0]);
    log.info("proxying " + provider);
    Object credentials = credentialsFromArgs(args);

    DNSApiManager mgr = Denominator.create(provider, credentials, new JavaLogger());
    new DenominatorD(mgr).start(port);
  }
615380
public static Server of(int port) {
        final ServerBuilder sb = new ServerBuilder();

        return sb.http(port)
                 .annotatedService("/pathPattern", new PathPatternService())
                 .annotatedService("/injection", new InjectionService())
                 .annotatedService("/messageConverter", new MessageConverterService())
                 .annotatedService("/exception", new ExceptionHandlerService())
                 .build();
    }
500100
function listen(self, address, port, addressType, backlog, exclusive) {
    /* TODO Index servers by a self-assigned identifier and the process
     * identifier so messages intended for previous instances do not pass
     * through. */
    servers[port] = self; // Index servers by port.
    self._port = port; // Remember the requested port for close.
    process.send({
        cmd: 'CLUSTER_LISTEN',
        port: port,
        address: address, // For confirmation purposes only.
        addressType: addressType, // We allow the supervisor to infer the address type.
        backlog: backlog, // Used to confirm uniformity of worker requests.
        exclusive: exclusive // TODO use this on the other end
    });
}
1340578
public ApiResponse<ApiEndpointsSuccess> getApiEndpointsWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = getApiEndpointsValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiEndpointsSuccess>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
840584
public ApiResponse<ApiPostEndpointsSuccess> postApiEndpointsWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = postApiEndpointsValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiPostEndpointsSuccess>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
1005131
public ApiResponse<GetArgsResponse> argsWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = argsValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<GetArgsResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
79111
public function listEndpoints() {
    $uri = new URIResource($this->path, array($this->id, "endpoints"));

    return new EndpointsCollection(new DataPacketCollection($this->client->get((string) $uri)));
  }
1200880
public ApiResponse<ApiSuccessResponse> modifyOutboundSettingsWithHttpInfo(ModifyOutboundData body) throws ApiException {
        com.squareup.okhttp.Call call = modifyOutboundSettingsValidateBeforeCall(body, null, null);
        Type localVarReturnType = new TypeToken<ApiSuccessResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
1310304
public static void main(String[] args) throws IOException {
		String outputDirectory = args[0];

		for (final RestAPIVersion apiVersion : RestAPIVersion.values()) {
			if (apiVersion == RestAPIVersion.V0) {
				// this version exists only for testing purposes
				continue;
			}
			createHtmlFile(
				new DocumentingDispatcherRestEndpoint(),
				apiVersion,
				Paths.get(outputDirectory, "rest_" + apiVersion.getURLVersionPrefix() + "_dispatcher.html"));
		}
	}
873111
function DevAdapter (controller) {
    this.id        = controller.svc;
    this.uid       = "//" + controller.svcopts.adapter + "/" + controller.svc + ":" +  controller.svcopts.port;;
    this.info      = 'Restapi';
    this.debug     = controller.svcopts.debug;  // inherit debug from controller
    this.controller= controller;  // keep a link to device controller and TCP socket
    this.control   = 'http';
    this.cors      = controller.svcopts.cors || false;
}
440922
@Deprecated
    public RpcInternalContext setLocalAddress(String host, int port) {
        if (host == null) {
            return this;
        }
        if (port < 0 || port > 0xFFFF) {
            port = 0;
        }
        // 提前检查是否为空，防止createUnresolved抛出异常，损耗性能
        this.localAddress = InetSocketAddress.createUnresolved(host, port);
        return this;
    }
207745
public static void main(String[] args) throws Exception {
		// javamelody parameters (optional),
		final Map<Parameter, String> parameters = new HashMap<>();
		// to add basic auth:
		// parameters.put(Parameter.AUTHORIZED_USERS, "admin:pwd");

		// to change the default storage directory:
		// parameters.put(Parameter.STORAGE_DIRECTORY, "/tmp/javamelody");

		// to change the default resolution in seconds:
		// parameters.put(Parameter.RESOLUTION_SECONDS, "60");

		// to hide all statistics such as http and sql, except logs:
		// parameters.put(Parameter.DISPLAYED_COUNTERS, "log");
		// parameters.put(Parameter.NO_DATABASE, "true");

		// enable hotspots sampling with a period of 1 second:
		parameters.put(Parameter.SAMPLING_SECONDS, "1.0");

		// set the path of the reports:
		parameters.put(Parameter.MONITORING_PATH, "/");

		// start the embedded http server with javamelody
		EmbeddedServer.start(8080, parameters);
		System.out.println("");
		System.out.println("For the reports, you can browse http://localhost:8080/");
		System.out.println("");

		// compute PI just to have something to do
		System.out.print("PI = ");
		final Pi p = new Pi();
		p.calcPiDigits();
	}
79482
public String generateSecuredApiKey(String privateApiKey, Query query) throws NoSuchAlgorithmException, InvalidKeyException {
    return generateSecuredApiKey(privateApiKey, query, null);
  }
1001739
@PostMapping(value = "/v1/users", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    public ResponseEntity<String> createTicketGrantingTicket(@RequestBody final MultiValueMap<String, String> requestBody,
                                                             final HttpServletRequest request) {
        try {
            val credential = this.credentialFactory.fromRequest(request, requestBody);
            if (credential == null || credential.isEmpty()) {
                throw new BadRestRequestException("No credentials are provided or extracted to authenticate the REST request");
            }
            val service = this.serviceFactory.createService(request);
            val authenticationResult =
                authenticationSystemSupport.handleAndFinalizeSingleAuthenticationTransaction(service, credential);
            if (authenticationResult == null) {
                throw new FailedLoginException("Authentication failed");
            }
            return this.userAuthenticationResourceEntityResponseFactory.build(authenticationResult, request);
        } catch (final AuthenticationException e) {
            return RestResourceUtils.createResponseEntityForAuthnFailure(e, request, applicationContext);
        } catch (final BadRestRequestException e) {
            LOGGER.error(e.getMessage(), e);
            return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
            return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
        }
    }
8973
public static PredictionEndpoint authenticate(RestClient restClient, final String apiKey) {
        return new PredictionEndpointImpl(restClient).withApiKey(apiKey);
    }
311449
@Deprecated
    public static Endpoint of(String host, int port, int weight) {
        return of(host, port).withWeight(weight);
    }
1071879
public ApiResponse<GetExportStatisticDefinitions> getExportStatisticDefinitionsWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = getExportStatisticDefinitionsValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<GetExportStatisticDefinitions>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }