@Test public void buildDocumentDescription() throws Throwable { setUp(false); URI factoryUri = UriUtils.buildUri(this.host, ExampleService.FACTORY_LINK); Map<URI, ExampleServiceState> states = this.host.doFactoryChildServiceStart(null, this.serviceCount, ExampleServiceState.class, (op) -> { ExampleServiceState st = new ExampleServiceState(); st.name = "foo"; op.setBody(st); }, factoryUri); validateDescriptions(states); TestContext ctx = this.host.testCreate(states.size()); for (URI childUri : states.keySet()) { Operation delete = Operation.createDelete(childUri) .setCompletion(ctx.getCompletion()); this.host.send(delete); } this.host.testWait(ctx); validateDescriptions(states); }
public ServiceDocumentDescription buildDocumentDescription(String servicePath) { Service s = findService(servicePath); if (s == null) { String parentPath = UriUtils.getParentPath(servicePath); return this.descriptionCachePerFactoryLink.get(parentPath); } return buildDocumentDescription(s); }
ServiceHost implements ServiceRequestSender { public ServiceDocumentDescription buildDocumentDescription(String servicePath) { Service s = findService(servicePath); if (s == null) { String parentPath = UriUtils.getParentPath(servicePath); return this.descriptionCachePerFactoryLink.get(parentPath); } return buildDocumentDescription(s); } }
ServiceHost implements ServiceRequestSender { public ServiceDocumentDescription buildDocumentDescription(String servicePath) { Service s = findService(servicePath); if (s == null) { String parentPath = UriUtils.getParentPath(servicePath); return this.descriptionCachePerFactoryLink.get(parentPath); } return buildDocumentDescription(s); } protected  ServiceHost(); }
ServiceHost implements ServiceRequestSender { public ServiceDocumentDescription buildDocumentDescription(String servicePath) { Service s = findService(servicePath); if (s == null) { String parentPath = UriUtils.getParentPath(servicePath); return this.descriptionCachePerFactoryLink.get(parentPath); } return buildDocumentDescription(s); } protected  ServiceHost(); static ServiceHost create(String... args); ServiceHost initialize(String[] args); ServiceHost initialize(Arguments args); String getLocation(); void setLocation(String location); @Override String toString(); boolean isStarted(); boolean isStopping(); boolean isServiceStateCaching(); ServiceHost setServiceStateCaching(boolean enable); int getPort(); ServiceHost setPort(int port); boolean isAuthorizationEnabled(); void setAuthorizationEnabled(boolean isAuthorizationEnabled); boolean isPeerSynchronizationEnabled(); void setPeerSynchronizationEnabled(boolean enabled); boolean isRequestLoggingEnabled(); RequestLoggingInfo getRequestLoggingInfo(); List<String> getSkipLoggingPragmaDirectives(); void setRequestLoggingInfo(RequestLoggingInfo loggingInfo); int getPeerSynchronizationTimeLimitSeconds(); void setPeerSynchronizationTimeLimitSeconds(int seconds); boolean isAutoBackupEnabled(); void setAutoBackupEnabled(boolean enabled); int getSecurePort(); ServiceHost setSecurePort(int port); ServiceHost setPrivateKeyFileReference(URI fileReference); ServiceHost setPrivateKeyPassphrase(String privateKeyPassphrase); ServiceHost setCertificateFileReference(URI fileReference); ServiceHost setBindAddress(String address); ServiceHost setPublicUri(URI publicUri); ServiceHost setId(String id); URI getStorageSandbox(); long getMaintenanceIntervalMicros(); long getMaintenanceCheckIntervalMicros(); ServiceHost setMaintenanceIntervalMicros(long micros); String getId(); String nextUUID(); long getOperationTimeoutMicros(); ServiceHostState getState(); URI getDocumentIndexServiceUri(); URI getAuthorizationServiceUri(); URI getManagementServiceUri(); ServiceHost setDocumentIndexingService(Service service); ServiceHost setAuthorizationService(Service service); ServiceHost setManagementService(Service service); ServiceStat getManagementServiceStat(String name); ServiceHost setAuthenticationService(Service service); URI getAuthenticationServiceUri(); ScheduledExecutorService getScheduledExecutor(); ExecutorService getExecutor(); ExecutorService allocateExecutor(Service s); ExecutorService allocateExecutor(Service s, int threadCount); ServiceHost start(); void startDefaultCoreServicesSynchronously(); void startDefaultCoreServicesSynchronously(boolean joinPeerNodes); List<URI> getInitialPeerHosts(); Path copyResourceToSandbox(URL url, Path resourcePath); Path discoverJarResources(Path path, Service s, Map<Path, String> pathToURIPath,
            Path baseUriPath, String prefix); Path discoverFileResources(Service s, Map<Path, String> pathToURIPath,
            Path baseUriPath,
            String prefix); void joinPeers(List<URI> peers, String nodeGroupUriPath); void startFactoryServicesSynchronously(Service... services); URI startSubscriptionService(
            Operation subscribe,
            Consumer<Operation> notificationConsumer); URI startReliableSubscriptionService(
            Operation subscribe,
            Consumer<Operation> notificationConsumer); URI startSubscriptionService(
            Operation subscribe,
            Consumer<Operation> notificationConsumer,
            ServiceSubscriber request); URI startSubscriptionService(
            Operation subscribe,
            Service notificationTarget,
            ServiceSubscriber request); void stopSubscriptionService(
            Operation unsubscribe,
            URI notificationTarget); static boolean isServiceStartingOrAvailable(ProcessingStage stage); static boolean isServiceStarting(ProcessingStage stage); ServiceHost startService(Service service); ServiceHost startService(Operation post, Service service); ServiceHost startFactory(Service instanceService); ServiceHost startFactory(Class<? extends Service> instServiceClass,
            Supplier<FactoryService> factoryCreator); ServiceHost startFactory(Supplier<FactoryService> factoryCreator, String servicePath); ServiceHost startIdempotentFactory(Service instanceService); static void restoreActionOnChildServiceToPostOnFactory(String link, Operation op); static boolean isServiceIndexed(Service s); static boolean isServiceImmutable(Service s); void scheduleNodeGroupChangeMaintenance(String nodeSelectorPath); void setFactoriesAvailabilityIfOwner(boolean isAvailable); boolean isAuthorized(Service service, ServiceDocument document, Operation op); void stopService(Service service); void stopService(String path); boolean handleRequest(Operation inboundOp); boolean handleRequest(Service service, Operation inboundOp); void executeOperationHandler(Service s, Operation op); @Override void sendRequest(Operation op); void stop(); static boolean isServiceCreate(Operation op); static boolean isServiceStop(Operation op); static boolean isServiceDeleteAndStop(Operation op); static boolean isServiceAvailable(Service s); static boolean isForServiceNamespace(Service s, Operation op); static boolean isHelperServicePath(String serviceUriPath); ServiceHost toggleDebuggingMode(boolean enable); ServiceHost setLoggingLevel(Level newLevel); ServiceHost toggleOperationProcessingLogging(boolean loggingEnabled); ServiceHost setOperationProcessingLogFilter(Predicate<Operation> logFilter); ServiceHost setOperationTracingLevel(Level newLevel); Level getOperationTracingLevel(); void log(Level level, String fmt, Object... args); void log(Level level, Supplier<String> messageSupplier); void registerForServiceAvailability(CompletionHandler completion,
            String... servicePaths); void registerForServiceAvailability(CompletionHandler completion, boolean checkReplica,
            String... servicePaths); void registerForServiceAvailability(CompletionHandler completion,
            String nodeSelectorPath, boolean checkReplica, String... servicePaths); void registerForServiceAvailability(Operation opTemplate, String... servicePaths); ServiceHost setRequestRateLimit(String key, double operationsPerSecond); ServiceHost setRequestRateLimit(String key, RequestRateInfo ri); RequestRateInfo getRequestRateLimit(String key); ServiceHost setServiceMemoryLimit(String servicePath, double percentOfTotal); Long getServiceMemoryLimitMB(String servicePath, MemoryLimitType limitType); ProcessingStage getServiceStage(String servicePath); boolean checkServiceAvailable(String servicePath); void checkReplicatedServiceAvailable(CompletionHandler ch, String servicePath); void checkReplicatedServiceAvailable(CompletionHandler ch, String servicePath,
            String nodeSelectorPath); SystemHostInfo getSystemInfo(); SystemHostInfo updateSystemInfo(boolean enumerateNetworkInterfaces); void enumerateNetworkInterfaces(); void updateMemoryAndDiskInfo(); void run(Runnable task); void run(ExecutorService executor, Runnable task); ScheduledFuture<?> schedule(Runnable task, long delay, TimeUnit unit); ScheduledFuture<?> scheduleCore(Runnable task, long delay, TimeUnit unit); ServiceHost setOperationTimeOutMicros(long timeoutMicros); ServiceHost setServiceCacheClearDelayMicros(long delayMicros); long getServiceCacheClearDelayMicros(); ServiceHost setProcessOwner(boolean isOwner); boolean isProcessOwner(); void setListener(ServiceRequestListener listener); ServiceRequestListener getSecureListener(); void setSecureListener(ServiceRequestListener listener); ServiceRequestListener getListener(); ServiceClient getClient(); void setClient(ServiceClient client); SelectOwnerResponse findOwnerNode(String selectorPath, String path); void broadcastRequest(String selectorPath, boolean excludeThisHost, Operation request); void broadcastRequest(String selectorPath, String key, boolean excludeThisHost,
            Operation request); void selectOwner(String selectorPath, String key, Operation op); void forwardRequest(String groupPath, Operation request); void forwardRequest(String selectorPath, String key, Operation request); void replicateRequest(EnumSet<ServiceOption> serviceOptions, ServiceDocument state,
            String selectorPath,
            String selectionKey,
            Operation op); void queryServices(String match, Operation get); void queryServices(EnumSet<ServiceOption> options,
            EnumSet<ServiceOption> matchAllOptions,
            EnumSet<ServiceOption> exclusionOptions, String match, Operation get); ServiceDocumentDescription buildDocumentDescription(String servicePath); URI getPublicUri(); String getPublicUriAsString(); URI getUri(); URI getSecureUri(); String getPreferredAddress(); void setRequestPayloadSizeLimit(int limit); void setResponsePayloadSizeLimit(int limit); void cacheAuthorizationContext(Service s, AuthorizationContext ctx); void cacheAuthorizationContext(Service s, String token, AuthorizationContext ctx); void clearAuthorizationContext(Service s, String userLink); AuthorizationContext getAuthorizationContext(Service s, String token); Thread getRuntimeShutdownHook(); void registerRuntimeShutdownHook(); boolean unregisterRuntimeShutdownHook(); void failRequestServiceAlreadyStarted(String path, Service s, Operation post); }
