private RingbufferConfig getRingbufferConfig ( RingbufferService service , ObjectNamespace ns ) { final String serviceName = ns . getServiceName ( ) ; if ( RingbufferService . SERVICE_NAME . equals ( serviceName ) ) { return service . getRingbufferConfig ( ns . getObjectName ( ) ) ; } else if ( MapService . SERVICE_NAME . equals ( serviceName ) ) { final MapService mapService = getNodeEngine ( ) . getService ( MapService . SERVICE_NAME ) ; final MapEventJournal journal = mapService . getMapServiceContext ( ) . getEventJournal ( ) ; final EventJournalConfig journalConfig = journal . getEventJournalConfig ( ns ) ; return journal . toRingbufferConfig ( journalConfig , ns ) ; } else if ( CacheService . SERVICE_NAME . equals ( serviceName ) ) { final CacheService cacheService = getNodeEngine ( ) . getService ( CacheService . SERVICE_NAME ) ; final CacheEventJournal journal = cacheService . getEventJournal ( ) ; final EventJournalConfig journalConfig = journal . getEventJournalConfig ( ns ) ; return journal . toRingbufferConfig ( journalConfig , ns ) ; } else { throw new IllegalArgumentException ( "Unsupported ringbuffer service name " + serviceName ) ; } }
Returns the ringbuffer config for the provided namespace . The namespace provides information whether the requested ringbuffer is a ringbuffer that the user is directly interacting with through a ringbuffer proxy or if this is a backing ringbuffer for an event journal . If a ringbuffer configuration for an event journal is requested this method will expect the configuration for the relevant map or cache to be available .