### Start Cache Server for Live Events Example Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/running-coherence-examples.html Start at least two cache server nodes for the live events example. Each execution starts a new cluster node. ```bash bin/run-cache-server events ``` -------------------------------- ### Run Persistence Example Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/running-coherence-examples.html Execute the persistence example after starting cache servers. The output will be displayed in the command window. ```shell bin/run-cache-server persistence ``` ```shell bin/run persistence ``` ```shell bin/run persistence notifications ``` ```shell bin/run persistence ``` ```shell CTRL+C ``` ```shell bin/run persistence parallel ``` -------------------------------- ### Run Security Example Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/running-coherence-examples.html Execute the security example after starting the cache server with proxy enabled. The output will be displayed in the command window. ```bash bin/run security ``` -------------------------------- ### Start Cache Server for Security Example Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/running-coherence-examples.html Start a cache server that also runs a proxy service for Coherence*Extend clients. This is required for the security example. ```bash bin/run-cache-server security ``` -------------------------------- ### Run Live Events Example Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/running-coherence-examples.html Execute the live events example after starting the required cache servers. The output will be displayed in the command window. ```bash bin/run events ``` -------------------------------- ### Run Contacts Example Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/running-coherence-examples.html Execute the contacts example after starting the cache server. The output will be displayed in the command window. ```bash bin/run contacts ``` -------------------------------- ### JFR Start Command Example Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/op-management-coherence-cluster-members-memberidentifier-diagnostic-cmd-jfrcmd-post.html Example of starting a JFR recording with specified options for name, duration, and filename. The target directory must exist on the node. ```shell jfrStart?options=name=myJfr,duration=60s,filename=$jfrFolder/myRecording.jfr ``` -------------------------------- ### Run Security Example (.NET) Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/running-coherence-examples.html Start cache servers with the security configuration and then run the security project from Visual Studio or execute the contacts.exe. This example requires Coherence for .NET and Visual Studio. ```shell bin/run-cache-server security ``` ```shell contacts.exe ``` -------------------------------- ### Run Contacts Example (.NET) Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/running-coherence-examples.html Start cache servers and then run the contacts project from Visual Studio or execute the contacts.exe. This example requires Coherence for .NET and Visual Studio. ```shell bin/run-cache-server ``` ```shell contacts.exe ``` -------------------------------- ### Run Java 8 Features Example Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/running-coherence-examples.html Execute the Java 8 features example after starting a cache server. Inspect the output and refer to the code in the specified directory. ```bash bin/run java8 ``` -------------------------------- ### Run Coherence Supplemental Installer Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/installing-oracle-coherence-java.html Execute the supplemental installer JAR file to install API documentation and code examples. This is typically used as part of a script for silent installation. ```shell java -jar fmw_version_coherence_quick_supplemental.jar ``` -------------------------------- ### PartitionSet Iteration Example Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/cplus-reference/_partition_set_8hpp-source.html This example demonstrates how to iterate over all marked partitions in a PartitionSet. It uses a loop to find the next marked partition starting from a given index. ```cpp int32_t nPartition = 0; while ((nPartition = next(nPartition)) >= 0) { // process partition nPartition } ``` -------------------------------- ### Run Asynchronous Features Example Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/running-coherence-examples.html Execute the asynchronous features example after starting a cache server. Inspect the output and refer to the code in the specified directory. ```bash bin/run async ``` -------------------------------- ### Start Oracle Coherence Graphical Installer Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/installing-oracle-coherence-java.html Execute this command from the directory containing the Coherence JAR file to launch the graphical installation program. Ensure JAVA_HOME/bin is in your system's PATH. ```shell java -jar fmw_version_coherence.jar ``` -------------------------------- ### Target .NET Framework 4.0 for Examples Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/release-notes/bugs-fixed-and-enhancements-this-release.html The `.csproj` files for the .NET examples bundled in the Java install have been updated to target .NET Framework 4.0. ```xml Debug AnyCPU {... Library Properties Coherence.Examples Coherence.Examples v4.0 512 ... ``` -------------------------------- ### Start Cache Server Programmatically using main Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/develop-applications/starting-and-stopping-cluster-members.html Start a cache server programmatically by invoking the `main` method of the `DefaultCacheServer` class. This is useful for applications that need to perform custom setup before starting the server. ```java String[] args = new String[]{"my-cache-config.xml", "5"}; DefaultCacheServer.main(args); ``` -------------------------------- ### Start Cache Server and HTTP Proxy Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/running-coherence-examples.html This command starts a cache server and an HTTP proxy for the Coherence REST examples. The application will automatically load the home page in the default browser. ```bash mvn exec:exec -DhttpProxy ``` -------------------------------- ### Example GET Operation Request and Response Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/develop-remote-clients/performing-grid-operations-rest.html Demonstrates a client outbound GET request for a 'name' attribute and the corresponding inbound JSON response. ```http * Client out-bound request > GET http://127.0.0.1:8080/dist-test-sepj/1;p=name > Accept: application/json * Client in-bound response < 200 < Transfer-Encoding: chunked < Content-Type: application/json < {"name":"Mark"} ``` -------------------------------- ### Start CohQL Command-Line Tool Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/develop-applications/using-coherence-query-language.html Launches the CohQL command-line tool on Windows. Assumes Coherence is installed in C:/coherence. ```bash C:/coherence/bin/query.cmd ``` -------------------------------- ### Start Cache Factory Instance Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/manage/using-jmx-manage-oracle-coherence.html Execute the `coherence` script to start a cache factory instance. This is a prerequisite for starting the HTML adapter. ```batch COHERENCE_HOME\bin\coherence ``` -------------------------------- ### Perform Coherence Quick Installation Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/installing-oracle-coherence-java.html Use this command to perform a quick Coherence installation. The ORACLE_HOME variable specifies the installation directory. ```bash java -jar fmw_version_coherence_quick.jar ORACLE_HOME=/oracle ``` -------------------------------- ### Get Entries with OrFilter (Like) Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/develop-remote-clients/using-coherence-net-client-library.html Retrieves cache entries matching either of two LikeFilter conditions. This example finds entries ending with 'an' (case-insensitive) or starting with 'An' (case-sensitive). ```csharp OrFilter orFilter = new OrFilter(new LikeFilter(IdentityExtractor.Instance, "%an", '\', false), new LikeFilter(IdentityExtractor.Instance, "An%", '\', true)); ICollection entries = cache.GetEntries(orFilter); ``` -------------------------------- ### Perform Coherence Quick Installation using Current Directory as ORACLE_HOME Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/installing-oracle-coherence-java.html Execute the quick installer from an empty directory, which will then be used as the ORACLE_HOME. ```bash cd /oracle java -jar /tmp/fmw_version_coherence_quick.jar ``` -------------------------------- ### C++ WriteBuffer getWriteBuffer(size32_t of) Example Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/cplus-reference/_write_buffer_8hpp-source.html Obtains a new WriteBuffer that represents a portion of the current buffer, starting from the specified offset. This is equivalent to getting a sub-buffer with the maximum possible capacity from that offset. Throws IndexOutOfBoundsException if the offset exceeds the maximum capacity. ```cpp return getWriteBuffer(of, getMaximumCapacity() - of); ``` -------------------------------- ### Start Federated Caching ClusterB Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/running-coherence-examples.html Start the second cluster node for the federated caching example. ```bash bin/run-cache-server federation ClusterB ``` -------------------------------- ### Run Security Example on Windows Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/running-coherence-examples.html Execute the 'security' example on a Windows system. Ensure a cache server with proxy service is running. ```shell bin\run.cmd security ``` -------------------------------- ### Start Federated Caching ClusterA Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/running-coherence-examples.html Start the first cluster node for the federated caching example. ```bash bin/run-cache-server federation ClusterA ``` -------------------------------- ### Start Federation with Sync Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json Starts federation for a specific participant after all cache entries have been federated. The connection is established only when there is data to be federated. ```APIDOC ## POST /management/coherence/cluster/services/{serviceName}/participants/{participantName}/startWithSync ### Description Use this endpoint to start federation for a specific federation participant after federating all cache entries. Any existing cache entries are federated. The connection is established only when there is data to be federated. ### Method POST ### Endpoint /management/coherence/cluster/services/{serviceName}/participants/{participantName}/startWithSync ### Parameters #### Path Parameters - **serviceName** (string) - Required - The name of the service. - **participantName** (string) - Required - The name of the participant. ### Response #### Success Response (200) - Description: Command invocation successful. ``` -------------------------------- ### POST /management/coherence/cluster/services/{serviceName}/federation/participants/{participantName}/startWithSync Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json Starts federation to a participant after synchronizing. This ensures that the participant is up-to-date before resuming normal federation. ```APIDOC ## POST /management/coherence/cluster/services/{serviceName}/federation/participants/{participantName}/startWithSync ### Description Starts Federation to a Participant After Synchronizing. ### Method POST ### Endpoint /management/coherence/cluster/services/{serviceName}/federation/participants/{participantName}/startWithSync ### Parameters #### Path Parameters - **serviceName** (string) - Required - The name of the Coherence service. - **participantName** (string) - Required - The name of the federation participant. ### Response #### Success Response (200) - **description** (string) - Command invocation successful. ``` -------------------------------- ### Cache Server Startup Script Example Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/administer-http-sessions/using-coherenceweb-other-application-servers.html This script configures the cache server for out-of-process deployment. It sets memory, classpath, management remote, cache configuration, and local storage properties. ```bash java -server -Xms512m -Xmx512m -cp /lib/coherence.jar:/lib/coherence-web.jar -Dcoherence.management.remote=true -Dcoherence.cacheconfig=default-session-cache-config.xml -Dcoherence.session.localstorage=true com.tangosol.net.DefaultCacheServer ``` -------------------------------- ### Start Federation With No Backlog Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json Initiates federation for a specified service, bypassing any initial backlog and immediately federating data to all participants. Existing cache entries are not federated. ```APIDOC ## POST /management/coherence/cluster/services/{serviceName}/federation/startWithNoBacklog ### Description Use this endpoint to clear any initial backlog and start federating data to all participants for a specific federated service. Any existing cache entries will not be federated. The connection is established only when there is data to be federated. ### Method POST ### Endpoint /management/coherence/cluster/services/{serviceName}/federation/startWithNoBacklog ### Parameters #### Path Parameters - **serviceName** (string) - Required - The name of the federated service. ### Responses #### Success Response (200) - Description: Command invocation successful. ``` -------------------------------- ### Start Federation to a Participant Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json Enables data federation to a specific participant within a federated service. The connection is established when there is data available to be federated. ```APIDOC ## POST /management/coherence/cluster/services/{serviceName}/federation/participants/{participantName}/start ### Description Use this endpoint to start federating data to a specific federation participant. The connection is established only when there is data to be federated. ### Method POST ### Endpoint /management/coherence/cluster/services/{serviceName}/federation/participants/{participantName}/start ### Parameters #### Path Parameters - **serviceName** (string) - Required - The name of the federated service. - **participantName** (string) - Required - The name of the federation participant. ### Responses #### Success Response (200) - Description: Command invocation successful. ``` -------------------------------- ### Start VisualVM Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/manage/using-jmx-manage-oracle-coherence.html Launch VisualVM to manage Coherence MBeans locally. Ensure VISUALVM_HOME is set correctly. ```shell VISUALVM_HOME\bin\visualvm ``` -------------------------------- ### POST /management/coherence/cluster/services/{serviceName}/federation/participants/{participantName}/startWithNoBacklog Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json Starts federation to a participant, clearing any initial backlog. Existing cache entries are not federated, and the connection is established only when data is available to be federated. ```APIDOC ## POST /management/coherence/cluster/services/{serviceName}/federation/participants/{participantName}/startWithNoBacklog ### Description Use this endpoint to clear any initial backlog and start federating data to a specific federation participant. Any existing cache entries will not be federated. The connection is established only when there is data to be federated. ### Method POST ### Endpoint /management/coherence/cluster/services/{serviceName}/federation/participants/{participantName}/startWithNoBacklog ### Parameters #### Path Parameters - **serviceName** (string) - Required - The name of the Coherence service. - **participantName** (string) - Required - The name of the federation participant. ### Response #### Success Response (200) - **description** (string) - Command invocation successful. ``` -------------------------------- ### Run Contacts Example on Windows Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/running-coherence-examples.html Execute the 'contacts' example on a Windows system. Ensure a cache server with proxy service is running. ```shell bin\run.cmd contacts ``` -------------------------------- ### GET /management/coherence/cluster/members/{memberIdentifier}/platform/operatingSystem Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json Retrieves operating system information for a specific cluster member. This endpoint provides details about the OS environment in which the cluster member is running. ```APIDOC ## GET /management/coherence/cluster/members/{memberIdentifier}/platform/operatingSystem ### Description View OS Information. Use this endpoint to view OS information for a specific cluster member. ### Method GET ### Endpoint /management/coherence/cluster/members/{memberIdentifier}/platform/operatingSystem ### Parameters #### Path Parameters - **memberIdentifier** (string) - Required - The identifier of the cluster member. ``` -------------------------------- ### Get Partition Assignment Strategy Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json Retrieves the details of the partition assignment strategy for a given cache service. This includes information about HA status, partition counts, and distribution analysis. ```APIDOC ## GET /services/{serviceName}/partitionAssignmentStrategy ### Description Retrieves the details of the partition assignment strategy for a given cache service. This includes information about HA status, partition counts, and distribution analysis. ### Method GET ### Endpoint /services/{serviceName}/partitionAssignmentStrategy ### Parameters #### Path Parameters - **serviceName** (string) - Required - The name of the cache service. ### Response #### Success Response (200) - **partitionCount** (integer) - The configured number of partitions for the service. - **backupCount** (integer) - The configured number of partition backups to be maintained by the service. - **serviceNodeCount** (integer) - The number of storage-enabled nodes running this service. - **serviceMachineCount** (integer) - The number of machines that host storage-enabled nodes running this service. - **serviceRackCount** (integer) - The number of racks that host storage-enabled nodes running this service. - **serviceSiteCount** (integer) - The number of sites that host storage-enabled nodes running this service. - **HAStatus** (string) - The High Availability status for this service. - **HATarget** (string) - The High Availability status that this strategy attempts to achieve. - **fairShareBackup** (integer) - The number of backup partitions per storage-enabled service member that this strategy will currently attempt to maintain. - **fairSharePrimary** (integer) - The number of primary partitions per storage-enabled service member that this strategy will currently attempt to maintain. - **strategyName** (string) - The name of the partition assignment strategy in use. - **lastAnalysisTime** (string) - The last time a distribution analysis was performed. - **coordinatorId** (integer) - The member id of the service node that is the ownership distribution coordinator. - **remainingDistributionCount** (integer) - The number of partition transfers that remain to be completed before the service achieves the goals set by this strategy. - **averagePartitionSizeKB** (integer) - The average partition storage size in kilobytes. - **maxPartitionSizeKB** (integer) - The maximum partition storage size in kilobytes. #### Response Example { "partitionCount": 1024, "backupCount": 1, "serviceNodeCount": 5, "serviceMachineCount": 2, "serviceRackCount": 1, "serviceSiteCount": 1, "HAStatus": "NODE-SAFE", "HATarget": "NODE-SAFE", "fairShareBackup": 1, "fairSharePrimary": 1, "strategyName": "default", "lastAnalysisTime": "2023-10-27T10:00:00Z", "coordinatorId": 1, "remainingDistributionCount": 0, "averagePartitionSizeKB": 10240, "maxPartitionSizeKB": 20480 } ``` -------------------------------- ### Get Coherence JMX Management Settings Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json Retrieves the current Coherence JMX management settings. ```APIDOC ## GET /management/coherence/cluster/management ### Description Retrieves the Coherence JMX management settings. ### Method GET ### Endpoint /management/coherence/cluster/management ### Response #### Success Response (200) - **jmxManagement** (object) - Coherence JMX management settings schema. ``` -------------------------------- ### Build and Run Archiver Example Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/running-coherence-examples.html Build the archiver example, update its configuration, and then run it. Ensure the JSch library is downloaded and extracted. ```shell bin/build archiver ``` ```shell bin/run archiver ``` -------------------------------- ### Start Cache Server with Custom Configuration and Libraries Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/administer/deploying-coherence-applications.html Starts a single cache server using specified configuration files and custom library classes. Ensure configuration files are found before coherence.jar if using default names. ```shell java -server -Xms4g -Xmx4g -cp APPLICATION_HOME\config;APPLICATION_HOME\lib\myClasses.jar;COHERENCE_HOME\lib\coherence.jar com.tangosol.net.DefaultCacheServer ``` -------------------------------- ### GET /management/coherence/cluster/members/{memberIdentifier}/platform/runtime Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json Retrieves runtime information for a specific cluster member. This endpoint provides details about the Java runtime environment of the cluster member. ```APIDOC ## GET /management/coherence/cluster/members/{memberIdentifier}/platform/runtime ### Description View Runtime Information. Use this endpoint to view runtime information for a specific cluster member. ### Method GET ### Endpoint /management/coherence/cluster/members/{memberIdentifier}/platform/runtime ### Parameters #### Path Parameters - **memberIdentifier** (string) - Required - The identifier of the cluster member. ``` -------------------------------- ### Create and Use QueryRecorder for Query Plan Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/cplus-reference/classcoherence_1_1util_1_1aggregator_1_1_query_recorder.html This example demonstrates how to create a QueryRecorder to obtain a QueryPlan, which includes the estimated query cost and execution steps. It uses the `explain` type for the recorder. ```C++ QueryRecorder::Handle hAgent = QueryRecorder::create(QueryRecorder::explain); QueryRecord::View vRecord = cast(hCache->aggregate(filter, agent)); ``` -------------------------------- ### Perform Cluster-wide Java Flight Recorder (JFR) Operation Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json Use this endpoint to perform a JFR operation on members that are configured with a specific role. You can omit the role if you want to perform the operation on all members. The $jfrFolder must already exist on the node where the JFR is taken. If no folder is specified, the JFR recording will be saved in the current directory of the MBeanServer. To ensure a global file name, we prepend the file name with the node ID. For example, for a node with ID 3, the file name will be $jfrFolder/3-myRecording.jfr. The filename can be a path and if so, the JFR dump will be created in $path/$nodeId-$jfrName.jfr. For example, if the input JFR options is "name=foo,filename=/myJfrdir", the node ID is 3, then the resulting JFR filename would be: "/myJfrdir/3-foo.jfr". ```APIDOC ## POST /management/coherence/cluster/diagnostic-cmd/{jfrCmd} ### Description Perform a Cluster wide Java Flight Recorder (JFR) operation. ### Method POST ### Endpoint /management/coherence/cluster/diagnostic-cmd/{jfrCmd} ### Parameters #### Path Parameters - **jfrCmd** (string) - Required - The JFR command to execute. #### Query Parameters - **options** (string) - Required - Options for the JFR operation, e.g., name=myJfr,duration=60s,filename=$jfrFolder/myRecording.jfr. - **role** (string) - Optional - The role of the members to perform the operation on. If omitted, the operation is performed on all members. ### Response #### Success Response (200) - **items** (array of strings) - Messages returned by jcmd from executing the command on each node, or exceptions if the command invocation fails. ``` -------------------------------- ### Get Proxy Statistics Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json Retrieves statistics for the HTTP proxy, including connection counts, request times, and buffer pool information. ```APIDOC ## GET /proxy/statistics ### Description Retrieves statistics for the HTTP proxy, including connection counts, request times, and buffer pool information. ### Method GET ### Endpoint /proxy/statistics ### Parameters #### Query Parameters None ### Response #### Success Response (200) - **readOnly** (boolean) - Indicates if the statistics are read-only. - **incomingBufferPoolCapacity** (integer) - The pool capacity (in bytes) of the incoming buffer. - **refreshTime** (string) - The timestamp when this model was last retrieved from a corresponding node. - **connectionCount** (integer) - The number of client connections. - **averageRequestTime** (number) - The average processing time in milliseconds for HTTP requests. - **outgoingBufferPoolSize** (integer) - The number of buffers in the outgoing pool. - **unauthorizedConnectionAttempts** (integer) - The number of connection attempts from unauthorized hosts. - **totalRequestCount** (integer) - The number of requests serviced since the HTTP server was started or the statistics were reset. - **totalBytesReceived** (integer) - The total number of bytes received by the Proxy host since the statistics were last reset. - **httpServerType** (string) - The type of HTTP server or n/a if not using HTTP protocol. - **incomingBufferPoolSize** (integer) - The number of buffers in the incoming pool. - **totalBytesSent** (integer) - The total number of bytes sent by the Proxy host since the statistics were last reset. - **totalMessagesSent** (integer) - The total number of messages sent by the Proxy host since the statistics were last reset. - **responseCount2xx** (integer) - The number of HTTP responses in the 200-299 range. - **outgoingBufferPoolCapacity** (integer) - The pool capacity (in bytes) of the outgoing buffer. - **responseCount3xx** (integer) - The number of HTTP responses in the 300-399 range. - **totalMessagesReceived** (integer) - The total number of messages received by the Proxy host since the statistics were last reset. - **responseCount4xx** (integer) - The number of HTTP responses in the 400-499 range. - **responseCount5xx** (integer) - The number of HTTP responses in the 500-599 range. - **totalErrorCount** (integer) - The total number of errors encountered. #### Response Example { "readOnly": false, "incomingBufferPoolCapacity": 1024, "refreshTime": "2023-10-27T10:00:00Z", "connectionCount": 50, "averageRequestTime": 15.5, "outgoingBufferPoolSize": 100, "unauthorizedConnectionAttempts": 5, "totalRequestCount": 10000, "totalBytesReceived": 5000000, "httpServerType": "Jetty", "incomingBufferPoolSize": 200, "totalBytesSent": 7500000, "totalMessagesSent": 15000, "responseCount2xx": 9500, "outgoingBufferPoolCapacity": 2048, "responseCount3xx": 200, "totalMessagesReceived": 12000, "responseCount4xx": 250, "responseCount5xx": 50, "totalErrorCount": 10 } ``` -------------------------------- ### Register multiple cache misses Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/net-reference/html/4ee459ca-83f8-37be-d230-0dcf639c2cf2.htm Records the number of cache misses and the start time of the get operation. Use this when multiple misses occur for a single get operation. ```csharp public virtual void RegisterMisses( int misses, long startMillis ) ``` -------------------------------- ### Run the Hello World Application Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/develop-applications/building-your-first-coherence-application.html Execute the compiled Coherence application. This command starts a cache node and interacts with the 'hello-example' cache. Ensure COHERENCE_HOME is set correctly and the distributed storage is disabled locally. ```shell java -cp COHERENCE_HOME\config;COHERENCE_HOME\lib\coherence.jar -Dcoherence.distributed.localstorage=false com.examples.HelloWorld ``` -------------------------------- ### Manage JFR Recordings Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json This endpoint allows users to execute JFR commands on specific cluster members or roles. Supported commands include starting, stopping, dumping, and checking the status of JFR recordings. ```APIDOC ## POST /jfr ### Description Executes a JFR command on a specified Coherence cluster member or role. ### Method POST ### Endpoint /jfr ### Parameters #### Path Parameters - **topologyName** (string) - Required - Name of the topology. - **appId** (string) - Required - ID of the application. - **participantName** (string) - Required - Name of the participant. - **viewedMemberId** (string) - Required - ID of the cluster member being viewed. - **snapshotName** (string) - Required - Name of the snapshot. - **jfrCmd** (string) - Required - The JFR command with its options. Valid commands are: jfrStart, jfrStop, jfrDump, jfrCheck. #### Query Parameters - **role** (string) - Optional - The data from cluster member belonging to the role will be included in the response. - **collector** (string) - Optional - The collector to use for aggregation. Possible values: all, avg, count, list, max, min, set, sum, intsummary, longsummary, doublesummary. - **options** (string) - Optional - A list of comma separated (JFR) options. ### Request Example ```json { "example": "POST /jfr/myTopology/myApp/myParticipant/member123/snapshot1?jfrCmd=jfrStart?options=name=myJfr,duration=60s,filename=$jfrFolder/myRecording.jfr" } ``` ### Response #### Success Response (200) - **message** (string) - Description of the operation's outcome. #### Response Example ```json { "example": "JFR recording started successfully." } ``` ``` -------------------------------- ### Sample Commands to Create User, Grant Permissions, and Enable Logging Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/integrate/integrating-oracle-coherence-goldengate-hotcache.html Use these Oracle Database commands to create a user, grant necessary permissions, and enable supplemental logging for GoldenGate integration. ```sql CREATE USER csdemo IDENTIFIED BY csdemo; GRANT DBA TO csdemo; grant alter session to csdemo; grant create session to csdemo; grant flashback any table to csdemo; grant select any dictionary to csdemo; grant select any table to csdemo; grant select any transaction to csdemo; grant unlimited tablespace to csdemo; ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; ``` -------------------------------- ### Get Cache Statistics Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json Retrieves detailed statistics for a specific Coherence cache. This includes metrics on gets, puts, cache misses, queueing, and persistence operations. ```APIDOC ## GET /caches/{cacheName}/statistics ### Description Retrieves statistics for a specified cache, providing insights into its performance and operational state. ### Method GET ### Endpoint /caches/{cacheName}/statistics ### Parameters #### Path Parameters - **cacheName** (string) - Required - The name of the cache to retrieve statistics for. ### Response #### Success Response (200) - **member** (string) - Name of the cluster member. - **tier** (string) - Tier of the cache. Enum: ["front", "back"]. - **totalGetsMillis** (integer) - The total number of milliseconds spent on get() operations since the last time statistics were reset. This statistic is only tracked for caches that may incur expensive hits (for example the front of a near cache). - **description** (string) - The cache description. - **lowUnits** (integer) - The number of units to which the cache will shrink when it prunes. This is often referred to as a `low water mark` of the cache. - **size** (integer) - The number of entries in the cache. - **queueDelay** (integer) - The number of seconds that an entry added to a write-behind queue will sit in the queue before being stored via a CacheStore. Applicable only for WRITE-BEHIND persistence type. - **storeWriteMillis** (integer) - The cumulative time (in milliseconds) spent on store and erase operations; -1 if persistence type is NONE or READ-ONLY. This statistic is only tracked for caches associated with a CacheStore. - **storeAverageReadMillis** (integer) - The average time (in millis) spent per read operation; -1 if persistence type is NONE. This statistic is only tracked for caches associated with a CacheStore. - **totalPuts** (integer) - The total number of put() operations since the last time statistics were reset. - **totalPutsMillis** (integer) - The total number of milliseconds spent on put() operations since the last time statistics were reset. This statistic is only tracked for caches that may incur expensive hits (for example the front of a near cache). - **refreshTime** (string) - The timestamp when this model was last retrieved from a corresponding node. For local servers it is the local time. - **queueSize** (integer) - The size of the write-behind queue size. Applicable only for WRITE-BEHIND persistence type. - **requeueThreshold** (integer) - The maximum size of the write-behind queue for which failed CacheStore write operations are requeued. If zero, the write-behind requeueing will be disabled. Applicable only for WRITE-BEHIND persistence type. - **averageMissMillis** (number) - The average number of milliseconds per get() invocation that is a miss. This statistic is only tracked for caches that may incur expensive hits (for example the front of a near cache). - **highUnits** (integer) - The maximum number of units to which the cache will grow. #### Response Example { "member": "member1", "tier": "front", "totalGetsMillis": 1500, "description": "User cache", "lowUnits": 1000, "size": 5000, "queueDelay": 5, "storeWriteMillis": 2000, "storeAverageReadMillis": 10, "totalPuts": 10000, "totalPutsMillis": 3000, "refreshTime": "2023-10-27T10:00:00Z", "queueSize": 50, "requeueThreshold": 100, "averageMissMillis": 2.5, "highUnits": 10000 } ``` -------------------------------- ### REST GET Operation Examples Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/develop-remote-clients/building-your-first-coherence-rest-application.html Illustrates various GET requests to retrieve data from the 'dist-http-example' cache, including specific entries, filtered entries, and aggregated data. ```http GET http://localhost:8080/api/dist-http-example/1.json ``` ```http GET http://localhost:8080/api/dist-http-example/1.xml ``` ```http GET http://localhost:8080/api/dist-http-example/entries?q=name is 'chris' ``` ```http GET http://localhost:8080/api/dist-http-example/1.json;p=name ``` ```http GET http://localhost:8080/api/dist-http-example/count() ``` ```http GET http://localhost:8080/api/dist-http-example/double-average(age) ``` -------------------------------- ### Enable Access Controller via System Property Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/secure/using-access-controller.html This command-line example demonstrates enabling the access controller by setting the `coherence.security` system property to `true`. ```bash -Dcoherence.security=true ``` -------------------------------- ### GET /management/coherence/cluster/members/{memberIdentifier}/platform/memory Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json Retrieves JVM memory statistics for a specific cluster member. This endpoint provides insights into the memory usage of the Java Virtual Machine on the target member. ```APIDOC ## GET /management/coherence/cluster/members/{memberIdentifier}/platform/memory ### Description View JVM Memory Information. Use this endpoint to view JVM memory statistics for a specific cluster member. ### Method GET ### Endpoint /management/coherence/cluster/members/{memberIdentifier}/platform/memory ### Parameters #### Path Parameters - **memberIdentifier** (string) - Required - The identifier of the cluster member. ``` -------------------------------- ### Perform Coherence Quick Installation with Custom Inventory Location Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/install/installing-oracle-coherence-java.html Run the quick installer, specifying a custom location for the oraInst.loc inventory pointer file. ```bash java -jar fmw_version_coherence_quick.jar -invPtrLoc /MyDirectory/oraInst.loc ``` -------------------------------- ### Get Federation Outgoing Statistics for a Participant Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json Retrieves the outgoing statistics for a specific participant within a Coherence cluster's federation. ```APIDOC ## GET /management/coherence/cluster/services/{serviceName}/members/{memberIdentifier}/federation/statistics/outgoing/participants/{participantName} ### Description Retrieves the outgoing statistics for a specific participant. ### Method GET ### Endpoint /management/coherence/cluster/services/{serviceName}/members/{memberIdentifier}/federation/statistics/outgoing/participants/{participantName} ### Parameters #### Path Parameters - **serviceName** (string) - Required - The name of the service. - **memberIdentifier** (string) - Required - The identifier of the member. - **participantName** (string) - Required - The name of the participant. ### Response #### Success Response (200) - **federationOutgoingStatistics** (object) - Statistics for the outgoing participant. ``` -------------------------------- ### Limit Direct Query Results with Start and Count Parameters Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/develop-remote-clients/performing-grid-operations-rest.html Use the 'start' and 'count' query parameters to specify a subset of results for a direct query. This example retrieves entries matching 'age < 18'. ```http GET http://host:port/persons;start=0;count=10?q=age%3C18 ``` -------------------------------- ### Get Cache Members Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json Retrieves a list of members that are part of a specific cache within a Coherence cluster. This endpoint is useful for understanding which members are involved with a particular cache. ```APIDOC ## GET /clusters/{clusterName}/caches/{cacheName}/members ### Description Retrieves a list of members that are part of a specific cache within a Coherence cluster. ### Method GET ### Endpoint /clusters/{clusterName}/caches/{cacheName}/members ### Parameters #### Path Parameters - **clusterName** (string) - Required - Name of the Coherence cluster. - **cacheName** (string) - Required - Name of the cache. ### Response #### Success Response (200) - **items** (array) - A list of members for the specified cache. ``` -------------------------------- ### Get Service Members Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/rest-reference/swagger.json Retrieves a list of members associated with a specific cache service within a Coherence cluster. This provides insights into the members participating in a particular service. ```APIDOC ## GET /clusters/{clusterName}/services/{serviceName}/members ### Description Retrieves a list of members associated with a specific cache service within a Coherence cluster. ### Method GET ### Endpoint /clusters/{clusterName}/services/{serviceName}/members ### Parameters #### Path Parameters - **clusterName** (string) - Required - Name of the Coherence cluster. - **serviceName** (string) - Required - Name of the cache service. ### Response #### Success Response (200) - **items** (array) - A list of members for the specified service. ``` -------------------------------- ### Limit Named Query Results with Start and Count Parameters Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/develop-remote-clients/performing-grid-operations-rest.html Use the 'start' and 'count' matrix parameters to specify a subset of results for a named query. This example retrieves the first 10 entries sorted by name. ```http http://host:port/persons/minors;start=0;count=10;order=name:asc ``` -------------------------------- ### Start Cache Server with Default Configuration Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/develop-applications/understanding-configuration.html Starts a cache server using the default coherence-cache-config.xml file found on the classpath. Ensure the configuration file precedes coherence.jar in the classpath. ```bash java -cp COHERENCE_HOME;COHERENCE_HOME\lib\coherence.jar com.tangosol.net.DefaultCacheServer ``` -------------------------------- ### Using System Properties in Configuration Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/release-notes/bugs-fixed-and-enhancements-this-release.html Demonstrates how to use system properties with default values for configuration elements in Coherence. ```xml ${system.property default_value} ``` -------------------------------- ### RegisterHit Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/net-reference/html/fc1fad14-2301-66f8-d1c2-bd83fa957750.htm Registers a cache hit, recording the time when a get operation started. This method is part of the SimpleCacheStatistics class. ```APIDOC ## RegisterHit ### Description Registers a cache hit, recording the time when a get operation started. This method is part of the SimpleCacheStatistics class. ### Method `public virtual void RegisterHit(long startMillis)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response None (void method) #### Response Example None ``` -------------------------------- ### Example Output: Loaded MBean Configuration Override File Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/develop-applications/understanding-configuration.html This example shows the log output confirming that an MBean configuration override file has been loaded. This message helps verify that Coherence is using the specified MBean configuration, especially when using custom override files. ```log Loaded operational overrides from resource "file:/D:/coherence/custom-mbeans.xml" ``` -------------------------------- ### Sample GoldenGate Capture ggsci Script Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/integrate/integrating-oracle-coherence-goldengate-hotcache.html This `ggsci` script demonstrates a comprehensive setup for capturing table changes. It includes starting the manager, configuring extract parameters, managing trail files, and starting the capture process. ```bash start mgr DBLOGIN USERID csdemo, PASSWORD csdemo STOP EXTRACT cs-cap DELETE EXTRACT cs-cap ADD TRANDATA csdemo.* ADD EXTRACT cs-cap, integrated tranlog, begin now SHELL rm -f dirdat/cs* ADD EXTTRAIL dirdat/cs, EXTRACT cs-cap start cs-cap ``` -------------------------------- ### Install Coherence*Web Application Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/administer-http-sessions/using-coherenceweb-other-application-servers.html Run this command to install the Coherence*Web application, replacing `` with the full path to your application. ```bash java -jar webInstaller.jar -install ``` -------------------------------- ### SimpleElement.AbsolutePath Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/net-reference/html/61284a12-ab87-0f74-d0b2-114f3eee8da2.htm Gets the '/'-delimited path of the element starting from the root element. This is a convenience property for retrieving elements by their simple name. ```APIDOC ## SimpleElement.AbsolutePath ### Description Gets the '/'-delimited path of the element starting from the root element. ### Method GET ### Endpoint N/A (This is a .NET property, not an HTTP endpoint) ### Return Value The element path. ### Implements IXmlElement.AbsolutePath ``` -------------------------------- ### Start Cache Server (Windows) Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/develop-remote-clients/building-your-first-coherence-rest-application.html Starts a Coherence cache server process on Windows. Ensure the classpath includes configuration files, the Person.class, and all dependency libraries. ```bash java -cp DEV_ROOT\config;DEV_ROOT;DEV_ROOT\libs\dependencies; COHERENCE_HOME\coherence-rest.jar -Dcoherence.clusterport=8090 -Dcoherence.ttl=0 -Dcoherence.cacheconfig=DEV_ROOT\config\example-server-config.xml com.tangosol.net.DefaultCacheServer ``` -------------------------------- ### processAll Implementation Example Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/cplus-reference/classcoherence_1_1util_1_1_invocable_map_1_1_entry_processor.html Provides a semantic equivalent for the processAll method, demonstrating how to iterate through a set of entries and process them individually, collecting results in a HashMap. ```cpp Map::Handle hMapResults = HashMap::create(); Iterator::Handle hIter = vSetEntries->iterator(); while (iter->hasNext) { InvocableMap::Entry::Handle hEntry = cast(hIter->next()); hMapResults->put(hEntry->getKey(), process(hEntry)); } return hMapResults; ``` -------------------------------- ### Get Cluster Information Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/manage/using-jmx-manage-oracle-coherence.html This example demonstrates how to retrieve cluster information using a cURL request to the Coherence management API. ```APIDOC ## GET /management/coherence/cluster ### Description Retrieves detailed information about the Coherence cluster, including its members, version, and status. ### Method GET ### Endpoint /management/coherence/cluster ### Parameters None ### Request Example ```bash curl -i -X GET http://127.0.0.1:63660/management/coherence/cluster ``` ### Response #### Success Response (200) - **links** (array) - Links to related management resources. - **refreshTime** (string) - The timestamp when the cluster information was last refreshed. - **licenseMode** (string) - The current license mode of the Coherence cluster. - **clusterSize** (integer) - The number of members in the cluster. - **localMemberId** (integer) - The ID of the local member. - **version** (string) - The version of Oracle Coherence. - **running** (boolean) - Indicates if the cluster is running. - **clusterName** (string) - The name of the Coherence cluster. - **membersDeparted** (array) - A list of members that have departed the cluster. - **memberIds** (array) - A list of IDs of the current members. - **membersDepartureCount** (integer) - The count of member departures. - **members** (array) - A list of strings describing the cluster members. - **oldestMemberId** (integer) - The ID of the oldest member in the cluster. - **type** (string) - The type of resource, typically 'Cluster'. #### Response Example ```json { "links": [ { "rel": "parent", "href": "http://127.0.0.1:63660/management/coherence" }, { "rel": "self", "href": "http://127.0.0.1:63660/management/coherence/cluster" }, { "rel": "canonical", "href": "http://127.0.0.1:63660/management/coherence/cluster" }, { "rel": "services", "href": "http://127.0.0.1:63660/management/coherence/cluster/services" }, { "rel": "caches", "href": "http://127.0.0.1:63660/management/coherence/cluster/caches" }, { "rel": "members", "href": "http://127.0.0.1:63660/management/coherence/cluster/members" }, { "rel": "management", "href": "http://127.0.0.1:63660/management/coherence/cluster/management" }, { "rel": "journal", "href": "http://127.0.0.1:63660/management/coherence/cluster/journal" }, { "rel": "hotcache", "href": "http://127.0.0.1:63660/management/coherence/cluster/hotcache" }, { "rel": "webApplications", "href": "http://127.0.0.1:63660/management/coherence/cluster/webApplications" } ], "refreshTime": "2018-12-12T18:04:34.225-05:00", "licenseMode": "Development", "clusterSize": 1, "localMemberId": 1, "version": "19.1.0.0.0", "running": true, "clusterName": "MyCluster", "membersDeparted": [], "memberIds": [1], "membersDepartureCount": 0, "members": ["Member(Id=1, Timestamp=2018-12-12 18:01:38.132, Address=127.0.0.1:63621, MachineId=46461, Location=site:Burlington,rack:100A,process:12124,member:COH-001, Role=Cache Server)"], "oldestMemberId": 1, "type": "Cluster" } ``` ``` -------------------------------- ### RegisterMiss Method Signature Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/net-reference/html/0705512b-8fd0-5a09-8795-fa61d2dc7812.htm Signature for the RegisterMiss method. Use this to record the start time of a cache get operation that resulted in a miss. ```csharp public virtual void RegisterMiss( long startMillis ) ``` -------------------------------- ### Create Keystore with Principals using keytool Source: https://docs.oracle.com/en/middleware/fusion-middleware/coherence/12.2.1.4/secure/using-access-controller.html Generate a keystore file and add principals for the Java Security framework and Oracle Coherence using the 'keytool' utility. ```bash keytool -genkey -v -keystore ./keystore.jks -storepass password -alias admin -keypass password -dname CN=Administrator,O=MyCompany,L=MyCity,ST=MyState keytool -genkey -v -keystore ./keystore.jks -storepass password -alias manager -keypass password -dname CN=Manager,OU=MyUnit keytool -genkey -v -keystore ./keystore.jks -storepass password -alias worker -keypass password -dname CN=Worker,OU=MyUnit ```