ServiceHost implements ServiceRequestSender { public ServiceDocumentDescription buildDocumentDescription(String servicePath) { Service s = findService(servicePath); if (s == null) { String parentPath = UriUtils.getParentPath(servicePath); return this.descriptionCachePerFactoryLink.get(parentPath); } return buildDocumentDescription(s); } protected  ServiceHost(); static ServiceHost create(String... args); ServiceHost initialize(String[] args); ServiceHost initialize(Arguments args); String getLocation(); void setLocation(String location); @Override String toString(); boolean isStarted(); boolean isStopping(); boolean isServiceStateCaching(); ServiceHost setServiceStateCaching(boolean enable); int getPort(); ServiceHost setPort(int port); boolean isAuthorizationEnabled(); void setAuthorizationEnabled(boolean isAuthorizationEnabled); boolean isPeerSynchronizationEnabled(); void setPeerSynchronizationEnabled(boolean enabled); boolean isRequestLoggingEnabled(); RequestLoggingInfo getRequestLoggingInfo(); List<String> getSkipLoggingPragmaDirectives(); void setRequestLoggingInfo(RequestLoggingInfo loggingInfo); int getPeerSynchronizationTimeLimitSeconds(); void setPeerSynchronizationTimeLimitSeconds(int seconds); boolean isAutoBackupEnabled(); void setAutoBackupEnabled(boolean enabled); int getSecurePort(); ServiceHost setSecurePort(int port); ServiceHost setPrivateKeyFileReference(URI fileReference); ServiceHost setPrivateKeyPassphrase(String privateKeyPassphrase); ServiceHost setCertificateFileReference(URI fileReference); ServiceHost setBindAddress(String address); ServiceHost setPublicUri(URI publicUri); ServiceHost setId(String id); URI getStorageSandbox(); long getMaintenanceIntervalMicros(); long getMaintenanceCheckIntervalMicros(); ServiceHost setMaintenanceIntervalMicros(long micros); String getId(); String nextUUID(); long getOperationTimeoutMicros(); ServiceHostState getState(); URI getDocumentIndexServiceUri(); URI getAuthorizationServiceUri(); URI getManagementServiceUri(); ServiceHost setDocumentIndexingService(Service service); ServiceHost setAuthorizationService(Service service); ServiceHost setManagementService(Service service); ServiceStat getManagementServiceStat(String name); ServiceHost setAuthenticationService(Service service); URI getAuthenticationServiceUri(); ScheduledExecutorService getScheduledExecutor(); ExecutorService getExecutor(); ExecutorService allocateExecutor(Service s); ExecutorService allocateExecutor(Service s, int threadCount); ServiceHost start(); void startDefaultCoreServicesSynchronously(); void startDefaultCoreServicesSynchronously(boolean joinPeerNodes); List<URI> getInitialPeerHosts(); Path copyResourceToSandbox(URL url, Path resourcePath); Path discoverJarResources(Path path, Service s, Map<Path, String> pathToURIPath,
            Path baseUriPath, String prefix); Path discoverFileResources(Service s, Map<Path, String> pathToURIPath,
            Path baseUriPath,
            String prefix); void joinPeers(List<URI> peers, String nodeGroupUriPath); void startFactoryServicesSynchronously(Service... services); URI startSubscriptionService(
            Operation subscribe,
            Consumer<Operation> notificationConsumer); URI startReliableSubscriptionService(
            Operation subscribe,
            Consumer<Operation> notificationConsumer); URI startSubscriptionService(
            Operation subscribe,
            Consumer<Operation> notificationConsumer,
            ServiceSubscriber request); URI startSubscriptionService(
            Operation subscribe,
            Service notificationTarget,
            ServiceSubscriber request); void stopSubscriptionService(
            Operation unsubscribe,
            URI notificationTarget); static boolean isServiceStartingOrAvailable(ProcessingStage stage); static boolean isServiceStarting(ProcessingStage stage); ServiceHost startService(Service service); ServiceHost startService(Operation post, Service service); ServiceHost startFactory(Service instanceService); ServiceHost startFactory(Class<? extends Service> instServiceClass,
            Supplier<FactoryService> factoryCreator); ServiceHost startFactory(Supplier<FactoryService> factoryCreator, String servicePath); ServiceHost startIdempotentFactory(Service instanceService); static void restoreActionOnChildServiceToPostOnFactory(String link, Operation op); static boolean isServiceIndexed(Service s); static boolean isServiceImmutable(Service s); void scheduleNodeGroupChangeMaintenance(String nodeSelectorPath); void setFactoriesAvailabilityIfOwner(boolean isAvailable); boolean isAuthorized(Service service, ServiceDocument document, Operation op); void stopService(Service service); void stopService(String path); boolean handleRequest(Operation inboundOp); boolean handleRequest(Service service, Operation inboundOp); void executeOperationHandler(Service s, Operation op); @Override void sendRequest(Operation op); void stop(); static boolean isServiceCreate(Operation op); static boolean isServiceStop(Operation op); static boolean isServiceDeleteAndStop(Operation op); static boolean isServiceAvailable(Service s); static boolean isForServiceNamespace(Service s, Operation op); static boolean isHelperServicePath(String serviceUriPath); ServiceHost toggleDebuggingMode(boolean enable); ServiceHost setLoggingLevel(Level newLevel); ServiceHost toggleOperationProcessingLogging(boolean loggingEnabled); ServiceHost setOperationProcessingLogFilter(Predicate<Operation> logFilter); ServiceHost setOperationTracingLevel(Level newLevel); Level getOperationTracingLevel(); void log(Level level, String fmt, Object... args); void log(Level level, Supplier<String> messageSupplier); void registerForServiceAvailability(CompletionHandler completion,
            String... servicePaths); void registerForServiceAvailability(CompletionHandler completion, boolean checkReplica,
            String... servicePaths); void registerForServiceAvailability(CompletionHandler completion,
            String nodeSelectorPath, boolean checkReplica, String... servicePaths); void registerForServiceAvailability(Operation opTemplate, String... servicePaths); ServiceHost setRequestRateLimit(String key, double operationsPerSecond); ServiceHost setRequestRateLimit(String key, RequestRateInfo ri); RequestRateInfo getRequestRateLimit(String key); ServiceHost setServiceMemoryLimit(String servicePath, double percentOfTotal); Long getServiceMemoryLimitMB(String servicePath, MemoryLimitType limitType); ProcessingStage getServiceStage(String servicePath); boolean checkServiceAvailable(String servicePath); void checkReplicatedServiceAvailable(CompletionHandler ch, String servicePath); void checkReplicatedServiceAvailable(CompletionHandler ch, String servicePath,
            String nodeSelectorPath); SystemHostInfo getSystemInfo(); SystemHostInfo updateSystemInfo(boolean enumerateNetworkInterfaces); void enumerateNetworkInterfaces(); void updateMemoryAndDiskInfo(); void run(Runnable task); void run(ExecutorService executor, Runnable task); ScheduledFuture<?> schedule(Runnable task, long delay, TimeUnit unit); ScheduledFuture<?> scheduleCore(Runnable task, long delay, TimeUnit unit); ServiceHost setOperationTimeOutMicros(long timeoutMicros); ServiceHost setServiceCacheClearDelayMicros(long delayMicros); long getServiceCacheClearDelayMicros(); ServiceHost setProcessOwner(boolean isOwner); boolean isProcessOwner(); void setListener(ServiceRequestListener listener); ServiceRequestListener getSecureListener(); void setSecureListener(ServiceRequestListener listener); ServiceRequestListener getListener(); ServiceClient getClient(); void setClient(ServiceClient client); SelectOwnerResponse findOwnerNode(String selectorPath, String path); void broadcastRequest(String selectorPath, boolean excludeThisHost, Operation request); void broadcastRequest(String selectorPath, String key, boolean excludeThisHost,
            Operation request); void selectOwner(String selectorPath, String key, Operation op); void forwardRequest(String groupPath, Operation request); void forwardRequest(String selectorPath, String key, Operation request); void replicateRequest(EnumSet<ServiceOption> serviceOptions, ServiceDocument state,
            String selectorPath,
            String selectionKey,
            Operation op); void queryServices(String match, Operation get); void queryServices(EnumSet<ServiceOption> options,
            EnumSet<ServiceOption> matchAllOptions,
            EnumSet<ServiceOption> exclusionOptions, String match, Operation get); ServiceDocumentDescription buildDocumentDescription(String servicePath); URI getPublicUri(); String getPublicUriAsString(); URI getUri(); URI getSecureUri(); String getPreferredAddress(); void setRequestPayloadSizeLimit(int limit); void setResponsePayloadSizeLimit(int limit); void cacheAuthorizationContext(Service s, AuthorizationContext ctx); void cacheAuthorizationContext(Service s, String token, AuthorizationContext ctx); void clearAuthorizationContext(Service s, String userLink); AuthorizationContext getAuthorizationContext(Service s, String token); Thread getRuntimeShutdownHook(); void registerRuntimeShutdownHook(); boolean unregisterRuntimeShutdownHook(); void failRequestServiceAlreadyStarted(String path, Service s, Operation post); static final String SERVICE_HOST_STATE_FILE; static final Double DEFAULT_PCT_MEMORY_LIMIT; static final Double DEFAULT_PCT_MEMORY_LIMIT_DOCUMENT_INDEX; static final Double DEFAULT_PCT_MEMORY_LIMIT_SERVICE_CONTEXT_INDEX; static final String LOOPBACK_ADDRESS; static final String LOCAL_HOST; static final String DEFAULT_BIND_ADDRESS; static final int PORT_VALUE_HTTP_DEFAULT; static final int PORT_VALUE_LISTENER_DISABLED; static final int DEFAULT_PORT; static final String ALL_INTERFACES; static final String ROOT_PATH; static final String SERVICE_URI_SUFFIX_STATS; static final String SERVICE_URI_SUFFIX_SUBSCRIPTIONS; static final String SERVICE_URI_SUFFIX_SYNCHRONIZATION; static final String SERVICE_URI_SUFFIX_AVAILABLE; static final String SERVICE_URI_SUFFIX_CONFIG; static final String SERVICE_URI_SUFFIX_TEMPLATE; static final String SERVICE_URI_SUFFIX_UI; static final String SERVICE_URI_SUFFIX_REPLICATION; static final String DCP_ENVIRONMENT_VAR_PREFIX; static final String GIT_COMMIT_PROPERTIES_RESOURCE_NAME; static final String GIT_COMMIT_SOURCE_PROPERTY_PREFIX; static final String GIT_COMMIT_SOURCE_PROPERTY_COMMIT_ID; static final String GIT_COMMIT_SOURCE_PROPERTY_COMMIT_TIME; static final String[] RESERVED_SERVICE_URI_PATHS; static final int DEFAULT_SERVICE_STATE_COST_BYTES; static final int DEFAULT_SERVICE_INSTANCE_COST_BYTES; static final boolean APPEND_PORT_TO_SANDBOX; }